Re: 2.6.5-mm4

From: Paul P Komkoff Jr
Date: Mon Apr 12 2004 - 04:13:12 EST


Replying to Andrew Morton:
> Yes. The below locking is not correct.
>
> > static void unplug_slaves(mddev_t *mddev)
> > {
> > conf_t *conf = mddev_to_conf(mddev);
> > int i;
> > unsigned long flags;
> >
> > spin_lock_irqsave(&conf->device_lock, flags);
> > for (i=0; i<mddev->raid_disks; i++) {
> > mdk_rdev_t *rdev = conf->mirrors[i].rdev;
> > if (rdev && !rdev->faulty) {
> > request_queue_t *r_queue = bdev_get_queue(rdev->bdev);
> >
> > if (r_queue->unplug_fn)
> > r_queue->unplug_fn(r_queue);
> > }
> > }
> > spin_unlock_irqrestore(&conf->device_lock, flags);
> > }

raid5 version of the same is slightly different:
static void unplug_slaves(mddev_t *mddev)
{
raid5_conf_t *conf = mddev_to_conf(mddev);
int i;

for (i=0; i<mddev->raid_disks; i++) {
mdk_rdev_t *rdev = conf->disks[i].rdev;
if (rdev && !rdev->faulty) {
struct block_device *bdev = rdev->bdev;
if (bdev) {
request_queue_t *r_queue = bdev_get_queue(bdev);
if (r_queue && r_queue->unplug_fn)
r_queue->unplug_fn(r_queue);
}
}
}
}

so is it racy or someone just can do the same in raid1?

--
Paul P 'Stingray' Komkoff Jr // http://stingr.net/key <- my pgp key
This message represents the official view of the voices in my head
-
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/