lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1453566230-5786-1-git-send-email-w@uter.be>
Date:	Sat, 23 Jan 2016 17:23:49 +0100
From:	Wouter Verhelst <w@...r.be>
To:	Markus Pargmann <mpa@...gutronix.de>,
	nbd-general@...ts.sourceforge.net (open list:NETWORK BLOCK DEVICE (NBD)),
	linux-kernel@...r.kernel.org (open list)
Cc:	Wouter Verhelst <w@...r.be>
Subject: [PATCH] Issue a uevent when disconnecting

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@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ