]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1: close some possible races on write errors during resync
authorNeilBrown <neilb@suse.de>
Thu, 19 Jul 2012 05:59:18 +0000 (15:59 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 19 Jul 2012 05:59:18 +0000 (15:59 +1000)
commitcd1b328e593f5740c9e8b40dc8ee4036d96c379b
treeb4711cd5bbd18c01ffd11d18b1a65c5eecebf8d5
parentbd04216f8ddb9eb2308e5d601d222d37aa7fc5a2
md/raid1: close some possible races on write errors during resync

commit bef84ddd24912c08e0552ba6f86deb491d7088a3
   md/raid1: clear bad-block record when write succeeds.

Added a 'reschedule_retry' call possibility at the end of
end_sync_write, but didn't add matching code at the end of
sync_request_write.  So if the writes complete very quickly, or
scheduling makes it seem that way, then we can miss rescheduling
the request and the resync could hang.

Also commit 377f6392ac1b4909b22bbf5c8ca4cd2f5b035c83
    md: avoid races when stopping resync.

Fix a race condition in this same code in end_sync_write but didn't
make the change in sync_request_write.

This patch updates sync_request_write to fix both of those.
Patch is suitable for 3.1 and later kernels.

Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Original-version-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c