Skip to content

Commit

Permalink
md: fix error paths from bitmap_create.
Browse files Browse the repository at this point in the history
Recent change to bitmap_create mishandles errors.
In particular a failure doesn't alway cause 'err' to be set.

Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Feb 25, 2015
1 parent 1aee41f commit ba599ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -6118,7 +6118,8 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap;
err = bitmap_load(mddev);
}
} else
err = PTR_ERR(bitmap);
}
if (fd < 0 || err) {
bitmap_destroy(mddev);
Expand Down Expand Up @@ -6408,7 +6409,8 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info)
if (!IS_ERR(bitmap)) {
mddev->bitmap = bitmap;
rv = bitmap_load(mddev);
}
} else
rv = PTR_ERR(bitmap);
if (rv)
bitmap_destroy(mddev);
mddev->pers->quiesce(mddev, 0);
Expand Down

0 comments on commit ba599ac

Please sign in to comment.