[patch] raid5_end_write_request spinlock fix

From: Qi Yong
Date: Fri Apr 21 2006 - 08:58:14 EST


Hello,

Reduce the raid5_end_write_request() spinlock window.

Signed-off-by: Coywolf Qi Hunt <qiyong@xxxxxxxxx>
---

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3184360..9c24377 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -581,7 +581,6 @@ static int raid5_end_write_request (stru
struct stripe_head *sh = bi->bi_private;
raid5_conf_t *conf = sh->raid_conf;
int disks = sh->disks, i;
- unsigned long flags;
int uptodate = test_bit(BIO_UPTODATE, &bi->bi_flags);

if (bi->bi_size)
@@ -599,16 +598,14 @@ static int raid5_end_write_request (stru
return 0;
}

- spin_lock_irqsave(&conf->device_lock, flags);
if (!uptodate)
md_error(conf->mddev, conf->disks[i].rdev);

rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
-
clear_bit(R5_LOCKED, &sh->dev[i].flags);
set_bit(STRIPE_HANDLE, &sh->state);
- __release_stripe(conf, sh);
- spin_unlock_irqrestore(&conf->device_lock, flags);
+ release_stripe(sh);
+
return 0;
}


--
Coywolf Qi Hunt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/