From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbcBLOtk (ORCPT ); Fri, 12 Feb 2016 09:49:40 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:57569 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751716AbcBLOth (ORCPT ); Fri, 12 Feb 2016 09:49:37 -0500 From: Markus Pargmann To: Wouter Verhelst Cc: nbd-general , lkml Subject: Re: [PATCH v2] nbd: Issue a uevent when disconnecting Date: Fri, 12 Feb 2016 15:49:32 +0100 Message-ID: <2089906.hSTA6UrdgZ@adelgunde> User-Agent: KMail/4.14.1 (Linux/4.3.0-0.bpo.1-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <20160205094241.GC6366@grep.be> References: <1453566230-5786-1-git-send-email-w@uter.be> <5247002.OuBHJMaBYj@adelgunde> <20160205094241.GC6366@grep.be> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3285713.0ToDMSYCx4"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-SA-Exim-Connect-IP: 2001:67c:670:100:a61f:72ff:fe68:75ba X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart3285713.0ToDMSYCx4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Hi Wouter, On Friday, February 05, 2016 10:42:41 AM Wouter Verhelst wrote: > Hi Markus, >=20 > On Fri, Feb 05, 2016 at 10:03:41AM +0100, Markus Pargmann wrote: > > Hi Wouter, > >=20 > > On Tuesday, February 02, 2016 04:27:00 PM Wouter Verhelst wrote: > > > There already is a uevent by default when closing a device upon c= onnect > > > of the device. However, the same isn't true on disconnect. > > >=20 > > > This makes it hard for userspace to keep track of whether a devic= e is > > > connected, since we are notified when the connection is created, = but not > > > when it is removed again. > > >=20 > > > Explicitly issue a "change" uevent to remedy. > > >=20 > > > [v2: incorporate feedback from udev maintainer and make sure that= we > > > issue a uevent upon connect as well as disconnect, rather than co= nnect > > > only] > >=20 > > The systemd people had the same feedback. >=20 > Well, the systemd people and the udev people are the same people thes= e > days :-) >=20 > > Basically the device is not marked as ready until a uevent is recei= ved. My > > idea was to use the size property consistently. If the device is co= nnected > > the size is correctly changed and a uevent is created. On disconnec= t the size > > is set to 0 with another uevent. > >=20 > > Does this work for you as well? I will send the patch as reply. >=20 > Sure. What matters most is that the uevent is done; how it's done, le= ss > so. >=20 > 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 =2D-=20 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-555= 5 | --nextPart3285713.0ToDMSYCx4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJWvfD8AAoJEEpcgKtcEGQQvPoP/1lscuy+hVS41+1t6m2nJSqt 1iqOBQJOZVw9WFoJig6Ob4UQFADA9PdtEj69jE0LFAbXeCRs+P0HcQ7h9FEOnVaX Qx3/8mcm6FUZ2UHz9MMxT/HgDh6DpD7vGuzr7uFSVEA+rAbMHXjVSs34ZSWHZE5z G9nPXTfGCG/N1W+jVhGQtxsX3nh8z+Ds/8wz/gZZK1ZLfCplMKLuNksg9LO89+a6 bp99Y1VImd/P+TALFqJfupl7rFkLEUy80k4vbfx3ItHlM1e78RAIlLHv/QMNaftr 7x7pcWwOlbKfJlYvIumlT4ge45zl8RnxkbD+iqyhS96o8VTM79e9vKUmYw+4NMg2 rspfPXGK9j+3hABqtwRLAWSm4sEuHuLydNV2dMQBsjlUjNmpB3IIVMMGhsxCEguW pJLLp2bfhH6/VXC3halkBTnb2kx2YWfqx2M00TQ4Db6irBMKJf2wKg/Gq8CTKJ3f TgJEUu8t2xNeHjIxrkKA4/0cljpJkRwYh6L/7IZjCO1M/ZLlwzNec2LgzplhbqiF DcEn62Yxn7SrDfHItwCcu2DL4ykRgXUiZDfgwoJ8w7cxKahxJCof7qST5QdwVqAS +URTWfNWa3NMmF5DkO0hUnChegeW44wU/1ap7gsrQFXViDi7pLQgzw/iIl9zWFXd E6CycQzeDsFkhotqSKct =LBTc -----END PGP SIGNATURE----- --nextPart3285713.0ToDMSYCx4--