Re: 2.6.5-mm4

Paul P Komkoff Jr
2004-04-12T09:12:15Z

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