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

login
register
mail settings
Submitter Robin Dong
Date May 19, 2011, 2:11 a.m.
Message ID <1305771094-2976-1-git-send-email-sanbai@taobao.com>
Download mbox | patch
Permalink /patch/96279/
State Superseded
Headers show

Comments

Robin Dong - May 19, 2011, 2:11 a.m.
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(-)

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;