Skip to contentSkip to conversation

mke2fs: fix force option to create filesystem on mounted device

PATCH Superseded Kazuya Mio 3 participants 3 messages Jun 24, 2013 – Jun 27, 2013

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kazuya Mio

author
#0 lore raw

PATCH v2 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 -FF option is specified.
However, currently we have to specify -F option third to force mke2fs. This patch fixes the problem.

---
 misc/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
misc/util.c +2 -2
index 6c93e1c..40c8858 100644
@@ -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;
 		}
Reviewed-by on v2 1/2
#1 lore raw
Quoted 6 lines · Kazuya Mio

According to mke2fs man, we can create a filesystem on the mounted device when -FF option is specified.
However, currently we have to specify -F option third to force mke2fs. This patch fixes the problem.

- Zheng

Quoted 31 lines
---
 misc/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
misc/util.c +2 -3
index 6c93e1c..40c8858 100644
@@ -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;
 		}
 
--

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Kazuya Mio
Quoted 10 lines · Kazuya Mio

Date: Mon, 24 Jun 2013 15:28:59 +0900
From: Kazuya Mio <[email protected]>
To: Andreas Dilger <[email protected]>, [email protected]
Cc: [email protected]
Subject: [PATCH 1/2 V2] mke2fs: fix force option to create filesystem on
mounted device

According to mke2fs man, we can create a filesystem on the mounted device when -FF option is specified.
However, currently we have to specify -F option third to force mke2fs.

Oh, you mean we have to specify -F option three times ? It took me some time to understand. Please rephrase the description.

Otherwise the patch looks good.

Thanks!
-Lukas

Quoted 35 lines

This patch fixes the problem.

---
 misc/util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
misc/util.c +2 -3
index 6c93e1c..40c8858 100644
@@ -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;
 		}
 
--

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html