]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
md: Skip cluster setup in case of error while reading bitmap
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Wed, 22 Jul 2015 17:09:16 +0000 (12:09 -0500)
committerNeilBrown <neilb@suse.com>
Fri, 24 Jul 2015 03:37:48 +0000 (13:37 +1000)
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>
drivers/md/bitmap.c

index c90118e907081c808cc634f1f5cddfb2f50f510b..a4ab51350f4055c18fa7b945fcd67e7721d66e4d 100644 (file)
@@ -680,7 +680,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",