diff options
author | Ming Lei <tom.leiming@gmail.com> | 2017-03-16 12:12:22 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-03-24 13:41:36 -0400 |
commit | c85ba149de4bd14aa028ac824f9f12aeded28b86 (patch) | |
tree | 8ec935d6b5b242e9174f73249bca6f55f2b1b366 /drivers/md/raid1.c | |
parent | 3560741e316b3ea52cfb27901ae284921445180f (diff) |
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, | |||
2894 | bio = r1_bio->bios[i]; | 2894 | bio = r1_bio->bios[i]; |
2895 | if (bio->bi_end_io) { | 2895 | if (bio->bi_end_io) { |
2896 | page = bio->bi_io_vec[bio->bi_vcnt].bv_page; | 2896 | page = bio->bi_io_vec[bio->bi_vcnt].bv_page; |
2897 | if (bio_add_page(bio, page, len, 0) == 0) { | 2897 | |
2898 | /* stop here */ | 2898 | /* |
2899 | bio->bi_io_vec[bio->bi_vcnt].bv_page = page; | 2899 | * won't fail because the vec table is big |
2900 | while (i > 0) { | 2900 | * enough to hold all these pages |
2901 | i--; | 2901 | */ |
2902 | bio = r1_bio->bios[i]; | 2902 | bio_add_page(bio, page, len, 0); |
2903 | if (bio->bi_end_io==NULL) | ||
2904 | continue; | ||
2905 | /* remove last page from this bio */ | ||
2906 | bio->bi_vcnt--; | ||
2907 | bio->bi_iter.bi_size -= len; | ||
2908 | bio_clear_flag(bio, BIO_SEG_VALID); | ||
2909 | } | ||
2910 | goto bio_full; | ||
2911 | } | ||
2912 | } | 2903 | } |
2913 | } | 2904 | } |
2914 | nr_sectors += len>>9; | 2905 | nr_sectors += len>>9; |
2915 | sector_nr += len>>9; | 2906 | sector_nr += len>>9; |
2916 | sync_blocks -= (len>>9); | 2907 | sync_blocks -= (len>>9); |
2917 | } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); | 2908 | } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); |
2918 | bio_full: | ||
2919 | r1_bio->sectors = nr_sectors; | 2909 | r1_bio->sectors = nr_sectors; |
2920 | 2910 | ||
2921 | if (mddev_is_clustered(mddev) && | 2911 | if (mddev_is_clustered(mddev) && |