public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul P Komkoff Jr <i@stingr.net>
To: linux-kernel@vger.kernel.org
Cc: Neil Brown <neilb@cse.unsw.edu.au>, Andrew Morton <akpm@osdl.org>
Subject: Re: 2.6.5-mm4
Date: Mon, 12 Apr 2004 13:10:49 +0400	[thread overview]
Message-ID: <20040412091049.GQ14129@stingr.net> (raw)
In-Reply-To: <20040412012840.1f3a65e2.akpm@osdl.org>

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

  reply	other threads:[~2004-04-12  9:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-11  3:05 2.6.5-mm4 Andrew Morton
2004-04-12  6:46 ` 2.6.5-mm4 Paul P Komkoff Jr
2004-04-12  7:42   ` 2.6.5-mm4 Andrew Morton
2004-04-12  8:22     ` 2.6.5-mm4 Paul P Komkoff Jr
2004-04-12  8:28       ` 2.6.5-mm4 Andrew Morton
2004-04-12  9:10         ` Paul P Komkoff Jr [this message]
2004-04-12  9:44 ` fix must_not_trace_exec() test (was: 2.6.5-mm4) Olaf Dietsche
2004-04-12 14:18   ` fix must_not_trace_exec() test Andy Lutomirski
2004-04-12 22:02     ` Chris Wright
2004-04-12 10:19 ` 2.6.5-mm4 (hci_usb module unloading oops) Martin Hermanowski
2004-04-12 22:03   ` Greg KH
2004-04-12 22:36     ` Marcel Holtmann
2004-04-12 22:42       ` Greg KH
2004-04-12 22:57         ` Marcel Holtmann
2004-04-19 20:29     ` Martin Hermanowski
2004-04-12 12:24 ` [PATCH] change audit_log_format() -> printk() (was: 2.6.5-mm4) Olaf Dietsche
2004-04-12 17:06 ` 2.6.5-mm4 (compile stats) John Cherry
  -- strict thread matches above, loose matches on Subject: below --
2004-04-12 19:19 2.6.5-mm4 Marcus Hartig
2004-04-12 19:35 ` 2.6.5-mm4 Marc-Christian Petersen
2004-04-12 19:52   ` 2.6.5-mm4 Sam Ravnborg
2004-04-12 19:56 ` 2.6.5-mm4 Sam Ravnborg
2004-04-12 20:15   ` 2.6.5-mm4 Andrew Vasquez
2004-04-13  4:54     ` 2.6.5-mm4 Sam Ravnborg
2004-04-12 20:48   ` 2.6.5-mm4 Marcus Hartig
2004-04-13  2:47     ` 2.6.5-mm4 Michael Baehr
2004-04-13  4:58     ` 2.6.5-mm4 Sam Ravnborg
2004-04-13 15:22 2.6.5-mm4 Andrew Vasquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040412091049.GQ14129@stingr.net \
    --to=i@stingr.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox