summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-02-25 11:44:11 +1100
committerNeilBrown <neilb@suse.de>2015-02-25 11:44:11 +1100
commitba599aca520d6005138d1e5edb125fb83a130141 (patch)
treeaa0cf6d5ca70fef5dfffcf797d40ed6a2aaa5d31 /drivers/md
parent1aee41f637694d4bbf91c24195f2b63e3f6badd2 (diff)
downloadlinux-ba599aca520d6005138d1e5edb125fb83a130141.tar.gz
linux-ba599aca520d6005138d1e5edb125fb83a130141.tar.bz2
linux-ba599aca520d6005138d1e5edb125fb83a130141.zip
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: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 5703c2e89f3a..ae3432e57ccb 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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);
@@ -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);