Commit 6468bfb9 authored by Gabriel de Perthuis's avatar Gabriel de Perthuis Committed by Luis Henriques

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

commit d7076f21 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@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>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent e43ebd52
......@@ -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 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment