Skip to content

Commit

Permalink
md: Skip cluster setup in case of error while reading bitmap
Browse files Browse the repository at this point in the history
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>
Signed-off-by: NeilBrown <neilb@suse.com>
  • Loading branch information
Goldwyn Rodrigues authored and NeilBrown committed Jul 24, 2015
1 parent 34cab6f commit f735727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
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",
Expand Down

0 comments on commit f735727

Please sign in to comment.