diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2023-03-30 03:43:50 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-04-17 18:01:20 +0200 |
commit | 078e4cf5dbedb3d407417a10ac5918dca6ca156a (patch) | |
tree | d672e05f82ba75bb512227606386a7313c472f7d /fs/btrfs/bio.c | |
parent | 7e812f2054b8eeaca2c61ae9dc8986e9190e4dd6 (diff) |
btrfs: use __bio_add_page for adding a single page in repair_one_sector
The btrfs repair bio submission 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: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/bio.c')
-rw-r--r-- | fs/btrfs/bio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c index cf09c6271edb..89c1a0d7e89f 100644 --- a/fs/btrfs/bio.c +++ b/fs/btrfs/bio.c @@ -227,7 +227,7 @@ static struct btrfs_failed_bio *repair_one_sector(struct btrfs_bio *failed_bbio, repair_bio = bio_alloc_bioset(NULL, 1, REQ_OP_READ, GFP_NOFS, &btrfs_repair_bioset); repair_bio->bi_iter.bi_sector = failed_bbio->saved_iter.bi_sector; - bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); + __bio_add_page(repair_bio, bv->bv_page, bv->bv_len, bv->bv_offset); repair_bbio = btrfs_bio(repair_bio); btrfs_bio_init(repair_bbio, failed_bbio->inode, NULL, fbio); |