* [PATCH] bcache: register_quiet should still report errors
[not found] <521BD3C0.9070209@gmail.com>
@ 2013-08-26 22:31 ` Gabriel de Perthuis
2013-08-26 22:37 ` Gabriel de Perthuis
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel de Perthuis @ 2013-08-26 22:31 UTC (permalink / raw)
To: linux-bcache, linux-kernel, Kent Overstreet; +Cc: Gabriel de Perthuis
register_quiet should still report all errors except
"device already registered".
Before this some potential errors would be silenced.
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
---
drivers/md/bcache/super.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index a41c681..c3a3dc8 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1901,14 +1901,17 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
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))
+ if (!IS_ERR(bdev) && bch_is_open(bdev)) {
+ if (attr == &ksysfs_register_quiet)
+ goto out;
err = "device already registered";
- else
+ } else {
err = "device busy";
+ }
}
goto err;
}
err = "failed to set blocksize";
@@ -1942,12 +1945,11 @@ out:
return ret;
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;
}
static int bcache_reboot(struct notifier_block *n, unsigned long code, void *x)
--
1.8.4.rc0.5.g48765cc
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] bcache: register_quiet should still report errors
2013-08-26 22:31 ` [PATCH] bcache: register_quiet should still report errors Gabriel de Perthuis
@ 2013-08-26 22:37 ` Gabriel de Perthuis
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel de Perthuis @ 2013-08-26 22:37 UTC (permalink / raw)
To: Kent Overstreet; +Cc: linux-bcache, linux-kernel
> register_quiet should still report all errors except
> "device already registered".
>
> Before this some potential errors would be silenced.
This can replace my other patch in this thread.
Switching /lib/udev/bcache-register to register_quiet
without this kernel patch will suppress the aforementioned errors,
but they probably aren't too common so we can live with it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-26 22:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <521BD3C0.9070209@gmail.com>
2013-08-26 22:31 ` [PATCH] bcache: register_quiet should still report errors Gabriel de Perthuis
2013-08-26 22:37 ` 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