mke2fs: fix force option to create filesystem on mounted device
PATCH v3 1/2 mke2fs: fix force option to create filesystem on mounted device
According to mke2fs man, we can create a filesystem on the mounted device when -F option is specified twice.
However, currently we have to specify -F option three times to force mke2fs. This patch fixes the problem.
Signed-off-by Kazuya Mio <[email protected]>
Reviewed-by Zheng Liu <[email protected]>
--- misc/util.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
misc/util.c +2 -2
@@ -150,7 +150,7 @@ void check_mount(const char *device, int force, const char *type) }if (mount_flags &EXT2_MF_MOUNTED ) {fprintf (stderr,_ ("%s is mounted; " ), device); -if (force >2 ) { +if (force >=2 ) {fputs (_ ("mke2fs forced anyway. Hope /etc/mtab is " "incorrect.\n" ), stderr);return ;
@@ -162,7 +162,7 @@ void check_mount(const char *device, int force, const char *type)if (mount_flags &EXT2_MF_BUSY ) {fprintf (stderr,_ ("%s is apparently in use by the system; " ), device); -if (force >2 ) { +if (force >=2 ) {fputs (_ ("mke2fs forced anyway.\n" ), stderr);return ; }