diff options
author | NeilBrown <neilb@suse.de> | 2006-06-26 03:27:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:38 -0400 |
commit | d7375ab324971e7acbea9f02a0269ae7348f4147 (patch) | |
tree | 0a2e2f17a6ed37be1870b2bcc2b02cd6cf7e8cf2 /drivers | |
parent | 52c03291a832d86c093996d0491a326de4a6b79b (diff) |
[PATCH] md/bitmap: fix online removal of file-backed bitmaps
When "mdadm --grow /dev/mdX --bitmap=none" is used to remove a filebacked
bitmap, the bitmap was disconnected from the array, but the file wasn't closed
(until the array was stopped).
The file also wasn't closed if adding the bitmap file failed.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8c1e1900893d..ea6837d45fc8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3601,10 +3601,13 @@ static int set_bitmap_file(mddev_t *mddev, int fd) | |||
3601 | mddev->pers->quiesce(mddev, 1); | 3601 | mddev->pers->quiesce(mddev, 1); |
3602 | if (fd >= 0) | 3602 | if (fd >= 0) |
3603 | err = bitmap_create(mddev); | 3603 | err = bitmap_create(mddev); |
3604 | if (fd < 0 || err) | 3604 | if (fd < 0 || err) { |
3605 | bitmap_destroy(mddev); | 3605 | bitmap_destroy(mddev); |
3606 | fd = -1; /* make sure to put the file */ | ||
3607 | } | ||
3606 | mddev->pers->quiesce(mddev, 0); | 3608 | mddev->pers->quiesce(mddev, 0); |
3607 | } else if (fd < 0) { | 3609 | } |
3610 | if (fd < 0) { | ||
3608 | if (mddev->bitmap_file) | 3611 | if (mddev->bitmap_file) |
3609 | fput(mddev->bitmap_file); | 3612 | fput(mddev->bitmap_file); |
3610 | mddev->bitmap_file = NULL; | 3613 | mddev->bitmap_file = NULL; |