aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2011-07-26 21:00:36 -0400
committerNeilBrown <neilb@suse.de>2011-07-26 21:00:36 -0400
commit9d3d80113df824a266c5db3fac357a036ebc0b62 (patch)
tree26607a8761b06cfc05e4259a6609a48d9dab3f26 /drivers/md/raid1.c
parent65a06f06744d3deae61f3596566952a8da92199f (diff)
md/raid1: move rdev->corrected_errors counting
Read errors are considered to corrected if write-back and re-read cycle is finished without further problems. Thus moving the rdev-> corrected_errors counting after the re-reading looks more reasonable IMHO. Also included a couple of whitespace fixes on sync_page_io(). Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 44069b38d6dd..a7e69081187f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1224,9 +1224,7 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
1224 * active, and resync is currently active 1224 * active, and resync is currently active
1225 */ 1225 */
1226 rdev = conf->mirrors[d].rdev; 1226 rdev = conf->mirrors[d].rdev;
1227 if (sync_page_io(rdev, 1227 if (sync_page_io(rdev, sect, s<<9,
1228 sect,
1229 s<<9,
1230 bio->bi_io_vec[idx].bv_page, 1228 bio->bi_io_vec[idx].bv_page,
1231 READ, false)) { 1229 READ, false)) {
1232 success = 1; 1230 success = 1;
@@ -1261,16 +1259,13 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
1261 if (r1_bio->bios[d]->bi_end_io != end_sync_read) 1259 if (r1_bio->bios[d]->bi_end_io != end_sync_read)
1262 continue; 1260 continue;
1263 rdev = conf->mirrors[d].rdev; 1261 rdev = conf->mirrors[d].rdev;
1264 if (sync_page_io(rdev, 1262 if (sync_page_io(rdev, sect, s<<9,
1265 sect,
1266 s<<9,
1267 bio->bi_io_vec[idx].bv_page, 1263 bio->bi_io_vec[idx].bv_page,
1268 WRITE, false) == 0) { 1264 WRITE, false) == 0) {
1269 r1_bio->bios[d]->bi_end_io = NULL; 1265 r1_bio->bios[d]->bi_end_io = NULL;
1270 rdev_dec_pending(rdev, mddev); 1266 rdev_dec_pending(rdev, mddev);
1271 md_error(mddev, rdev); 1267 md_error(mddev, rdev);
1272 } else 1268 }
1273 atomic_add(s, &rdev->corrected_errors);
1274 } 1269 }
1275 d = start; 1270 d = start;
1276 while (d != r1_bio->read_disk) { 1271 while (d != r1_bio->read_disk) {
@@ -1280,12 +1275,12 @@ static int fix_sync_read_error(r1bio_t *r1_bio)
1280 if (r1_bio->bios[d]->bi_end_io != end_sync_read) 1275 if (r1_bio->bios[d]->bi_end_io != end_sync_read)
1281 continue; 1276 continue;
1282 rdev = conf->mirrors[d].rdev; 1277 rdev = conf->mirrors[d].rdev;
1283 if (sync_page_io(rdev, 1278 if (sync_page_io(rdev, sect, s<<9,
1284 sect,
1285 s<<9,
1286 bio->bi_io_vec[idx].bv_page, 1279 bio->bi_io_vec[idx].bv_page,
1287 READ, false) == 0) 1280 READ, false) == 0)
1288 md_error(mddev, rdev); 1281 md_error(mddev, rdev);
1282 else
1283 atomic_add(s, &rdev->corrected_errors);
1289 } 1284 }
1290 sectors -= s; 1285 sectors -= s;
1291 sect += s; 1286 sect += s;