Skip to content

Commit

Permalink
[PATCH] md: don't allow new md/bitmap file to be set if one already e…
Browse files Browse the repository at this point in the history
…xists

... otherwise we loose a reference and can never free the file.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Sep 9, 2005
1 parent 844e8d9 commit 1923b99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,7 @@ static int set_bitmap_file(mddev_t *mddev, int fd)
{
int err;

if (mddev->pers)
if (mddev->pers || mddev->bitmap_file)
return -EBUSY;

mddev->bitmap_file = fget(fd);
Expand Down

0 comments on commit 1923b99

Please sign in to comment.