From a81c093a935c62b9e4586ae930aab7439948d538 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 16 Jun 2021 14:48:33 -0600 Subject: [PATCH] LU-14767 utils: mkfs.lustre allow lazy_itable_init=1 When "lazy_itable_init=0" was added to the mke2fs options the call to append_unique() to see whether "lazy_itable_init" was already listed in the mke2fs options was incorrect. It checks to see if "lazy_itable_init=0" is already present in the options, and doesn't match "lazy_itable_init=1" if it was specified on the command-line. Separate the key and value passed to append_unique() so that it can check if any form of the key is present in the existing options. Test-Parameters: trivial testlist=conf-sanity Fixes: 701cc249594e ("LU-13533 utils: ext4lazyinit should be disabled") Signed-off-by: Andreas Dilger Change-Id: Ic7a6dbb81f004dd35f0f1c5f5ddec0fb363ebbe5 Reviewed-on: https://review.whamcloud.com/44019 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Artem Blagodarenko Reviewed-by: Oleg Drokin --- lustre/utils/libmount_utils_ldiskfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/utils/libmount_utils_ldiskfs.c b/lustre/utils/libmount_utils_ldiskfs.c index c7a6aae..5907213 100644 --- a/lustre/utils/libmount_utils_ldiskfs.c +++ b/lustre/utils/libmount_utils_ldiskfs.c @@ -886,12 +886,12 @@ 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")) { append_unique(start, ext_opts ? "," : " -E ", - "lazy_journal_init=0", NULL, maxbuflen); + "lazy_journal_init", "0", maxbuflen); ext_opts = 1; } if (is_e2fsprogs_feature_supp("-E lazy_itable_init=0")) { append_unique(start, ext_opts ? "," : "-E", - "lazy_itable_init=0", NULL, maxbuflen); + "lazy_itable_init", "0", maxbuflen); ext_opts = 1; } -- 1.8.3.1