From 26bfdca8f2f538bba26e44c1f4c6527ab229586f Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 1 Jun 2002 21:48:24 -0400 Subject: [PATCH] fs_ext2.c (fs_init_task): Fix minor bugs pointed out by Steve Pratt. Fixed a selection bug and added checks to make sure volumes are not mounted when creating the list of volumes which can be mkfs'ed by the ext2/3 plugin. --- lib/evms/ChangeLog | 7 +++++++ lib/evms/fs_ext2.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/evms/ChangeLog b/lib/evms/ChangeLog index a977ce8..bc35340 100644 --- a/lib/evms/ChangeLog +++ b/lib/evms/ChangeLog @@ -1,3 +1,10 @@ +2002-06-01 + + * fs_ext2.c (fs_init_task): Fix minor bugs pointed out by Steve + Pratt. Fixed a selection bug and added checks to make + sure volumes are not mounted when creating the list of + volumes which can be mkfs'ed by the ext2/3 plugin. + 2002-05-28 * fsimext2.c: Log the fsck and mke2fs command lines. Return diff --git a/lib/evms/fs_ext2.c b/lib/evms/fs_ext2.c index 16c2a2f..88a1485 100644 --- a/lib/evms/fs_ext2.c +++ b/lib/evms/fs_ext2.c @@ -631,7 +631,7 @@ static int fs_init_task( task_context_t * context ) LOGENTRY(); - context->min_selected_objects = 0; + context->min_selected_objects = 1; context->max_selected_objects = 1; context->option_descriptors->count = 0; @@ -647,7 +647,9 @@ static int fs_init_task( task_context_t * context ) switch (context->action) { case EVMS_Task_mkfs: /* only mkfs unformatted volumes */ - if (volume->file_system_manager == NULL) { + if ((volume->file_system_manager == NULL) && + !EVMS_IS_MOUNTED(volume) && + (volume->vol_size > MINEXT2)) { rc = InsertObject(context->acceptable_objects, sizeof(logical_volume_t), volume, VOLUME_TAG, NULL, InsertAtStart, TRUE, (void **)&waste); } break; -- 1.8.3.1