aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-12-29 20:08:49 -0500
committerNeilBrown <neilb@suse.de>2009-12-29 20:08:49 -0500
commitcbd1998377504df005302ac90d49db72a48552a6 (patch)
treef5c0d83ebe8534477bd252204da804640fd5413b /drivers/md
parent6b7b284958d47b77d06745b36bc7f36dab769d9b (diff)
md: Fix unfortunate interaction with evms
evms configures md arrays by: open device send ioctl close device for each different ioctl needed. Since 2.6.29, the device can disappear after the 'close' unless a significant configuration has happened to the device. The change made by "SET_ARRAY_INFO" can too minor to stop the device from disappearing, but important enough that losing the change is bad. So: make sure SET_ARRAY_INFO sets mddev->ctime, and keep the device active as long as ctime is non-zero (it gets zeroed with lots of other things when the array is stopped). This is suitable for -stable kernels since 2.6.29. Signed-off-by: NeilBrown <neilb@suse.de> Cc: stable@kernel.org
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c8
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;