]> git.baikalelectronics.ru Git - kernel.git/commit
md/raid5: Remove use of sh->lock in sync_request
authorNeilBrown <neilb@suse.de>
Tue, 26 Jul 2011 01:19:49 +0000 (11:19 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 26 Jul 2011 01:19:49 +0000 (11:19 +1000)
commitfe7a13b1369e5deed1243d653248b5bc1a4c49a4
tree69e1c082cb33d19a508c764da613e0c6b5ced27b
parentc4cf644cc99362214ec2ffe1707b6e8615f6754f
md/raid5: Remove use of sh->lock in sync_request

This is the start of a series of patches to remove sh->lock.

sync_request takes sh->lock before setting STRIPE_SYNCING to ensure
there is no race with testing it in handle_stripe[56].

Instead, use a new flag STRIPE_SYNC_REQUESTED and test it early
in handle_stripe[56] (after getting the same lock) and perform the
same set/clear operations if it was set.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Namhyung Kim <namhyung@gmail.com>
drivers/md/raid5.c
drivers/md/raid5.h