[3.5.y.z extended stable] Patch "9p: send uevent after adding/removing mount_tag attribute" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Dec 12 16:31:31 UTC 2013


This is a note to let you know that I have just added a patch titled

    9p: send uevent after adding/removing mount_tag attribute

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 8a2dd064a71089e2886711fc6d4aae03a127addf Mon Sep 17 00:00:00 2001
From: Michael Marineau <michael.marineau at coreos.com>
Date: Sun, 11 Aug 2013 00:53:45 -0400
Subject: 9p: send uevent after adding/removing mount_tag attribute

commit e0d6cb9cd3a3ac8a3b8e5b22b83c4f8619786f22 upstream.

This driver adds an attribute to the existing virtio device so a CHANGE
event is required in order udev rules to make use of it. The ADD event
happens before this driver is probed and unlike a more typical driver
like a block device there isn't a higher level device to watch for.

Signed-off-by: Michael Marineau <michael.marineau at coreos.com>
Signed-off-by: Eric Van Hensbergen <ericvh at gmail.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/9p/trans_virtio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 2a16765..6c3d561 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -546,6 +546,10 @@ static int p9_virtio_probe(struct virtio_device *vdev)
 	mutex_lock(&virtio_9p_lock);
 	list_add_tail(&chan->chan_list, &virtio_chan_list);
 	mutex_unlock(&virtio_9p_lock);
+
+	/* Let udev rules use the new mount_tag attribute. */
+	kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE);
+
 	return 0;

 out_free_tag:
@@ -623,6 +627,7 @@ static void p9_virtio_remove(struct virtio_device *vdev)
 	list_del(&chan->chan_list);
 	mutex_unlock(&virtio_9p_lock);
 	sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr);
+	kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE);
 	kfree(chan->tag);
 	kfree(chan->vc_wq);
 	kfree(chan);
--
1.8.3.2





More information about the kernel-team mailing list