* [PATCH] bcache: Downgrade "device already registered" to pr_debug
[not found] <kvfvst$j12$2@ger.gmane.org>
@ 2013-08-26 16:54 ` Gabriel de Perthuis
0 siblings, 0 replies; only message in thread
From: Gabriel de Perthuis @ 2013-08-26 16:54 UTC (permalink / raw)
To: Kent Overstreet, linux-bcache, linux-kernel; +Cc: Gabriel de Perthuis
People tended to see:
(info) bcache: register_bcache() error opening /dev/blah: device already registered
as more problematic than it really is. Change it to:
(debug) bcache: register_bcache() device /dev/blah is already registered
and don't return -EINVAL in this case.
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
---
drivers/md/bcache/super.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index a41c681..b09e973 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1894,21 +1894,24 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
if (!(path = kstrndup(buffer, size, GFP_KERNEL)) ||
!(sb = kmalloc(sizeof(struct cache_sb), GFP_KERNEL)))
goto err;
- err = "failed to open device";
bdev = blkdev_get_by_path(strim(path),
FMODE_READ|FMODE_WRITE|FMODE_EXCL,
sb);
if (IS_ERR(bdev)) {
if (bdev == ERR_PTR(-EBUSY)) {
bdev = lookup_bdev(strim(path));
- if (!IS_ERR(bdev) && bch_is_open(bdev))
- err = "device already registered";
- else
- err = "device busy";
+ if (!IS_ERR(bdev) && bch_is_open(bdev)) {
+ pr_debug("device %s is already registered",
+ path);
+ goto out;
+ }
+ err = "device busy";
+ } else {
+ err = "failed to open device";
}
goto err;
}
err = "failed to set blocksize";
--
1.8.4.rc0.5.g48765cc
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-08-26 16:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <kvfvst$j12$2@ger.gmane.org>
2013-08-26 16:54 ` [PATCH] bcache: Downgrade "device already registered" to pr_debug Gabriel de Perthuis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).