diff options
author | Ming Lei <tom.leiming@gmail.com> | 2017-03-17 00:12:22 +0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-03-24 10:41:36 -0700 |
commit | c85ba149de4bd14aa028ac824f9f12aeded28b86 (patch) | |
tree | 8ec935d6b5b242e9174f73249bca6f55f2b1b366 /drivers/md/raid1.c | |
parent | 3560741e316b3ea52cfb27901ae284921445180f (diff) | |
download | linux-c85ba149de4bd14aa028ac824f9f12aeded28b86.tar.bz2 |
md: raid1/raid10: don't handle failure of bio_add_page()
All bio_add_page() is for adding one page into resync bio,
which is big enough to hold RESYNC_PAGES pages, and
the current bio_add_page() doesn't check queue limit any more,
so it won't fail at all.
remove unused label (shaohua)
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 941f81063891..569f501fb710 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2894,28 +2894,18 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, bio = r1_bio->bios[i]; if (bio->bi_end_io) { page = bio->bi_io_vec[bio->bi_vcnt].bv_page; - if (bio_add_page(bio, page, len, 0) == 0) { - /* stop here */ - bio->bi_io_vec[bio->bi_vcnt].bv_page = page; - while (i > 0) { - i--; - bio = r1_bio->bios[i]; - if (bio->bi_end_io==NULL) - continue; - /* remove last page from this bio */ - bio->bi_vcnt--; - bio->bi_iter.bi_size -= len; - bio_clear_flag(bio, BIO_SEG_VALID); - } - goto bio_full; - } + + /* + * won't fail because the vec table is big + * enough to hold all these pages + */ + bio_add_page(bio, page, len, 0); } } nr_sectors += len>>9; sector_nr += len>>9; sync_blocks -= (len>>9); } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); - bio_full: r1_bio->sectors = nr_sectors; if (mddev_is_clustered(mddev) && |