diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f4f5f82f9f53..7862231a0750 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -386,7 +386,9 @@ static void mddev_put(mddev_t *mddev) | |||
386 | if (!atomic_dec_and_lock(&mddev->active, &all_mddevs_lock)) | 386 | if (!atomic_dec_and_lock(&mddev->active, &all_mddevs_lock)) |
387 | return; | 387 | return; |
388 | if (!mddev->raid_disks && list_empty(&mddev->disks) && | 388 | if (!mddev->raid_disks && list_empty(&mddev->disks) && |
389 | !mddev->hold_active) { | 389 | mddev->ctime == 0 && !mddev->hold_active) { |
390 | /* Array is not configured at all, and not held active, | ||
391 | * so destroy it */ | ||
390 | list_del(&mddev->all_mddevs); | 392 | list_del(&mddev->all_mddevs); |
391 | if (mddev->gendisk) { | 393 | if (mddev->gendisk) { |
392 | /* we did a probe so need to clean up. | 394 | /* we did a probe so need to clean up. |
@@ -5262,6 +5264,10 @@ static int set_array_info(mddev_t * mddev, mdu_array_info_t *info) | |||
5262 | mddev->minor_version = info->minor_version; | 5264 | mddev->minor_version = info->minor_version; |
5263 | mddev->patch_version = info->patch_version; | 5265 | mddev->patch_version = info->patch_version; |
5264 | mddev->persistent = !info->not_persistent; | 5266 | mddev->persistent = !info->not_persistent; |
5267 | /* ensure mddev_put doesn't delete this now that there | ||
5268 | * is some minimal configuration. | ||
5269 | */ | ||
5270 | mddev->ctime = get_seconds(); | ||
5265 | return 0; | 5271 | return 0; |
5266 | } | 5272 | } |
5267 | mddev->major_version = MD_MAJOR_VERSION; | 5273 | mddev->major_version = MD_MAJOR_VERSION; |