From: Gabriel de Perthuis <g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kent Overstreet <kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org>
Cc: Gabriel de Perthuis <g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] bcache: register_quiet should still report errors
Date: Tue, 27 Aug 2013 00:31:46 +0200 [thread overview]
Message-ID: <1377556306-29938-1-git-send-email-g2p.code@gmail.com> (raw)
In-Reply-To: <521BD3C0.9070209-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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
WARNING: multiple messages have this Message-ID (diff)
From: Gabriel de Perthuis <g2p.code@gmail.com>
To: linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org,
Kent Overstreet <kmo@daterainc.com>
Cc: Gabriel de Perthuis <g2p.code@gmail.com>
Subject: [PATCH] bcache: register_quiet should still report errors
Date: Tue, 27 Aug 2013 00:31:46 +0200 [thread overview]
Message-ID: <1377556306-29938-1-git-send-email-g2p.code@gmail.com> (raw)
In-Reply-To: <521BD3C0.9070209@gmail.com>
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
next prev parent reply other threads:[~2013-08-26 22:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-26 9:14 bcache-tools: minor change for bcache-register Rolf Fokkens
[not found] ` <521B1C5E.2090007-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
2013-08-26 16:17 ` Darrick J. Wong
2013-08-26 16:31 ` Gabriel de Perthuis
2013-08-26 16:54 ` [PATCH] bcache: Downgrade "device already registered" to pr_debug Gabriel de Perthuis
2013-08-26 16:54 ` Gabriel de Perthuis
2013-08-26 21:48 ` bcache-tools: minor change for bcache-register Kent Overstreet
2013-08-26 22:16 ` Gabriel de Perthuis
[not found] ` <521BD3C0.9070209-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-26 22:31 ` Gabriel de Perthuis [this message]
2013-08-26 22:31 ` [PATCH] bcache: register_quiet should still report errors Gabriel de Perthuis
[not found] ` <1377556306-29938-1-git-send-email-g2p.code-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-26 22:37 ` Gabriel de Perthuis
2013-08-26 22:37 ` Gabriel de Perthuis
2013-08-26 21:41 ` bcache-tools: minor change for bcache-register Kent Overstreet
2013-08-27 6:58 ` Rolf Fokkens
[not found] ` <521C4E2B.8090008-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
2013-08-27 10:00 ` Alex Pyrgiotis
2013-08-27 11:45 ` Gabriel de Perthuis
2013-08-27 12:02 ` Rolf Fokkens
[not found] ` <521C9560.2020603-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
2013-08-27 12:11 ` Gabriel de Perthuis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1377556306-29938-1-git-send-email-g2p.code@gmail.com \
--to=g2p.code-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org \
--cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.