All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Issue a uevent when disconnecting
@ 2016-01-23 16:23 Wouter Verhelst
  2016-02-02 15:27 ` [PATCH v2] nbd: " Wouter Verhelst
  0 siblings, 1 reply; 6+ messages in thread
From: Wouter Verhelst @ 2016-01-23 16:23 UTC (permalink / raw)
  To: Markus Pargmann, open list:NETWORK BLOCK DEVICE (NBD), open list
  Cc: Wouter Verhelst

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-12 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-02-05  9:04   ` [PATCH] nbd: Create size change events for userspace Markus Pargmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.