diff options
author | NeilBrown <neilb@suse.de> | 2014-08-08 01:40:24 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-08-08 01:43:20 -0400 |
commit | d66b1b395a59027a1c054e1fc57d582cb4194491 (patch) | |
tree | 7baa7abbfe0b1671c421613c97c41f8e37a8d322 /drivers/md/md.c | |
parent | a8461a61c241a25afedbe493c13d98a6e0cf4246 (diff) |
md: don't allow bitmap file to be added to raid0/linear.
An array can only accept a bitmap if it will call bitmap_daemon_work
periodically, which means it needs a thread running.
If there is no thread, don't allow a bitmap to be added.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index eb8c93dff7c6..1294238610df 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5961,7 +5961,7 @@ static int set_bitmap_file(struct mddev *mddev, int fd) | |||
5961 | int err = 0; | 5961 | int err = 0; |
5962 | 5962 | ||
5963 | if (mddev->pers) { | 5963 | if (mddev->pers) { |
5964 | if (!mddev->pers->quiesce) | 5964 | if (!mddev->pers->quiesce || !mddev->thread) |
5965 | return -EBUSY; | 5965 | return -EBUSY; |
5966 | if (mddev->recovery || mddev->sync_thread) | 5966 | if (mddev->recovery || mddev->sync_thread) |
5967 | return -EBUSY; | 5967 | return -EBUSY; |
@@ -6263,7 +6263,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) | |||
6263 | rv = update_raid_disks(mddev, info->raid_disks); | 6263 | rv = update_raid_disks(mddev, info->raid_disks); |
6264 | 6264 | ||
6265 | if ((state ^ info->state) & (1<<MD_SB_BITMAP_PRESENT)) { | 6265 | if ((state ^ info->state) & (1<<MD_SB_BITMAP_PRESENT)) { |
6266 | if (mddev->pers->quiesce == NULL) | 6266 | if (mddev->pers->quiesce == NULL || mddev->thread == NULL) |
6267 | return -EINVAL; | 6267 | return -EINVAL; |
6268 | if (mddev->recovery || mddev->sync_thread) | 6268 | if (mddev->recovery || mddev->sync_thread) |
6269 | return -EBUSY; | 6269 | return -EBUSY; |