add patch dont-show-jbd-data-option-if-defaulted
[ext4-patch-queue.git] / omit-init_itable-in-procfs-when-disabled
blob416bd3c121c33f990a6744de2d898bb022d419d8
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>
10 ---
12 Before:
14 $ sudo mount -o loop=$(losetup -f) image.ext4 mnt
15 $ mount | grep image
16 /home/tgnottingham/image.ext4 on /home/tgnottingham/mnt type ext4 (rw,relatime,data=ordered)
17 $ grep init /proc/fs/ext4/loop0/options
18 init_itable=10
20 $ sudo mount -o loop=$(losetup -f),noinit_itable image.ext4 mnt
21 $ mount | grep image
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
24 noinit_itable
25 init_itable=10
27 ^ Superfluous init_itable=10.
30 After:
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
36 init_itable=10
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
42 noinit_itable
44 ---
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
50 --- a/fs/ext4/super.c
51 +++ b/fs/ext4/super.c
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)
61 -- 
62 2.7.4