Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

md: Skip cluster setup in case of error while reading bitmap

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>

authored by

Goldwyn Rodrigues and committed by
NeilBrown
f7357273 34cab6f4

+1 -1
+1 -1
drivers/md/bitmap.c
··· 680 680 kunmap_atomic(sb); 681 681 /* Assiging chunksize is required for "re_read" */ 682 682 bitmap->mddev->bitmap_info.chunksize = chunksize; 683 - if (nodes && (bitmap->cluster_slot < 0)) { 683 + if (err == 0 && nodes && (bitmap->cluster_slot < 0)) { 684 684 err = md_setup_cluster(bitmap->mddev, nodes); 685 685 if (err) { 686 686 pr_err("%s: Could not setup cluster service (%d)\n",