|
@@ -2774,10 +2774,12 @@ static void handle_stripe_clean_event(struct r5conf *conf,
|
|
dev = &sh->dev[i];
|
|
dev = &sh->dev[i];
|
|
if (!test_bit(R5_LOCKED, &dev->flags) &&
|
|
if (!test_bit(R5_LOCKED, &dev->flags) &&
|
|
(test_bit(R5_UPTODATE, &dev->flags) ||
|
|
(test_bit(R5_UPTODATE, &dev->flags) ||
|
|
- test_and_clear_bit(R5_Discard, &dev->flags))) {
|
|
|
|
|
|
+ test_bit(R5_Discard, &dev->flags))) {
|
|
/* We can return any write requests */
|
|
/* We can return any write requests */
|
|
struct bio *wbi, *wbi2;
|
|
struct bio *wbi, *wbi2;
|
|
pr_debug("Return write for disc %d\n", i);
|
|
pr_debug("Return write for disc %d\n", i);
|
|
|
|
+ if (test_and_clear_bit(R5_Discard, &dev->flags))
|
|
|
|
+ clear_bit(R5_UPTODATE, &dev->flags);
|
|
wbi = dev->written;
|
|
wbi = dev->written;
|
|
dev->written = NULL;
|
|
dev->written = NULL;
|
|
while (wbi && wbi->bi_sector <
|
|
while (wbi && wbi->bi_sector <
|
|
@@ -2795,7 +2797,8 @@ static void handle_stripe_clean_event(struct r5conf *conf,
|
|
!test_bit(STRIPE_DEGRADED, &sh->state),
|
|
!test_bit(STRIPE_DEGRADED, &sh->state),
|
|
0);
|
|
0);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ } else if (test_bit(R5_Discard, &sh->dev[i].flags))
|
|
|
|
+ clear_bit(R5_Discard, &sh->dev[i].flags);
|
|
|
|
|
|
if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
|
|
if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
|
|
if (atomic_dec_and_test(&conf->pending_full_writes))
|
|
if (atomic_dec_and_test(&conf->pending_full_writes))
|