Commit ba599aca authored by NeilBrown's avatar NeilBrown

md: fix error paths from bitmap_create.

Recent change to bitmap_create mishandles errors.
In particular a failure doesn't alway cause 'err' to be set.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 1aee41f6
...@@ -6118,7 +6118,8 @@ static int set_bitmap_file(struct mddev *mddev, int fd) ...@@ -6118,7 +6118,8 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
if (!IS_ERR(bitmap)) { if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap; mddev->bitmap = bitmap;
err = bitmap_load(mddev); err = bitmap_load(mddev);
} } else
err = PTR_ERR(bitmap);
} }
if (fd < 0 || err) { if (fd < 0 || err) {
bitmap_destroy(mddev); bitmap_destroy(mddev);
...@@ -6408,7 +6409,8 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) ...@@ -6408,7 +6409,8 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
if (!IS_ERR(bitmap)) { if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap; mddev->bitmap = bitmap;
rv = bitmap_load(mddev); rv = bitmap_load(mddev);
} } else
rv = PTR_ERR(bitmap);
if (rv) if (rv)
bitmap_destroy(mddev); bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0); mddev->pers->quiesce(mddev, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment