Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);