All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 V3] mke2fs: fix force option to create filesystem on mounted device
@ 2013-07-02  8:35 Kazuya Mio
  0 siblings, 0 replies; only message in thread
From: Kazuya Mio @ 2013-07-02  8:35 UTC (permalink / raw)
  To: Andreas Dilger, tytso; +Cc: linux-ext4

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 <k-mio@sx.jp.nec.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
---
 misc/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/util.c b/misc/util.c
index 6c93e1c..40c8858 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -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;
 		}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-02  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02  8:35 [PATCH 1/2 V3] mke2fs: fix force option to create filesystem on mounted device Kazuya Mio

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.