md/raid5: output stripe state for debug

Neil recently fixed an obscure race in break_stripe_batch_list. Debug would be
quite convenient if we know the stripe state. This is what this patch does.

Signed-off-by: Shaohua Li <shli@fb.com>
This commit is contained in:
Shaohua Li 2016-03-09 10:08:38 -08:00
parent 550da24f8d
commit fb3229d5cd

View File

@ -4236,7 +4236,7 @@ static void break_stripe_batch_list(struct stripe_head *head_sh,
list_del_init(&sh->batch_list); list_del_init(&sh->batch_list);
WARN_ON_ONCE(sh->state & ((1 << STRIPE_ACTIVE) | WARN_ONCE(sh->state & ((1 << STRIPE_ACTIVE) |
(1 << STRIPE_SYNCING) | (1 << STRIPE_SYNCING) |
(1 << STRIPE_REPLACED) | (1 << STRIPE_REPLACED) |
(1 << STRIPE_DELAYED) | (1 << STRIPE_DELAYED) |
@ -4248,9 +4248,11 @@ static void break_stripe_batch_list(struct stripe_head *head_sh,
(1 << STRIPE_DISCARD) | (1 << STRIPE_DISCARD) |
(1 << STRIPE_BATCH_READY) | (1 << STRIPE_BATCH_READY) |
(1 << STRIPE_BATCH_ERR) | (1 << STRIPE_BATCH_ERR) |
(1 << STRIPE_BITMAP_PENDING))); (1 << STRIPE_BITMAP_PENDING)),
WARN_ON_ONCE(head_sh->state & ((1 << STRIPE_DISCARD) | "stripe state: %lx\n", sh->state);
(1 << STRIPE_REPLACED))); WARN_ONCE(head_sh->state & ((1 << STRIPE_DISCARD) |
(1 << STRIPE_REPLACED)),
"head stripe state: %lx\n", head_sh->state);
set_mask_bits(&sh->state, ~(STRIPE_EXPAND_SYNC_FLAGS | set_mask_bits(&sh->state, ~(STRIPE_EXPAND_SYNC_FLAGS |
(1 << STRIPE_PREREAD_ACTIVE) | (1 << STRIPE_PREREAD_ACTIVE) |