Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

md: raid1: use __bio_add_page for adding single page to bio

The sync request code uses bio_add_page() to add a page to a newly created bio.
bio_add_page() can fail, but the return value is never checked.

Use __bio_add_page() as adding a single page to a newly created bio is
guaranteed to succeed.

This brings us a step closer to marking bio_add_page() as __must_check.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/6cf7f66c6e646231200d025dfd5f2d3ae75c8fe5.1685532726.git.johannes.thumshirn@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Johannes Thumshirn and committed by
Jens Axboe
f8312322 b42473cd

+1 -1
+1 -1
drivers/md/raid1.c
··· 2917 2917 * won't fail because the vec table is big 2918 2918 * enough to hold all these pages 2919 2919 */ 2920 - bio_add_page(bio, page, len, 0); 2920 + __bio_add_page(bio, page, len, 0); 2921 2921 } 2922 2922 } 2923 2923 nr_sectors += len>>9;