ext4: don't show mount options in /proc/mounts if there is no journal
commit373cd5c53d5ea6622c319ecd84e29e2737d488bd
authorTheodore Ts'o <tytso@mit.edu>
Sun, 22 May 2011 20:12:35 +0000 (22 16:12 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 22 May 2011 20:12:35 +0000 (22 16:12 -0400)
tree2df40a29def22438cc15f90e4683d43974798784
parent1bb933fb1fa8e4cb337a0d5dfd2ff4c0dc2073e8
ext4: don't show mount options in /proc/mounts if there is no journal

After creating an ext4 file system without a journal:

  # mke2fs -t 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 can fool users into thinking that the fs is using writeback mode.

So don't set the writeback option when the journal has not been
enabled; we don't depend on the writeback option being set, since
ext4_should_writeback_data() in ext4_jbd2.h tests to see if the
journal is not present before returning true.

Reported-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c