From: Goldwyn Rodrigues <rgoldwyn@suse.com>
To: linux-raid@vger.kernel.org
Cc: neilb@suse.com, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH 2/3] Skip cluster setup in case of error while reading bitmap
Date: Wed, 22 Jul 2015 12:09:16 -0500 [thread overview]
Message-ID: <1437584957-23879-2-git-send-email-rgoldwyn@suse.com> (raw)
In-Reply-To: <1437584957-23879-1-git-send-email-rgoldwyn@suse.com>
If the bitmap read fails, the error code set is -EINVAL. However,
we don't check for errors and go ahead with cluster_setup.
Skip the cluster setup in case of error.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
drivers/md/bitmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ed2346d..f23b8e4 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -671,7 +671,7 @@ out:
kunmap_atomic(sb);
/* Assiging chunksize is required for "re_read" */
bitmap->mddev->bitmap_info.chunksize = chunksize;
- if (nodes && (bitmap->cluster_slot < 0)) {
+ if (err == 0 && nodes && (bitmap->cluster_slot < 0)) {
err = md_setup_cluster(bitmap->mddev, nodes);
if (err) {
pr_err("%s: Could not setup cluster service (%d)\n",
--
2.1.4
next prev parent reply other threads:[~2015-07-22 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 17:09 [PATCH 1/3] Return error if request_module fails and returns positive value Goldwyn Rodrigues
2015-07-22 17:09 ` Goldwyn Rodrigues [this message]
2015-07-22 17:09 ` [PATCH 3/3] Skip cluster setup for dm-raid Goldwyn Rodrigues
2015-07-22 23:21 ` NeilBrown
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=1437584957-23879-2-git-send-email-rgoldwyn@suse.com \
--to=rgoldwyn@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
/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 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).