]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
mke2fs: enable lazy_itable_init on newer kernel by default
authorLukas Czerner <lczerner@redhat.com>
Sun, 6 Jul 2014 01:08:34 +0000 (21:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 6 Jul 2014 01:08:38 +0000 (21:08 -0400)
Currently is used did not specified lazy_itable_init option we rely on
information from ext4 module exported via sysfs interface. However if
the ext4 module is not loaded it will not be enabled even though kernel
might support it.

With this commit we set the default according to the kernel version,
however we still allow it to be set manually via extended option or be
enabled in case that ext4 module advertise that it supports this
feature.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
misc/mke2fs.c

index 23fbdbf70831f85a08d9212d76cfac59b4ae9dd6..d5e16c03a1e07c7e605ab885a5f71637a702ba40 100644 (file)
@@ -2106,7 +2106,15 @@ profile_error:
                        blocksize, sys_page_size);
        }
 
-       lazy_itable_init = 0;
+       /*
+        * On newer kernels we do have lazy_itable_init support. So pick the
+        * right default in case ext4 module is not loaded.
+        */
+       if (is_before_linux_ver(2, 6, 37))
+               lazy_itable_init = 0;
+       else
+               lazy_itable_init = 1;
+
        if (access("/sys/fs/ext4/features/lazy_itable_init", R_OK) == 0)
                lazy_itable_init = 1;