History

md/raid1: Avoid raid1 resync getting stuck

close_sync() needs to set conf->next_resync to a large, but safe value below MaxSector and use it to determine whether or not to set start_next_window in wait_barrier() Solution suggested by Neil Brown.

Jes Sorensen committed 11 years ago

Commit e8ff8bf1 parent 644df1a1 file · +2 −3Browse files

Unified · Split

drivers/md/raid1.c+2−3
@@ -881,8 +881,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio) · 880 unmodified lines
881881 }
882882
883883 if (bio && bio_data_dir(bio) == WRITE) {
884− if (bio->bi_iter.bi_sector >=
885− conf->mddev->curr_resync_completed) {
884+ if (bio->bi_iter.bi_sector >= conf->next_resync) {
886885 if (conf->start_next_window == MaxSector)
887886 conf->start_next_window =
888887 conf->next_resync +
@@ -1516,7 +1515,7 @@ static void close_sync(struct r1conf *conf) · 627 unmodified lines
15161515 conf->r1buf_pool = NULL;
15171516
15181517 spin_lock_irq(&conf->resync_lock);
1519− conf->next_resync = 0;
1518+ conf->next_resync = MaxSector - 2 * NEXT_NORMALIO_DISTANCE;
15201519 conf->start_next_window = MaxSector;
15211520 conf->current_window_requests +=
15221521 conf->next_window_requests;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t