lkml.org 
[lkml]   [2004]   [Apr]   [12]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 12 Apr 2004 13:10:49 +0400
FromPaul P Komkoff Jr <>
SubjectRe: 2.6.5-mm4
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:02    [from the cache]
©2003-2008