Commit 1923b99a authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] md: don't allow new md/bitmap file to be set if one already exists

... otherwise we loose a reference and can never free the file.
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 844e8d90
...@@ -2430,7 +2430,7 @@ static int set_bitmap_file(mddev_t *mddev, int fd) ...@@ -2430,7 +2430,7 @@ static int set_bitmap_file(mddev_t *mddev, int fd)
{ {
int err; int err;
if (mddev->pers) if (mddev->pers || mddev->bitmap_file)
return -EBUSY; return -EBUSY;
mddev->bitmap_file = fget(fd); mddev->bitmap_file = fget(fd);
......
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