[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454538786-12215-66-git-send-email-luis.henriques@canonical.com>
Date: Wed, 3 Feb 2016 22:31:11 +0000
From: Luis Henriques <luis.henriques@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Denis Bychkov <manover@...il.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Eric Wheeler <bcache@...ux.ewheeler.net>,
Gabriel de Perthuis <g2p.code@...il.com>,
Jens Axboe <axboe@...com>,
Luis Henriques <luis.henriques@...onical.com>
Subject: [PATCH 3.16.y-ckt 065/180] bcache: allows use of register in udev to avoid "device_busy" error.
3.16.7-ckt24 -stable review patch. If anyone has any objections, please let me know.
---8<------------------------------------------------------------
From: Gabriel de Perthuis <g2p.code@...il.com>
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@...il.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@...il.com>
Cc: Kent Overstreet <kent.overstreet@...il.com>
Cc: Eric Wheeler <bcache@...ux.ewheeler.net>
Cc: Gabriel de Perthuis <g2p.code@...il.com>
Signed-off-by: Jens Axboe <axboe@...com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@...onical.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;
}
Powered by blists - more mailing lists