1 ext4: omit init_itable=n in procfs when disabled
3 From: Tyson Nottingham <tgnottingham@gmail.com>
5 Don't show init_itable=n in /proc/fs/ext4/<dev>/options when filesystem
6 is mounted with noinit_itable.
8 Signed-off-by: Tyson Nottingham <tgnottingham@gmail.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 $ sudo mount -o loop=$(losetup -f) image.ext4 mnt
16 /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,data=ordered)
17 $ grep init /proc/fs/ext4/loop0/options
20 $ sudo mount -o loop=$(losetup -f),noinit_itable image.ext4 mnt
22 /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,noinit_itable,data=ordered)
23 $ grep init /proc/fs/ext4/loop0/options
27 ^ Superfluous init_itable=10.
32 $ sudo mount -o loop=$(losetup -f) image.ext4 mnt
33 $ mount -l | grep image
34 /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,data=ordered)
35 $ grep init /proc/fs/ext4/loop0/options
38 $ sudo mount -o loop=$(losetup -f),noinit_itable image.ext4 mnt
39 $ mount -l | grep image
40 /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,noinit_itable,data=ordered)
41 $ grep init /proc/fs/ext4/loop0/options
45 fs/ext4/super.c | 2 +-
46 1 file changed, 1 insertion(+), 1 deletion(-)
48 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
49 index 6b07fa2..7437ed0 100644
52 @@ -2081,7 +2081,7 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
53 SEQ_OPTS_PRINT("inode_readahead_blks=%u",
54 sbi->s_inode_readahead_blks);
56 - if (nodefs || (test_opt(sb, INIT_INODE_TABLE) &&
57 + if (test_opt(sb, INIT_INODE_TABLE) && (nodefs ||
58 (sbi->s_li_wait_mult != EXT4_DEF_LI_WAIT_MULT)))
59 SEQ_OPTS_PRINT("init_itable=%u", sbi->s_li_wait_mult);
60 if (nodefs || sbi->s_max_dir_size_kb)