From: NeilBrown Date: Fri, 9 Sep 2005 23:23:43 +0000 (-0700) Subject: [PATCH] md: don't allow new md/bitmap file to be set if one already exists X-Git-Tag: v2.6.14-rc1~252 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1923b99a0f4748aa6be0b9b9523ce224a3449b17;p=linux-2.6 [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: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 373ab92e36..63c5661651 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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);