linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kinga Stefaniuk <kinga.stefaniuk@linux.intel.com>
To: Song Liu <song@kernel.org>
Cc: Kinga Stefaniuk <kinga.stefaniuk@intel.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH v6 1/1] md: generate CHANGE uevents for md device
Date: Thu, 4 Jul 2024 11:43:04 +0200	[thread overview]
Message-ID: <20240704114304.00004750@intel.linux.com> (raw)
In-Reply-To: <CAPhsuW7xOdQgcWLjOVjYDLqBzMo+TgZxmEbUqCwGZFtGGA0rXQ@mail.gmail.com>

On Mon, 10 Jun 2024 11:03:25 -0700
Song Liu <song@kernel.org> wrote:

> On Wed, May 22, 2024 at 12:32 AM Kinga Stefaniuk
> <kinga.stefaniuk@intel.com> wrote:
> >  
> [...]
> 
> > ---
> >  drivers/md/md.c     | 47
> > ++++++++++++++++++++++++++++++--------------- drivers/md/md.h     |
> >  2 +- drivers/md/raid10.c |  2 +-
> >  drivers/md/raid5.c  |  2 +-
> >  4 files changed, 35 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/md/md.c b/drivers/md/md.c
> > index aff9118ff697..2ec696e17f3d 100644
> > --- a/drivers/md/md.c
> > +++ b/drivers/md/md.c
> > @@ -313,6 +313,16 @@ static int start_readonly;
> >   */
> >  static bool create_on_open = true;
> >
> > +/*
> > + * Send every new event to the userspace.
> > + */
> > +static void trigger_kobject_uevent(struct work_struct *work)
> > +{
> > +       struct mddev *mddev = container_of(work, struct mddev,
> > event_work); +
> > +       kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj,
> > KOBJ_CHANGE); +}
> > +
> >  /*
> >   * We have a system wide 'event count' that is incremented
> >   * on any 'interesting' event, and readers of /proc/mdstat
> > @@ -325,10 +335,15 @@ static bool create_on_open = true;
> >   */
> >  static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
> >  static atomic_t md_event_count;
> > -void md_new_event(void)
> > +void md_new_event(struct mddev *mddev, bool trigger_event)
> >  {
> >         atomic_inc(&md_event_count);
> >         wake_up(&md_event_waiters);
> > +
> > +       if (trigger_event)
> > +               kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj,
> > KOBJ_CHANGE);
> > +       else
> > +               schedule_work(&mddev->event_work);  
> 
> event_work is also used by dmraid. Will this cause an issue with
> dmraid?
> 
> Thanks,
> Song
> 

Hi Song,

yes, you're right. It is fixed in next patchset - new work_struct
uevent_work was added.

Regards,
Kinga

  reply	other threads:[~2024-07-04  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  7:33 [PATCH v6 0/1] md: generate CHANGE uevents for md device Kinga Stefaniuk
2024-05-22  7:33 ` [PATCH v6 1/1] " Kinga Stefaniuk
2024-05-28  8:51   ` kernel test robot
2024-06-10 18:03   ` Song Liu
2024-07-04  9:43     ` Kinga Stefaniuk [this message]
2024-06-11  8:56   ` Yu Kuai
2024-06-11  9:01     ` Yu Kuai

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=20240704114304.00004750@intel.linux.com \
    --to=kinga.stefaniuk@linux.intel.com \
    --cc=kinga.stefaniuk@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=song@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).