From: Li Dongyang Date: Thu, 20 Jul 2023 13:12:19 +0000 (+1000) Subject: LU-15002 utils: disable meta_bg and enable packed_meta_blocks X-Git-Tag: 2.15.59~101 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7cce9f2d1c0911ee8501f08da6b6573735dee70e;p=fs%2Flustre-release.git LU-15002 utils: disable meta_bg and enable packed_meta_blocks 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 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51723 Tested-by: jenkins Tested-by: Maloo Tested-by: Emoly Liu Reviewed-by: Andreas Dilger Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/libmount_utils_ldiskfs.c b/lustre/utils/libmount_utils_ldiskfs.c index 32b19a1..1721bf9 100644 --- a/lustre/utils/libmount_utils_ldiskfs.c +++ b/lustre/utils/libmount_utils_ldiskfs.c @@ -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 */