]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid1,raid10: use freeze_array in place of raise_barrier in various places.
authorNeilBrown <neilb@suse.de>
Wed, 12 Jun 2013 01:01:22 +0000 (11:01 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 13 Jun 2013 03:40:48 +0000 (13:40 +1000)
commitbce81198f9c0eda1d600496902b16043e9618d2f
tree35ac67de5be7d4a96c2c3f9665f9d7d68b52e8dd
parentd5a8ed322d96fd7fc4ca21e1e5c3ce7ca15f87cd
md/raid1,raid10: use freeze_array in place of raise_barrier in various places.

Various places in raid1 and raid10 are calling raise_barrier when they
really should call freeze_array.
The former is only intended to be called from "make_request".
The later has extra checks for 'nr_queued' and makes a call to
flush_pending_writes(), so it is safe to call it from within the
management thread.

Using raise_barrier will sometimes deadlock.  Using freeze_array
should not.

As 'freeze_array' currently expects one request to be pending (in
handle_read_error - the only previous caller), we need to pass
it the number of pending requests (extra) to ignore.

The deadlock was made particularly noticeable by commits
fbb227abde5699 (raid10) and 8943fdaad791413d (raid1) which
appeared in 3.4, so the fix is appropriate for any -stable
kernel since then.

This patch probably won't apply directly to some early kernels and
will need to be applied by hand.

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