diff options
author | Gabriel de Perthuis <g2p.code@gmail.com> | 2015-11-29 21:40:23 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-12-30 22:23:13 -0500 |
commit | d7076f21629f8f329bca4a44dc408d94670f49e2 (patch) | |
tree | 6d1685199f00f73be98c21e162e61f6a1866854a | |
parent | 2ecf0cdb2b437402110ab57546e02abfa68a716b (diff) |
bcache: allows use of register in udev to avoid "device_busy" error.
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@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@gmail.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Eric Wheeler <bcache@linux.ewheeler.net>
Cc: Gabriel de Perthuis <g2p.code@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/md/bcache/super.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 18f14a246d70..8d0ead98eb6e 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -1938,6 +1938,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, | |||
1938 | else | 1938 | else |
1939 | err = "device busy"; | 1939 | err = "device busy"; |
1940 | mutex_unlock(&bch_register_lock); | 1940 | mutex_unlock(&bch_register_lock); |
1941 | if (attr == &ksysfs_register_quiet) | ||
1942 | goto out; | ||
1941 | } | 1943 | } |
1942 | goto err; | 1944 | goto err; |
1943 | } | 1945 | } |
@@ -1976,8 +1978,7 @@ out: | |||
1976 | err_close: | 1978 | err_close: |
1977 | blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); | 1979 | blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); |
1978 | err: | 1980 | err: |
1979 | if (attr != &ksysfs_register_quiet) | 1981 | pr_info("error opening %s: %s", path, err); |
1980 | pr_info("error opening %s: %s", path, err); | ||
1981 | ret = -EINVAL; | 1982 | ret = -EINVAL; |
1982 | goto out; | 1983 | goto out; |
1983 | } | 1984 | } |