diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-11-08 00:22:06 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-11-08 00:22:06 -0500 |
commit | 257a4b42af7586fab4eaec7f04e6896b86551843 (patch) | |
tree | ec65357b2320ba4e4341a2853245048889666f5c | |
parent | 9a3f530f39f4490eaa18b02719fb74ce5f4d2d86 (diff) |
md/raid5: STRIPE_ACTIVE has lock semantics, add barriers
All updates that occur under STRIPE_ACTIVE should be globally visible
when STRIPE_ACTIVE clears. test_and_set_bit() implies a barrier, but
clear_bit() does not.
This is suitable for 3.1-stable.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
-rw-r--r-- | drivers/md/raid5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 318bdae9b56c..297e26092178 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3110,7 +3110,7 @@ static void handle_stripe(struct stripe_head *sh) | |||
3110 | struct r5dev *pdev, *qdev; | 3110 | struct r5dev *pdev, *qdev; |
3111 | 3111 | ||
3112 | clear_bit(STRIPE_HANDLE, &sh->state); | 3112 | clear_bit(STRIPE_HANDLE, &sh->state); |
3113 | if (test_and_set_bit(STRIPE_ACTIVE, &sh->state)) { | 3113 | if (test_and_set_bit_lock(STRIPE_ACTIVE, &sh->state)) { |
3114 | /* already being handled, ensure it gets handled | 3114 | /* already being handled, ensure it gets handled |
3115 | * again when current action finishes */ | 3115 | * again when current action finishes */ |
3116 | set_bit(STRIPE_HANDLE, &sh->state); | 3116 | set_bit(STRIPE_HANDLE, &sh->state); |
@@ -3375,7 +3375,7 @@ finish: | |||
3375 | 3375 | ||
3376 | return_io(s.return_bi); | 3376 | return_io(s.return_bi); |
3377 | 3377 | ||
3378 | clear_bit(STRIPE_ACTIVE, &sh->state); | 3378 | clear_bit_unlock(STRIPE_ACTIVE, &sh->state); |
3379 | } | 3379 | } |
3380 | 3380 | ||
3381 | static void raid5_activate_delayed(struct r5conf *conf) | 3381 | static void raid5_activate_delayed(struct r5conf *conf) |