diff mbox

ext4: fix the incorrect info of /proc/mounts after mount no-journal fs

Message ID 1305771094-2976-1-git-send-email-sanbai@taobao.com
State Superseded, archived
Headers show

Commit Message

Robin Dong May 19, 2011, 2:11 a.m. UTC
After mkfs without journal:

  # mkfs.ext4 -O ^has_journal /dev/sda
  # mount -t ext4 /dev/sda /test

the /proc/mounts will show:
"/dev/sda /test ext4 rw,relatime,user_xattr,acl,barrier=1,data=writeback 0 0"
which usually make users think the fs is using writeback-mode.

Signed-off-by: Robin Dong <sanbai@taobao.com>
---
 fs/ext4/super.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 8553dfb..4ea1e85 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3474,7 +3474,8 @@  static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		goto failed_mount_wq;
 	} else {
 		clear_opt(sb, DATA_FLAGS);
-		set_opt(sb, WRITEBACK_DATA);
+		if (EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL))
+			set_opt(sb, WRITEBACK_DATA);
 		sbi->s_journal = NULL;
 		needs_recovery = 0;
 		goto no_journal;