LKML Archive mirror
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Wouter Verhelst <w@uter.be>
Cc: nbd-general <nbd-general@lists.sourceforge.net>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] nbd: Issue a uevent when disconnecting
Date: Fri, 12 Feb 2016 15:49:32 +0100	[thread overview]
Message-ID: <2089906.hSTA6UrdgZ@adelgunde> (raw)
In-Reply-To: <20160205094241.GC6366@grep.be>

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

Hi Wouter,

On Friday, February 05, 2016 10:42:41 AM Wouter Verhelst wrote:
> Hi Markus,
> 
> On Fri, Feb 05, 2016 at 10:03:41AM +0100, Markus Pargmann wrote:
> > Hi Wouter,
> > 
> > On Tuesday, February 02, 2016 04:27:00 PM Wouter Verhelst wrote:
> > > There already is a uevent by default when closing a device upon connect
> > > of the device. However, the same isn't true on disconnect.
> > > 
> > > This makes it hard for userspace to keep track of whether a device is
> > > connected, since we are notified when the connection is created, but not
> > > when it is removed again.
> > > 
> > > Explicitly issue a "change" uevent to remedy.
> > > 
> > > [v2: incorporate feedback from udev maintainer and make sure that we
> > > issue a uevent upon connect as well as disconnect, rather than connect
> > > only]
> > 
> > The systemd people had the same feedback.
> 
> Well, the systemd people and the udev people are the same people these
> days :-)
> 
> > Basically the device is not marked as ready until a uevent is received. My
> > idea was to use the size property consistently. If the device is connected
> > the size is correctly changed and a uevent is created. On disconnect the size
> > is set to 0 with another uevent.
> > 
> > Does this work for you as well? I will send the patch as reply.
> 
> Sure. What matters most is that the uevent is done; how it's done, less
> so.
> 
> I should add that this was meant to go with systemd #2422. I wasn't
> aware of #358, or I would've talked to you more :-)

Ah I see, thanks.

I wrote some tests yesterday to ensure that I don't break other things
with the new size calculations. I will send the pull request with this
patch for 4.6.

Best Regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-02-12 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 16:23 [PATCH] Issue a uevent when disconnecting Wouter Verhelst
2016-02-02 15:27 ` [PATCH v2] nbd: " Wouter Verhelst
2016-02-05  9:03   ` Markus Pargmann
2016-02-05  9:42     ` Wouter Verhelst
2016-02-12 14:49       ` Markus Pargmann [this message]
2016-02-05  9:04   ` [PATCH] nbd: Create size change events for userspace Markus Pargmann

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=2089906.hSTA6UrdgZ@adelgunde \
    --to=mpa@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=w@uter.be \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).