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-Url: https://git.stricted.de/?a=commitdiff_plain;h=1923b99a0f4748aa6be0b9b9523ce224a3449b17;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 373ab92e367b..63c566165189 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);