Whamcloud - gitweb
LU-15002 utils: disable meta_bg and enable packed_meta_blocks 23/51723/2
authorLi Dongyang <dongyangli@ddn.com>
Thu, 20 Jul 2023 13:12:19 +0000 (23:12 +1000)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Oct 2023 05:47:22 +0000 (05:47 +0000)
To take advantage of the upcoming e2fsprogs changes,
disable meta_bg to allow group descriptor blocks allocate
beyond group#0. This allows the group descriptor blocks
to be packed and placed at the beginning, rather than
distributed across the entire file system with meta_bg.

Enable packed_meta_blocks to place bitmaps, inode table
and journal at the beginning of the file system.

Due to LU-16971, use 200 blocks when testing mke2fs options.

Re-enable lazy_journal_init, which got turned off accidentally.

Fix up the handling of extented options, there should be spaces
in front and after -E when building the mke2fs cmd.

Test-Parameters: trivial testlist=conf-sanity
Change-Id: If4385c1d3740bf7a47bd12f90c2c93046bc8bead
Fixes: 701cc24959 ("LU-13533 utils: ext4lazyinit should be disabled")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51723
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/libmount_utils_ldiskfs.c

index 32b19a1..1721bf9 100644 (file)
@@ -416,7 +416,7 @@ static bool is_e2fsprogs_feature_supp(const char *feature)
 
        close(fd);
 
-       snprintf(cmd, sizeof(cmd), "%s -F %s %s 100 >/dev/null 2>&1",
+       snprintf(cmd, sizeof(cmd), "%s -F %s %s 200 >/dev/null 2>&1",
                 MKE2FS, feature, imgname);
        /* run_command() displays the output of mke2fs when it fails for
         * some feature, so use system() directly */
@@ -515,8 +515,6 @@ static int enable_default_ext4_features(struct mkfs_opts *mop, char *anchor,
 
        if (enable_64bit) {
                append_unique(anchor, ",", "64bit", NULL, maxbuflen);
-               if (is_e2fsprogs_feature_supp("-O meta_bg"))
-                       append_unique(anchor, ",", "meta_bg", NULL, maxbuflen);
                append_unique(anchor, ",", "^resize_inode", NULL, maxbuflen);
        }
 
@@ -879,16 +877,21 @@ int ldiskfs_make_lustre(struct mkfs_opts *mop)
        }
 
        /* Avoid zeroing out the full journal - speeds up mkfs */
-       if (is_e2fsprogs_feature_supp("-E lazy_journal_init=0")) {
+       if (is_e2fsprogs_feature_supp("-E lazy_journal_init")) {
                append_unique(start, ext_opts ? "," : " -E ",
-                             "lazy_journal_init", "0", maxbuflen);
+                             "lazy_journal_init", NULL, maxbuflen);
                ext_opts = 1;
        }
        if (is_e2fsprogs_feature_supp("-E lazy_itable_init=0")) {
-               append_unique(start, ext_opts ? "," : "-E",
+               append_unique(start, ext_opts ? "," : " -E ",
                            "lazy_itable_init", "0", maxbuflen);
                ext_opts = 1;
        }
+       if (is_e2fsprogs_feature_supp("-E packed_meta_blocks")) {
+               append_unique(start, ext_opts ? "," : " -E ",
+                             "packed_meta_blocks", NULL, maxbuflen);
+               ext_opts = 1;
+       }
 
        /* end handle -E mkfs options */