[3.16.y-ckt stable] Patch "bcache: allows use of register in udev to avoid "device_busy" error." has been added to the 3.16.y-ckt tree

Luis Henriques luis.henriques at canonical.com
Wed Feb 3 13:58:43 UTC 2016


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

    bcache: allows use of register in udev to avoid "device_busy" error.

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

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt24.

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.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

---8<------------------------------------------------------------

>From 6468bfb9bcd2db7697612afc854132b7554fb465 Mon Sep 17 00:00:00 2001
From: Gabriel de Perthuis <g2p.code at gmail.com>
Date: Sun, 29 Nov 2015 18:40:23 -0800
Subject: bcache: allows use of register in udev to avoid "device_busy" error.

commit d7076f21629f8f329bca4a44dc408d94670f49e2 upstream.

Allows to use register, not register_quiet in udev to avoid "device_busy" error.
The initial patch proposed at https://lkml.org/lkml/2013/8/26/549 by Gabriel de Perthuis
<g2p.code at gmail.com> does not unlock the mutex and hangs the kernel.

See http://thread.gmane.org/gmane.linux.kernel.bcache.devel/2594 for the discussion.

Cc: Denis Bychkov <manover at gmail.com>
Cc: Kent Overstreet <kent.overstreet at gmail.com>
Cc: Eric Wheeler <bcache at linux.ewheeler.net>
Cc: Gabriel de Perthuis <g2p.code at gmail.com>

Signed-off-by: Jens Axboe <axboe at fb.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/md/bcache/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 04506f7189e7..72e660cafadd 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1954,6 +1954,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
 				err = "device already registered";
 			else
 				err = "device busy";
+			if (attr == &ksysfs_register_quiet)
+				goto out;
 		}
 		goto err;
 	}
@@ -1992,8 +1994,7 @@ out:
 err_close:
 	blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
 err:
-	if (attr != &ksysfs_register_quiet)
-		pr_info("error opening %s: %s", path, err);
+	pr_info("error opening %s: %s", path, err);
 	ret = -EINVAL;
 	goto out;
 }




More information about the kernel-team mailing list