From: Wouter Verhelst <w@uter.be>
To: Markus Pargmann <mpa@pengutronix.de>,
nbd-general@lists.sourceforge.net (open list:NETWORK BLOCK
DEVICE (NBD)), linux-kernel@vger.kernel.org (open list)
Cc: Wouter Verhelst <w@uter.be>
Subject: [PATCH] Issue a uevent when disconnecting
Date: Sat, 23 Jan 2016 17:23:49 +0100 [thread overview]
Message-ID: <1453566230-5786-1-git-send-email-w@uter.be> (raw)
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.
Signed-off-by: Wouter Verhelst <w@uter.be>
---
drivers/block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index e4c5cc1..43dcc12 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -438,6 +438,7 @@ static int nbd_thread_recv(struct nbd_device *nbd)
}
device_remove_file(disk_to_dev(nbd->disk), &pid_attr);
+ kobject_uevent(&disk_to_dev(nbd->disk)->kobj, KOBJ_CHANGE);
spin_lock_irqsave(&nbd->tasks_lock, flags);
nbd->task_recv = NULL;
--
2.7.0
next reply other threads:[~2016-01-23 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 16:23 Wouter Verhelst [this message]
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
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=1453566230-5786-1-git-send-email-w@uter.be \
--to=w@uter.be \
--cc=linux-kernel@vger.kernel.org \
--cc=mpa@pengutronix.de \
--cc=nbd-general@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®