diff --git a/0038-LU-16322-build-Add-client-build-support-for-openEule.patch b/0001-LU-16322-build-Add-client-build-support-for-openEule.patch similarity index 95% rename from 0038-LU-16322-build-Add-client-build-support-for-openEule.patch rename to 0001-LU-16322-build-Add-client-build-support-for-openEule.patch index 31340c5079ce1f4810c550cb204bc89fd5fc6029..ee5872ed95bbf230107bae15d9b76c831f518999 100644 --- a/0038-LU-16322-build-Add-client-build-support-for-openEule.patch +++ b/0001-LU-16322-build-Add-client-build-support-for-openEule.patch @@ -1,7 +1,7 @@ -From 1efdc0f82bf67c06ad50d09c24cab97a7f0e2e89 Mon Sep 17 00:00:00 2001 +From b02bc706549466cd9e4729f72e5b8c1f3e0aae20 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Wed, 26 Oct 2022 08:58:14 +0000 -Subject: [PATCH 38/61] LU-16322: build: Add client build support for openEuler +Subject: [PATCH 01/23] LU-16322: build: Add client build support for openEuler The kernel of current openEuler LTS version 22.03 is based on Linux 5.10.0 which is already supported in Lustre master. Thus we only need @@ -93,7 +93,7 @@ index db1b2ea86a..63e212a3d1 100644 IN_KERNEL="${PACKAGE}"]) AC_MSG_RESULT($KMP_MODDIR) diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh -index a6c39473cf..78e2af9468 100644 +index 29cb66bdd9..25978095d4 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -154,6 +154,11 @@ autodetect_distro() { @@ -108,9 +108,9 @@ index a6c39473cf..78e2af9468 100644 *) fatal 1 "I don't know what distro name $name and version $version is.\nEither update autodetect_distro() or use the --distro argument." ;; -@@ -207,6 +212,7 @@ autodetect_target() { - sles15.3) target="$(uname -r | cut -d . -f 1,2)-sles15sp3";; +@@ -209,6 +214,7 @@ autodetect_target() { sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";; + sles15.5) target="$(uname -r | cut -d . -f 1,2)-sles15sp5";; fc18) target="3.x-fc18";; + oe2203) target="5.10-oe2203";; *) fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";; @@ -253,10 +253,10 @@ index f4ac0c894d..a8c0934428 100644 %if %{with servers} echo '%{_sysconfdir}/init.d/lustre' >>lustre.files diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 4b21088869..192662875e 100644 +index 782557e3f5..e028e29051 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog -@@ -206,6 +206,7 @@ TBD Whamcloud +@@ -210,6 +210,7 @@ 5.8.0-53 (Ubuntu 20.04.2 HWE) 5.11.0-31 (Ubuntu 20.04.3 HWE) 5.11.0 (vanilla kernel.org) @@ -265,12 +265,12 @@ index 4b21088869..192662875e 100644 * Recommended ZFS version: 2.1.5 * NFS export disabled when stack size < 8192 (32-bit Lustre clients), diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index 2927df790c..12afe95fbc 100644 +index 7713b8cf45..cb153cc3fc 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 -@@ -3496,6 +3496,7 @@ lustre/kernel_patches/targets/5.3-sles15sp2.target - lustre/kernel_patches/targets/5.3-sles15sp3.target +@@ -4341,6 +4341,7 @@ lustre/kernel_patches/targets/5.3-sles15sp3.target lustre/kernel_patches/targets/5.14-sles15sp4.target + lustre/kernel_patches/targets/5.14-sles15sp5.target lustre/kernel_patches/targets/3.x-fc18.target +lustre/kernel_patches/targets/5.10-oe2203.target lustre/ldlm/Makefile diff --git a/0001-Prepare-for-next-pointrelease.patch b/0001-Prepare-for-next-pointrelease.patch deleted file mode 100644 index c9b24c11616cb3e4a16fd3434ee32aec8a27d00e..0000000000000000000000000000000000000000 --- a/0001-Prepare-for-next-pointrelease.patch +++ /dev/null @@ -1,97 +0,0 @@ -From c209fe8c68e4275855154285901cfc0091bdf9e9 Mon Sep 17 00:00:00 2001 -From: Oleg Drokin -Date: Tue, 18 Jul 2023 10:54:54 -0400 -Subject: [PATCH 01/61] Prepare for next pointrelease. - -Change-Id: Idc2b25dea2b4c0f587f735dc1bdf2dd358d1f647 ---- - lustre/ChangeLog | 76 +++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 75 insertions(+), 1 deletion(-) - -diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 59b05d21f2..57699d2232 100644 ---- a/lustre/ChangeLog -+++ b/lustre/ChangeLog -@@ -1,4 +1,78 @@ --06-19-2023 Whamcloud -+TBD Whamcloud -+ * version 2.15.4 -+ * See https://wiki.whamcloud.com/display/PUB/Lustre+Support+Matrix -+ for currently supported client and server kernel versions. -+ * Server primary kernels built and tested during release cycle: -+ 4.18.0-477.10.1.el8 (RHEL8.8) -+ * Other server kernels known to build and work at some point (others may also work): -+ 3.10.0-862.14.4.el7 (RHEL7.5) -+ 3.10.0-957.27.2.el7 (RHEL7.6) -+ 3.10.0-1062.18.1.el7 (RHEL7.7) -+ 3.10.0-1127.19.1.el7 (RHEL7.8) -+ 3.10.0-1160.88.1.el7 (RHEL7.9) -+ 4.18.0-80.11.2.el8 (RHEL8.0) -+ 4.18.0-147.8.1.el8 (RHEL8.1) -+ 4.18.0-193.28.1.el8 (RHEL8.2) -+ 4.18.0-240.22.1.el8 (RHEL8.3) -+ 4.18.0-305.25.1.el8 (RHEL8.4) -+ 4.18.0-348.23.1.el8 (RHEL8.5) -+ 4.18.0-372.32.1.el8 (RHEL8.6) -+ 4.18.0-425.3.1.el8 (RHEL8.7) -+ 4.4.120-92.70 (SLES12 SP2) -+ 4.4.180-94.100 (SLES12 SP3) -+ 4.4.0-131 (Ubuntu 16.04) -+ 4.15.0-32 (Ubuntu 18.04) -+ 5.4.0-48 (Ubuntu 20.04) -+ vanilla linux 5.4.0 (ZFS + ldiskfs) -+ vanilla linux 5.4.21 (ZFS + ldiskfs) -+ vanilla linux 5.4.136 (ZFS + ldiskfs) -+ * ldiskfs needs an ldiskfs patch series for that kernel, ZFS does not -+ * Client primary kernels built and tested during release cycle: -+ 5.14.0-284.11.1.el9 (RHEL9.2) -+ 5.14.0-162.23.1.el9 (RHEL9.1) -+ 4.18.0-477.10.1.el8 (RHEL8.8) -+ 5.4.0-37 (Ubuntu 20.04) -+ 5.14.21-150400.24.28 (SLES15 SP4) -+ * Other clients known to build on these kernels at some point (others may also work): -+ 3.10.0-862.14.4.el7 (RHEL7.5) -+ 3.10.0-957.27.2.el7 (RHEL7.6) -+ 4.14.0-49.13.1.el7a (RHEL7.5) -+ 4.14.0-115.2.2.el7a (RHEL7.6) -+ 3.10.0-1062.18.1.el7 (RHEL7.7) -+ 3.10.0-1127.19.1.el7 (RHEL7.8) -+ 3.10.0-1160.88.1.el7 (RHEL7.9) -+ 4.18.0-80.11.2.el8 (RHEL8.0) -+ 4.18.0-147.8.1.el8 (RHEL8.1) -+ 4.18.0-193.28.1.el8 (RHEL8.2) -+ 4.18.0-240.22.1.el8 (RHEL8.3) -+ 4.18.0-305.25.1.el8 (RHEL8.4) -+ 4.18.0-348.23.1.el8 (RHEL8.5) -+ 4.18.0-372.32.1.el8 (RHEL8.6) -+ 4.18.0-425.3.1.el8 (RHEL8.7) -+ 5.14.0-70.30.1.el9 (RHEL9.0) -+ 4.4.120-92.70 (SLES12 SP2) -+ 4.4.180-94.100 (SLES12 SP3) -+ 4.12.14-95.48 (SLES12 SP4) -+ 4.12.14-122.91 (SLES12 SP5) -+ 4.12.14-197.75 (SLES15 SP1) -+ 5.3.18-24.96 (SLES15 SP2) -+ 5.3.18-150300.59.93 (SLES15 SP3) -+ 4.4.0-131 (Ubuntu 16.04) -+ 4.15.0-48 (Ubuntu 18.04) -+ 5.8.0-53 (Ubuntu 20.04.2 HWE) -+ 5.11.0-31 (Ubuntu 20.04.3 HWE) -+ 5.11.0 (vanilla kernel.org) -+ * Recommended e2fsprogs version: 1.47.0-wc1 or newer -+ * Recommended ZFS version: 2.1.11 -+ * NFS export disabled when stack size < 8192 (32-bit Lustre clients), -+ since the NFSv4 export of Lustre filesystem with 4K stack may cause a -+ stack overflow. For more information, please refer to bugzilla 17630. -+ * NFSv4 reexport to 32-bit NFS client nodes requires Lustre client on -+ the re-exporting nodes to be mounted with "32bitapi" mount option -+ -+-------------------------------------------------------------------------------- -+ -+'06-19-2023 Whamcloud - * version 2.15.3 - * See https://wiki.whamcloud.com/display/PUB/Lustre+Support+Matrix - for currently supported client and server kernel versions. --- -2.33.0 - diff --git a/0002-LU-15821-ldlm-Prioritize-blocking-callbacks.patch b/0002-LU-15821-ldlm-Prioritize-blocking-callbacks.patch deleted file mode 100644 index 1cdbf0de16d89a85477b05f23f295a7daa663496..0000000000000000000000000000000000000000 --- a/0002-LU-15821-ldlm-Prioritize-blocking-callbacks.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 8ca1186151faa778edd5abd361e92fcd5d8ff56b Mon Sep 17 00:00:00 2001 -From: Patrick Farrell -Date: Wed, 4 May 2022 20:50:57 -0400 -Subject: [PATCH 02/61] LU-15821 ldlm: Prioritize blocking callbacks - -The current code places bl_ast lock callbacks at the end of -the global BL callback queue. This is bad because it -causes urgent requests from the server to wait behind -non-urgent cleanup tasks to keep lru_size at the right -level. - -This can lead to evictions if there is a large queue of -items in the global queue so the callback is not serviced -in a timely manner. - -Put bl_ast callbacks on the priority queue so they do not -wait behind the background traffic. - -Add some additional debug in this area. - -Lustre-change: https://review.whamcloud.com/47215 -Lustre-commit: 2d59294d52b696125acc464e5910c893d9aef237 - -Signed-off-by: Patrick Farrell -Change-Id: Ic6eb65819a4a93e9d30e807d386ca18380b30c7d -Reviewed-by: Andreas Dilger -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49610 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Stephane Thiell -Reviewed-by: Oleg Drokin ---- - lustre/ldlm/ldlm_lockd.c | 60 ++++++++++++++++++++++++++++++++-------- - 1 file changed, 48 insertions(+), 12 deletions(-) - -diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c -index f82df7df0e..7e59709ea6 100644 ---- a/lustre/ldlm/ldlm_lockd.c -+++ b/lustre/ldlm/ldlm_lockd.c -@@ -83,27 +83,29 @@ static inline timeout_t ldlm_get_rq_timeout(void) - } - - struct ldlm_bl_pool { -- spinlock_t blp_lock; -+ spinlock_t blp_lock; - - /* - * blp_prio_list is used for callbacks that should be handled - * as a priority. It is used for LDLM_FL_DISCARD_DATA requests. - * see b=13843 - */ -- struct list_head blp_prio_list; -+ struct list_head blp_prio_list; - - /* - * blp_list is used for all other callbacks which are likely - * to take longer to process. - */ -- struct list_head blp_list; -- -- wait_queue_head_t blp_waitq; -- struct completion blp_comp; -- atomic_t blp_num_threads; -- atomic_t blp_busy_threads; -- int blp_min_threads; -- int blp_max_threads; -+ struct list_head blp_list; -+ -+ wait_queue_head_t blp_waitq; -+ struct completion blp_comp; -+ atomic_t blp_num_threads; -+ atomic_t blp_busy_threads; -+ int blp_min_threads; -+ int blp_max_threads; -+ int blp_total_locks; -+ int blp_total_blwis; - }; - - struct ldlm_bl_work_item { -@@ -2116,22 +2118,41 @@ static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi, - enum ldlm_cancel_flags cancel_flags) - { - struct ldlm_bl_pool *blp = ldlm_state->ldlm_bl_pool; -+ char *prio = "regular"; -+ int count; - - ENTRY; - - spin_lock(&blp->blp_lock); -+ /* cannot access blwi after added to list and lock is dropped */ -+ count = blwi->blwi_lock ? 1 : blwi->blwi_count; -+ -+ /* if the server is waiting on a lock to be cancelled (bl_ast), this is -+ * an urgent request and should go in the priority queue so it doesn't -+ * get stuck behind non-priority work (eg, lru size management) -+ * -+ * We also prioritize discard_data, which is for eviction handling -+ */ - if (blwi->blwi_lock && -- ldlm_is_discard_data(blwi->blwi_lock)) { -- /* add LDLM_FL_DISCARD_DATA requests to the priority list */ -+ (ldlm_is_discard_data(blwi->blwi_lock) || -+ ldlm_is_bl_ast(blwi->blwi_lock))) { - list_add_tail(&blwi->blwi_entry, &blp->blp_prio_list); -+ prio = "priority"; - } else { - /* other blocking callbacks are added to the regular list */ - list_add_tail(&blwi->blwi_entry, &blp->blp_list); - } -+ blp->blp_total_locks += count; -+ blp->blp_total_blwis++; - spin_unlock(&blp->blp_lock); - - wake_up(&blp->blp_waitq); - -+ /* unlocked read of blp values is intentional - OK for debug */ -+ CDEBUG(D_DLMTRACE, -+ "added %d/%d locks to %s blp list, %d blwis in pool\n", -+ count, blp->blp_total_locks, prio, blp->blp_total_blwis); -+ - /* - * can not check blwi->blwi_flags as blwi could be already freed in - * LCF_ASYNC mode -@@ -2749,10 +2770,23 @@ static int ldlm_bl_get_work(struct ldlm_bl_pool *blp, - if (++num_bl >= num_th) - num_bl = 0; - list_del(&blwi->blwi_entry); -+ blp->blp_total_locks -= blwi->blwi_lock ? 1 : blwi->blwi_count; -+ blp->blp_total_blwis--; - } - spin_unlock(&blp->blp_lock); - *p_blwi = blwi; - -+ /* intentional unlocked read of blp values - OK for debug */ -+ if (blwi) { -+ CDEBUG(D_DLMTRACE, -+ "Got %d locks of %d total in blp. (%d blwis in pool)\n", -+ blwi->blwi_lock ? 1 : blwi->blwi_count, -+ blp->blp_total_locks, blp->blp_total_blwis); -+ } else { -+ CDEBUG(D_DLMTRACE, -+ "No blwi found in queue (no bl locks in queue)\n"); -+ } -+ - if (*p_exp != NULL && *p_blwi != NULL) { - obd_stale_export_put(*p_exp); - *p_exp = NULL; -@@ -3293,6 +3327,8 @@ static int ldlm_setup(void) - init_waitqueue_head(&blp->blp_waitq); - atomic_set(&blp->blp_num_threads, 0); - atomic_set(&blp->blp_busy_threads, 0); -+ blp->blp_total_locks = 0; -+ blp->blp_total_blwis = 0; - - if (ldlm_num_threads == 0) { - blp->blp_min_threads = LDLM_NTHRS_INIT; --- -2.33.0 - diff --git a/0039-LU-16481-build-add-server-support-for-openEuler.patch b/0002-LU-16481-build-add-server-support-for-openEuler.patch similarity index 99% rename from 0039-LU-16481-build-add-server-support-for-openEuler.patch rename to 0002-LU-16481-build-add-server-support-for-openEuler.patch index b1da3fde7f3ee16d3f5f37f7deeb72023e9da73d..b2d9f4a1a4e2a8dd462e519c5486bc3b383b0efa 100644 --- a/0039-LU-16481-build-add-server-support-for-openEuler.patch +++ b/0002-LU-16481-build-add-server-support-for-openEuler.patch @@ -1,7 +1,7 @@ -From f989b37b3bd1e4f7a465e959eaf7559438bab248 Mon Sep 17 00:00:00 2001 +From cc6c9797befddb6d0b9a4e3ea77332ba25f97c96 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Mon, 21 Nov 2022 03:36:38 +0000 -Subject: [PATCH 39/61] LU-16481 build: add server support for openEuler +Subject: [PATCH 02/23] LU-16481 build: add server support for openEuler openEuer uses dnf as rpm pkg manager, it is somewhat like RHEL/Fedora. The current openEuler LTS 22.03 kernel is based on Linux 5.10.0. @@ -83,10 +83,10 @@ Signed-off-by: Xinliang Liu create mode 100644 ldiskfs/kernel_patches/series/ldiskfs-5.10.0-oe2203.series diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 -index 14ad1e2215..8bc334b951 100644 +index 2e0b3e6d76..9ece25f757 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 -@@ -123,9 +123,13 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ +@@ -124,9 +124,13 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ [LDISKFS_SERIES="5.8.0-53-ubuntu20.series"], [LDISKFS_SERIES="5.8.0-63-ubuntu20.series"], [LDISKFS_SERIES="5.8.0-ml.series"]) @@ -2027,10 +2027,10 @@ index 0000000000..65d1f3a312 +oe2203/ext4-delayed-iput.patch +rhel8/ext4-old_ea_inodes_handling_fix.patch diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 192662875e..9401e95187 100644 +index e028e29051..d58aa724bc 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog -@@ -100,6 +100,7 @@ TBD Whamcloud +@@ -104,6 +104,7 @@ vanilla linux 5.4.0 (ZFS + ldiskfs) vanilla linux 5.4.21 (ZFS + ldiskfs) vanilla linux 5.4.136 (ZFS + ldiskfs) @@ -2038,7 +2038,7 @@ index 192662875e..9401e95187 100644 * ldiskfs needs an ldiskfs patch series for that kernel, ZFS does not * Client primary kernels built and tested during release cycle: 5.14.0-284.11.1.el9 (RHEL9.2) -@@ -206,7 +207,7 @@ TBD Whamcloud +@@ -210,7 +211,7 @@ 5.8.0-53 (Ubuntu 20.04.2 HWE) 5.11.0-31 (Ubuntu 20.04.3 HWE) 5.11.0 (vanilla kernel.org) diff --git a/0003-LU-14377-tests-make-parallel-scale-rr_alloc-less-str.patch b/0003-LU-14377-tests-make-parallel-scale-rr_alloc-less-str.patch deleted file mode 100644 index ba98d63af6b9b6c96f8ee253c0338438f4c6f511..0000000000000000000000000000000000000000 --- a/0003-LU-14377-tests-make-parallel-scale-rr_alloc-less-str.patch +++ /dev/null @@ -1,144 +0,0 @@ -From c0b60c0c79a2d5d5be651570564d6d0407457a5f Mon Sep 17 00:00:00 2001 -From: Andreas Dilger -Date: Tue, 18 Oct 2022 18:37:58 -0600 -Subject: [PATCH 03/61] LU-14377 tests: make parallel-scale/rr_alloc less - strict - -test_rr_alloc() sometimes fails with a difference of 3-4 objects -per OST, after creating 1500+ objects on each OST. This should -not be considered fatal. Make the test more lenient, and allow -a difference of up to 0.3% of objects between the OSTs. - -Fix some code style issues in the test. - -Lustre-change: https://review.whamcloud.com/48914 -Lustre-commit: b104c0a27713899a4d047f56fed57c30c39b8195 - -Test-Parameters: trivial testlist=parallel-scale env=ONLY=rr_alloc -Signed-off-by: Andreas Dilger -Change-Id: Ib6ba8c5d8e9d3245833448a52f8ed25308698a33 -Reviewed-by: Lai Siyao -Reviewed-by: Elena Gryaznova -(cherry picked from commit b104c0a27713899a4d047f56fed57c30c39b8195) -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51142 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/tests/functions.sh | 52 +++++++++++++++++++++------------------ - 1 file changed, 28 insertions(+), 24 deletions(-) - -diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh -index 1807bb8d17..3017fdb887 100644 ---- a/lustre/tests/functions.sh -+++ b/lustre/tests/functions.sh -@@ -1010,16 +1010,15 @@ cleanup_rr_alloc () { - - run_rr_alloc() { - remote_mds_nodsh && skip "remote MDS with nodsh" -- echo "===Test gives more reproduction percentage if number of "\ -- "client and ost are more. Test with 44 or more clients "\ -- "and 73 or more OSTs gives 100% reproduction rate==" -+ -+ echo "===Test gives more reproduction percentage if number of " -+ echo " client and ost are more. Test with 44 or more clients " -+ echo " and 73 or more OSTs gives 100% reproduction rate==" - - RR_ALLOC=${RR_ALLOC:-$(which rr_alloc 2> /dev/null || true)} - [ x$RR_ALLOC = x ] && skip_env "rr_alloc not found" - declare -a diff_max_min_arr -- # foeo = file on each ost. calc = calculated. - local ost_idx -- local foeo_calc - local qos_prec_objs="${TMP}/qos_and_precreated_objects" - local rr_alloc_NFILES=${rr_alloc_NFILES:-555} - local rr_alloc_MNTPTS=${rr_alloc_MNTPTS:-11} -@@ -1036,9 +1035,6 @@ run_rr_alloc() { - error_exit "Failed to mount lustre on ${mntpt_root}$i $clients" - done - -- local cmd="$RR_ALLOC $mntpt_root/$tdir/ash $rr_alloc_NFILES \ -- $num_clients" -- - # Save mdt values, set threshold to 100% i.e always Round Robin, - # restore the saved values again after creating files... - save_lustre_params mds1 \ -@@ -1056,7 +1052,8 @@ run_rr_alloc() { - # per OST are not multiple of that then it will be set to nearest - # lower power of 2. So set 'create_count' to the upper power of 2. - -- foeo_calc=$((rr_alloc_NFILES * total_MNTPTS / OSTCOUNT)) -+ # foeo = file on each ost. calc = calculated. -+ local foeo_calc=$((rr_alloc_NFILES * total_MNTPTS / OSTCOUNT)) - local create_count=$((2 * foeo_calc)) - - # create_count accepted values: -@@ -1078,18 +1075,19 @@ run_rr_alloc() { - # is created per OSTs. - createmany -o $DIR/$tdir/foo- $(((old_create_count + 1) * OSTCOUNT)) \ - > /dev/null -- rm -f /$DIR/$tdir/foo* -+ unlinkmany $DIR/$tdir/foo- $(((old_create_count + 1) * OSTCOUNT)) - - # Check for enough precreated objects... We should not - # fail here because code(osp_precreate.c) also takes care of it. - # So we have good chances of passing test even if this check fails. - local mdt_idx=0 -- for ost_idx in $(seq 0 $((OSTCOUNT - 1))); do -- [[ $(precreated_ost_obj_count $mdt_idx $ost_idx) -ge \ -- $foeo_calc ]] || echo "Warning: test may fail because" \ -- "of lack of precreated objects on OST${ost_idx}" -+ for ((ost_idx = 0; ost_idx < $OSTCOUNT; ost_idx++ )); do -+ (($(precreated_ost_obj_count $mdt_idx $ost_idx) >= foeo_calc))|| -+ echo "Warning: test may fail from too few objs on OST$ost_idx" - done - -+ local cmd="$RR_ALLOC $mntpt_root/$tdir/f $rr_alloc_NFILES $num_clients" -+ - if [[ $total_MNTPTS -ne 0 ]]; then - # Now start the actual file creation app. - mpi_run "-np $total_MNTPTS" $cmd || return -@@ -1101,12 +1099,14 @@ run_rr_alloc() { - rm -f $qos_prec_objs - - diff_max_min_arr=($($LFS getstripe -r $DIR/$tdir/ | -- grep "lmm_stripe_offset:" | awk '{print $2}' | sort -n | -- uniq -c | awk 'NR==1 {min=max=$1} \ -- { $1max ? max=$1 : max} \ -- END {print max-min, max, min}')) -+ awk '/lmm_stripe_offset:/ {print $2}' | -+ sort | uniq -c | -+ awk 'NR==1 {min=max=$1} \ -+ { $1max ? max=$1:max} \ -+ END {print max-min, max, min}')) -+ -+ $LFS find $DIR/$tdir -type f | xargs -n1 -P8 unlink - -- rm -rf $DIR/$tdir - - # In-case of fairly large number of file creation using RR (round-robin) - # there can be two cases in which deviation will occur than the regular -@@ -1114,11 +1114,15 @@ run_rr_alloc() { - # 1- When rr_alloc does not start right with 'lqr_start_count' reseeded, - # 2- When rr_alloc does not finish with 'lqr_start_count == 0'. - # So the difference of files b/w any 2 OST should not be more than 2. -- [[ ${diff_max_min_arr[0]} -le 2 ]] || -- error "Uneven distribution detected: difference between" \ -- "maximum files per OST (${diff_max_min_arr[1]}) and" \ -- "minimum files per OST (${diff_max_min_arr[2]}) must not be" \ -- "greater than 2" -+ # In some cases it may be more, but shouldn't be > 0.3% of the files. -+ local max_diff=$((create_count > 600 ? create_count / 300 : 2)) -+ -+ (( ${diff_max_min_arr[0]} <= $max_diff )) || { -+ $LFS getstripe -r $DIR/$tdir | -+ awk '/lmm_stripe_offset:/ {print $2}' | sort | uniq -c -+ -+ error "max/min OST objects (${diff_max_min_arr[1]} : ${diff_max_min_arr[2]}) too different" -+ } - } - - run_fs_test() { --- -2.33.0 - diff --git a/0040-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch b/0003-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch similarity index 98% rename from 0040-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch rename to 0003-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch index 2e51ba4e5d2990eaae5679505d8cb82b612534d4..5fefd2786c6143a8b7e2b844b229bdebc694b94a 100644 --- a/0040-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch +++ b/0003-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch @@ -1,7 +1,7 @@ -From 1d3b7b31f3f0f4c9040e16ade9b333e32c94bbae Mon Sep 17 00:00:00 2001 +From 5dbd6e09cc878780420c210a452d076d434bc1d4 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Wed, 10 May 2023 10:08:38 +0000 -Subject: [PATCH 40/61] LU-16824 ldiskfs: add support for openEuler 22.03 LTS +Subject: [PATCH 03/23] LU-16824 ldiskfs: add support for openEuler 22.03 LTS SP1 Add openEuler 22.03 LTS SP1 config target file. @@ -32,10 +32,10 @@ Signed-off-by: Xinliang Liu create mode 100644 lustre/kernel_patches/targets/5.10-oe2203sp1.target.in diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 -index 8bc334b951..f0e987b010 100644 +index 9ece25f757..b521b29be7 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 -@@ -126,6 +126,7 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ +@@ -127,6 +127,7 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ ], [test x$OPENEULER_KERNEL = xyes], [ case $OPENEULER_VERSION_NO in 2203.0) LDISKFS_SERIES="5.10.0-oe2203.series" ;; @@ -44,7 +44,7 @@ index 8bc334b951..f0e987b010 100644 ]) ]) diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh -index 78e2af9468..8db9532b67 100644 +index 25978095d4..2323b31fb8 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -156,8 +156,17 @@ autodetect_distro() { @@ -65,8 +65,8 @@ index 78e2af9468..8db9532b67 100644 ;; *) fatal 1 "I don't know what distro name $name and version $version is.\nEither update autodetect_distro() or use the --distro argument." -@@ -213,6 +222,7 @@ autodetect_target() { - sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";; +@@ -215,6 +224,7 @@ autodetect_target() { + sles15.5) target="$(uname -r | cut -d . -f 1,2)-sles15sp5";; fc18) target="3.x-fc18";; oe2203) target="5.10-oe2203";; + oe2203sp1) target="5.10-oe2203sp1";; @@ -977,10 +977,10 @@ index a8c0934428..6ef7960300 100644 BuildRequires: pkg-config %endif diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 9401e95187..18c0649a11 100644 +index d58aa724bc..6a8dbf5f6c 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog -@@ -101,6 +101,7 @@ TBD Whamcloud +@@ -105,6 +105,7 @@ vanilla linux 5.4.21 (ZFS + ldiskfs) vanilla linux 5.4.136 (ZFS + ldiskfs) 5.10.0-60.94.0.118.oe2203 (openEuler 22.03 LTS) @@ -989,11 +989,11 @@ index 9401e95187..18c0649a11 100644 * Client primary kernels built and tested during release cycle: 5.14.0-284.11.1.el9 (RHEL9.2) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index 12afe95fbc..2d4ad45d71 100644 +index cb153cc3fc..ada95f6856 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 -@@ -3497,6 +3497,7 @@ lustre/kernel_patches/targets/5.3-sles15sp3.target - lustre/kernel_patches/targets/5.14-sles15sp4.target +@@ -4342,6 +4342,7 @@ lustre/kernel_patches/targets/5.14-sles15sp4.target + lustre/kernel_patches/targets/5.14-sles15sp5.target lustre/kernel_patches/targets/3.x-fc18.target lustre/kernel_patches/targets/5.10-oe2203.target +lustre/kernel_patches/targets/5.10-oe2203sp1.target diff --git a/0004-LU-15123-tests-check-quota-reintegration-after-recov.patch b/0004-LU-15123-tests-check-quota-reintegration-after-recov.patch deleted file mode 100644 index 003037814ffb440f9228c1b407d0398c23c04029..0000000000000000000000000000000000000000 --- a/0004-LU-15123-tests-check-quota-reintegration-after-recov.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 13805e3a2d4f520e297bc408d94b9971a6094f9a Mon Sep 17 00:00:00 2001 -From: Alex Zhuravlev -Date: Wed, 19 Apr 2023 10:20:33 +0300 -Subject: [PATCH 04/61] LU-15123 tests: check quota reintegration after - recovery - -4th step of quota reintegration (reconciliation) waits for recovery -completion. So the tests (like sanity-quota/7a) should wait for -recovery completion before checking reintegration results. - -Lustre-change: https://review.whamcloud.com/50688 -Lustre-commit: 4432b6e2824775e292f96e202d6fc0db231bc749 - -Signed-off-by: Alex Zhuravlev -Change-Id: Id0aa5db01658621103d94ad6dafe91b2960b3a33 -Reviewed-by: Andreas Dilger -Reviewed-by: Sergey Cheremencev -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51233 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/tests/sanity-quota.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh -index f552d84fd6..047b1a9687 100755 ---- a/lustre/tests/sanity-quota.sh -+++ b/lustre/tests/sanity-quota.sh -@@ -285,6 +285,8 @@ wait_reintegration() { - cmd=${cmd}.quota_slave.info - - if $(facet_up $tgt); then -+ # reintegration starts after recovery completion -+ wait_recovery_complete $tgt - wait_update_facet $tgt "$cmd | - grep "$qtype" | awk '{ print \\\$3 }'" \ - "$result" $max || return 1 --- -2.33.0 - diff --git a/0041-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch b/0004-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch similarity index 93% rename from 0041-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch rename to 0004-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch index 26a1bc1b2910293de8a1e9cc50399b186b8a83f4..d9ba4575f1ea2533b25850dea36f56e0567a16ad 100644 --- a/0041-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch +++ b/0004-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch @@ -1,7 +1,7 @@ -From 38a03676580e5f2925d30fd1a2459cc9b0237d60 Mon Sep 17 00:00:00 2001 +From 6e3761da04a6b40d469a8bc40620e03bf8bb6b45 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Tue, 18 Jul 2023 03:42:19 +0000 -Subject: [PATCH 41/61] LU-16976 ldiskfs: add support for openEuler 22.03 SP2 +Subject: [PATCH 04/23] LU-16976 ldiskfs: add support for openEuler 22.03 SP2 Add ldiskfs server support for oe2203sp2. Also refine openEuler lbuild scripts. @@ -26,20 +26,20 @@ Signed-off-by: Xinliang Liu create mode 100644 lustre/kernel_patches/targets/5.10-oe2203sp2.target.in diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 -index f0e987b010..c225a6abaa 100644 +index b521b29be7..c520febcd9 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 -@@ -126,7 +126,7 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ +@@ -127,7 +127,7 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ ], [test x$OPENEULER_KERNEL = xyes], [ case $OPENEULER_VERSION_NO in 2203.0) LDISKFS_SERIES="5.10.0-oe2203.series" ;; - 2203.1) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;; -+ 2203.1|2203.2) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;; ++ 2203.*) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;; esac ]) ]) diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh -index 8db9532b67..78389a5d96 100644 +index 2323b31fb8..3261a4752f 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh @@ -165,7 +165,7 @@ autodetect_distro() { @@ -51,8 +51,8 @@ index 8db9532b67..78389a5d96 100644 fi ;; *) -@@ -222,7 +222,8 @@ autodetect_target() { - sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";; +@@ -224,7 +224,8 @@ autodetect_target() { + sles15.5) target="$(uname -r | cut -d . -f 1,2)-sles15sp5";; fc18) target="3.x-fc18";; oe2203) target="5.10-oe2203";; - oe2203sp1) target="5.10-oe2203sp1";; @@ -227,10 +227,10 @@ index 0000000000..35845f336b +EOF +)" diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 18c0649a11..3f03823e3d 100644 +index 6a8dbf5f6c..7506abaaf1 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog -@@ -102,6 +102,7 @@ TBD Whamcloud +@@ -106,6 +106,7 @@ vanilla linux 5.4.136 (ZFS + ldiskfs) 5.10.0-60.94.0.118.oe2203 (openEuler 22.03 LTS) 5.10.0-136.32.0.108.oe2203sp1 (openEuler 22.03 LTS SP1) @@ -239,10 +239,10 @@ index 18c0649a11..3f03823e3d 100644 * Client primary kernels built and tested during release cycle: 5.14.0-284.11.1.el9 (RHEL9.2) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index 2d4ad45d71..feed23e01f 100644 +index ada95f6856..8a475e74b0 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 -@@ -3498,6 +3498,7 @@ lustre/kernel_patches/targets/5.14-sles15sp4.target +@@ -4343,6 +4343,7 @@ lustre/kernel_patches/targets/5.14-sles15sp5.target lustre/kernel_patches/targets/3.x-fc18.target lustre/kernel_patches/targets/5.10-oe2203.target lustre/kernel_patches/targets/5.10-oe2203sp1.target diff --git a/0005-LU-13081-tests-skip-sanity-test_151-test_156.patch b/0005-LU-13081-tests-skip-sanity-test_151-test_156.patch deleted file mode 100644 index f8c97cbddef4d906fb9e0286f2ab426a38d902bd..0000000000000000000000000000000000000000 --- a/0005-LU-13081-tests-skip-sanity-test_151-test_156.patch +++ /dev/null @@ -1,57 +0,0 @@ -From d15f9619eec367805606f4a46d049e6ecb62f36d Mon Sep 17 00:00:00 2001 -From: Alex Deiter -Date: Thu, 27 Apr 2023 02:04:01 +0400 -Subject: [PATCH 05/61] LU-13081 tests: skip sanity test_151/test_156 - -Skip both sanity test_151 and test_156 during interop testing, -since this is really testing server-side functionality only -(OSS caching behavior). And it makes sense to just exclude -test_151 and test_156 during interop testing, otherwise it -seems that the client version of the test can become -inconsistent with the caching behavior/tunables on the OSS -and the failures don't mean anything. There is enough -non-interop testing to catch any regressions in the OSS -cache behavior. - -Lustre-change: https://review.whamcloud.com/50777 -Lustre-commit: 305dda878d1dde822eab7a9dacfe8dec0b96cb3e - -Test-Parameters: trivial -Signed-off-by: Alex Deiter -Change-Id: I39a8b54894d5b0c7573e6c56d1f8e1ba02b3e3fe -Reviewed-by: Jian Yu -Reviewed-by: Andreas Dilger -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51286 -Reviewed-by: Alex Deiter -Reviewed-by: Oleg Drokin -Tested-by: jenkins -Tested-by: Maloo ---- - lustre/tests/sanity.sh | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index fec778e9fe..d73b285eca 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -15079,6 +15079,8 @@ function set_cache() { - test_151() { - [ $PARALLEL == "yes" ] && skip "skip parallel run" - remote_ost_nodsh && skip "remote OST with nodsh" -+ (( CLIENT_VERSION == OST1_VERSION )) || -+ skip "LU-13081: no interop testing for OSS cache" - - local CPAGES=3 - local list=$(comma_list $(osts_nodes)) -@@ -15754,6 +15756,8 @@ test_156() { - skip "stats not implemented on old servers" - [ "$ost1_FSTYPE" = "zfs" ] && - skip "LU-1956/LU-2261: stats not implemented on OSD ZFS" -+ (( CLIENT_VERSION == OST1_VERSION )) || -+ skip "LU-13081: no interop testing for OSS cache" - - local CPAGES=3 - local BEFORE --- -2.33.0 - diff --git a/0042-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch b/0005-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch similarity index 96% rename from 0042-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch rename to 0005-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch index 0b8d21c49bb91236186d2b9fc399a342aa883fe2..228cfcd05bea9db1d5557b2430cc5f58708e2df2 100644 --- a/0042-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch +++ b/0005-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch @@ -1,7 +1,7 @@ -From bf5b9a174b2ec1d1a26c09e7c5d4b928a24aaa8c Mon Sep 17 00:00:00 2001 +From cf0576a8dd973a88998f3b7981850557da82849f Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Mon, 7 Aug 2023 10:18:49 +0000 -Subject: [PATCH 42/61] lustre.spec.in: match rpm macro openEuler for openEuler +Subject: [PATCH 05/23] lustre.spec.in: match rpm macro openEuler for openEuler Linux So that it can handle openEuler derived OSes, like KylinOS. diff --git a/0006-LU-11785-tests-fix-conf-sanity-98-mount-check-on-64K.patch b/0006-LU-11785-tests-fix-conf-sanity-98-mount-check-on-64K.patch deleted file mode 100644 index 980a0af2d463943a0a94ce67e44c29ca47635809..0000000000000000000000000000000000000000 --- a/0006-LU-11785-tests-fix-conf-sanity-98-mount-check-on-64K.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3e9a06398a168a52f72a65450e5249ed502a86cd Mon Sep 17 00:00:00 2001 -From: Kevin Zhao -Date: Fri, 28 Oct 2022 10:05:24 +0800 -Subject: [PATCH 06/61] LU-11785 tests: fix conf-sanity/98 mount check on 64K - page - -This patch fix the mount option length check expectation -fail on 64K page. Since the maxopt_len is the minmium -value of page_size or 64K page_size, but the test cases -only hard code the length of option to the 4K one. This -patch add the mount options according to the page size. - -Lustre-change: https://review.whamcloud.com/48177 -Lustre-commit: 4068ca725954db2a1fc42bf8d184f4672c2ed113 - -Test-Parameters: trivial testlist=conf-sanity env=ONLY=98 -Test-Parameters: testlist=conf-sanity env=ONLY=98 clientarch=aarch64 clientdistro=el8.7 -Signed-off-by: Kevin Zhao -Change-Id: Icdeb8b73308056e216c3f4ce71907b0c928d2c30 -Reviewed-by: Andreas Dilger -Reviewed-by: xinliang -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51288 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/tests/conf-sanity.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh -index dc00fb42ff..a52429afe0 100755 ---- a/lustre/tests/conf-sanity.sh -+++ b/lustre/tests/conf-sanity.sh -@@ -7783,7 +7783,7 @@ test_98() - setup - check_mount || error "mount failed" - mountopt="user_xattr" -- for ((x = 1; x <= 400; x++)); do -+ for ((x = 1; x <= PAGE_SIZE/11; x++)); do - mountopt="$mountopt,user_xattr" - done - mount_client $MOUNT remount,$mountopt 2>&1 | grep "too long" || --- -2.33.0 - diff --git a/0043-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch b/0006-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch similarity index 94% rename from 0043-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch rename to 0006-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch index a86193740904d83d1284ac9de0c2a949b8f81b01..aaf11abaf06b15467f68606c7e24af75dddd5d00 100644 --- a/0043-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch +++ b/0006-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch @@ -1,7 +1,7 @@ -From deacd917d127dda1ec2f22d8f4451205b03860ae Mon Sep 17 00:00:00 2001 +From 3205300a96c3a332a66c4e029aee951ff847a5da Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Wed, 6 Apr 2022 08:06:33 +0000 -Subject: [PATCH 43/61] LU-15722 osd-ldiskfs: fix IO write gets stuck for 64K +Subject: [PATCH 06/23] LU-15722 osd-ldiskfs: fix IO write gets stuck for 64K PAGE_SIZE This fixes below IO write stuck issue: @@ -45,7 +45,7 @@ Reviewed-by: Oleg Drokin 1 file changed, 44 insertions(+) diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c -index 7131add58d..dcc1081e0a 100644 +index f74862cd05..6df532bc00 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1091,6 +1091,7 @@ static int osd_ldiskfs_map_inode_pages(struct inode *inode, @@ -56,7 +56,7 @@ index 7131add58d..dcc1081e0a 100644 int rc = 0, i = 0, mapped_index = 0; struct page *fp = NULL; int clen = 0; -@@ -1147,6 +1148,48 @@ static int osd_ldiskfs_map_inode_pages(struct inode *inode, +@@ -1148,6 +1149,48 @@ static int osd_ldiskfs_map_inode_pages(struct inode *inode, /* process found extent */ map.m_lblk = fp->index * blocks_per_page; map.m_len = blen = clen * blocks_per_page; @@ -105,7 +105,7 @@ index 7131add58d..dcc1081e0a 100644 cont_map: /** * We might restart transaction for block allocations, -@@ -1211,6 +1254,7 @@ cont_map: +@@ -1222,6 +1265,7 @@ cont_map: rc = 0; } diff --git a/0007-LU-11388-tests-replay-single-131b-to-refresh-grants.patch b/0007-LU-11388-tests-replay-single-131b-to-refresh-grants.patch deleted file mode 100644 index a2734481af6e13d6620dabd48f8b4ff641479212..0000000000000000000000000000000000000000 --- a/0007-LU-11388-tests-replay-single-131b-to-refresh-grants.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 653ae754fa93ecf8b9d290675122956eaf63b6af Mon Sep 17 00:00:00 2001 -From: Alex Zhuravlev -Date: Mon, 17 Apr 2023 21:13:59 +0300 -Subject: [PATCH 07/61] LU-11388 tests: replay-single/131b to refresh grants - -so that the write (to be replayed after replay-barrier) -doesn't turn sync due to insufficient grant. - -Lustre-change: https://review.whamcloud.com/50661 -Lustre-commit: 384e1e858eef826677bfa6913074a83c4fab37d3 - -Test-Parameters: trivial testlist=replay-single env=ONLY=131b,ONLY_REPEAT=30 -Fixes: cb3b2bb683 ("LU-11388 test: enable replay-single test_131b") -Signed-off-by: Alex Zhuravlev -Change-Id: If4656c1028b49c58eedd905abd0c329f3706f491 -Reviewed-by: Mikhail Pershin -Reviewed-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51289 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/tests/replay-single.sh | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh -index a0ac037ead..c6641c0d0e 100755 ---- a/lustre/tests/replay-single.sh -+++ b/lustre/tests/replay-single.sh -@@ -4858,6 +4858,12 @@ test_131b() { - [ "$MDS1_VERSION" -lt $(version_code 2.10.90) ] && - skip "Do not support Data-on-MDT before 2.11" - -+ # refresh grants so write after replay_barrier doesn't -+ # turn sync -+ $LFS setstripe -E 1M -L mdt -E EOF -c 2 $DIR/$tfile-2 -+ stack_trap "rm -f $DIR/$tfile-2" -+ dd if=/dev/zero of=$DIR/$tfile-2 bs=64k count=2 || -+ error "can't dd" - $LFS setstripe -E 1M -L mdt -E EOF -c 2 $DIR/$tfile - replay_barrier $SINGLEMDS - echo "dom_data" | dd of=$DIR/$tfile bs=8 count=1 --- -2.33.0 - diff --git a/0044-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch b/0007-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch similarity index 95% rename from 0044-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch rename to 0007-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch index 33a5ba1b9a891e5cf454c12433d2c6e3facd6ccb..92e64041b9f9cfbb5f86141bd466bbe1c552006b 100644 --- a/0044-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch +++ b/0007-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch @@ -1,7 +1,7 @@ -From 7b3bbf6fb4dace0af738bc69500558180a8e7227 Mon Sep 17 00:00:00 2001 +From 3b6fb96254839ac5cd81fe40a338a851eabff76e Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Mon, 6 Jun 2022 08:59:54 +0000 -Subject: [PATCH 44/61] LU-15722 osd-ldiskfs: fix write stuck for 64K PAGE_SIZE +Subject: [PATCH 07/23] LU-15722 osd-ldiskfs: fix write stuck for 64K PAGE_SIZE This reverts a previous commit for large PAGE_SIZE to fix a stuck IO issue in another way. @@ -41,7 +41,7 @@ index f06dde1b00..7300278b80 100644 #define osd_dirty_inode(inode, flag) (inode)->i_sb->s_op->dirty_inode((inode), flag) diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c -index dcc1081e0a..233d88397c 100644 +index 6df532bc00..1af570e932 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -90,6 +90,14 @@ static int __osd_init_iobuf(struct osd_device *d, struct osd_iobuf *iobuf, @@ -97,7 +97,7 @@ index dcc1081e0a..233d88397c 100644 int rc = 0, i = 0, mapped_index = 0; struct page *fp = NULL; int clen = 0; -@@ -1150,44 +1149,19 @@ static int osd_ldiskfs_map_inode_pages(struct inode *inode, +@@ -1151,44 +1150,19 @@ static int osd_ldiskfs_map_inode_pages(struct inode *inode, map.m_len = blen = clen * blocks_per_page; /* @@ -153,7 +153,7 @@ index dcc1081e0a..233d88397c 100644 } cont_map: -@@ -1215,6 +1189,8 @@ cont_map: +@@ -1216,6 +1190,8 @@ cont_map: if (rc) GOTO(cleanup, rc); thandle->th_restart_tran = 1; @@ -162,7 +162,7 @@ index dcc1081e0a..233d88397c 100644 GOTO(cleanup, rc = -EAGAIN); } -@@ -1254,10 +1230,9 @@ cont_map: +@@ -1265,10 +1241,9 @@ cont_map: rc = 0; } diff --git a/0045-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch b/0008-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch similarity index 98% rename from 0045-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch rename to 0008-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch index eec8f3a7972faf3d18effba28be949b6067227c7..fbef206a857d508757308a4b4ec7e14a92b99a86 100644 --- a/0045-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch +++ b/0008-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch @@ -1,7 +1,7 @@ -From 3ef6abe3067ba1cb61d655d33ef129cf004a7ebc Mon Sep 17 00:00:00 2001 +From 1534fb65cc85b0e03febd85ffb9ee62d4085e9c0 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Tue, 28 Jun 2022 08:34:46 +0000 -Subject: [PATCH 45/61] LU-15978 osp: fix striped directory deletion fails for +Subject: [PATCH 08/23] LU-15978 osp: fix striped directory deletion fails for 64K PAGE_SIZE This fixes the rmdir errors below: diff --git a/0008-LU-16163-tests-skip-racer_on_nfs-for-NFSv3.patch b/0008-LU-16163-tests-skip-racer_on_nfs-for-NFSv3.patch deleted file mode 100644 index c683246dcfa46b57cfcffeaf9d15882f60eea636..0000000000000000000000000000000000000000 --- a/0008-LU-16163-tests-skip-racer_on_nfs-for-NFSv3.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3626be5686cc395ce622d281a993603dba16e3e2 Mon Sep 17 00:00:00 2001 -From: Alex Deiter -Date: Fri, 7 Apr 2023 23:49:23 +0400 -Subject: [PATCH 08/61] LU-16163 tests: skip racer_on_nfs for NFSv3 - -Export ALWAYS_EXCEPT env for child NFS test - -Lustre-change: https://review.whamcloud.com/50579 -Lustre-commit: 892d726f274c7cd4e505689ad69194ac68dc323b - -Fixes: 513eb670b0 ("LU-16163 tests: skip racer_on_nfs for NFSv3") -Test-Parameters: trivial testlist=parallel-scale-nfsv3 -Signed-off-by: Alex Deiter -Change-Id: Ibb4a9916166f13ab9bd2374b33d4313453972276 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51282 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Andreas Dilger -Reviewed-by: Oleg Drokin ---- - lustre/tests/parallel-scale-nfsv3.sh | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/lustre/tests/parallel-scale-nfsv3.sh b/lustre/tests/parallel-scale-nfsv3.sh -index 014d2cda2a..fdbfc949c8 100755 ---- a/lustre/tests/parallel-scale-nfsv3.sh -+++ b/lustre/tests/parallel-scale-nfsv3.sh -@@ -4,4 +4,9 @@ LUSTRE=${LUSTRE:-$(dirname $0)/..} - . $LUSTRE/tests/test-framework.sh - init_test_env $@ - --sh $LUSTRE/tests/parallel-scale-nfs.sh 3 -+export ALWAYS_EXCEPT="$PARALLEL_SCALE_NFSV3_EXCEPT " -+# Bug number for skipped test: LU-16163 -+ALWAYS_EXCEPT+=" racer_on_nfs " -+# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! -+ -+$LUSTRE/tests/parallel-scale-nfs.sh 3 --- -2.33.0 - diff --git a/0009-LU-14294-tests-fixed-NFS-configuration-issue.patch b/0009-LU-14294-tests-fixed-NFS-configuration-issue.patch deleted file mode 100644 index 8aa1834bb0370423cc46628d83478a60e6f00c0e..0000000000000000000000000000000000000000 --- a/0009-LU-14294-tests-fixed-NFS-configuration-issue.patch +++ /dev/null @@ -1,197 +0,0 @@ -From cef89c354f22f873f1f2e09536de7c690852828b Mon Sep 17 00:00:00 2001 -From: Alex Deiter -Date: Mon, 7 Nov 2022 21:47:21 +0400 -Subject: [PATCH 09/61] LU-14294 tests: fixed NFS configuration issue - -* Used the systemctl command to manage system services -* Used the same order of parameters to setup and cleanup NFS -* Used tab for indentation - -Lustre-change: https://review.whamcloud.com/49062 -Lustre-commit: 1a8fe55b17ac2bc2195aaba446467ccdac67b564 - -Test-Parameters: trivial clientdistro=el7.9 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 -Test-Parameters: clientdistro=el8.7 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 -Test-Parameters: clientdistro=el9.0 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 -Test-Parameters: clientdistro=sles12sp5 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 -Test-Parameters: clientdistro=sles15sp4 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 -Test-Parameters: clientdistro=ubuntu2004 \ -testlist=parallel-scale-nfsv3,parallel-scale-nfsv4 - -Change-Id: I6b087035ac7524aa99c0facad48f8c3fb7444cbc -Signed-off-by: Alex Deiter -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51283 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Andreas Dilger -Reviewed-by: Oleg Drokin ---- - lustre/tests/parallel-scale-nfs.sh | 11 ++- - lustre/tests/setup-nfs.sh | 107 +++++++++++------------------ - 2 files changed, 47 insertions(+), 71 deletions(-) - -diff --git a/lustre/tests/parallel-scale-nfs.sh b/lustre/tests/parallel-scale-nfs.sh -index 7f426ee0a2..ab88f379a4 100755 ---- a/lustre/tests/parallel-scale-nfs.sh -+++ b/lustre/tests/parallel-scale-nfs.sh -@@ -47,7 +47,8 @@ cleanup_exit () { - } - - cleanup () { -- cleanup_nfs "$NFS_CLIMNTPT" "$LUSTRE_CLIENT_NFSSRV" "$NFS_CLIENTS" || -+ cleanup_nfs "$LUSTRE_CLIENT_NFSSRV" "$NFS_SRVMNTPT" \ -+ "$NFS_CLIENTS" "$NFS_CLIMNTPT" || \ - error_noexit false "failed to cleanup nfs" - zconf_umount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT force || - error_noexit false "failed to umount lustre on"\ -@@ -63,8 +64,8 @@ zconf_mount $LUSTRE_CLIENT_NFSSRV $NFS_SRVMNTPT "$cl_mnt_opt" || - error "mount lustre on $LUSTRE_CLIENT_NFSSRV failed" - - # setup the nfs --setup_nfs "$NFSVERSION" "$NFS_SRVMNTPT" "$LUSTRE_CLIENT_NFSSRV" \ -- "$NFS_CLIENTS" "$NFS_CLIMNTPT" || -+setup_nfs "$LUSTRE_CLIENT_NFSSRV" "$NFS_SRVMNTPT" "$NFS_CLIENTS" \ -+ "$NFS_CLIMNTPT" "$NFSVERSION" || \ - error false "setup nfs failed!" - - NFSCLIENT=true -@@ -101,6 +102,10 @@ MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"} - $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS - - test_compilebench() { -+ if [[ "$TESTSUITE" =~ "parallel-scale-nfs" ]]; then -+ skip "LU-12957 and LU-13068: compilebench for $TESTSUITE" -+ fi -+ - run_compilebench $TESTDIR - } - run_test compilebench "compilebench" -diff --git a/lustre/tests/setup-nfs.sh b/lustre/tests/setup-nfs.sh -index ab3afff36c..eb6720febd 100755 ---- a/lustre/tests/setup-nfs.sh -+++ b/lustre/tests/setup-nfs.sh -@@ -1,77 +1,48 @@ - #!/bin/bash --#set -x --EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"} - --setup_nfs() { -- local NFS_VER=${1} -- local MNTPNT=${2} -- local LUSTRE_CLIENT=${3} -- local NFS_CLIENTS=${4} -- local nfs_climntpt=${5:-$MNTPNT} -- -- local export_opts_v=$EXPORT_OPTS -- -- echo "Exporting Lustre filesystem..." -- -- if [ "$NFS_VER" = "4" ]; then -- export_opts_v="$EXPORT_OPTS,fsid=0" -- do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery" -- fi -- -- do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\ -- { mkdir -p /var/lib/nfs/rpc_pipefs && \ -- mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1 -- sleep 5 -- -- # get rid of old $MNTPNT entries in /etc/exports -- do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports && -- echo $MNTPNT *\($export_opts_v\) >> /etc/exports" || -- return 1 -- -- # restart nfs server according to distro -- do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] && -- service nfsserver restart; } || -- service nfs restart || -- service nfs-server restart" || return 1 -+DEFAULT_NFS_OPTIONS=${DEFAULT_NFS_OPTIONS:-"rw,async,no_root_squash"} -+DEFAULT_EXPORTS_FILE=${DEFAULT_EXPORTS_FILE:-"/etc/exports.d/lustre.exports"} - -- do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null | -- grep -q rpcidmapd && service rpcidmapd restart || -- true" -- -- echo -e "\nMounting NFS clients (version $NFS_VER)..." -+setup_nfs() { -+ local LUSTRE_CLIENT=$1 -+ local LUSTRE_MOUNT_POINT=$2 -+ local NFS_CLIENTS=$3 -+ local NFS_MOUNT_POINT=$4 -+ local NFS_VERSION=$5 -+ local EXPORTS_FILE=$DEFAULT_EXPORTS_FILE -+ local NFS_OPTIONS=$DEFAULT_NFS_OPTIONS -+ -+ echo "Exporting Lustre filesystem via NFS version $NFS_VERSION" -+ do_nodes "$LUSTRE_CLIENT" \ -+ "echo '$LUSTRE_MOUNT_POINT *($NFS_OPTIONS)' | \ -+ tee $EXPORTS_FILE" || return 1 -+ do_nodes "$LUSTRE_CLIENT" "systemctl restart nfs-server" || return 1 -+ do_nodes "$LUSTRE_CLIENT" "systemctl restart nfs-idmapd" || return 1 -+ -+ echo "Mounting NFS clients version $NFS_VERSION" -+ do_nodes "$NFS_CLIENTS" "systemctl restart nfs-idmapd" || return 1 -+ do_nodes "$NFS_CLIENTS" "mkdir -p $NFS_MOUNT_POINT" || return 1 -+ do_nodes "$NFS_CLIENTS" \ -+ "mount -v -t nfs -o nfsvers=$NFS_VERSION,async \ -+ $LUSTRE_CLIENT:$LUSTRE_MOUNT_POINT \ -+ $NFS_MOUNT_POINT" || return 1 - -- do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1 -- if [ "$NFS_VER" = "4" ]; then -- do_nodes $NFS_CLIENTS \ -- "mount -t nfs$NFS_VER -o async \ -- $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1 -- else -- do_nodes $NFS_CLIENTS \ -- "mount -t nfs -o nfsvers=$NFS_VER,async \ -- $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1 -- fi - return 0 - } - - cleanup_nfs() { -- local MNTPNT=${1} -- local LUSTRE_CLIENT=${2} -- local NFS_CLIENTS=${3} -- -- echo -e "\nUnmounting NFS clients..." -- do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true -- -- echo -e "\nUnexporting Lustre filesystem..." -- do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null | -- grep -q rpcidmapd && service rpcidmapd stop || -- true" -- -- do_nodes $LUSTRE_CLIENT "{ [[ -e /etc/SuSE-release ]] && -- service nfsserver stop; } || -- service nfs stop || -- service nfs-server stop" || return 1 -- -- do_nodes $LUSTRE_CLIENT "sed -i '/${MNTPNT##*/}/d' /etc/exports" || return 1 -- -- do_nodes $LUSTRE_CLIENT "exportfs -v" -+ local LUSTRE_CLIENT=$1 -+ local LUSTRE_MOUNT_POINT=$2 -+ local NFS_CLIENTS=$3 -+ local NFS_MOUNT_POINT=$4 -+ local EXPORTS_FILE=$DEFAULT_EXPORTS_FILE -+ -+ echo "Unmounting NFS clients" -+ do_nodes "$NFS_CLIENTS" "umount -v -f $NFS_MOUNT_POINT" || return 1 -+ do_nodes "$NFS_CLIENTS" "systemctl stop nfs-idmapd" || return 1 -+ -+ echo "Unexporting Lustre filesystem" -+ do_nodes "$LUSTRE_CLIENT" "systemctl stop nfs-server" || return 1 -+ do_nodes "$LUSTRE_CLIENT" "systemctl stop nfs-idmapd" || return 1 -+ do_nodes "$LUSTRE_CLIENT" "rm -v $EXPORTS_FILE" || return 1 - } --- -2.33.0 - diff --git a/0046-ldiskfs-add-support-for-oe2003.patch b/0009-ldiskfs-add-support-for-oe2003.patch similarity index 99% rename from 0046-ldiskfs-add-support-for-oe2003.patch rename to 0009-ldiskfs-add-support-for-oe2003.patch index 70416f1ff726cd168f8736224a76869068b572a9..e101d60305522d16f236529ae9a7883380e039d6 100644 --- a/0046-ldiskfs-add-support-for-oe2003.patch +++ b/0009-ldiskfs-add-support-for-oe2003.patch @@ -1,7 +1,7 @@ -From 7325c6cf0aeb80aeefe1cc864decc4ce02a9fe01 Mon Sep 17 00:00:00 2001 +From 7b0678abe3c8a5e807bb23c87a7863f2601f2586 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Thu, 10 Aug 2023 09:34:02 +0000 -Subject: [PATCH 46/61] ldiskfs: add support for oe2003 +Subject: [PATCH 09/23] ldiskfs: add support for oe2003 Signed-off-by: Xinliang Liu --- @@ -32,12 +32,12 @@ Signed-off-by: Xinliang Liu create mode 100644 lustre/kernel_patches/targets/4.19-oe2003sp3.target.in diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 -index c225a6abaa..51ddcd07e1 100644 +index c520febcd9..a7bc057687 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 -@@ -128,6 +128,12 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ +@@ -129,6 +129,12 @@ AS_IF([test x$RHEL_KERNEL = xyes], [ 2203.0) LDISKFS_SERIES="5.10.0-oe2203.series" ;; - 2203.1|2203.2) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;; + 2203.*) LDISKFS_SERIES="5.10.0-oe2203sp1.series" ;; esac + + AS_IF([test -z "$OPENEULER_VERSION_NO"], [ @@ -83,12 +83,12 @@ index 1ff6c47856..6cdcba0b60 100644 AS_IF([test "x$KERNEL_FOUND" = "xno"], [ AC_MSG_WARN([Kernel Distro seems to be neither RedHat, SuSE, openEuler nor Ubuntu]) diff --git a/contrib/lbuild/funcs.sh b/contrib/lbuild/funcs.sh -index 78389a5d96..7889ff072e 100644 +index 3261a4752f..8cbe00b5a8 100644 --- a/contrib/lbuild/funcs.sh +++ b/contrib/lbuild/funcs.sh -@@ -221,6 +221,7 @@ autodetect_target() { - sles15.3) target="$(uname -r | cut -d . -f 1,2)-sles15sp3";; +@@ -223,6 +223,7 @@ autodetect_target() { sles15.4) target="$(uname -r | cut -d . -f 1,2)-sles15sp4";; + sles15.5) target="$(uname -r | cut -d . -f 1,2)-sles15sp5";; fc18) target="3.x-fc18";; + oe2003.sp3) target="4.19-oe2003sp3";; oe2203) target="5.10-oe2203";; @@ -2449,10 +2449,10 @@ index 0000000000..ec19e1e90f +rhel8/ext4-old_ea_inodes_handling_fix.patch +rhel8.4/ext4-optimize-find_delayed_extent.patch diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 3f03823e3d..6706ff15b1 100644 +index 7506abaaf1..d535470a3c 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog -@@ -100,6 +100,7 @@ TBD Whamcloud +@@ -104,6 +104,7 @@ vanilla linux 5.4.0 (ZFS + ldiskfs) vanilla linux 5.4.21 (ZFS + ldiskfs) vanilla linux 5.4.136 (ZFS + ldiskfs) @@ -2460,7 +2460,7 @@ index 3f03823e3d..6706ff15b1 100644 5.10.0-60.94.0.118.oe2203 (openEuler 22.03 LTS) 5.10.0-136.32.0.108.oe2203sp1 (openEuler 22.03 LTS SP1) 5.10.0-153.19.0.95.oe2203sp2 (openEuler 22.03 LTS SP2) -@@ -209,6 +210,7 @@ TBD Whamcloud +@@ -213,6 +214,7 @@ 5.8.0-53 (Ubuntu 20.04.2 HWE) 5.11.0-31 (Ubuntu 20.04.3 HWE) 5.11.0 (vanilla kernel.org) @@ -2469,12 +2469,12 @@ index 3f03823e3d..6706ff15b1 100644 * Recommended e2fsprogs version: 1.46.5.wc1 or newer * Recommended ZFS version: 2.1.5 diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index feed23e01f..251c977ea4 100644 +index 8a475e74b0..1c413d1da9 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 -@@ -3496,6 +3496,7 @@ lustre/kernel_patches/targets/5.3-sles15sp2.target - lustre/kernel_patches/targets/5.3-sles15sp3.target +@@ -4341,6 +4341,7 @@ lustre/kernel_patches/targets/5.3-sles15sp3.target lustre/kernel_patches/targets/5.14-sles15sp4.target + lustre/kernel_patches/targets/5.14-sles15sp5.target lustre/kernel_patches/targets/3.x-fc18.target +lustre/kernel_patches/targets/4.19-oe2003sp3.target lustre/kernel_patches/targets/5.10-oe2203.target diff --git a/0010-LU-16717-mdt-treat-unknown-hash-type-as-sane-type.patch b/0010-LU-16717-mdt-treat-unknown-hash-type-as-sane-type.patch deleted file mode 100644 index f20d906bb8d0bbf3be285c44e928f82c29259007..0000000000000000000000000000000000000000 --- a/0010-LU-16717-mdt-treat-unknown-hash-type-as-sane-type.patch +++ /dev/null @@ -1,155 +0,0 @@ -From e4208468b65a34c84c20d5d932f35b29f9025722 Mon Sep 17 00:00:00 2001 -From: Lai Siyao -Date: Sun, 23 Apr 2023 04:09:02 -0400 -Subject: [PATCH 10/61] LU-16717 mdt: treat unknown hash type as sane type - -Directory migration failure may leave directory hash type as -LMV_HASH_TYPE_UNKNOWN|LMV_HASH_FLAG_BAD_TYPE, which should be treated -as sane hash type on existing directories, otherwise such directories -can't be unlinked. - -Add sanity 230y. - -Lustre-change: https://review.whamcloud.com/50796 -Lustre-commit: 05cdb71ba6813570123613993f3cfcf74fc83561 - -Signed-off-by: Lai Siyao -Change-Id: Ieffc0808d1db989d0bf9723f05cddb06f349e208 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50796 -Reviewed-by: Andreas Dilger -Reviewed-by: Hongchao Zhang -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51235 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/include/lustre_lmv.h | 4 +-- - lustre/include/obd_support.h | 1 + - .../include/uapi/linux/lustre/lustre_user.h | 10 ++++++++ - lustre/mdt/mdt_reint.c | 18 +++++++++++++ - lustre/tests/sanity.sh | 25 +++++++++++++++++++ - 5 files changed, 56 insertions(+), 2 deletions(-) - -diff --git a/lustre/include/lustre_lmv.h b/lustre/include/lustre_lmv.h -index 2ffd77fc57..b848408da9 100644 ---- a/lustre/include/lustre_lmv.h -+++ b/lustre/include/lustre_lmv.h -@@ -438,7 +438,7 @@ static inline bool lmv_is_sane(const struct lmv_mds_md_v1 *lmv) - if (le32_to_cpu(lmv->lmv_stripe_count) == 0) - goto insane; - -- if (!lmv_is_known_hash_type(le32_to_cpu(lmv->lmv_hash_type))) -+ if (!lmv_is_sane_hash_type(le32_to_cpu(lmv->lmv_hash_type))) - goto insane; - - return true; -@@ -460,7 +460,7 @@ static inline bool lmv_is_sane2(const struct lmv_mds_md_v1 *lmv) - if (le32_to_cpu(lmv->lmv_stripe_count) == 0) - goto insane; - -- if (!lmv_is_known_hash_type(le32_to_cpu(lmv->lmv_hash_type))) -+ if (!lmv_is_sane_hash_type(le32_to_cpu(lmv->lmv_hash_type))) - goto insane; - - return true; -diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h -index cca40a688b..5a6998043b 100644 ---- a/lustre/include/obd_support.h -+++ b/lustre/include/obd_support.h -@@ -681,6 +681,7 @@ extern char obd_jobid_var[]; - - /* MIGRATE */ - #define OBD_FAIL_MIGRATE_ENTRIES 0x1801 -+#define OBD_FAIL_MIGRATE_BAD_HASH 0x1802 - - /* LMV */ - #define OBD_FAIL_UNKNOWN_LMV_STRIPE 0x1901 -diff --git a/lustre/include/uapi/linux/lustre/lustre_user.h b/lustre/include/uapi/linux/lustre/lustre_user.h -index b2ae5992d2..25fa6ad28d 100644 ---- a/lustre/include/uapi/linux/lustre/lustre_user.h -+++ b/lustre/include/uapi/linux/lustre/lustre_user.h -@@ -1046,6 +1046,16 @@ static inline bool lmv_is_known_hash_type(__u32 type) - - #define LMV_HASH_FLAG_KNOWN 0xbe000000 - -+/* migration failure may leave hash type as -+ * LMV_HASH_TYPE_UNKNOWN|LMV_HASH_FLAG_BAD_TYPE, which should be treated as -+ * sane, so such directory can be accessed (resume migration or unlink). -+ */ -+static inline bool lmv_is_sane_hash_type(__u32 type) -+{ -+ return lmv_is_known_hash_type(type) || -+ type == (LMV_HASH_TYPE_UNKNOWN | LMV_HASH_FLAG_BAD_TYPE); -+} -+ - /* both SPLIT and MIGRATION are set for directory split */ - static inline bool lmv_hash_is_splitting(__u32 hash) - { -diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c -index c800ca64be..a2ddbbcf07 100644 ---- a/lustre/mdt/mdt_reint.c -+++ b/lustre/mdt/mdt_reint.c -@@ -2312,6 +2312,24 @@ int mdt_reint_migrate(struct mdt_thread_info *info, - if (rc) - GOTO(put_parent, rc); - -+ if (CFS_FAIL_CHECK(OBD_FAIL_MIGRATE_BAD_HASH) && -+ (ma->ma_valid & MA_LMV) && -+ lmv_is_migrating(&ma->ma_lmv->lmv_md_v1)) { -+ struct lu_buf *buf = &info->mti_buf; -+ struct lmv_mds_md_v1 *lmv = &ma->ma_lmv->lmv_md_v1; -+ __u32 version = le32_to_cpu(lmv->lmv_layout_version); -+ -+ lmv->lmv_hash_type = cpu_to_le32(LMV_HASH_TYPE_UNKNOWN | -+ LMV_HASH_FLAG_BAD_TYPE); -+ lmv->lmv_layout_version = cpu_to_le32(version + 1); -+ buf->lb_buf = lmv; -+ buf->lb_len = sizeof(*lmv); -+ rc = mo_xattr_set(env, mdt_object_child(pobj), buf, -+ XATTR_NAME_LMV, LU_XATTR_REPLACE); -+ mo_invalidate(env, mdt_object_child(pobj)); -+ GOTO(put_parent, rc); -+ } -+ - lock_parent: - /* lock parent object */ - lhp = &info->mti_lh[MDT_LH_PARENT]; -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index d73b285eca..6cd539a737 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -20636,6 +20636,31 @@ test_230w() { - } - run_test 230w "non-recursive mode dir migration" - -+test_230y() { -+ (( MDSCOUNT > 1 )) || skip "needs >= 2 MDTs" -+ (( MDS1_VERSION >= $(version_code 2.15.3) )) || -+ skip "Need MDS version at least 2.15.3" -+ -+ local pid -+ -+ test_mkdir -c -1 $DIR/$tdir || error "mkdir $tdir failed" -+ $LFS getdirstripe $DIR/$tdir -+ createmany -d $DIR/$tdir/d 100 || error "createmany failed" -+ $LFS migrate -m 1 -c 2 $DIR/$tdir & -+ pid=$! -+ sleep 1 -+ -+ #OBD_FAIL_MIGRATE_BAD_HASH 0x1802 -+ do_facet mds2 lctl set_param fail_loc=0x1802 -+ -+ wait $pid -+ do_facet mds2 lctl set_param fail_loc=0 -+ $LFS getdirstripe $DIR/$tdir -+ unlinkmany -d $DIR/$tdir/d 100 || error "unlinkmany failed" -+ rmdir $DIR/$tdir || error "rmdir $tdir failed" -+} -+run_test 230y "unlink dir with bad hash type" -+ - test_231a() - { - # For simplicity this test assumes that max_pages_per_rpc --- -2.33.0 - diff --git a/0047-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch b/0010-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch similarity index 86% rename from 0047-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch rename to 0010-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch index 9e4f6fad5933055e9a32dce82d8ec47e6dcc7ad8..272ca211ec8a1392d3adf607df71023a06be53ac 100644 --- a/0047-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch +++ b/0010-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch @@ -1,7 +1,7 @@ -From 9021e6e81632d116c9bc0e5d59ce2b1a47cc1559 Mon Sep 17 00:00:00 2001 +From d40429eebc3ca98ba9ba3870197d6456902e759a Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Fri, 24 Mar 2023 08:21:06 +0000 -Subject: [PATCH 47/61] lustre.spec.in: Add gcc option -Wno-stringop-overflow +Subject: [PATCH 10/23] lustre.spec.in: Add gcc option -Wno-stringop-overflow See openEuler gcc bug: https://gitee.com/openeuler/gcc/issues/I5XMD0 diff --git a/0011-LU-15481-llog-Add-LLOG_SKIP_PLAIN-to-skip-llog-plain.patch b/0011-LU-15481-llog-Add-LLOG_SKIP_PLAIN-to-skip-llog-plain.patch deleted file mode 100644 index 45ceec2df09047888d3dbd0f0e93e21526e3afeb..0000000000000000000000000000000000000000 --- a/0011-LU-15481-llog-Add-LLOG_SKIP_PLAIN-to-skip-llog-plain.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 053ab4a47a3391ff2b3b252b649b88e4579ab88f Mon Sep 17 00:00:00 2001 -From: Etienne AUJAMES -Date: Wed, 22 Feb 2023 11:18:49 -0800 -Subject: [PATCH 11/61] LU-15481 llog: Add LLOG_SKIP_PLAIN to skip llog plain - -Add the catalog callback return LLOG_SKIP_PLAIN to conditionally skip -an entire llog plain. - -This could speedup the catalog processing for specific usages when a -record need to be access in the "middle" of the catalog. This could -be usefull for changelog with several users or HSM. - -This patch modify chlg_read_cat_process_cb() to use LLOG_SKIP_PLAIN. -The main idea came from: d813c75d ("LU-14688 mdt: changelog purge -deletes plain llog") - -**Performance test:** - -* Environement: -2474195 changelogs record store on the mds0 (40 llog plain): -mds# lctl get_param -n mdd.lustrefs-MDT0000.changelog_users -current index: 2474195 -ID index (idle seconds) -cl1 0 (3509) - -* Test -Access to records at the end of the catalog (offset: 2474194): -client# time lfs changelog lustrefs-MDT0000 2474194 >/dev/null - -* Results -- with the patch: real 0m0.592s -- without the patch: real 0m17.835s (x30) - -Lustre-change: https://review.whamcloud.com/46310 -Lustre-commit: aa22a6826ee521ab14994a4533b0dbffb529aab0 - -Signed-off-by: Etienne AUJAMES -Change-Id: I887d5bef1f3a6a31c46bc58959e0f508266c53d2 -Reviewed-by: Alexander Boyko -Reviewed-by: Andreas Dilger -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48771 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin -Reviewed-by: Etienne AUJAMES ---- - lustre/include/lustre_log.h | 17 +++++++++++++++++ - lustre/mdc/mdc_changelog.c | 5 +++++ - lustre/mdd/mdd_device.c | 4 ++-- - lustre/obdclass/llog.c | 6 ++++-- - lustre/obdclass/llog_cat.c | 6 ++++++ - 5 files changed, 34 insertions(+), 4 deletions(-) - -diff --git a/lustre/include/lustre_log.h b/lustre/include/lustre_log.h -index 360ba26dd5..1fdca73715 100644 ---- a/lustre/include/lustre_log.h -+++ b/lustre/include/lustre_log.h -@@ -340,6 +340,7 @@ struct llog_ctxt { - #define LLOG_PROC_BREAK 0x0001 - #define LLOG_DEL_RECORD 0x0002 - #define LLOG_DEL_PLAIN 0x0003 -+#define LLOG_SKIP_PLAIN 0x0004 - - static inline int llog_obd2ops(struct llog_ctxt *ctxt, - const struct llog_operations **lop) -@@ -519,6 +520,22 @@ static inline int llog_is_full(struct llog_handle *llh) - return llh->lgh_last_idx >= LLOG_HDR_BITMAP_SIZE(llh->lgh_hdr) - 1; - } - -+/* Determine if a llog plain of a catalog could be skiped based on record -+ * custom indexes. -+ * This assumes that indexes follow each other. The number of records to skip -+ * can be computed base on a starting offset and the index of the current -+ * record (in llog catalog callback). -+ */ -+static inline int llog_is_plain_skipable(struct llog_log_hdr *lh, -+ struct llog_rec_hdr *rec, -+ __u64 curr, __u64 start) -+{ -+ if (start == 0 || curr >= start) -+ return 0; -+ -+ return (LLOG_HDR_BITMAP_SIZE(lh) - rec->lrh_index) < (start - curr); -+} -+ - struct llog_cfg_rec { - struct llog_rec_hdr lcr_hdr; - struct lustre_cfg lcr_cfg; -diff --git a/lustre/mdc/mdc_changelog.c b/lustre/mdc/mdc_changelog.c -index 843c4de8a4..aea492b9f5 100644 ---- a/lustre/mdc/mdc_changelog.c -+++ b/lustre/mdc/mdc_changelog.c -@@ -228,6 +228,11 @@ static int chlg_read_cat_process_cb(const struct lu_env *env, - RETURN(rc); - } - -+ /* Check if we can skip the entire llog plain */ -+ if (llog_is_plain_skipable(llh->lgh_hdr, hdr, rec->cr.cr_index, -+ crs->crs_start_offset)) -+ RETURN(LLOG_SKIP_PLAIN); -+ - /* Skip undesired records */ - if (rec->cr.cr_index < crs->crs_start_offset) - RETURN(0); -diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c -index 37667afde0..94fb1f64a5 100644 ---- a/lustre/mdd/mdd_device.c -+++ b/lustre/mdd/mdd_device.c -@@ -393,8 +393,8 @@ static int llog_changelog_cancel_cb(const struct lu_env *env, - * last cr_index at this plain llog. And if it less then cookie endrec - * cancel the whole file. - */ -- if ((LLOG_HDR_BITMAP_SIZE(llh->lgh_hdr) - hdr->lrh_index + -- rec->cr.cr_index) < cl_cookie->endrec) { -+ if (llog_is_plain_skipable(llh->lgh_hdr, hdr, rec->cr.cr_index, -+ cl_cookie->endrec)) { - int rc; - - if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_CHANGELOG_DEL))) { -diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c -index 2c45c9673a..79f89fe365 100644 ---- a/lustre/obdclass/llog.c -+++ b/lustre/obdclass/llog.c -@@ -736,7 +736,8 @@ repeat: - lgc->lgc_index = tmp_idx; - } - -- if (rc == LLOG_PROC_BREAK) { -+ if (rc == LLOG_PROC_BREAK || -+ rc == LLOG_SKIP_PLAIN) { - GOTO(out, rc); - } else if (rc == LLOG_DEL_RECORD) { - rc = llog_cancel_rec(lpi->lpi_env, -@@ -1005,7 +1006,8 @@ int llog_reverse_process(const struct lu_env *env, - sizeof(*tail); - - rc = cb(env, loghandle, rec, data); -- if (rc == LLOG_PROC_BREAK) { -+ if (rc == LLOG_PROC_BREAK || -+ rc == LLOG_SKIP_PLAIN) { - GOTO(out, rc); - } else if (rc == LLOG_DEL_RECORD) { - rc = llog_cancel_rec(env, loghandle, -diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c -index ba44ad3003..4f5b0b1133 100644 ---- a/lustre/obdclass/llog_cat.c -+++ b/lustre/obdclass/llog_cat.c -@@ -895,6 +895,9 @@ out: - if (rc == LLOG_DEL_PLAIN || rc == LLOG_DEL_RECORD) - /* clear wrong catalog entry */ - rc = llog_cat_cleanup(env, cat_llh, llh, rec->lrh_index); -+ else if (rc == LLOG_SKIP_PLAIN) -+ /* processing callback ask to skip the llog -> continue */ -+ rc = 0; - - if (llh) - llog_handle_put(env, llh); -@@ -1060,6 +1063,9 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env, - } else if (rc == LLOG_DEL_RECORD) { - /* clear wrong catalog entry */ - rc = llog_cat_cleanup(env, cat_llh, NULL, rec->lrh_index); -+ } else if (rc == LLOG_SKIP_PLAIN) { -+ /* processing callback ask to skip the llog -> continue */ -+ rc = 0; - } - if (rc) - RETURN(rc); --- -2.33.0 - diff --git a/0048-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch b/0011-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch similarity index 97% rename from 0048-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch rename to 0011-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch index d37d58edd91b60c145dbf21704d88c5ccf24a9cd..da0f838218955b8c3b044b3e4a9975e720654aef 100644 --- a/0048-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch +++ b/0011-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch @@ -1,7 +1,7 @@ -From e55361ee38116437b8b6529368f6a25160bfa410 Mon Sep 17 00:00:00 2001 +From d15784afb827a708b65ac740e6667f931cd28b58 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 2 Dec 2022 04:19:59 -0600 -Subject: [PATCH 48/61] LU-16321 osd: Allow fiemap on kernel buffers +Subject: [PATCH 11/23] LU-16321 osd: Allow fiemap on kernel buffers Linux commit v5.17-rc3-19-g967747bbc084 uaccess: remove CONFIG_SET_FS @@ -385,10 +385,10 @@ index 1cc20c8e58..82711ec7a5 100644 +linux-5.10/ext4-fiemap-kernel-data.patch rhel8/ext4-old_ea_inodes_handling_fix.patch diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c -index 233d88397c..19b5da7bd1 100644 +index 1af570e932..9657b60379 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c -@@ -1357,6 +1357,22 @@ struct osd_fextent { +@@ -1368,6 +1368,22 @@ struct osd_fextent { unsigned int mapped:1; }; @@ -411,7 +411,7 @@ index 233d88397c..19b5da7bd1 100644 static int osd_is_mapped(struct dt_object *dt, __u64 offset, struct osd_fextent *cached_extent) { -@@ -1366,6 +1382,7 @@ static int osd_is_mapped(struct dt_object *dt, __u64 offset, +@@ -1377,6 +1393,7 @@ static int osd_is_mapped(struct dt_object *dt, __u64 offset, struct fiemap_extent_info fei = { 0 }; struct fiemap_extent fe = { 0 }; int rc; @@ -419,7 +419,7 @@ index 233d88397c..19b5da7bd1 100644 if (block >= cached_extent->start && block < cached_extent->end) return cached_extent->mapped; -@@ -1379,8 +1396,9 @@ static int osd_is_mapped(struct dt_object *dt, __u64 offset, +@@ -1390,8 +1407,9 @@ static int osd_is_mapped(struct dt_object *dt, __u64 offset, fei.fi_extents_max = 1; fei.fi_extents_start = &fe; @@ -430,7 +430,7 @@ index 233d88397c..19b5da7bd1 100644 if (rc != 0) return 0; -@@ -2633,6 +2651,7 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt, +@@ -2650,6 +2668,7 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt, struct inode *inode = osd_dt_obj(dt)->oo_inode; u64 len; int rc; @@ -438,7 +438,7 @@ index 233d88397c..19b5da7bd1 100644 LASSERT(inode); if (inode->i_op->fiemap == NULL) -@@ -2652,7 +2671,9 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt, +@@ -2669,7 +2688,9 @@ static int osd_fiemap_get(const struct lu_env *env, struct dt_object *dt, if (fieinfo.fi_flags & FIEMAP_FLAG_SYNC) filemap_write_and_wait(inode->i_mapping); diff --git a/0049-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch b/0012-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch similarity index 96% rename from 0049-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch rename to 0012-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch index 39711236229e29225c36d1d975d9ba9753a8f712..2ea5a7a63e58459b417d1f230fd615665a85eab7 100644 --- a/0049-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch +++ b/0012-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch @@ -1,7 +1,7 @@ -From 7495ac45845283a6abf5cb12baf42cb876159081 Mon Sep 17 00:00:00 2001 +From 5157050691c59a52bc45643e4bdc972db59006b7 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 14 Jan 2020 22:38:51 +0300 -Subject: [PATCH 49/61] LU-13135 quota: improve checks in OSDs to ignore quota +Subject: [PATCH 12/23] LU-13135 quota: improve checks in OSDs to ignore quota for root-owned files. diff --git a/0012-LU-6612-utils-strengthen-llog_reader-vs-wrong-format.patch b/0012-LU-6612-utils-strengthen-llog_reader-vs-wrong-format.patch deleted file mode 100644 index 43c82ae57f9fa191007f9f4710a59496b91b4f1b..0000000000000000000000000000000000000000 --- a/0012-LU-6612-utils-strengthen-llog_reader-vs-wrong-format.patch +++ /dev/null @@ -1,74 +0,0 @@ -From badba63a54e905129dbdf28e31026580453ea337 Mon Sep 17 00:00:00 2001 -From: Bruno Faccini -Date: Wed, 22 Feb 2023 11:21:06 -0800 -Subject: [PATCH 12/61] LU-6612 utils: strengthen llog_reader vs wrong - format/header - -The following snippet shows that llog_reader can be puzzled due to -an invalid 0 for the number of records when parsing an expected -LLOG file header : -root# dd if=/dev/zero bs=4096 count=1 of=/tmp/zeroes -1+0 records in -1+0 records out -4096 bytes (4.1 kB) copied, 0.000263962 s, 15.5 MB/s -root# llog_reader /tmp/zeroes -Memory Alloc for recs_buf error. -Could not pack buffer; rc=-12 - -Lustre-change: https://review.whamcloud.com/15654 -Lustre-commit: 45291b8c06eebf33d3654db3a7d3cfc5836004a6 - -Test-Parameters: trivial testlist=sanity,sanity-hsm -Signed-off-by: Bruno Faccini -Change-Id: I12be79e6c6a5da384a5fd81878a76a7ea8aa5834 -Reviewed-by: Andreas Dilger -Reviewed-by: Mike Pershin -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48900 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin -Reviewed-by: Mikhail Pershin ---- - lustre/utils/llog_reader.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/lustre/utils/llog_reader.c b/lustre/utils/llog_reader.c -index dc2ef05127..153a471cc2 100644 ---- a/lustre/utils/llog_reader.c -+++ b/lustre/utils/llog_reader.c -@@ -222,6 +222,9 @@ int llog_pack_buffer(int fd, struct llog_log_hdr **llog, - int count; - int i, last_idx; - -+ *recs = NULL; -+ *recs_number = 0; -+ - rc = fstat(fd, &st); - if (rc < 0) { - rc = -errno; -@@ -270,11 +273,13 @@ int llog_pack_buffer(int fd, struct llog_log_hdr **llog, - } else if (count == 0) { - llapi_printf(LLAPI_MSG_NORMAL, - "uninitialized llog: zero record number\n"); -- *recs_number = 0; - goto clear_file_buf; - } -+ - /* the llog header not countable here.*/ - recs_num = count - 1; -+ if (recs_num == 0) -+ goto clear_file_buf; - - recs_buf = calloc(recs_num, sizeof(**recs_pr)); - if (!recs_buf) { -@@ -343,7 +348,6 @@ int llog_pack_buffer(int fd, struct llog_log_hdr **llog, - - *recs = recs_pr; - *recs_number = recs_num; -- - out: - return rc; - --- -2.33.0 - diff --git a/0013-LU-16052-llog-handle-EBADR-for-catalog-processing.patch b/0013-LU-16052-llog-handle-EBADR-for-catalog-processing.patch deleted file mode 100644 index 486e3472ac5d4f2b177e337eb2131d382b2190b9..0000000000000000000000000000000000000000 --- a/0013-LU-16052-llog-handle-EBADR-for-catalog-processing.patch +++ /dev/null @@ -1,46 +0,0 @@ -From b996d1e0276fdf6c084410cd1dcfac0df13437fe Mon Sep 17 00:00:00 2001 -From: Mikhail Pershin -Date: Mon, 17 Oct 2022 16:29:52 -0700 -Subject: [PATCH 13/61] LU-16052 llog: handle -EBADR for catalog processing - -Llog catalog processing might retry to get the last llog block -to check for new records if any. That might return -EBADR code -which should be considered as valid. Previously -EIO was -returned in all cases. - -Run conf-sanity test_106 several times as specific test - -Lustre-change: https://review.whamcloud.com/48070 -Lustre-commit: e260f751f2a21fa126eeb4bc9e94250ba3e815f1 - -Test-Parameters: testlist=conf-sanity env=ONLY=106,SLOW=yes,ONLY_REPEAT=10 -Signed-off-by: Mikhail Pershin -Change-Id: I30e04ba2c91c8bdce72c95675a1209639e9f0570 -Reviewed-by: Andreas Dilger -Reviewed-by: Etienne AUJAMES -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48772 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/obdclass/llog.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c -index 79f89fe365..b23645d8b4 100644 ---- a/lustre/obdclass/llog.c -+++ b/lustre/obdclass/llog.c -@@ -576,8 +576,8 @@ repeat: - GOTO(out, rc = 0); - /* we`ve tried to reread the chunk, but there is no - * new records */ -- if (rc == -EIO && repeated && (chunk_offset + buf_offset) == -- cur_offset) -+ if (repeated && (chunk_offset + buf_offset) == cur_offset && -+ (rc == -EBADR || rc == -EIO)) - GOTO(out, rc = 0); - if (rc != 0) - GOTO(out, rc); --- -2.33.0 - diff --git a/0050-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch b/0013-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch similarity index 95% rename from 0050-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch rename to 0013-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch index 0ad2da1c62721192f1faa210c35afb2c8c624a19..35ace0ef6c79193b070844011253b98bdc84e354 100644 --- a/0050-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch +++ b/0013-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch @@ -1,7 +1,7 @@ -From df7fe641427f384e33d06cb837b09af59dd2830e Mon Sep 17 00:00:00 2001 +From 758ce999f1a18f7093a214f21f4974ad0b2100f6 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Tue, 27 Jun 2023 15:10:19 +0700 -Subject: [PATCH 50/61] LU-16893 libcfs: Remove force_sig usage from lfsck +Subject: [PATCH 13/23] LU-16893 libcfs: Remove force_sig usage from lfsck The lfsck pool of kernel threads uses force_sig() to signal the worker threads to stop. A signal is used here as the @@ -31,7 +31,7 @@ Signed-off-by: Xinliang Liu 4 files changed, 16 insertions(+), 43 deletions(-) diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 -index 2e99cff179..34726fe8dc 100644 +index 37c2762cbd..ec169c9b28 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -1742,27 +1742,6 @@ AC_DEFUN([LIBCFS_LOOKUP_USER_KEY], [ @@ -62,7 +62,7 @@ index 2e99cff179..34726fe8dc 100644 # # LIBCFS_CACHE_DETAIL_WRITERS # -@@ -2305,7 +2284,6 @@ AC_DEFUN([LIBCFS_PROG_LINUX_SRC], [ +@@ -2357,7 +2336,6 @@ AC_DEFUN([LIBCFS_PROG_LINUX_SRC], [ LIBCFS_SRC_KOBJ_TYPE_DEFAULT_GROUPS # 5.3 LIBCFS_SRC_LOOKUP_USER_KEY @@ -70,7 +70,7 @@ index 2e99cff179..34726fe8dc 100644 LIBCFS_SRC_CACHE_DETAIL_WRITERS # 5.4 LIBCFS_SRC_GENL_DUMPIT_INFO -@@ -2444,7 +2422,6 @@ AC_DEFUN([LIBCFS_PROG_LINUX_RESULTS], [ +@@ -2499,7 +2477,6 @@ AC_DEFUN([LIBCFS_PROG_LINUX_RESULTS], [ LIBCFS_KOBJ_TYPE_DEFAULT_GROUPS # 5.3 LIBCFS_LOOKUP_USER_KEY diff --git a/0051-LU-16534-build-Prefer-timer_delete-_sync.patch b/0014-LU-16534-build-Prefer-timer_delete-_sync.patch similarity index 82% rename from 0051-LU-16534-build-Prefer-timer_delete-_sync.patch rename to 0014-LU-16534-build-Prefer-timer_delete-_sync.patch index 5733d496dd548d6d3f0a16d68fec21db48e0190b..0b56505acae836cf4ca762b39575502a8ed113f3 100644 --- a/0051-LU-16534-build-Prefer-timer_delete-_sync.patch +++ b/0014-LU-16534-build-Prefer-timer_delete-_sync.patch @@ -1,7 +1,7 @@ -From 929ab1c506f1f46a1860422e084545734819301a Mon Sep 17 00:00:00 2001 +From f642b5eb1f21725cfcf3b558e8cf053333442388 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Tue, 7 Feb 2023 02:18:36 -0600 -Subject: [PATCH 51/61] LU-16534 build: Prefer timer_delete[_sync] +Subject: [PATCH 14/23] LU-16534 build: Prefer timer_delete[_sync] Linux commit v6.1-rc1-7-g9a5a30568697 timers: Get rid of del_singleshot_timer_sync() @@ -34,170 +34,10 @@ Signed-off-by: Xinliang Liu libcfs/autoconf/lustre-libcfs.m4 lnet/klnds/kfilnd/kfilnd_tn.c --- - contrib/scripts/spelling.txt | 3 + - libcfs/autoconf/lustre-libcfs.m4 | 58 ++ - lnet/klnds/gnilnd/gnilnd_cb.c | 8 +- - lnet/klnds/gnilnd/gnilnd_conn.c | 2 +- - lnet/klnds/kfilnd/kfilnd_tn.c | 1646 ++++++++++++++++++++++++++++++ - lnet/lnet/net_fault.c | 4 +- - lustre/ldlm/ldlm_lockd.c | 2 +- - lustre/lod/lod_qos.c | 2 +- - lustre/osp/osp_precreate.c | 6 +- - lustre/ptlrpc/gss/gss_keyring.c | 2 +- - lustre/ptlrpc/service.c | 6 +- - 11 files changed, 1723 insertions(+), 16 deletions(-) + lnet/klnds/kfilnd/kfilnd_tn.c | 1646 +++++++++++++++++++++++++++++++++ + 1 file changed, 1646 insertions(+) create mode 100644 lnet/klnds/kfilnd/kfilnd_tn.c -diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt -index b812339ea3..5e34d04572 100644 ---- a/contrib/scripts/spelling.txt -+++ b/contrib/scripts/spelling.txt -@@ -100,6 +100,9 @@ cfs_time_current_sec||ktime_get_real_seconds - CLASSERT||BUILD_BUG_ON() - msecs_to_jiffies||cfs_time_seconds - DEFINE_TIMER||CFS_DEFINE_TIMER -+del_timer||timer_delete -+del_timer_sync||timer_delete_sync -+del_singleshot_timer_sync||timer_delete_sync - EWOULDBLOCK||EAGAIN - container_of0||container_of_safe - DN_MAX_BONUSLEN||DN_BONUS_SIZE(dnodesize) -diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 -index 34726fe8dc..ec169c9b28 100644 ---- a/libcfs/autoconf/lustre-libcfs.m4 -+++ b/libcfs/autoconf/lustre-libcfs.m4 -@@ -2176,6 +2176,58 @@ AC_DEFUN([LIBCFS_PDE_DATA_EXISTS],[ - ]) - ]) # LIBCFS_PDE_DATA_EXISTS - -+# -+# LIBCFS_TIMER_DELETE_SYNC -+# -+# Linux commit v6.1-rc1-7-g9a5a30568697 -+# timers: Get rid of del_singleshot_timer_sync() -+# Linux commit v6.1-rc1-11-g9b13df3fb64e -+# timers: Rename del_timer_sync() to timer_delete_sync() -+# -+AC_DEFUN([LIBCFS_SRC_TIMER_DELETE_SYNC],[ -+ LB2_LINUX_TEST_SRC([timer_delete_sync], [ -+ #include -+ ],[ -+ struct timer_list *timer = NULL; -+ (void)timer_delete_sync(timer); -+ ],[]) -+]) -+AC_DEFUN([LIBCFS_TIMER_DELETE_SYNC],[ -+ AC_MSG_CHECKING([is timer_delete_sync() available]) -+ LB2_LINUX_TEST_RESULT([timer_delete_sync], [ -+ AC_DEFINE(HAVE_TIMER_DELETE_SYNC, 1, -+ [timer_delete_sync() is available]) -+ ],[ -+ AC_DEFINE(timer_delete_sync(t), del_timer_sync(t), -+ [timer_delete_sync() not is available]) -+ ]) -+]) # LIBCFS_TIMER_DELETE_SYNC -+ -+# -+# LIBCFS_TIMER_DELETE_SYNC -+# -+# Linux commit v6.1-rc1-12-gbb663f0f3c39 -+# timers: Rename del_timer() to timer_delete() -+# -+AC_DEFUN([LIBCFS_SRC_TIMER_DELETE],[ -+ LB2_LINUX_TEST_SRC([timer_delete], [ -+ #include -+ ],[ -+ struct timer_list *timer = NULL; -+ (void)timer_delete(timer); -+ ],[]) -+]) -+AC_DEFUN([LIBCFS_TIMER_DELETE],[ -+ AC_MSG_CHECKING([is timer_delete() available]) -+ LB2_LINUX_TEST_RESULT([timer_delete], [ -+ AC_DEFINE(HAVE_TIMER_DELETE, 1, -+ [timer_delete() is available]) -+ ],[ -+ AC_DEFINE(timer_delete(t), del_timer(t), -+ [timer_delete() not is available]) -+ ]) -+]) # LIBCFS_TIMER_DELETE -+ - dnl # - dnl # Generate and compile all of the kernel API test cases to determine - dnl # which interfaces are available. By invoking the kernel build system -@@ -2312,6 +2364,9 @@ AC_DEFUN([LIBCFS_PROG_LINUX_SRC], [ - LIBCFS_SRC_PARAM_SET_UINT_MINMAX - # 5.17 - LIBCFS_SRC_PDE_DATA_EXISTS -+ # 6.2 -+ LIBCFS_SRC_TIMER_DELETE_SYNC -+ LIBCFS_SRC_TIMER_DELETE - - LB2_LINUX_TEST_COMPILE_ALL([libcfs], - [for available kernel interfaces to libcfs]) -@@ -2450,6 +2505,9 @@ AC_DEFUN([LIBCFS_PROG_LINUX_RESULTS], [ - LIBCFS_PARAM_SET_UINT_MINMAX - # 5.17 - LIBCFS_PDE_DATA_EXISTS -+ # 6.2 -+ LIBCFS_TIMER_DELETE_SYNC -+ LIBCFS_TIMER_DELETE - ]) - - # -diff --git a/lnet/klnds/gnilnd/gnilnd_cb.c b/lnet/klnds/gnilnd/gnilnd_cb.c -index 6be0b2a74b..abf88d3928 100644 ---- a/lnet/klnds/gnilnd/gnilnd_cb.c -+++ b/lnet/klnds/gnilnd/gnilnd_cb.c -@@ -2988,7 +2988,7 @@ kgnilnd_reaper(void *arg) - CDEBUG(D_INFO, "awake after schedule\n"); - } - -- del_singleshot_timer_sync(&timer); -+ timer_delete_sync(&timer); - spin_lock(&kgnilnd_data.kgn_reaper_lock); - finish_wait(&kgnilnd_data.kgn_reaper_waitq, &wait); - continue; -@@ -3805,7 +3805,7 @@ kgnilnd_process_rdmaq(kgn_device_t *dev) - /* if we think we need to adjust, take lock to serialize and recheck */ - spin_lock(&dev->gnd_rdmaq_lock); - if (time_after_eq(jiffies, dev->gnd_rdmaq_deadline)) { -- del_singleshot_timer_sync(&dev->gnd_rdmaq_timer); -+ timer_delete_sync(&dev->gnd_rdmaq_timer); - - dead_bump = cfs_time_seconds(1) / *kgnilnd_tunables.kgn_rdmaq_intervals; - -@@ -4636,7 +4636,7 @@ kgnilnd_process_mapped_tx(kgn_device_t *dev) - spin_lock(&dev->gnd_lock); - if (list_empty(&dev->gnd_map_tx)) { - /* if the list is empty make sure we dont have a timer running */ -- del_singleshot_timer_sync(&dev->gnd_map_timer); -+ timer_delete_sync(&dev->gnd_map_timer); - spin_unlock(&dev->gnd_lock); - RETURN(0); - } -@@ -4663,7 +4663,7 @@ kgnilnd_process_mapped_tx(kgn_device_t *dev) - } - - /* delete the previous timer if it exists */ -- del_singleshot_timer_sync(&dev->gnd_map_timer); -+ timer_delete_sync(&dev->gnd_map_timer); - /* stash the last map version to let us know when a good one was seen */ - last_map_version = dev->gnd_map_version; - -diff --git a/lnet/klnds/gnilnd/gnilnd_conn.c b/lnet/klnds/gnilnd/gnilnd_conn.c -index 38dce1d475..9ac954957f 100644 ---- a/lnet/klnds/gnilnd/gnilnd_conn.c -+++ b/lnet/klnds/gnilnd/gnilnd_conn.c -@@ -2545,7 +2545,7 @@ kgnilnd_dgram_mover(void *arg) - deadline = jiffies + cfs_time_seconds(*kgnilnd_tunables.kgn_dgram_timeout); - } - -- del_singleshot_timer_sync(&timer.timer); -+ timer_delete_sync(&timer.timer); - finish_wait(&dev->gnd_dgram_waitq, &wait); - } - diff --git a/lnet/klnds/kfilnd/kfilnd_tn.c b/lnet/klnds/kfilnd/kfilnd_tn.c new file mode 100644 index 0000000000..59fe030fb4 @@ -1850,129 +1690,6 @@ index 0000000000..59fe030fb4 + + return 0; +} -diff --git a/lnet/lnet/net_fault.c b/lnet/lnet/net_fault.c -index 0a201a0b3c..98bdb1664f 100644 ---- a/lnet/lnet/net_fault.c -+++ b/lnet/lnet/net_fault.c -@@ -649,7 +649,7 @@ delayed_msg_check(struct lnet_delay_rule *rule, bool all, - } - - if (list_empty(&rule->dl_msg_list)) { -- del_timer(&rule->dl_timer); -+ timer_delete(&rule->dl_timer); - rule->dl_msg_send = -1; - - } else if (!list_empty(msg_list)) { -@@ -936,7 +936,7 @@ lnet_delay_rule_del(lnet_nid_t src, lnet_nid_t dst, bool shutdown) - list_for_each_entry_safe(rule, tmp, &rule_list, dl_link) { - list_del_init(&rule->dl_link); - -- del_timer_sync(&rule->dl_timer); -+ timer_delete_sync(&rule->dl_timer); - delayed_msg_check(rule, true, &msg_list); - delay_rule_decref(rule); /* -1 for the_lnet.ln_delay_rules */ - n++; -diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c -index 7e59709ea6..7a42d5d3df 100644 ---- a/lustre/ldlm/ldlm_lockd.c -+++ b/lustre/ldlm/ldlm_lockd.c -@@ -511,7 +511,7 @@ static int __ldlm_del_waiting_lock(struct ldlm_lock *lock) - /* Removing the head of the list, adjust timer. */ - if (list_next == &waiting_locks_list) { - /* No more, just cancel. */ -- del_timer(&waiting_locks_timer); -+ timer_delete(&waiting_locks_timer); - } else { - time64_t now = ktime_get_seconds(); - struct ldlm_lock *next; -diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c -index 6447dd90db..a4ba6786b0 100644 ---- a/lustre/lod/lod_qos.c -+++ b/lustre/lod/lod_qos.c -@@ -1488,7 +1488,7 @@ static int lod_ost_alloc_qos(const struct lu_env *env, struct lod_object *lo, - /* Do actual allocation, use write lock here. */ - rc = down_write_killable(&lod->lod_ost_descs.ltd_qos.lq_rw_sem); - -- del_singleshot_timer_sync(&timer.timer); -+ timer_delete_sync(&timer.timer); - kernel_sigaction(SIGKILL, SIG_IGN); - if (rc) { - flush_signals(current); -diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c -index 5585ce1bf4..d9d64ff536 100644 ---- a/lustre/osp/osp_precreate.c -+++ b/lustre/osp/osp_precreate.c -@@ -239,7 +239,7 @@ static int osp_statfs_update(const struct lu_env *env, struct osp_device *d) - /* - * no updates till reply - */ -- del_timer(&d->opd_statfs_timer); -+ timer_delete(&d->opd_statfs_timer); - d->opd_statfs_fresh_till = ktime_add_ns(ktime_get(), expire); - d->opd_statfs_update_in_progress = 1; - -@@ -293,7 +293,7 @@ void osp_statfs_need_now(struct osp_device *d) - * is replied - */ - d->opd_statfs_fresh_till = ktime_sub_ns(ktime_get(), NSEC_PER_SEC); -- del_timer(&d->opd_statfs_timer); -+ timer_delete(&d->opd_statfs_timer); - wake_up(&d->opd_pre_waitq); - } - } -@@ -1837,7 +1837,7 @@ void osp_statfs_fini(struct osp_device *d) - struct task_struct *task = d->opd_pre_task; - ENTRY; - -- del_timer(&d->opd_statfs_timer); -+ timer_delete(&d->opd_statfs_timer); - - d->opd_pre_task = NULL; - if (task) -diff --git a/lustre/ptlrpc/gss/gss_keyring.c b/lustre/ptlrpc/gss/gss_keyring.c -index 124ebe1dc1..5d4e3c19a0 100644 ---- a/lustre/ptlrpc/gss/gss_keyring.c -+++ b/lustre/ptlrpc/gss/gss_keyring.c -@@ -149,7 +149,7 @@ void ctx_clear_timer_kr(struct ptlrpc_cli_ctx *ctx) - - CDEBUG(D_SEC, "ctx %p, key %p\n", ctx, gctx_kr->gck_key); - -- del_singleshot_timer_sync(timer); -+ timer_delete_sync(timer); - } - - static -diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c -index 16fcaba8f0..366dc5a20b 100644 ---- a/lustre/ptlrpc/service.c -+++ b/lustre/ptlrpc/service.c -@@ -1248,7 +1248,7 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt) - time64_t next; - - if (array->paa_count == 0) { -- del_timer(&svcpt->scp_at_timer); -+ timer_delete(&svcpt->scp_at_timer); - return; - } - -@@ -3390,7 +3390,7 @@ ptlrpc_service_del_atimer(struct ptlrpc_service *svc) - /* early disarm AT timer... */ - ptlrpc_service_for_each_part(svcpt, i, svc) { - if (svcpt->scp_service != NULL) -- del_timer(&svcpt->scp_at_timer); -+ timer_delete(&svcpt->scp_at_timer); - } - } - -@@ -3558,7 +3558,7 @@ ptlrpc_service_free(struct ptlrpc_service *svc) - break; - - /* In case somebody rearmed this in the meantime */ -- del_timer(&svcpt->scp_at_timer); -+ timer_delete(&svcpt->scp_at_timer); - array = &svcpt->scp_at_array; - - if (array->paa_reqs_array != NULL) { -- 2.33.0 diff --git a/0014-LU-16717-mdt-resume-dir-migration-with-bad_type.patch b/0014-LU-16717-mdt-resume-dir-migration-with-bad_type.patch deleted file mode 100644 index e8d45dc8cd68f11ae95f36a62a7bcfdc50429f32..0000000000000000000000000000000000000000 --- a/0014-LU-16717-mdt-resume-dir-migration-with-bad_type.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 1c882aebeaac4970c78a3616f1dd96d0920d133f Mon Sep 17 00:00:00 2001 -From: Lai Siyao -Date: Fri, 28 Apr 2023 05:22:03 -0400 -Subject: [PATCH 14/61] LU-16717 mdt: resume dir migration with bad_type - -LFSCK may set hash type to "none,bad_type" upon migration failure, -set it back to "fnv_1a_64,migrating,bad_type,fixed" to allow -migration resumption. fnv_1a_64 is set because it's the default hash -type, and now that we don't know the hash type in the original -migration command, just try with it. - -LFSCK just add "bad_type" flag on such directory, so that such -migration can always be resumed in the future. - -Add sanity 230z. - -Lustre-change: https://review.whamcloud.com/50797 -Lustre-commit: 151650e468ab423e831c30d635ea380e0434a122 - -Signed-off-by: Lai Siyao -Change-Id: I19606aefcb9115e6724843785aea89a1c380e23f -Reviewed-by: Andreas Dilger -Reviewed-by: Hongchao Zhang -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51243 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/lfsck/lfsck_striped_dir.c | 6 +++++- - lustre/mdt/mdt_reint.c | 32 ++++++++++++++++++++++++++++++++ - lustre/tests/sanity.sh | 30 ++++++++++++++++++++++++++++++ - 3 files changed, 67 insertions(+), 1 deletion(-) - -diff --git a/lustre/lfsck/lfsck_striped_dir.c b/lustre/lfsck/lfsck_striped_dir.c -index 63a875403f..2aa2c7d6e3 100644 ---- a/lustre/lfsck/lfsck_striped_dir.c -+++ b/lustre/lfsck/lfsck_striped_dir.c -@@ -1567,7 +1567,11 @@ int lfsck_namespace_repair_bad_name_hash(const struct lu_env *env, - GOTO(log, rc = 1); - - *lmv2 = llmv->ll_lmv; -- lmv2->lmv_hash_type = LMV_HASH_TYPE_UNKNOWN | LMV_HASH_FLAG_BAD_TYPE; -+ /* only set BAD_TYPE here, do not clear hash type or MIGRATION flag, -+ * so that user can resume dir migration if this is caused by dir -+ * migration failure. -+ */ -+ lmv2->lmv_hash_type |= LMV_HASH_FLAG_BAD_TYPE; - rc = lfsck_namespace_set_lmv_master(env, com, parent, lmv2, - lfsck_dto2fid(shard), - llmv->ll_lmv.lmv_master_mdt_index, -diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c -index a2ddbbcf07..23948879cd 100644 ---- a/lustre/mdt/mdt_reint.c -+++ b/lustre/mdt/mdt_reint.c -@@ -2207,6 +2207,17 @@ close: - return rc ?: rc2; - } - -+/* LFSCK used to clear hash type and MIGRATION flag upon migration failure */ -+static inline bool lmv_is_failed_migration(const struct lmv_mds_md_v1 *lmv) -+{ -+ return le32_to_cpu(lmv->lmv_hash_type) == -+ (LMV_HASH_TYPE_UNKNOWN | LMV_HASH_FLAG_BAD_TYPE) && -+ lmv_is_known_hash_type(le32_to_cpu(lmv->lmv_migrate_hash)) && -+ le32_to_cpu(lmv->lmv_migrate_offset) > 0 && -+ le32_to_cpu(lmv->lmv_migrate_offset) < -+ le32_to_cpu(lmv->lmv_stripe_count); -+} -+ - /* - * migrate file in below steps: - * 1. lock parent and its stripes -@@ -2384,6 +2395,27 @@ lock_parent: - if ((ma->ma_valid & MA_LMV) && - lmv_is_restriping(&ma->ma_lmv->lmv_md_v1)) - GOTO(unlock_links, rc = -EBUSY); -+ else if (lmv_is_failed_migration(&ma->ma_lmv->lmv_md_v1)) { -+ struct lu_buf *buf = &info->mti_buf; -+ struct lmv_mds_md_v1 *lmv = &ma->ma_lmv->lmv_md_v1; -+ __u32 version = le32_to_cpu(lmv->lmv_layout_version); -+ -+ /* migration failed before, and LFSCK cleared hash type -+ * and flags, fake it to resume migration. -+ */ -+ lmv->lmv_hash_type = -+ cpu_to_le32(LMV_HASH_TYPE_FNV_1A_64 | -+ LMV_HASH_FLAG_MIGRATION | -+ LMV_HASH_FLAG_BAD_TYPE | -+ LMV_HASH_FLAG_FIXED); -+ lmv->lmv_layout_version = cpu_to_le32(version + 1); -+ buf->lb_buf = lmv; -+ buf->lb_len = sizeof(*lmv); -+ rc = mo_xattr_set(env, mdt_object_child(sobj), buf, -+ XATTR_NAME_LMV, LU_XATTR_REPLACE); -+ mo_invalidate(env, mdt_object_child(sobj)); -+ GOTO(unlock_links, rc = -EALREADY); -+ } - } - - /* if migration HSM is allowed */ -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 6cd539a737..93f8c3b30c 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -20661,6 +20661,36 @@ test_230y() { - } - run_test 230y "unlink dir with bad hash type" - -+test_230z() { -+ (( MDSCOUNT > 1 )) || skip "needs >= 2 MDTs" -+ (( MDS1_VERSION >= $(version_code 2.15.3) )) || -+ skip "Need MDS version at least 2.15.3" -+ -+ local pid -+ -+ test_mkdir -c -1 $DIR/$tdir || error "mkdir $tdir failed" -+ $LFS getdirstripe $DIR/$tdir -+ createmany -d $DIR/$tdir/d 100 || error "createmany failed" -+ $LFS migrate -m 1 -c 2 -H fnv_1a_64 $DIR/$tdir & -+ pid=$! -+ sleep 1 -+ -+ #OBD_FAIL_MIGRATE_BAD_HASH 0x1802 -+ do_facet mds2 lctl set_param fail_loc=0x1802 -+ -+ wait $pid -+ do_facet mds2 lctl set_param fail_loc=0 -+ $LFS getdirstripe $DIR/$tdir -+ -+ # resume migration -+ $LFS migrate -m 1 -c 2 -H fnv_1a_64 $DIR/$tdir || -+ error "resume migration failed" -+ $LFS getdirstripe $DIR/$tdir -+ [ $($LFS getdirstripe -H $DIR/$tdir) == "fnv_1a_64,fixed" ] || -+ error "migration is not finished" -+} -+run_test 230z "resume dir migration with bad hash type" -+ - test_231a() - { - # For simplicity this test assumes that max_pages_per_rpc --- -2.33.0 - diff --git a/0015-LU-14668-lnet-Lock-primary-NID-logic.patch b/0015-LU-14668-lnet-Lock-primary-NID-logic.patch deleted file mode 100644 index 7a2a69d26b47a75d48c104a2abe7793af06c779a..0000000000000000000000000000000000000000 --- a/0015-LU-14668-lnet-Lock-primary-NID-logic.patch +++ /dev/null @@ -1,241 +0,0 @@ -From b341288179d9b3ad594b461586d826d6811db5a1 Mon Sep 17 00:00:00 2001 -From: Amir Shehata -Date: Wed, 5 May 2021 11:35:06 -0700 -Subject: [PATCH 15/61] LU-14668 lnet: Lock primary NID logic - -If a peer is created by Lustre make sure to lock that peer's -primary NID. This peer can be discovered in the background. -There is no need to block until discovery is complete, as Lustre -can continue on with the primary NID it provided. - -Discovery will populate the peer with other interfaces the peer has -but will not change the peer's primary NID. It can also delete -peer's NIDs which Lustre told it about (not the Primary NID). - -If a peer has been manually discovered via - lnetctl discover -command, then make sure to delete the manually discovered -peer and recreate it with the Lustre NID information -provided for us. - -Lustre-change: https://review.whamcloud.com/50106 -Lustre-commit: aacb16191a72bc6db1155030849efb0d6971a572 - -Signed-off-by: Amir Shehata -Change-Id: I8fc8a69caccca047e3085bb33d026a3f09fb359b -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51130 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lnet/lnet/peer.c | 113 +++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 90 insertions(+), 23 deletions(-) - -diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c -index 7a438ea086..01eb9aa8aa 100644 ---- a/lnet/lnet/peer.c -+++ b/lnet/lnet/peer.c -@@ -546,6 +546,15 @@ lnet_peer_del_nid(struct lnet_peer *lp, lnet_nid_t nid4, unsigned int flags) - } - - lpni = lnet_peer_ni_find_locked(&nid); -+ /* If we're asked to lock down the primary NID we shouldn't be -+ * deleting it -+ */ -+ if (lp->lp_state & LNET_PEER_LOCK_PRIMARY && -+ nid_same(&primary_nid, &nid)) { -+ rc = -EPERM; -+ goto out; -+ } -+ - if (!lpni) { - rc = -ENOENT; - goto out; -@@ -1420,6 +1429,19 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - if (!pnid) { - pnid = nids[i]; - rc = lnet_add_peer_ni(pnid, LNET_NID_ANY, mr, true); -+ if (rc == -EALREADY) { -+ struct lnet_peer *lp; -+ -+ CDEBUG(D_NET, "A peer exists for NID %s\n", -+ libcfs_nid2str(pnid)); -+ rc = 0; -+ /* Adds a refcount */ -+ lp = lnet_find_peer4(pnid); -+ LASSERT(lp); -+ pnid = lnet_nid_to_nid4(&lp->lp_primary_nid); -+ /* Drop refcount from lookup */ -+ lnet_peer_decref_locked(lp); -+ } - } else if (lnet_peer_discovery_disabled) { - rc = lnet_add_peer_ni(nids[i], LNET_NID_ANY, mr, true); - } else { -@@ -1466,13 +1488,20 @@ LNetPrimaryNID(lnet_nid_t nid) - * down then this discovery can introduce long delays into the mount - * process, so skip it if it isn't necessary. - */ -- while (!lnet_peer_discovery_disabled && !lnet_peer_is_uptodate(lp)) { -- spin_lock(&lp->lp_lock); -+ spin_lock(&lp->lp_lock); -+ if (!lnet_peer_discovery_disabled && -+ (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY) || -+ !lnet_peer_is_uptodate_locked(lp))) { - /* force a full discovery cycle */ -- lp->lp_state |= LNET_PEER_FORCE_PING | LNET_PEER_FORCE_PUSH; -+ lp->lp_state |= LNET_PEER_FORCE_PING | LNET_PEER_FORCE_PUSH | -+ LNET_PEER_LOCK_PRIMARY; - spin_unlock(&lp->lp_lock); - -- rc = lnet_discover_peer_locked(lpni, cpt, true); -+ /* start discovery in the background. Messages to that -+ * peer will not go through until the discovery is -+ * complete -+ */ -+ rc = lnet_discover_peer_locked(lpni, cpt, false); - if (rc) - goto out_decref; - /* The lpni (or lp) for this NID may have changed and our ref is -@@ -1486,14 +1515,8 @@ LNetPrimaryNID(lnet_nid_t nid) - goto out_unlock; - } - lp = lpni->lpni_peer_net->lpn_peer; -- -- /* If we find that the peer has discovery disabled then we will -- * not modify whatever primary NID is currently set for this -- * peer. Thus, we can break out of this loop even if the peer -- * is not fully up to date. -- */ -- if (lnet_is_discovery_disabled(lp)) -- break; -+ } else { -+ spin_unlock(&lp->lp_lock); - } - primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid); - out_decref: -@@ -1530,9 +1553,9 @@ lnet_peer_get_net_locked(struct lnet_peer *peer, __u32 net_id) - */ - static int - lnet_peer_attach_peer_ni(struct lnet_peer *lp, -- struct lnet_peer_net *lpn, -- struct lnet_peer_ni *lpni, -- unsigned flags) -+ struct lnet_peer_net *lpn, -+ struct lnet_peer_ni *lpni, -+ unsigned flags) - { - struct lnet_peer_table *ptable; - bool new_lpn = false; -@@ -1599,6 +1622,8 @@ lnet_peer_attach_peer_ni(struct lnet_peer *lp, - lnet_peer_clr_non_mr_pref_nids(lp); - } - } -+ if (flags & LNET_PEER_LOCK_PRIMARY) -+ lp->lp_state |= LNET_PEER_LOCK_PRIMARY; - spin_unlock(&lp->lp_lock); - - lp->lp_nnis++; -@@ -1661,13 +1686,28 @@ lnet_peer_add(lnet_nid_t nid4, unsigned int flags) - else if ((lp->lp_state ^ flags) & LNET_PEER_MULTI_RAIL) - rc = -EPERM; - goto out; -- } else if (!(flags & LNET_PEER_CONFIGURED)) { -- if (lnet_nid_to_nid4(&lp->lp_primary_nid) == nid4) { -+ } else if (lp->lp_state & LNET_PEER_LOCK_PRIMARY) { -+ if (nid_same(&lp->lp_primary_nid, &nid)) { - rc = -EEXIST; - goto out; - } -+ /* we're trying to recreate an existing peer which -+ * has already been created and its primary -+ * locked. This is likely due to two servers -+ * existing on the same node. So we'll just refer -+ * to that node with the primary NID which was -+ * first added by Lustre -+ */ -+ rc = -EALREADY; -+ goto out; - } -- /* Delete and recreate as a configured peer. */ -+ /* Delete and recreate the peer. -+ * We can get here: -+ * 1. If the peer is being recreated as a configured NID -+ * 2. if there already exists a peer which -+ * was discovered manually, but is recreated via Lustre -+ * with PRIMARY_lock -+ */ - rc = lnet_peer_del(lp); - if (rc) - goto out; -@@ -1760,9 +1800,27 @@ lnet_peer_add_nid(struct lnet_peer *lp, lnet_nid_t nid4, unsigned int flags) - } - /* If this is the primary NID, destroy the peer. */ - if (lnet_peer_ni_is_primary(lpni)) { -- struct lnet_peer *rtr_lp = -+ struct lnet_peer *lp2 = - lpni->lpni_peer_net->lpn_peer; -- int rtr_refcount = rtr_lp->lp_rtr_refcount; -+ int rtr_refcount = lp2->lp_rtr_refcount; -+ -+ /* If the new peer that this NID belongs to is -+ * a primary NID for another peer which we're -+ * suppose to preserve the Primary for then we -+ * don't want to mess with it. But the -+ * configuration is wrong at this point, so we -+ * should flag both of these peers as in a bad -+ * state -+ */ -+ if (lp2->lp_state & LNET_PEER_LOCK_PRIMARY) { -+ spin_lock(&lp->lp_lock); -+ lp->lp_state |= LNET_PEER_BAD_CONFIG; -+ spin_unlock(&lp->lp_lock); -+ spin_lock(&lp2->lp_lock); -+ lp2->lp_state |= LNET_PEER_BAD_CONFIG; -+ spin_unlock(&lp2->lp_lock); -+ goto out_free_lpni; -+ } - /* - * if we're trying to delete a router it means - * we're moving this peer NI to a new peer so must -@@ -1770,9 +1828,9 @@ lnet_peer_add_nid(struct lnet_peer *lp, lnet_nid_t nid4, unsigned int flags) - */ - if (rtr_refcount > 0) { - flags |= LNET_PEER_RTR_NI_FORCE_DEL; -- lnet_rtr_transfer_to_peer(rtr_lp, lp); -+ lnet_rtr_transfer_to_peer(lp2, lp); - } -- lnet_peer_del(lpni->lpni_peer_net->lpn_peer); -+ lnet_peer_del(lp2); - lnet_peer_ni_decref_locked(lpni); - lpni = lnet_peer_ni_alloc(&nid); - if (!lpni) { -@@ -1830,7 +1888,8 @@ lnet_peer_set_primary_nid(struct lnet_peer *lp, lnet_nid_t nid, - if (lnet_nid_to_nid4(&lp->lp_primary_nid) == nid) - goto out; - -- lnet_nid4_to_nid(nid, &lp->lp_primary_nid); -+ if (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY)) -+ lnet_nid4_to_nid(nid, &lp->lp_primary_nid); - - rc = lnet_peer_add_nid(lp, nid, flags); - if (rc) { -@@ -1838,6 +1897,14 @@ lnet_peer_set_primary_nid(struct lnet_peer *lp, lnet_nid_t nid, - goto out; - } - out: -+ /* if this is a configured peer or the primary for that peer has -+ * been locked, then we don't want to flag this scenario as -+ * a failure -+ */ -+ if (lp->lp_state & LNET_PEER_CONFIGURED || -+ lp->lp_state & LNET_PEER_LOCK_PRIMARY) -+ return 0; -+ - CDEBUG(D_NET, "peer %s NID %s: %d\n", - libcfs_nidstr(&old), libcfs_nid2str(nid), rc); - --- -2.33.0 - diff --git a/0053-LU-16788-tests-sanity-should-remove-temp-files.patch b/0015-LU-16788-tests-sanity-should-remove-temp-files.patch similarity index 87% rename from 0053-LU-16788-tests-sanity-should-remove-temp-files.patch rename to 0015-LU-16788-tests-sanity-should-remove-temp-files.patch index 888acce0f7bed8d38e7b0060bbc18e5b1e6e92a9..10bfeff8ca2c5e992b0230379d16bf0039c3ee2a 100644 --- a/0053-LU-16788-tests-sanity-should-remove-temp-files.patch +++ b/0015-LU-16788-tests-sanity-should-remove-temp-files.patch @@ -1,7 +1,7 @@ -From bc58052e3b1a1883e4a22eccdd43a3992b99ec42 Mon Sep 17 00:00:00 2001 +From 4e4651a4c2f12780e10039f845bae8051cdc3f4d Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Mon, 1 May 2023 18:05:35 +0300 -Subject: [PATCH 53/61] LU-16788 tests: sanity should remove temp files +Subject: [PATCH 15/23] LU-16788 tests: sanity should remove temp files during the test to fit OSTSIZE @@ -20,7 +20,7 @@ Signed-off-by: Xinliang Liu 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index c2693abd2d..a004738552 100755 +index 41110ac575..0df5419d5f 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -7094,6 +7094,7 @@ test_56w() { @@ -63,7 +63,7 @@ index c2693abd2d..a004738552 100755 dd if=/dev/urandom of=$DIR/$tfile bs=1M count=4 status=none || error "Unable to write on $tfile" -@@ -8884,6 +8889,7 @@ test_64e() { +@@ -8910,6 +8915,7 @@ test_64e() { local grants=$((wb_round_up + extent_tax)) $LFS setstripe -c 1 -i 0 $DIR/$tfile || error "lfs setstripe failed" @@ -71,7 +71,7 @@ index c2693abd2d..a004738552 100755 # define OBD_FAIL_TGT_NO_GRANT 0x725 # make the server not grant more back -@@ -9042,6 +9048,7 @@ test_64h() { +@@ -9068,6 +9074,7 @@ test_64h() { $LCTL set_param osc.*OST0000*.grant_shrink_interval=10 $LFS setstripe -c 1 -i 0 $DIR/$tfile @@ -79,7 +79,7 @@ index c2693abd2d..a004738552 100755 dd if=/dev/zero of=$DIR/$tfile bs=1M count=10 oflag=sync # drop cache so that coming read would do rpc -@@ -9081,6 +9088,7 @@ test_64i() { +@@ -9107,6 +9114,7 @@ test_64i() { remote_ost_nodsh && skip "remote OSTs with nodsh" $LFS setstripe -c 1 -i 0 $DIR/$tfile @@ -87,7 +87,7 @@ index c2693abd2d..a004738552 100755 dd if=/dev/zero of=$DIR/$tfile bs=1M count=64 -@@ -9527,6 +9535,7 @@ test_69() { +@@ -9553,6 +9561,7 @@ test_69() { f="$DIR/$tfile" $LFS setstripe -c 1 -i 0 $f @@ -95,7 +95,7 @@ index c2693abd2d..a004738552 100755 $DIRECTIO write ${f}.2 0 1 || error "directio write error" -@@ -9544,7 +9553,6 @@ test_69() { +@@ -9570,7 +9579,6 @@ test_69() { $DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT" do_facet ost1 lctl set_param fail_loc=0 @@ -103,7 +103,7 @@ index c2693abd2d..a004738552 100755 } run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======" -@@ -11518,6 +11526,7 @@ test_103b() { +@@ -11551,6 +11559,7 @@ test_103b() { declare -a pids local U @@ -111,7 +111,7 @@ index c2693abd2d..a004738552 100755 for U in {0..511}; do { local O=$(printf "%04o" $U) -@@ -13697,6 +13706,7 @@ OLDIFS="$IFS" +@@ -13730,6 +13739,7 @@ OLDIFS="$IFS" cleanup_130() { trap 0 IFS="$OLDIFS" @@ -119,7 +119,7 @@ index c2693abd2d..a004738552 100755 } test_130a() { -@@ -13942,6 +13952,7 @@ test_130e() { +@@ -13975,6 +13985,7 @@ test_130e() { local fm_file=$DIR/$tfile $LFS setstripe -S 131072 -c 2 $fm_file || error "setstripe on $fm_file" @@ -127,7 +127,7 @@ index c2693abd2d..a004738552 100755 NUM_BLKS=512 EXPECTED_LEN=$(( (NUM_BLKS / 2) * 64 )) -@@ -14793,7 +14804,7 @@ test_150d() { +@@ -14826,7 +14837,7 @@ test_150d() { [[ "x$DOM" == "xyes" ]] && striping="-L mdt" @@ -136,7 +136,7 @@ index c2693abd2d..a004738552 100755 $LFS setstripe -E1M $striping -E eof -c $OSTCOUNT -S1M $DIR/$tdir || error "setstripe failed" fallocate -o 1G -l ${OSTCOUNT}m $DIR/$tdir || error "fallocate failed" -@@ -18305,14 +18316,12 @@ test_187a() { +@@ -18338,14 +18349,12 @@ test_187a() { local file=$dir0/file1 dd if=/dev/urandom of=$file count=10 bs=1M conv=fsync @@ -152,7 +152,7 @@ index c2693abd2d..a004738552 100755 } run_test 187a "Test data version change" -@@ -19331,6 +19340,7 @@ test_224c() { # LU-6441 +@@ -19364,6 +19373,7 @@ test_224c() { # LU-6441 #define OBD_FAIL_PTLRPC_CLIENT_BULK_CB3 0x520 do_facet ost1 "$LCTL set_param fail_loc=0x520" $LFS setstripe -c 1 -i 0 $DIR/$tfile @@ -160,7 +160,7 @@ index c2693abd2d..a004738552 100755 dd if=/dev/zero of=$DIR/$tfile bs=8MB count=1 sync do_facet ost1 "$LCTL set_param fail_loc=0" -@@ -20714,6 +20724,7 @@ test_231a() +@@ -20747,6 +20757,7 @@ test_231a() mkdir -p $DIR/$tdir $LFS setstripe -S ${brw_size}M $DIR/$tdir || error "failed to set stripe with -S ${brw_size}M option" @@ -168,7 +168,7 @@ index c2693abd2d..a004738552 100755 # clear the OSC stats $LCTL set_param osc.*.stats=0 &>/dev/null -@@ -20751,6 +20762,7 @@ run_test 231a "checking that reading/writing of BRW RPC size results in one RPC" +@@ -20784,6 +20795,7 @@ run_test 231a "checking that reading/writing of BRW RPC size results in one RPC" test_231b() { mkdir -p $DIR/$tdir @@ -176,7 +176,7 @@ index c2693abd2d..a004738552 100755 local i for i in {0..1023}; do dd if=/dev/zero of=$DIR/$tdir/$tfile conv=notrunc \ -@@ -20770,6 +20782,7 @@ test_232a() { +@@ -20803,6 +20815,7 @@ test_232a() { # ignore dd failure dd if=/dev/zero of=$DIR/$tdir/$tfile bs=1M count=1 || true @@ -184,7 +184,7 @@ index c2693abd2d..a004738552 100755 do_facet ost1 $LCTL set_param fail_loc=0 umount_client $MOUNT || error "umount failed" -@@ -20786,6 +20799,7 @@ test_232b() { +@@ -20819,6 +20832,7 @@ test_232b() { mkdir -p $DIR/$tdir $LFS setstripe -c1 -i0 $DIR/$tdir/$tfile dd if=/dev/zero of=$DIR/$tdir/$tfile bs=1M count=1 @@ -192,7 +192,7 @@ index c2693abd2d..a004738552 100755 sync cancel_lru_locks osc -@@ -21549,6 +21563,7 @@ test_253() { +@@ -21582,6 +21596,7 @@ test_253() { wait_mds_ost_sync wait_delete_completed mkdir $DIR/$tdir @@ -200,7 +200,7 @@ index c2693abd2d..a004738552 100755 pool_add $TESTNAME || error "Pool creation failed" pool_add_targets $TESTNAME 0 || error "Pool add targets failed" -@@ -22856,6 +22871,7 @@ test_272b() { +@@ -22889,6 +22904,7 @@ test_272b() { local dom=$DIR/$tdir/dom mkdir -p $DIR/$tdir $LFS setstripe -E 1M -L mdt -E -1 -c1 $dom @@ -208,7 +208,7 @@ index c2693abd2d..a004738552 100755 local mdtidx=$($LFS getstripe -m $dom) local mdtname=MDT$(printf %04x $mdtidx) -@@ -22898,6 +22914,7 @@ test_272c() { +@@ -22931,6 +22947,7 @@ test_272c() { local dom=$DIR/$tdir/$tfile mkdir -p $DIR/$tdir $LFS setstripe -E 1M -L mdt -E -1 -c1 $dom @@ -216,7 +216,7 @@ index c2693abd2d..a004738552 100755 local mdtidx=$($LFS getstripe -m $dom) local mdtname=MDT$(printf %04x $mdtidx) -@@ -23085,6 +23102,7 @@ test_275() { +@@ -23118,6 +23135,7 @@ test_275() { dd if=/dev/urandom of=$file bs=1M count=2 || error "failed to create a file" @@ -224,7 +224,7 @@ index c2693abd2d..a004738552 100755 cancel_lru_locks osc #lock 1 -@@ -24439,6 +24457,7 @@ test_398a() { # LU-4198 +@@ -24472,6 +24490,7 @@ test_398a() { # LU-4198 cut -d'.' -f2) $LFS setstripe -c 1 -i 0 $DIR/$tfile diff --git a/0016-LU-14668-lnet-Peers-added-via-kernel-API-should-be-p.patch b/0016-LU-14668-lnet-Peers-added-via-kernel-API-should-be-p.patch deleted file mode 100644 index 30b717fc43fd506df0f0bff79ec4178dbbdafb5a..0000000000000000000000000000000000000000 --- a/0016-LU-14668-lnet-Peers-added-via-kernel-API-should-be-p.patch +++ /dev/null @@ -1,167 +0,0 @@ -From f63e87f0a88a856d5cc38039afef704676ff5521 Mon Sep 17 00:00:00 2001 -From: Chris Horn -Date: Tue, 25 May 2021 11:17:49 -0500 -Subject: [PATCH 16/61] LU-14668 lnet: Peers added via kernel API should be - permanent - -The LNetAddPeer() API allows Lustre to predefine the Peer for LNet. -Originally these peers would be temporary and potentially re-created -via discovery. Instead, let's make these peers permanent. This allows -Lustre to dictate the primary NID of the peer. LNet makes sure this -primary NID is not changed afterwards. - -Lustre-change: https://review.whamcloud.com/43788 -Lustre-commit: 41733dadd8ad0e87e44dd19e25e576e90484cb9b - -Test-Parameters: trivial -Signed-off-by: Amir Shehata -Signed-off-by: Chris Horn -Change-Id: I3f54c04719c9e0374176682af08183f0c93ef737 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51131 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lnet/include/lnet/lib-lnet.h | 2 +- - lnet/lnet/api-ni.c | 7 +++--- - lnet/lnet/peer.c | 43 ++++++++++++++++++++++-------------- - 3 files changed, 32 insertions(+), 20 deletions(-) - -diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h -index 223c6d328b..a1261d137d 100644 ---- a/lnet/include/lnet/lib-lnet.h -+++ b/lnet/include/lnet/lib-lnet.h -@@ -1011,8 +1011,8 @@ void lnet_peer_clr_pref_rtrs(struct lnet_peer_ni *lpni); - int lnet_peer_add_pref_rtr(struct lnet_peer_ni *lpni, struct lnet_nid *nid); - int lnet_peer_ni_set_non_mr_pref_nid(struct lnet_peer_ni *lpni, - struct lnet_nid *nid); --int lnet_add_peer_ni(lnet_nid_t key_nid, lnet_nid_t nid, bool mr, bool temp); - int lnet_del_peer_ni(lnet_nid_t key_nid, lnet_nid_t nid); -+int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr); - int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk); - int lnet_get_peer_ni_info(__u32 peer_index, __u64 *nid, - char alivness[LNET_MAX_STR_LEN], -diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c -index b99c85b73d..08c28d5aac 100644 ---- a/lnet/lnet/api-ni.c -+++ b/lnet/lnet/api-ni.c -@@ -4204,9 +4204,10 @@ LNetCtl(unsigned int cmd, void *arg) - return -EINVAL; - - mutex_lock(&the_lnet.ln_api_mutex); -- rc = lnet_add_peer_ni(cfg->prcfg_prim_nid, -- cfg->prcfg_cfg_nid, -- cfg->prcfg_mr, false); -+ lnet_nid4_to_nid(cfg->prcfg_cfg_nid, &nid); -+ rc = lnet_user_add_peer_ni(cfg->prcfg_prim_nid, -+ &nid, -+ cfg->prcfg_mr); - mutex_unlock(&the_lnet.ln_api_mutex); - return rc; - } -diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c -index 01eb9aa8aa..040fa36d34 100644 ---- a/lnet/lnet/peer.c -+++ b/lnet/lnet/peer.c -@@ -47,6 +47,8 @@ - #define LNET_REDISCOVER_PEER (1) - - static int lnet_peer_queue_for_discovery(struct lnet_peer *lp); -+static int lnet_add_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, bool mr, -+ unsigned int flags); - - static void - lnet_peer_remove_from_remote_list(struct lnet_peer_ni *lpni) -@@ -1428,7 +1430,8 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - - if (!pnid) { - pnid = nids[i]; -- rc = lnet_add_peer_ni(pnid, LNET_NID_ANY, mr, true); -+ rc = lnet_add_peer_ni(pnid, LNET_NID_ANY, mr, -+ LNET_PEER_LOCK_PRIMARY); - if (rc == -EALREADY) { - struct lnet_peer *lp; - -@@ -1443,9 +1446,11 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - lnet_peer_decref_locked(lp); - } - } else if (lnet_peer_discovery_disabled) { -- rc = lnet_add_peer_ni(nids[i], LNET_NID_ANY, mr, true); -+ rc = lnet_add_peer_ni(nids[i], LNET_NID_ANY, mr, -+ LNET_PEER_LOCK_PRIMARY); - } else { -- rc = lnet_add_peer_ni(pnid, nids[i], mr, true); -+ rc = lnet_add_peer_ni(pnid, nids[i], mr, -+ LNET_PEER_LOCK_PRIMARY); - } - - if (rc && rc != -EEXIST) -@@ -1977,20 +1982,18 @@ out: - * The caller must hold ln_api_mutex. This prevents the peer from - * being created/modified/deleted by a different thread. - */ --int --lnet_add_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, bool mr, bool temp) -+static int -+lnet_add_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, bool mr, -+ unsigned int flags) -+__must_hold(&the_lnet.ln_api_mutex) - { - struct lnet_peer *lp = NULL; - struct lnet_peer_ni *lpni; -- unsigned int flags = 0; - - /* The prim_nid must always be specified */ - if (prim_nid == LNET_NID_ANY) - return -EINVAL; - -- if (!temp) -- flags = LNET_PEER_CONFIGURED; -- - if (mr) - flags |= LNET_PEER_MULTI_RAIL; - -@@ -2008,13 +2011,6 @@ lnet_add_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, bool mr, bool temp) - lnet_peer_ni_decref_locked(lpni); - lp = lpni->lpni_peer_net->lpn_peer; - -- /* Peer must have been configured. */ -- if (!temp && !(lp->lp_state & LNET_PEER_CONFIGURED)) { -- CDEBUG(D_NET, "peer %s was not configured\n", -- libcfs_nid2str(prim_nid)); -- return -ENOENT; -- } -- - /* Primary NID must match */ - if (lnet_nid_to_nid4(&lp->lp_primary_nid) != prim_nid) { - CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n", -@@ -2030,9 +2026,24 @@ lnet_add_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, bool mr, bool temp) - return -EPERM; - } - -+ if ((flags & LNET_PEER_LOCK_PRIMARY) && -+ (lnet_peer_is_uptodate(lp) && -+ (lp->lp_state & LNET_PEER_LOCK_PRIMARY))) { -+ CDEBUG(D_NET, -+ "Don't add temporary peer NI for uptodate peer %s\n", -+ libcfs_nidstr(&lp->lp_primary_nid)); -+ return -EINVAL; -+ } -+ - return lnet_peer_add_nid(lp, nid, flags); - } - -+int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr) -+{ -+ return lnet_add_peer_ni(prim_nid, lnet_nid_to_nid4(nid), mr, -+ LNET_PEER_CONFIGURED); -+} -+ - /* - * Implementation of IOC_LIBCFS_DEL_PEER_NI. - * --- -2.33.0 - diff --git a/0054-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch b/0016-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch similarity index 94% rename from 0054-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch rename to 0016-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch index 66ec0a25a3813268d32a6492c693ab171071b736..c057415661af45967a66618899c6715f0d7032b3 100644 --- a/0054-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch +++ b/0016-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch @@ -1,7 +1,7 @@ -From 24eaacb00262fe64001255f274f28e8a3837349a Mon Sep 17 00:00:00 2001 +From d7343c2f50a590b4f31a33da432903b877956f83 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Mon, 13 Sep 2021 10:35:30 -0600 -Subject: [PATCH 54/61] LU-14992 tests: sanity/replay-vbr mkdir on MDT0 +Subject: [PATCH 16/23] LU-14992 tests: sanity/replay-vbr mkdir on MDT0 Replace mkdir with mkdir_on_mdt0() for sanity test 133a and relay-vbr test 7a. These tests expect the newly @@ -64,10 +64,10 @@ index 4c0f697494..2c785c459e 100755 run_test 7a "create, {lost}, create" diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index a004738552..3ebb944ab2 100755 +index 0df5419d5f..2dd6ca3054 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh -@@ -14092,21 +14092,31 @@ check_stats() { +@@ -14125,21 +14125,31 @@ check_stats() { local want=${3:-0} local res @@ -108,7 +108,7 @@ index a004738552..3ebb944ab2 100755 fi } -@@ -14126,8 +14136,11 @@ test_133a() { +@@ -14159,8 +14169,11 @@ test_133a() { do_facet ost1 $LCTL set_param obdfilter.*.stats=clear # verify mdt stats first. @@ -121,7 +121,7 @@ index a004738552..3ebb944ab2 100755 touch ${testdir}/${tfile} || error "touch failed" check_stats $SINGLEMDS "open" 1 check_stats $SINGLEMDS "close" 1 -@@ -14167,7 +14180,8 @@ test_133b() { +@@ -14200,7 +14213,8 @@ test_133b() { local testdir=$DIR/${tdir}/stats_testdir @@ -131,7 +131,7 @@ index a004738552..3ebb944ab2 100755 touch ${testdir}/${tfile} || error "touch failed" cancel_lru_locks mdc -@@ -14322,12 +14336,12 @@ test_133d() { +@@ -14355,12 +14369,12 @@ test_133d() { local testdir1=$DIR/${tdir}/stats_testdir1 local testdir2=$DIR/${tdir}/stats_testdir2 diff --git a/0017-LU-14668-lnet-don-t-delete-peer-created-by-Lustre.patch b/0017-LU-14668-lnet-don-t-delete-peer-created-by-Lustre.patch deleted file mode 100644 index 9e6098db4ef95024c4e2b76ed6acb71454c7247b..0000000000000000000000000000000000000000 --- a/0017-LU-14668-lnet-don-t-delete-peer-created-by-Lustre.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 26d11f254795a2869ae30a7e5d6ebf2bee59f879 Mon Sep 17 00:00:00 2001 -From: Amir Shehata -Date: Wed, 5 May 2021 23:02:22 -0700 -Subject: [PATCH 17/61] LU-14668 lnet: don't delete peer created by Lustre - -Peers created by Lustre have their primary NIDs locked. -If that peer is deleted, it'll confuse lustre. So when manually -deleting a peer using: - lnetctl peer del --prim_nid ... -We must continue to preserve the primary NID. Therefore we delete -all the constituent NIDs, but keep the primary NID. We then -flag the peer for rediscovery. - -Lustre-change: https://review.whamcloud.com/43565 -Lustre-commit: 7cc5b4329fc2eecbf09dbda85efe58f4ad5a32b9 - -Signed-off-by: Amir Shehata -Change-Id: I34eef9b0049435a01fde87dc8263dd50f631c551 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51132 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lnet/lnet/peer.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 47 insertions(+), 2 deletions(-) - -diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c -index 040fa36d34..3b45639b19 100644 ---- a/lnet/lnet/peer.c -+++ b/lnet/lnet/peer.c -@@ -2044,6 +2044,43 @@ int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr) - LNET_PEER_CONFIGURED); - } - -+static int -+lnet_reset_peer(struct lnet_peer *lp) -+{ -+ struct lnet_peer_net *lpn, *lpntmp; -+ struct lnet_peer_ni *lpni, *lpnitmp; -+ unsigned int flags; -+ int rc; -+ -+ lnet_peer_cancel_discovery(lp); -+ -+ flags = LNET_PEER_CONFIGURED; -+ if (lp->lp_state & LNET_PEER_MULTI_RAIL) -+ flags |= LNET_PEER_MULTI_RAIL; -+ -+ list_for_each_entry_safe(lpn, lpntmp, &lp->lp_peer_nets, -+ lpn_peer_nets) { -+ list_for_each_entry_safe(lpni, lpnitmp, &lpn->lpn_peer_nis, -+ lpni_peer_nis) { -+ if (nid_same(&lpni->lpni_nid, &lp->lp_primary_nid)) -+ continue; -+ -+ rc = lnet_peer_del_nid(lp, -+ lnet_nid_to_nid4(&lpni->lpni_nid), -+ flags); -+ if (rc) { -+ CERROR("Failed to delete %s from peer %s\n", -+ libcfs_nidstr(&lpni->lpni_nid), -+ libcfs_nidstr(&lp->lp_primary_nid)); -+ } -+ } -+ } -+ -+ /* mark it for discovery the next time we use it */ -+ lp->lp_state &= ~LNET_PEER_NIDS_UPTODATE; -+ return 0; -+} -+ - /* - * Implementation of IOC_LIBCFS_DEL_PEER_NI. - * -@@ -2087,8 +2124,16 @@ lnet_del_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid) - } - lnet_net_unlock(LNET_LOCK_EX); - -- if (nid == LNET_NID_ANY || nid == lnet_nid_to_nid4(&lp->lp_primary_nid)) -- return lnet_peer_del(lp); -+ if (nid == LNET_NID_ANY || -+ nid == lnet_nid_to_nid4(&lp->lp_primary_nid)) { -+ if (lp->lp_state & LNET_PEER_LOCK_PRIMARY) { -+ CERROR("peer %s created by Lustre. Must preserve primary NID, but will remove other NIDs\n", -+ libcfs_nidstr(&lp->lp_primary_nid)); -+ return lnet_reset_peer(lp); -+ } else { -+ return lnet_peer_del(lp); -+ } -+ } - - flags = LNET_PEER_CONFIGURED; - if (lp->lp_state & LNET_PEER_MULTI_RAIL) --- -2.33.0 - diff --git a/0057-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch b/0017-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch similarity index 94% rename from 0057-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch rename to 0017-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch index c6a519dc3ede4d4f2ffbc2c72061d4144511604e..cf8d0e63dac6fafaa3243349e1a6b13932a9bcee 100644 --- a/0057-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch +++ b/0017-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch @@ -1,7 +1,7 @@ -From 6b25f2b394f1d1e83963fa9dcba5a40015e672a4 Mon Sep 17 00:00:00 2001 +From 9fa378568014fa8451364210c9f625e4fb8e808c Mon Sep 17 00:00:00 2001 From: Etienne AUJAMES Date: Wed, 22 Feb 2023 11:37:49 +0100 -Subject: [PATCH 57/61] LU-16571 utils: fix parallel "lfs migrate -b" on hard +Subject: [PATCH 17/23] LU-16571 utils: fix parallel "lfs migrate -b" on hard links Multiple blocking "lfs migrate" on the same file can exhaust "ost" @@ -46,7 +46,7 @@ Reviewed-by: Patrick Farrell 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 76f261b2d1..70f43a2dcd 100755 +index 2dd6ca3054..ed0b42821c 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -7874,6 +7874,44 @@ test_56xg() { @@ -95,10 +95,10 @@ index 76f261b2d1..70f43a2dcd 100755 [ $MDS1_VERSION -lt $(version_code 2.4.53) ] && skip "No HSM $(lustre_build_version $SINGLEMDS) MDS < 2.4.53" diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c -index 7946d9e050..4ae2a5f098 100644 +index 95780b9c23..57a68fc994 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c -@@ -900,31 +900,34 @@ static int migrate_block(int fd, int fdv) +@@ -901,31 +901,34 @@ static int migrate_block(int fd, int fdv) int rc; int rc2; diff --git a/0058-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch b/0018-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch similarity index 92% rename from 0058-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch rename to 0018-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch index 9702f9bf13d762f7305a0967b47f977e515690d9..85c26522909b324d03dbc3e7c8f7073d3f69afc3 100644 --- a/0058-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch +++ b/0018-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch @@ -1,7 +1,7 @@ -From 827664003a452e249ed423cb2113dbbbae28e3a9 Mon Sep 17 00:00:00 2001 +From 6538a85dcd846ff983111caf86be35b39d7f1041 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Fri, 9 Dec 2022 16:31:13 +1100 -Subject: [PATCH 58/61] LU-14073 ldiskfs: don't test LDISKFS_IOC_FSSETXATTR +Subject: [PATCH 18/23] LU-14073 ldiskfs: don't test LDISKFS_IOC_FSSETXATTR EXT4_IOC_FSSETXATTR was removed upstream in Linux 5.9, Commit cb29a02d3a9d ("ext4: use generic names for generic ioctls"). diff --git a/0018-LU-14668-lnet-add-force-option-to-lnetctl-peer-del.patch b/0018-LU-14668-lnet-add-force-option-to-lnetctl-peer-del.patch deleted file mode 100644 index e007e314e07faf4f96a18a8c0aee7809d48cf57f..0000000000000000000000000000000000000000 --- a/0018-LU-14668-lnet-add-force-option-to-lnetctl-peer-del.patch +++ /dev/null @@ -1,375 +0,0 @@ -From 8c4df87ec21bf5d61dab4b6580fc7f7ecfa91e37 Mon Sep 17 00:00:00 2001 -From: Serguei Smirnov -Date: Mon, 27 Feb 2023 15:41:19 -0800 -Subject: [PATCH 18/61] LU-14668 lnet: add 'force' option to lnetctl peer del - -Add --force option to 'lnetctl peer del' command. -If the peer has primary NID locked, this option allows -for the peer to be deleted manually: - lnetctl peer del --prim_nid --force - -Add --prim_lock option to 'lnetctl peer add' command. -If specified, the primary NID of the peer is locked -such that it is going to be the NID used to identify -the peer in communications with Lustre layer. - -Lustre-change: https://review.whamcloud.com/50149 -Lustre-commit: f1b2d8d60c593a670b36006bcf9b040549d8c13a - -Test-Parameters: trivial -Signed-off-by: Serguei Smirnov -Change-Id: Ia6001856cfbce7b0c3288cff9b244b569d259647 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51133 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lnet/include/lnet/lib-lnet.h | 5 +++-- - lnet/include/uapi/linux/lnet/lnet-dlc.h | 4 +++- - lnet/lnet/api-ni.c | 6 +++-- - lnet/lnet/peer.c | 12 +++++----- - lnet/utils/lnetconfig/liblnetconfig.c | 24 +++++++++++--------- - lnet/utils/lnetconfig/liblnetconfig.h | 5 +++-- - lnet/utils/lnetctl.c | 29 +++++++++++++++++++++---- - lustre/doc/lnetctl.8 | 6 +++++ - lustre/tests/sanity-lnet.sh | 18 +++++++++++++++ - 9 files changed, 83 insertions(+), 26 deletions(-) - -diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h -index a1261d137d..5805586fb2 100644 ---- a/lnet/include/lnet/lib-lnet.h -+++ b/lnet/include/lnet/lib-lnet.h -@@ -1011,8 +1011,9 @@ void lnet_peer_clr_pref_rtrs(struct lnet_peer_ni *lpni); - int lnet_peer_add_pref_rtr(struct lnet_peer_ni *lpni, struct lnet_nid *nid); - int lnet_peer_ni_set_non_mr_pref_nid(struct lnet_peer_ni *lpni, - struct lnet_nid *nid); --int lnet_del_peer_ni(lnet_nid_t key_nid, lnet_nid_t nid); --int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr); -+int lnet_del_peer_ni(lnet_nid_t key_nid, lnet_nid_t nid, int force); -+int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr, -+ bool lock_prim); - int lnet_get_peer_info(struct lnet_ioctl_peer_cfg *cfg, void __user *bulk); - int lnet_get_peer_ni_info(__u32 peer_index, __u64 *nid, - char alivness[LNET_MAX_STR_LEN], -diff --git a/lnet/include/uapi/linux/lnet/lnet-dlc.h b/lnet/include/uapi/linux/lnet/lnet-dlc.h -index 2b2c05fa3b..6718f34d93 100644 ---- a/lnet/include/uapi/linux/lnet/lnet-dlc.h -+++ b/lnet/include/uapi/linux/lnet/lnet-dlc.h -@@ -273,7 +273,9 @@ struct lnet_ioctl_peer_cfg { - struct libcfs_ioctl_hdr prcfg_hdr; - lnet_nid_t prcfg_prim_nid; - lnet_nid_t prcfg_cfg_nid; -- __u32 prcfg_count; -+ __u32 prcfg_count; /* ADD_PEER_NI: used for 'lock_prim' option -+ * DEL_PEER_NI: used for 'force' option -+ */ - __u32 prcfg_mr; - __u32 prcfg_state; - __u32 prcfg_size; -diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c -index 08c28d5aac..3a56ea83a1 100644 ---- a/lnet/lnet/api-ni.c -+++ b/lnet/lnet/api-ni.c -@@ -4207,7 +4207,8 @@ LNetCtl(unsigned int cmd, void *arg) - lnet_nid4_to_nid(cfg->prcfg_cfg_nid, &nid); - rc = lnet_user_add_peer_ni(cfg->prcfg_prim_nid, - &nid, -- cfg->prcfg_mr); -+ cfg->prcfg_mr, -+ cfg->prcfg_count == 1); - mutex_unlock(&the_lnet.ln_api_mutex); - return rc; - } -@@ -4220,7 +4221,8 @@ LNetCtl(unsigned int cmd, void *arg) - - mutex_lock(&the_lnet.ln_api_mutex); - rc = lnet_del_peer_ni(cfg->prcfg_prim_nid, -- cfg->prcfg_cfg_nid); -+ cfg->prcfg_cfg_nid, -+ cfg->prcfg_count); - mutex_unlock(&the_lnet.ln_api_mutex); - return rc; - } -diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c -index 3b45639b19..33a16f8470 100644 ---- a/lnet/lnet/peer.c -+++ b/lnet/lnet/peer.c -@@ -2038,10 +2038,12 @@ __must_hold(&the_lnet.ln_api_mutex) - return lnet_peer_add_nid(lp, nid, flags); - } - --int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr) -+int lnet_user_add_peer_ni(lnet_nid_t prim_nid, struct lnet_nid *nid, bool mr, -+ bool lock_prim) - { -- return lnet_add_peer_ni(prim_nid, lnet_nid_to_nid4(nid), mr, -- LNET_PEER_CONFIGURED); -+ int fl = LNET_PEER_CONFIGURED | (LNET_PEER_LOCK_PRIMARY * lock_prim); -+ -+ return lnet_add_peer_ni(prim_nid, lnet_nid_to_nid4(nid), mr, fl); - } - - static int -@@ -2093,7 +2095,7 @@ lnet_reset_peer(struct lnet_peer *lp) - * being modified/deleted by a different thread. - */ - int --lnet_del_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid) -+lnet_del_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid, int force) - { - struct lnet_peer *lp; - struct lnet_peer_ni *lpni; -@@ -2126,7 +2128,7 @@ lnet_del_peer_ni(lnet_nid_t prim_nid, lnet_nid_t nid) - - if (nid == LNET_NID_ANY || - nid == lnet_nid_to_nid4(&lp->lp_primary_nid)) { -- if (lp->lp_state & LNET_PEER_LOCK_PRIMARY) { -+ if (!force && lp->lp_state & LNET_PEER_LOCK_PRIMARY) { - CERROR("peer %s created by Lustre. Must preserve primary NID, but will remove other NIDs\n", - libcfs_nidstr(&lp->lp_primary_nid)); - return lnet_reset_peer(lp); -diff --git a/lnet/utils/lnetconfig/liblnetconfig.c b/lnet/utils/lnetconfig/liblnetconfig.c -index 9f0dabd903..bbf5d3824a 100644 ---- a/lnet/utils/lnetconfig/liblnetconfig.c -+++ b/lnet/utils/lnetconfig/liblnetconfig.c -@@ -630,7 +630,7 @@ int lustre_lnet_discover_nid(char *ping_nids, int force, int seq_no, - } - - static int lustre_lnet_handle_peer_nidlist(lnet_nid_t *nidlist, int num_nids, -- bool is_mr, __u32 cmd, -+ bool is_mr, int option, __u32 cmd, - char *cmd_type, char *err_str) - { - struct lnet_ioctl_peer_cfg data; -@@ -645,6 +645,7 @@ static int lustre_lnet_handle_peer_nidlist(lnet_nid_t *nidlist, int num_nids, - data.prcfg_mr = is_mr; - data.prcfg_prim_nid = nidlist[0]; - data.prcfg_cfg_nid = LNET_NID_ANY; -+ data.prcfg_count = option; - - rc = dispatch_peer_ni_cmd(cmd, &data, err_str, cmd_type); - -@@ -660,6 +661,7 @@ static int lustre_lnet_handle_peer_nidlist(lnet_nid_t *nidlist, int num_nids, - data.prcfg_mr = is_mr; - data.prcfg_prim_nid = nidlist[0]; - data.prcfg_cfg_nid = nidlist[nid_idx]; -+ data.prcfg_count = option; - - rc = dispatch_peer_ni_cmd(cmd, &data, err_str, cmd_type); - -@@ -675,6 +677,7 @@ static int lustre_lnet_handle_peer_nidlist(lnet_nid_t *nidlist, int num_nids, - LIBCFS_IOC_INIT_V2(data, prcfg_hdr); - data.prcfg_prim_nid = nidlist[0]; - data.prcfg_cfg_nid = LNET_NID_ANY; -+ data.prcfg_count = option; - - rc = dispatch_peer_ni_cmd(cmd, &data, err_str, cmd_type); - } -@@ -684,8 +687,8 @@ static int lustre_lnet_handle_peer_nidlist(lnet_nid_t *nidlist, int num_nids, - - static int - lustre_lnet_mod_peer_nidlist(lnet_nid_t pnid, lnet_nid_t *lnet_nidlist, -- int cmd, int num_nids, bool is_mr, int seq_no, -- struct cYAML **err_rc) -+ int cmd, int num_nids, bool is_mr, int option, -+ int seq_no, struct cYAML **err_rc) - { - int rc = LUSTRE_CFG_RC_NO_ERR; - char err_str[LNET_MAX_STR_LEN]; -@@ -706,8 +709,8 @@ lustre_lnet_mod_peer_nidlist(lnet_nid_t pnid, lnet_nid_t *lnet_nidlist, - (num_nids - 1)); - - rc = lustre_lnet_handle_peer_nidlist(lnet_nidlist2, -- num_nids, is_mr, ioc_cmd, -- cmd_str, err_str); -+ num_nids, is_mr, option, -+ ioc_cmd, cmd_str, err_str); - out: - if (lnet_nidlist2) - free(lnet_nidlist2); -@@ -734,8 +737,8 @@ replace_sep(char *str, char sep, char newsep) - } - } - --int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr, -- int cmd, int seq_no, struct cYAML **err_rc) -+int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr, int cmd, -+ int option, int seq_no, struct cYAML **err_rc) - { - int num_nids, rc; - char err_str[LNET_MAX_STR_LEN] = "Error"; -@@ -774,7 +777,7 @@ int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr, - - rc = lustre_lnet_mod_peer_nidlist(pnid, lnet_nidlist, - cmd, num_nids, is_mr, -- -1, err_rc); -+ option, -1, err_rc); - - out: - if (rc != LUSTRE_CFG_RC_NO_ERR) -@@ -4696,6 +4699,7 @@ static int handle_yaml_peer_common(struct cYAML *tree, struct cYAML **show_rc, - struct cYAML *seq_no, *prim_nid, *mr, *peer_nis; - lnet_nid_t lnet_nidlist[LNET_MAX_NIDS_PER_PEER]; - lnet_nid_t pnid = LNET_NID_ANY; -+ int force = 0; - - seq_no = cYAML_get_object_item(tree, "seq_no"); - seqn = seq_no ? seq_no->cy_valueint : -1; -@@ -4762,8 +4766,8 @@ static int handle_yaml_peer_common(struct cYAML *tree, struct cYAML **show_rc, - } - - rc = lustre_lnet_mod_peer_nidlist(pnid, lnet_nidlist, cmd, -- num_nids, mr_value, seqn, -- err_rc); -+ num_nids, mr_value, force, -+ seqn, err_rc); - - failed: - if (nidstr) -diff --git a/lnet/utils/lnetconfig/liblnetconfig.h b/lnet/utils/lnetconfig/liblnetconfig.h -index 5096ac0c60..2c5397dce3 100644 ---- a/lnet/utils/lnetconfig/liblnetconfig.h -+++ b/lnet/utils/lnetconfig/liblnetconfig.h -@@ -664,11 +664,12 @@ int lustre_lnet_reset_stats(int seq_no, struct cYAML **err_rc); - * nids - a comma separated string of nids - * is_mr - Specifies whether this peer is MR capable. - * cmd - CONFIG or DELETE -+ * force - whether force-deleting a peer with locked primary nid - * seq_no - sequence number of the command - * err_rc - YAML structure of the resultant return code - */ --int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr, -- int cmd, int seq_no, struct cYAML **err_rc); -+int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr, int cmd, -+ int force, int seq_no, struct cYAML **err_rc); - - /* - * lustre_lnet_show_peer -diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c -index 51dfab605e..0f89e206e8 100644 ---- a/lnet/utils/lnetctl.c -+++ b/lnet/utils/lnetctl.c -@@ -258,12 +258,14 @@ command_t peer_cmds[] = { - "\t--prim_nid: Primary NID of the peer.\n" - "\t--nid: one or more peer NIDs\n" - "\t--non_mr: create this peer as not Multi-Rail capable\n" -- "\t--ip2nets: specify a range of nids per peer"}, -+ "\t--ip2nets: specify a range of nids per peer\n" -+ "\t--lock_prim: lock primary nid\n"}, - {"del", jt_del_peer_nid, 0, "delete a peer NID\n" - "\t--prim_nid: Primary NID of the peer.\n" - "\t--nid: list of NIDs to remove. If none provided,\n" - "\t peer is deleted\n" -- "\t--ip2nets: specify a range of nids per peer"}, -+ "\t--ip2nets: specify a range of nids per peer\n" -+ "\t--force: force-delete locked primary NID\n"}, - {"show", jt_show_peer, 0, "show peer information\n" - "\t--nid: NID of peer to filter on.\n" - "\t--verbose: display detailed output per peer." -@@ -2082,12 +2084,15 @@ static int jt_peer_nid_common(int argc, char **argv, int cmd) - char *prim_nid = NULL, *nidstr = NULL; - char err_str[LNET_MAX_STR_LEN] = "Error"; - struct cYAML *err_rc = NULL; -+ int force_lock = 0; - -- const char *const short_opts = "k:mn:"; -+ const char *const short_opts = "k:m:n:f:l"; - const struct option long_opts[] = { - { .name = "prim_nid", .has_arg = required_argument, .val = 'k' }, - { .name = "non_mr", .has_arg = no_argument, .val = 'm' }, - { .name = "nid", .has_arg = required_argument, .val = 'n' }, -+ { .name = "force", .has_arg = no_argument, .val = 'f' }, -+ { .name = "lock_prim", .has_arg = no_argument, .val = 'l' }, - { .name = NULL } }; - - rc = check_cmd(peer_cmds, "peer", "add", 2, argc, argv); -@@ -2112,6 +2117,22 @@ static int jt_peer_nid_common(int argc, char **argv, int cmd) - } - is_mr = false; - break; -+ case 'f': -+ if (cmd == LNETCTL_ADD_CMD) { -+ rc = LUSTRE_CFG_RC_BAD_PARAM; -+ snprintf(err_str, LNET_MAX_STR_LEN, -+ "Unrecognized option '-%c'", opt); -+ } -+ force_lock = 1; -+ break; -+ case 'l': -+ if (cmd == LNETCTL_DEL_CMD) { -+ rc = LUSTRE_CFG_RC_BAD_PARAM; -+ snprintf(err_str, LNET_MAX_STR_LEN, -+ "Unrecognized option '-%c'", opt); -+ } -+ force_lock = 1; -+ break; - case '?': - print_help(peer_cmds, "peer", - cmd == LNETCTL_ADD_CMD ? "add" : "del"); -@@ -2121,7 +2142,7 @@ static int jt_peer_nid_common(int argc, char **argv, int cmd) - } - - rc = lustre_lnet_modify_peer(prim_nid, nidstr, is_mr, cmd, -- -1, &err_rc); -+ force_lock, -1, &err_rc); - if (rc != LUSTRE_CFG_RC_NO_ERR) - goto out; - -diff --git a/lustre/doc/lnetctl.8 b/lustre/doc/lnetctl.8 -index f2a2793825..0df13e2493 100644 ---- a/lustre/doc/lnetctl.8 -+++ b/lustre/doc/lnetctl.8 -@@ -125,6 +125,9 @@ Configure an LNET peer with at least one supplied NID\. The primary NID must be - \-\-non_mr: create this peer as not Multi-Rail capable\. - . - .br -+\-\-lock_prim: lock primary NID of the peer for the purpose of identification with Lustre\. -+. -+.br - - .TP - \fBlnetctl peer\fR del -@@ -139,6 +142,9 @@ Delete a peer NID. The primary NID must be specified. If the removed NID is th - \-\-prim_nid: Primary NID of the peer\. - . - .br -+\-\-force: optional, use to delete a peer with primary NID locked\. -+. -+.br - - .TP - \fBlnetctl peer\fR show -diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh -index 367cb19d15..4af5e96ef8 100755 ---- a/lustre/tests/sanity-lnet.sh -+++ b/lustre/tests/sanity-lnet.sh -@@ -932,6 +932,24 @@ EOF - } - run_test 25 "Delete all secondary nids from peer (tcp, gni and o2ib)" - -+test_26() { -+ reinit_dlc || return $? -+ -+ do_lnetctl peer add --prim_nid 1.1.1.1@tcp --lock_prim || -+ error "Peer add with --lock_prim option failed $?" -+ do_lnetctl peer del --prim_nid 1.1.1.1@tcp || -+ error "Peer del failed $?" -+ $LNETCTL peer show --nid 1.1.1.1@tcp | grep -q 1.1.1.1@tcp || -+ error "1.1.1.1@tcp is not listed" -+ do_lnetctl peer del --prim_nid 1.1.1.1@tcp --force || -+ error "Peer del --force failed $?" -+ do_lnetctl peer show --nid 1.1.1.1@tcp && -+ error "failed to delete 1.1.1.1@tcp" -+ -+ return 0 -+} -+run_test 26 "Delete peer with primary nid locked" -+ - test_99a() { - reinit_dlc || return $? - --- -2.33.0 - diff --git a/0019-LU-14668-lnet-add-lock_prim_nid-lnet-module-paramete.patch b/0019-LU-14668-lnet-add-lock_prim_nid-lnet-module-paramete.patch deleted file mode 100644 index 5b41c683d88b92f89cda9652ef901087717a0db4..0000000000000000000000000000000000000000 --- a/0019-LU-14668-lnet-add-lock_prim_nid-lnet-module-paramete.patch +++ /dev/null @@ -1,245 +0,0 @@ -From 6cfc8e55a2e77c9c91b81a8842e2cbd886025298 Mon Sep 17 00:00:00 2001 -From: Serguei Smirnov -Date: Tue, 28 Feb 2023 15:02:20 -0800 -Subject: [PATCH 19/61] LU-14668 lnet: add 'lock_prim_nid" lnet module - parameter - -Add 'lock_prim_nid' lnet module parameter to allow control -of how Lustre peer primary NID is selected. -If set to 1 (default), the NID specified by Lustre when -calling LNet API is designated as primary for the peer, -allowing for non-blocking discovery in the background. -If set to 0, peer discovery is blocking until complete -and the NID listed first in discovery response is designated -as primary. - -Lustre-change: https://review.whamcloud.com/50159 -Lustre-commit: fc7a0d6013b46ebc17cdfdccc04a5d1d92c6af24 - -Signed-off-by: Serguei Smirnov -Change-Id: I6ed1cb0c637f4aa7a7340a6f01819ba9a85858f4 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51134 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lnet/include/lnet/lib-lnet.h | 1 + - lnet/lnet/api-ni.c | 5 ++ - lnet/lnet/peer.c | 106 +++++++++++++++++++++++------------ - 3 files changed, 75 insertions(+), 37 deletions(-) - -diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h -index 5805586fb2..5821d20be2 100644 ---- a/lnet/include/lnet/lib-lnet.h -+++ b/lnet/include/lnet/lib-lnet.h -@@ -615,6 +615,7 @@ extern int alive_router_check_interval; - extern int live_router_check_interval; - extern int dead_router_check_interval; - extern int portal_rotor; -+extern int lock_prim_nid; - - void lnet_mt_event_handler(struct lnet_event *event); - -diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c -index 3a56ea83a1..fa7d702c2f 100644 ---- a/lnet/lnet/api-ni.c -+++ b/lnet/lnet/api-ni.c -@@ -243,6 +243,11 @@ module_param_call(lnet_response_tracking, response_tracking_set, param_get_int, - MODULE_PARM_DESC(lnet_response_tracking, - "(0|1|2|3) LNet Internal Only|GET Reply only|PUT ACK only|Full Tracking (default)"); - -+int lock_prim_nid = 1; -+module_param(lock_prim_nid, int, 0444); -+MODULE_PARM_DESC(lock_prim_nid, -+ "Whether nid passed down by Lustre is locked as primary"); -+ - #define LNET_LND_TIMEOUT_DEFAULT ((LNET_TRANSACTION_TIMEOUT_DEFAULT - 1) / \ - (LNET_RETRY_COUNT_DEFAULT + 1)) - unsigned int lnet_lnd_timeout = LNET_LND_TIMEOUT_DEFAULT; -diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c -index 33a16f8470..4eb7a44cf4 100644 ---- a/lnet/lnet/peer.c -+++ b/lnet/lnet/peer.c -@@ -1411,6 +1411,7 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - lnet_nid_t pnid = 0; - bool mr; - int i, rc; -+ int flags = lock_prim_nid ? LNET_PEER_LOCK_PRIMARY : 0; - - if (!nids || num_nids < 1) - return -EINVAL; -@@ -1431,7 +1432,7 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - if (!pnid) { - pnid = nids[i]; - rc = lnet_add_peer_ni(pnid, LNET_NID_ANY, mr, -- LNET_PEER_LOCK_PRIMARY); -+ flags); - if (rc == -EALREADY) { - struct lnet_peer *lp; - -@@ -1447,10 +1448,10 @@ LNetAddPeer(lnet_nid_t *nids, __u32 num_nids) - } - } else if (lnet_peer_discovery_disabled) { - rc = lnet_add_peer_ni(nids[i], LNET_NID_ANY, mr, -- LNET_PEER_LOCK_PRIMARY); -+ flags); - } else { - rc = lnet_add_peer_ni(pnid, nids[i], mr, -- LNET_PEER_LOCK_PRIMARY); -+ flags); - } - - if (rc && rc != -EEXIST) -@@ -1493,37 +1494,54 @@ LNetPrimaryNID(lnet_nid_t nid) - * down then this discovery can introduce long delays into the mount - * process, so skip it if it isn't necessary. - */ -+again: - spin_lock(&lp->lp_lock); -- if (!lnet_peer_discovery_disabled && -- (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY) || -- !lnet_peer_is_uptodate_locked(lp))) { -- /* force a full discovery cycle */ -- lp->lp_state |= LNET_PEER_FORCE_PING | LNET_PEER_FORCE_PUSH | -- LNET_PEER_LOCK_PRIMARY; -+ if (!(lp->lp_state & LNET_PEER_LOCK_PRIMARY) && lock_prim_nid) -+ lp->lp_state |= LNET_PEER_LOCK_PRIMARY; -+ -+ /* DD disabled, nothing to do */ -+ if (lnet_peer_discovery_disabled) { -+ nid = lnet_nid_to_nid4(&lp->lp_primary_nid); - spin_unlock(&lp->lp_lock); -+ goto out_decref; -+ } - -- /* start discovery in the background. Messages to that -- * peer will not go through until the discovery is -- * complete -- */ -- rc = lnet_discover_peer_locked(lpni, cpt, false); -- if (rc) -- goto out_decref; -- /* The lpni (or lp) for this NID may have changed and our ref is -- * the only thing keeping the old one around. Release the ref -- * and lookup the lpni again -- */ -- lnet_peer_ni_decref_locked(lpni); -- lpni = lnet_find_peer_ni_locked(nid); -- if (!lpni) { -- rc = -ENOENT; -- goto out_unlock; -- } -- lp = lpni->lpni_peer_net->lpn_peer; -- } else { -+ /* Peer already up to date, nothing to do */ -+ if (lnet_peer_is_uptodate_locked(lp)) { -+ nid = lnet_nid_to_nid4(&lp->lp_primary_nid); - spin_unlock(&lp->lp_lock); -+ goto out_decref; -+ } -+ spin_unlock(&lp->lp_lock); -+ -+ /* If primary nid locking is enabled, discovery is performed -+ * in the background. -+ * If primary nid locking is disabled, discovery blocks here. -+ * Messages to the peer will not go through until the discovery is -+ * complete. -+ */ -+ if (lock_prim_nid) -+ rc = lnet_discover_peer_locked(lpni, cpt, false); -+ else -+ rc = lnet_discover_peer_locked(lpni, cpt, true); -+ if (rc) -+ goto out_decref; -+ -+ /* The lpni (or lp) for this NID may have changed and our ref is -+ * the only thing keeping the old one around. Release the ref -+ * and lookup the lpni again -+ */ -+ lnet_peer_ni_decref_locked(lpni); -+ lpni = lnet_find_peer_ni_locked(nid); -+ if (!lpni) { -+ rc = -ENOENT; -+ goto out_unlock; - } -- primary_nid = lnet_nid_to_nid4(&lp->lp_primary_nid); -+ lp = lpni->lpni_peer_net->lpn_peer; -+ -+ if (!lock_prim_nid && !lnet_is_discovery_disabled(lp)) -+ goto again; -+ nid = lnet_nid_to_nid4(&lp->lp_primary_nid); - out_decref: - lnet_peer_ni_decref_locked(lpni); - out_unlock: -@@ -1614,7 +1632,6 @@ lnet_peer_attach_peer_ni(struct lnet_peer *lp, - ptable->pt_peers++; - } - -- - /* Update peer state */ - spin_lock(&lp->lp_lock); - if (flags & LNET_PEER_CONFIGURED) { -@@ -1692,10 +1709,8 @@ lnet_peer_add(lnet_nid_t nid4, unsigned int flags) - rc = -EPERM; - goto out; - } else if (lp->lp_state & LNET_PEER_LOCK_PRIMARY) { -- if (nid_same(&lp->lp_primary_nid, &nid)) { -+ if (nid_same(&lp->lp_primary_nid, &nid)) - rc = -EEXIST; -- goto out; -- } - /* we're trying to recreate an existing peer which - * has already been created and its primary - * locked. This is likely due to two servers -@@ -1703,8 +1718,19 @@ lnet_peer_add(lnet_nid_t nid4, unsigned int flags) - * to that node with the primary NID which was - * first added by Lustre - */ -- rc = -EALREADY; -+ else -+ rc = -EALREADY; - goto out; -+ } else if (!(flags & -+ (LNET_PEER_LOCK_PRIMARY | LNET_PEER_CONFIGURED))) { -+ /* if not recreating peer as configured and -+ * not locking primary nid, no need to -+ * do anything if primary nid is not being changed -+ */ -+ if (nid_same(&lp->lp_primary_nid, &nid)) { -+ rc = -EEXIST; -+ goto out; -+ } - } - /* Delete and recreate the peer. - * We can get here: -@@ -2011,6 +2037,14 @@ __must_hold(&the_lnet.ln_api_mutex) - lnet_peer_ni_decref_locked(lpni); - lp = lpni->lpni_peer_net->lpn_peer; - -+ /* Peer must have been configured. */ -+ if ((flags & LNET_PEER_CONFIGURED) && -+ !(lp->lp_state & LNET_PEER_CONFIGURED)) { -+ CDEBUG(D_NET, "peer %s was not configured\n", -+ libcfs_nid2str(prim_nid)); -+ return -ENOENT; -+ } -+ - /* Primary NID must match */ - if (lnet_nid_to_nid4(&lp->lp_primary_nid) != prim_nid) { - CDEBUG(D_NET, "prim_nid %s is not primary for peer %s\n", -@@ -2026,9 +2060,7 @@ __must_hold(&the_lnet.ln_api_mutex) - return -EPERM; - } - -- if ((flags & LNET_PEER_LOCK_PRIMARY) && -- (lnet_peer_is_uptodate(lp) && -- (lp->lp_state & LNET_PEER_LOCK_PRIMARY))) { -+ if (lnet_peer_is_uptodate(lp) && !(flags & LNET_PEER_CONFIGURED)) { - CDEBUG(D_NET, - "Don't add temporary peer NI for uptodate peer %s\n", - libcfs_nidstr(&lp->lp_primary_nid)); --- -2.33.0 - diff --git a/0059-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch b/0019-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch similarity index 90% rename from 0059-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch rename to 0019-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch index 2a429ac8f5092dc5d1ba3c12bba1bc119d1250f8..e830c4e50468dd20694bcc0dae45469442a42a51 100644 --- a/0059-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch +++ b/0019-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch @@ -1,7 +1,7 @@ -From 4a3d324f5827d64216c4b7ea62adbfb5183bb795 Mon Sep 17 00:00:00 2001 +From 2e4755ff863a9c57d3b90341c33d017309adcc2f Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Mon, 15 Aug 2022 11:15:25 -0700 -Subject: [PATCH 59/61] LU-16019 llite: fully disable readahead in kernel I/O +Subject: [PATCH 19/23] LU-16019 llite: fully disable readahead in kernel I/O path In the new kernel (rhel9 or ubuntu 2204), the readahead path may @@ -69,11 +69,11 @@ Signed-off-by: Xinliang Liu 2 files changed, 25 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index 251c977ea4..1bfc917dde 100644 +index 1c413d1da9..1831327e0c 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 -@@ -1964,6 +1964,27 @@ posix_acl_update_mode, [ - ]) +@@ -2161,6 +2161,27 @@ AC_DEFUN([LC_POSIX_ACL_UPDATE_MODE], [ + ]) ]) # LC_POSIX_ACL_UPDATE_MODE +# @@ -100,7 +100,7 @@ index 251c977ea4..1bfc917dde 100644 # # LC_IOP_GENERIC_READLINK # -@@ -2990,6 +3011,7 @@ AC_DEFUN([LC_PROG_LINUX], [ +@@ -3790,6 +3811,7 @@ AC_DEFUN([LC_PROG_LINUX_RESULTS], [ LC_GROUP_INFO_GID LC_VFS_SETXATTR LC_POSIX_ACL_UPDATE_MODE @@ -109,7 +109,7 @@ index 251c977ea4..1bfc917dde 100644 # 4.10 LC_IOP_GENERIC_READLINK diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c -index f67ea3f7eb..ab8363e7a3 100644 +index 5121d456c0..6addf6caf1 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1366,6 +1366,9 @@ int ll_fill_super(struct super_block *sb) diff --git a/0020-LU-14668-tests-verify-state-of-peer-added-with-lock_.patch b/0020-LU-14668-tests-verify-state-of-peer-added-with-lock_.patch deleted file mode 100644 index 9a4646b8a6256075fc707ff123422a567b772c1c..0000000000000000000000000000000000000000 --- a/0020-LU-14668-tests-verify-state-of-peer-added-with-lock_.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 7ee579d25a614946ba22a5a08fdc4373c41ef8f1 Mon Sep 17 00:00:00 2001 -From: Serguei Smirnov -Date: Thu, 9 Mar 2023 15:00:46 -0800 -Subject: [PATCH 20/61] LU-14668 tests: verify state of peer added with - '--lock_prim' - -Add peer state verification to sanity-lnet test_26: -check that peer state has corresponding bit set for a peer -created with '--lock_prim' option. - -Lustre-change: https://review.whamcloud.com/50249 -Lustre-commit: 9b6fcfa334b153e52caec16d4cfd180306826a3a - -Test-Parameters: trivial testlist=sanity-lnet -Fixes: 05f7f6a0b ("LU-14668 lnet: add 'force' option to lnetctl peer del") -Signed-off-by: Serguei Smirnov -Change-Id: Id5fde036907f9dd19a21e8e6611a070321310f0e -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51135 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Frank Sehr -Reviewed-by: Cyril Bordage -Reviewed-by: Oleg Drokin ---- - lustre/tests/sanity-lnet.sh | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/lustre/tests/sanity-lnet.sh b/lustre/tests/sanity-lnet.sh -index 4af5e96ef8..1fb298776c 100755 ---- a/lustre/tests/sanity-lnet.sh -+++ b/lustre/tests/sanity-lnet.sh -@@ -937,6 +937,13 @@ test_26() { - - do_lnetctl peer add --prim_nid 1.1.1.1@tcp --lock_prim || - error "Peer add with --lock_prim option failed $?" -+ local peer_state=$($LNETCTL peer show -v 4 --nid 1.1.1.1@tcp | -+ awk '/peer state/ {print $NF}') -+ # This relies on the following peer state definition: -+ # #define LNET_PEER_LOCK_PRIMARY BIT(20) -+ if ((!("$peer_state" & (1 << 20)))); then -+ error "Peer state does not have 'locked' bit set: $peer_state" -+ fi - do_lnetctl peer del --prim_nid 1.1.1.1@tcp || - error "Peer del failed $?" - $LNETCTL peer show --nid 1.1.1.1@tcp | grep -q 1.1.1.1@tcp || --- -2.33.0 - diff --git a/0060-Update-openEuler-22.03-kernels.patch b/0020-Update-openEuler-22.03-kernels.patch similarity index 99% rename from 0060-Update-openEuler-22.03-kernels.patch rename to 0020-Update-openEuler-22.03-kernels.patch index 12360f63573d08700242917a0ea9fe484aaefc9d..d96fe028e843f07871ef67d699558a2802aa785a 100644 --- a/0060-Update-openEuler-22.03-kernels.patch +++ b/0020-Update-openEuler-22.03-kernels.patch @@ -1,7 +1,7 @@ -From 16169e4dfb7f3383ff62dc218c74aa8ff00dc0ba Mon Sep 17 00:00:00 2001 +From 5156296bfad9e53be05576d2d449c381f6b44856 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Fri, 20 Oct 2023 10:12:18 +0000 -Subject: [PATCH 60/61] Update openEuler 22.03 kernels +Subject: [PATCH 20/23] Update openEuler 22.03 kernels Update the ldiskfs patch ext4-data-in-dirent.patch. Also fix kernel download URL for 22.03 LTS. diff --git a/0021-LU-11787-test-Fix-checkfilemap-tests-for-64K-page.patch b/0021-LU-11787-test-Fix-checkfilemap-tests-for-64K-page.patch deleted file mode 100644 index 0197a03a34887ba38cf8a1639d14b1311546a949..0000000000000000000000000000000000000000 --- a/0021-LU-11787-test-Fix-checkfilemap-tests-for-64K-page.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 66d9916dc947064b598f52476fb6482c0bbaff10 Mon Sep 17 00:00:00 2001 -From: James Simmons -Date: Mon, 31 Jan 2022 12:44:46 -0500 -Subject: [PATCH 21/61] LU-11787 test: Fix checkfilemap tests for 64K page - -File mapping is page size aligned. Modify the tests to handle 64K -page. - -Lustre-change: https://review.whamcloud.com/45629 -Lustre-commit: 7c88dfd28b5cc6114a85f187ecb2473657d42c9d - -Test-Parameters: trivial clientdistro=el8.7 clientarch=aarch64 testlist=sanityn env=ONLY="71a 71b" -Change-Id: I316a197db8cdd0f9064431f8c572b43adf6110b8 -Signed-off-by: James Simmons -Signed-off-by: Xinliang Liu -Reviewed-by: Arshad Hussain -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51287 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/tests/sanityn.sh | 22 ++++++++-------------- - 1 file changed, 8 insertions(+), 14 deletions(-) - -diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh -index 17a1231d4c..ca366fd10a 100755 ---- a/lustre/tests/sanityn.sh -+++ b/lustre/tests/sanityn.sh -@@ -22,12 +22,6 @@ ALWAYS_EXCEPT="$SANITYN_EXCEPT " - ALWAYS_EXCEPT+=" 28 " - # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! - --# skip tests for PPC until they are fixed --if [[ $(uname -m) = ppc64 ]]; then -- # bug number: LU-11787 -- ALWAYS_EXCEPT+=" 71a" --fi -- - if [ $mds1_FSTYPE = "zfs" ]; then - # bug number: LU-15757 (test_102() causes crash in umount later) - ALWAYS_EXCEPT+=" 102" -@@ -3560,28 +3554,28 @@ test_71a() { - checkfiemap --test || - skip "checkfiemap not runnable: $?" - # write data this way: hole - data - hole - data -- dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=1 count=1 -+ dd if=/dev/urandom of=$DIR1/$tfile bs=64K seek=1 count=1 - [ "$(facet_fstype ost$(($($LFS getstripe -i $DIR1/$tfile) + 1)))" = \ - "zfs" ] && - skip "ORI-366/LU-1941: FIEMAP unimplemented on ZFS" && return 0 -- dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=3 count=1 -+ dd if=/dev/urandom of=$DIR1/$tfile bs=64K seek=3 count=1 - GET_STAT="lctl get_param -n ldlm.services.ldlm_cbd.stats" - stat $DIR2/$tfile - local can1=$($GET_STAT | awk '/ldlm_bl_callback/ {print $2}') - echo $can1 -- checkfiemap $DIR2/$tfile 81920 || -+ checkfiemap $DIR2/$tfile 131072 || - error "data is not flushed from client" - local can2=$($GET_STAT | awk '/ldlm_bl_callback/ {print $2}') - echo $can2 - - # common case of "create file, copy file" on a single node - # should not flush data from ost -- dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=1 count=1 -- dd if=/dev/urandom of=$DIR1/$tfile bs=40K seek=3 count=1 -+ dd if=/dev/urandom of=$DIR1/$tfile bs=64K seek=1 count=1 -+ dd if=/dev/urandom of=$DIR1/$tfile bs=64K seek=3 count=1 - stat $DIR1/$tfile - local can3=$($GET_STAT | awk '/ldlm_bl_callback/ {print $2}') - echo $can3 -- checkfiemap $DIR1/$tfile 81920 || -+ checkfiemap $DIR1/$tfile 131072 || - error 4 - local can4=$($GET_STAT | awk '/ldlm_bl_callback/ {print $2}') - echo $can2 -@@ -3605,11 +3599,11 @@ test_71b() { - mkdir -p $DIR1/$tdir - - $LFS setstripe -c -1 $DIR1/$tdir || error "setstripe failed" -- dd if=/dev/urandom of=$DIR1/$tdir/$tfile bs=40K count=1 -+ dd if=/dev/urandom of=$DIR1/$tdir/$tfile bs=64K count=1 - [ "$(facet_fstype ost$(($($LFS getstripe -i $DIR1/$tdir/$tfile) + 1)))" = \ - "zfs" ] && - skip "ORI-366/LU-1941: FIEMAP unimplemented on ZFS" && return 0 -- checkfiemap $DIR1/$tdir/$tfile 40960 || error "checkfiemap failed" -+ checkfiemap $DIR1/$tdir/$tfile 65536 || error "checkfiemap failed" - } - run_test 71b "check fiemap support for stripecount > 1" - --- -2.33.0 - diff --git a/0061-Update-kernel-for-openEuler-20.03-LTS.patch b/0021-Update-kernel-for-openEuler-20.03-LTS.patch similarity index 99% rename from 0061-Update-kernel-for-openEuler-20.03-LTS.patch rename to 0021-Update-kernel-for-openEuler-20.03-LTS.patch index 3b3f542077925cc342252e0b0c30131e14f480d5..52699fa94e21c8f0152200b8a75ef1cc2e9365ec 100644 --- a/0061-Update-kernel-for-openEuler-20.03-LTS.patch +++ b/0021-Update-kernel-for-openEuler-20.03-LTS.patch @@ -1,7 +1,7 @@ -From 9f5b25ec2254a00041aa7f57c2df899c205c137e Mon Sep 17 00:00:00 2001 +From 728e9bc428174719f8edda2b33712f73985ae2f4 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Thu, 9 Nov 2023 02:25:34 +0000 -Subject: [PATCH 61/61] Update kernel for openEuler 20.03 LTS +Subject: [PATCH 21/23] Update kernel for openEuler 20.03 LTS Update ldiskfs patch ext4-data-in-dirent.patch. diff --git a/0022-LU-15800-ofd-take-a-read-lock-for-fallocate.patch b/0022-LU-15800-ofd-take-a-read-lock-for-fallocate.patch deleted file mode 100644 index 42a83dff35b0a8eb6717677774f6aa8ad0d07c00..0000000000000000000000000000000000000000 --- a/0022-LU-15800-ofd-take-a-read-lock-for-fallocate.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 8299b3fd77ebcc372b5d929eaa08231fc703c431 Mon Sep 17 00:00:00 2001 -From: Alex Zhuravlev -Date: Tue, 10 May 2022 10:48:55 +0300 -Subject: [PATCH 22/61] LU-15800 ofd: take a read lock for fallocate - -there is no need to take an write (exclusive) object's -lock for fallocate - we just need to serialize fallocate -vs destroy, all internal structures should be protected -by OSD and disk filesystem like the write path does. - -Lustre-change: https://review.whamcloud.com/47268 -Lustre-commit: 5fae80066162ea637c8649f6439fc14e1d9a7cf8 - -Fixes: cdaaa87f6b ("LU-14214 ofd: fix locking in ofd_object_fallocate()") -Signed-off-by: Alex Zhuravlev -Change-Id: I65986745865ee329c5257a7efca5e79403830608 -Reviewed-by: Arshad Hussain -Reviewed-by: Andreas Dilger -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51702 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/ofd/ofd_objects.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c -index 41fe74bb11..16f9fba3d8 100644 ---- a/lustre/ofd/ofd_objects.c -+++ b/lustre/ofd/ofd_objects.c -@@ -801,7 +801,7 @@ int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo, - if (rc) - GOTO(stop, rc); - -- ofd_write_lock(env, fo); -+ ofd_read_lock(env, fo); - if (!ofd_object_exists(fo)) - GOTO(unlock, rc = -ENOENT); - -@@ -824,7 +824,7 @@ int ofd_object_fallocate(const struct lu_env *env, struct ofd_object *fo, - filter_fid_le_to_cpu(&fo->ofo_ff, ff, sizeof(*ff)); - } - unlock: -- ofd_write_unlock(env, fo); -+ ofd_read_unlock(env, fo); - stop: - ofd_trans_stop(env, ofd, th, rc); - RETURN(rc); --- -2.33.0 - diff --git a/0062-ldiskfs-fix-build-for-oe2203sp3.patch b/0022-ldiskfs-fix-build-for-oe2203sp3.patch similarity index 99% rename from 0062-ldiskfs-fix-build-for-oe2203sp3.patch rename to 0022-ldiskfs-fix-build-for-oe2203sp3.patch index 88f2b3ac3249f6138a8ecd31694598886d2450b0..74d9f38cdbb1277998b1be9020b39388a9e1086b 100644 --- a/0062-ldiskfs-fix-build-for-oe2203sp3.patch +++ b/0022-ldiskfs-fix-build-for-oe2203sp3.patch @@ -1,7 +1,7 @@ -From 3e677b9e42a412b2445ed738113860a580497290 Mon Sep 17 00:00:00 2001 +From dd4a069f2c1f22caa177a9e06cf764e350a10865 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Tue, 28 Nov 2023 07:53:08 +0000 -Subject: [PATCH] ldiskfs: fix build for oe2203sp3 +Subject: [PATCH 22/23] ldiskfs: fix build for oe2203sp3 Update ldiskfs patch for oe2203sp3 for new kernel 5.10.0-171.0.0.84.oe2203sp3. diff --git a/0001-Fix-sanity-running-stuck.patch b/0023-Fix-sanity-running-stuck.patch similarity index 98% rename from 0001-Fix-sanity-running-stuck.patch rename to 0023-Fix-sanity-running-stuck.patch index 6a156b439f9ac1887dac8efe7f15bf947f70e2f0..c998c26255a67102cdb23aeb71afc2463fb93c6b 100644 --- a/0001-Fix-sanity-running-stuck.patch +++ b/0023-Fix-sanity-running-stuck.patch @@ -1,7 +1,7 @@ -From b85c7d2486a356e5dd90c4ceea7bc5df9fd6f596 Mon Sep 17 00:00:00 2001 +From d894beb7cab6aefe436e14fc0cd8bc02e088f967 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Mon, 18 Dec 2023 02:05:59 +0000 -Subject: [PATCH] Fix sanity running stuck +Subject: [PATCH 23/23] Fix sanity running stuck Fix sanity test suite runing stuck, via reverting series patchset[1]. See bug: https://gitee.com/src-openeuler/lustre/issues/I8OSQ4 diff --git a/0023-LU-16873-osd-update-OI_Scrub-file-with-new-magic.patch b/0023-LU-16873-osd-update-OI_Scrub-file-with-new-magic.patch deleted file mode 100644 index 18b58437ab774fb197aff042f3a97ba7a91a8963..0000000000000000000000000000000000000000 --- a/0023-LU-16873-osd-update-OI_Scrub-file-with-new-magic.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 703d8a994bf33ac07f8bd4c956880db3d9abb016 Mon Sep 17 00:00:00 2001 -From: Alexander Zarochentsev -Date: Sun, 28 May 2023 08:42:27 -0400 -Subject: [PATCH 23/61] LU-16873 osd: update OI_Scrub file with new magic - -The fix for LUS-11542 detects the format change correctly -but does not write new oi scrub file magic, so new mount -triggers the "oi files counter reset" again and again. - -Lustre-change: https://review.whamcloud.com/51226 -Lustre-commit: 38b7c408212f60d684c9b114d90b4514e0044ffe - -Fixes: 126275ba83 ("LU-16655 scrub: upgrade scrub_file from 2.12 format") -HPE-bug-id: LUS-11646 -Signed-off-by: Alexander Zarochentsev -Change-Id: Ia13fcfaf0d8f2c4ee9331dd9fec0ff159d195186 -Reviewed-by: Andreas Dilger -Reviewed-by: Andrew Perepechko -Signed-off-by: Etienne AUJAMES -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51525 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/obdclass/scrub.c | 2 ++ - lustre/osd-ldiskfs/osd_oi.c | 15 ++++++--------- - 2 files changed, 8 insertions(+), 9 deletions(-) - -diff --git a/lustre/obdclass/scrub.c b/lustre/obdclass/scrub.c -index 89c3f752da..cc100244c0 100644 ---- a/lustre/obdclass/scrub.c -+++ b/lustre/obdclass/scrub.c -@@ -127,6 +127,7 @@ EXPORT_SYMBOL(scrub_file_init); - void scrub_file_reset(struct lustre_scrub *scrub, uuid_t uuid, u64 flags) - { - struct scrub_file *sf = &scrub->os_file; -+ ENTRY; - - CDEBUG(D_LFSCK, "%s: reset OI scrub file, old flags = " - "%#llx, add flags = %#llx\n", -@@ -150,6 +151,7 @@ void scrub_file_reset(struct lustre_scrub *scrub, uuid_t uuid, u64 flags) - sf->sf_items_igif = 0; - if (!scrub->os_in_join) - sf->sf_items_updated_prior = 0; -+ EXIT; - } - EXPORT_SYMBOL(scrub_file_reset); - -diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c -index 21468fec15..b361796e41 100644 ---- a/lustre/osd-ldiskfs/osd_oi.c -+++ b/lustre/osd-ldiskfs/osd_oi.c -@@ -316,7 +316,7 @@ osd_oi_table_open(struct osd_thread_info *info, struct osd_device *osd, - - if (rc == -ENOENT && create == false) { - if (oi_count == 0) -- return count; -+ RETURN(count); - - rc = 0; - ldiskfs_set_bit(i, sf->sf_oi_bitmap); -@@ -425,23 +425,20 @@ int osd_oi_init(struct osd_thread_info *info, struct osd_device *osd, - if (count == sf->sf_oi_count) - GOTO(out, rc = count); - -- if (sf->sf_oi_count == 0) { -- if (likely((count & (count - 1)) == 0)) -- GOTO(out, rc = count); -- -- LCONSOLE_WARN( -- "%s: invalid oi count %d, remove them, then set it to %d\n", -+ /* Trust the counted number of OI files if it is sane */ -+ if ((count & (count - 1)) != 0) { -+ LCONSOLE_WARN("%s: invalid oi count %d, remove them, then set it to %d\n", - osd_dev2name(osd), count, osd_oi_count); - osd_oi_table_put(info, oi, count); - rc = osd_remove_ois(info, osd); - if (rc) - GOTO(out, rc); - -- sf->sf_oi_count = osd_oi_count; -+ count = osd_oi_count; - } - - scrub_file_reset(scrub, osd->od_uuid, SF_RECREATED); -- count = sf->sf_oi_count; -+ sf->sf_oi_count = count; - goto create; - } - --- -2.33.0 - diff --git a/0024-LU-15519-quota-fallocate-does-not-increase-projectid.patch b/0024-LU-15519-quota-fallocate-does-not-increase-projectid.patch deleted file mode 100644 index 3d77bca48d74362ec892b7db8eb1d50d6c4328f5..0000000000000000000000000000000000000000 --- a/0024-LU-15519-quota-fallocate-does-not-increase-projectid.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 691387d77bfe9260b65669978fb3f988055fc1e0 Mon Sep 17 00:00:00 2001 -From: Arshad Hussain -Date: Mon, 14 Feb 2022 14:06:47 +0530 -Subject: [PATCH 24/61] LU-15519 quota: fallocate does not increase projectid - usage - -fallocate() was not accounting for projectid quota usage. -This was happening due to two reasons. 1) the projectid -was not properly passed to md_op_data in ll_set_project() -and 2) the OBD_MD_FLPROJID flag was not set receive the -projctid. - -This patch addresses the above reasons. - -Test-case: sanity-quota/78a added - -Lustre-change: https://review.whamcloud.com/46676 -Lustre-commit: 5fc934ebbbe665f24e2f11fe224065dd8e9a08ba - -Fixes: 48457868a02a ("LU-3606 fallocate: Implement fallocate preallocate operation") -Signed-off-by: Arshad Hussain -Change-Id: I3ed44e7ef7ca8fe49a08133449c33b62b1eff500 -Reviewed-by: Andreas Dilger -Reviewed-by: Hongchao Zhang -Signed-off-by: Etienne AUJAMES -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51535 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/include/cl_object.h | 1 + - lustre/llite/file.c | 15 ++++++++---- - lustre/llite/vvp_object.c | 3 ++- - lustre/lov/lov_io.c | 2 ++ - lustre/osc/osc_io.c | 9 ++++--- - lustre/tests/sanity-quota.sh | 47 ++++++++++++++++++++++++++++++++++++ - 6 files changed, 68 insertions(+), 9 deletions(-) - -diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h -index e4fb55a705..d44d59b074 100644 ---- a/lustre/include/cl_object.h -+++ b/lustre/include/cl_object.h -@@ -1874,6 +1874,7 @@ struct cl_io { - loff_t sa_falloc_end; - uid_t sa_falloc_uid; - gid_t sa_falloc_gid; -+ __u32 sa_falloc_projid; - } ci_setattr; - struct cl_data_version_io { - u64 dv_data_version; -diff --git a/lustre/llite/file.c b/lustre/llite/file.c -index 219931e06b..71f11a9ea2 100644 ---- a/lustre/llite/file.c -+++ b/lustre/llite/file.c -@@ -2834,7 +2834,7 @@ static int ll_do_fiemap(struct inode *inode, struct fiemap *fiemap, - GOTO(out, rc); - } - -- fmkey.lfik_oa.o_valid = OBD_MD_FLID | OBD_MD_FLGROUP; -+ fmkey.lfik_oa.o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLPROJID; - obdo_from_inode(&fmkey.lfik_oa, inode, OBD_MD_FLSIZE); - obdo_set_parent_fid(&fmkey.lfik_oa, &ll_i2info(inode)->lli_fid); - -@@ -3575,8 +3575,8 @@ int ll_ioctl_check_project(struct inode *inode, __u32 xflags, - - static int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid) - { -- struct md_op_data *op_data; - struct ptlrpc_request *req = NULL; -+ struct md_op_data *op_data; - struct cl_object *obj; - unsigned int inode_flags; - int rc = 0; -@@ -3594,7 +3594,10 @@ static int ll_set_project(struct inode *inode, __u32 xflags, __u32 projid) - op_data->op_attr_flags = ll_inode_to_ext_flags(inode_flags); - if (xflags & FS_XFLAG_PROJINHERIT) - op_data->op_attr_flags |= LUSTRE_PROJINHERIT_FL; -+ -+ /* pass projid to md_op_data */ - op_data->op_projid = projid; -+ - op_data->op_xvalid |= OP_XVALID_PROJID | OP_XVALID_FLAGS; - rc = md_setattr(ll_i2sbi(inode)->ll_md_exp, op_data, NULL, 0, &req); - ptlrpc_req_finished(req); -@@ -5454,11 +5457,11 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat) - int cl_falloc(struct file *file, struct inode *inode, int mode, loff_t offset, - loff_t len) - { -+ loff_t size = i_size_read(inode); - struct lu_env *env; - struct cl_io *io; - __u16 refcheck; - int rc; -- loff_t size = i_size_read(inode); - - ENTRY; - -@@ -5477,12 +5480,14 @@ int cl_falloc(struct file *file, struct inode *inode, int mode, loff_t offset, - io->u.ci_setattr.sa_falloc_end = offset + len; - io->u.ci_setattr.sa_subtype = CL_SETATTR_FALLOCATE; - -- CDEBUG(D_INODE, "UID %u GID %u\n", -+ CDEBUG(D_INODE, "UID %u GID %u PRJID %u\n", - from_kuid(&init_user_ns, inode->i_uid), -- from_kgid(&init_user_ns, inode->i_gid)); -+ from_kgid(&init_user_ns, inode->i_gid), -+ ll_i2info(inode)->lli_projid); - - io->u.ci_setattr.sa_falloc_uid = from_kuid(&init_user_ns, inode->i_uid); - io->u.ci_setattr.sa_falloc_gid = from_kgid(&init_user_ns, inode->i_gid); -+ io->u.ci_setattr.sa_falloc_projid = ll_i2info(inode)->lli_projid; - - if (io->u.ci_setattr.sa_falloc_end > size) { - loff_t newsize = io->u.ci_setattr.sa_falloc_end; -diff --git a/lustre/llite/vvp_object.c b/lustre/llite/vvp_object.c -index 2413da9498..ab5c68b797 100644 ---- a/lustre/llite/vvp_object.c -+++ b/lustre/llite/vvp_object.c -@@ -198,7 +198,8 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj, - { - struct inode *inode; - struct obdo *oa; -- u64 valid_flags = OBD_MD_FLTYPE | OBD_MD_FLUID | OBD_MD_FLGID; -+ u64 valid_flags = OBD_MD_FLTYPE | OBD_MD_FLUID | OBD_MD_FLGID | -+ OBD_MD_FLPROJID; - - oa = attr->cra_oa; - inode = vvp_object_inode(obj); -diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c -index ce4fa30b84..381ae56699 100644 ---- a/lustre/lov/lov_io.c -+++ b/lustre/lov/lov_io.c -@@ -694,6 +694,8 @@ static void lov_io_sub_inherit(struct lov_io_sub *sub, struct lov_io *lio, - parent->u.ci_setattr.sa_falloc_uid; - io->u.ci_setattr.sa_falloc_gid = - parent->u.ci_setattr.sa_falloc_gid; -+ io->u.ci_setattr.sa_falloc_projid = -+ parent->u.ci_setattr.sa_falloc_projid; - } - if (cl_io_is_trunc(io)) { - loff_t new_size = parent->u.ci_setattr.sa_attr.lvb_size; -diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c -index e4bd2738a6..86399655f5 100644 ---- a/lustre/osc/osc_io.c -+++ b/lustre/osc/osc_io.c -@@ -680,11 +680,14 @@ static int osc_io_setattr_start(const struct lu_env *env, - oa->o_blocks = io->u.ci_setattr.sa_falloc_end; - oa->o_uid = io->u.ci_setattr.sa_falloc_uid; - oa->o_gid = io->u.ci_setattr.sa_falloc_gid; -+ oa->o_projid = io->u.ci_setattr.sa_falloc_projid; - oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | -- OBD_MD_FLUID | OBD_MD_FLGID; -+ OBD_MD_FLUID | OBD_MD_FLGID | OBD_MD_FLPROJID; - -- CDEBUG(D_INODE, "size %llu blocks %llu uid %u gid %u\n", -- oa->o_size, oa->o_blocks, oa->o_uid, oa->o_gid); -+ CDEBUG(D_INODE, -+ "size %llu blocks %llu uid %u gid %u prjid %u\n", -+ oa->o_size, oa->o_blocks, oa->o_uid, oa->o_gid, -+ oa->o_projid); - result = osc_fallocate_base(osc_export(cl2osc(obj)), - oa, osc_async_upcall, - cbargs, falloc_mode); -diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh -index 047b1a9687..f36601ce5d 100755 ---- a/lustre/tests/sanity-quota.sh -+++ b/lustre/tests/sanity-quota.sh -@@ -5251,6 +5251,53 @@ test_78() - } - run_test 78 "Check fallocate increase quota usage" - -+test_78a() -+{ -+ (( $CLIENT_VERSION >= $(version_code 2.15.3) )) || -+ skip "need client at least 2.15.3" -+ (( $OST1_VERSION >= $(version_code 2.15.3) )) || -+ skip "need OST at least 2.15.3" -+ check_set_fallocate_or_skip -+ -+ setup_quota_test || error "setup quota failed with $?" -+ -+ # enable ost quota -+ set_ost_qtype $QTYPE || error "enable ost quota failed" -+ -+ mkdir -p $DIR/$tdir || error "failed to create $tdir" -+ -+ local projectid=5200 # Random project id to test -+ -+ change_project -sp $projectid $DIR/$tdir -+ -+ # setup quota limit -+ $LFS setquota -p $projectid -b25M -B25M $DIR/$tdir || -+ error "lfs setquota project failed" -+ -+ # call fallocate -+ fallocate -l 204800 $DIR/$tdir/$tfile -+ -+ # Get curspace (kbytes) for $projectid -+ local kbytes=$(getquota -p $projectid global curspace) -+ -+ echo "kbytes returned:$kbytes" -+ -+ # For file size of 204800. We should be having roughly 200 kbytes -+ # returned. Anything alarmingly low (50 taken as arbitrary value) -+ # would bail out this TC. Also this also avoids $kbytes of 0 -+ # to be used in calculation below. -+ (( $kbytes > 50 )) || -+ error "fallocate did not use projectid. kbytes returned:$kbytes" -+ -+ local expect_lo=$(($kbytes * 95 / 100)) # 5% below -+ local expect_hi=$(($kbytes * 105 / 100)) # 5% above -+ -+ # Verify kbytes is 200 (204800/1024). With a permited 5% drift -+ (( $kbytes >= $expect_lo && $kbytes <= $expect_hi )) || -+ error "fallocate did not use quota projectid correctly" -+} -+run_test 78a "Check fallocate increase projectid usage" -+ - test_79() - { - local qpool="qpool1" --- -2.33.0 - diff --git a/0025-LU-16060-osd-ldiskfs-copy-nul-byte-terminator-in-wri.patch b/0025-LU-16060-osd-ldiskfs-copy-nul-byte-terminator-in-wri.patch deleted file mode 100644 index 68197cb5eec84ac5e6f2a20a481cc10fefebf5ed..0000000000000000000000000000000000000000 --- a/0025-LU-16060-osd-ldiskfs-copy-nul-byte-terminator-in-wri.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d1f0ef129d8e9af13c31dc821a00639de3349873 Mon Sep 17 00:00:00 2001 -From: Alexander Zarochentsev -Date: Wed, 20 Jul 2022 19:05:53 +0300 -Subject: [PATCH 25/61] LU-16060 osd-ldiskfs: copy nul byte terminator in - writelink - -memcpy() call in osd_ldiskfs_writelink() doesn't copy the nul -terminator byte from the source buffer, leaving the space -after target link name uninialized which is ok for the kernel -code and debugfs but not e2fsck. - -HPE-bug-id: LUS-11103 - -Lustre-change: https://review.whamcloud.com/48092 -Lustre-commit: 907dc0a2d333f2df2d654a968fc50f8cc05b779d - -Signed-off-by: Alexander Zarochentsev -Change-Id: I914f2c78e1a6571bf360a23b0ede8c70502bf0df -Reviewed-by: Artem Blagodarenko -Reviewed-by: Andrew Perepechko -Reviewed-by: Andreas Dilger -Signed-off-by: Etienne AUJAMES -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51356 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/osd-ldiskfs/osd_io.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c -index f44420dda2..7131add58d 100644 ---- a/lustre/osd-ldiskfs/osd_io.c -+++ b/lustre/osd-ldiskfs/osd_io.c -@@ -2022,7 +2022,8 @@ static int osd_ldiskfs_writelink(struct inode *inode, char *buffer, int buflen) - /* LU-2634: clear the extent format for fast symlink */ - ldiskfs_clear_inode_flag(inode, LDISKFS_INODE_EXTENTS); - -- memcpy((char *)&LDISKFS_I(inode)->i_data, (char *)buffer, buflen); -+ /* Copying the NUL byte terminating the link target as well */ -+ memcpy((char *)&LDISKFS_I(inode)->i_data, (char *)buffer, buflen + 1); - spin_lock(&inode->i_lock); - LDISKFS_I(inode)->i_disksize = buflen; - i_size_write(inode, buflen); --- -2.33.0 - diff --git a/0026-LU-16934-kernel-update-RHEL-8.8-4.18.0-477.15.1.el8_.patch b/0026-LU-16934-kernel-update-RHEL-8.8-4.18.0-477.15.1.el8_.patch deleted file mode 100644 index 130c8b1c5cf4f9f710106b3ce9b070c404217213..0000000000000000000000000000000000000000 --- a/0026-LU-16934-kernel-update-RHEL-8.8-4.18.0-477.15.1.el8_.patch +++ /dev/null @@ -1,79 +0,0 @@ -From f144190bbe3728dc15fc731612f10fe3fad98bef Mon Sep 17 00:00:00 2001 -From: Jian Yu -Date: Fri, 28 Jul 2023 20:36:03 -0700 -Subject: [PATCH 26/61] LU-16934 kernel: update RHEL 8.8 - [4.18.0-477.15.1.el8_8] - -Update RHEL 8.8 kernel to 4.18.0-477.15.1.el8_8. - -Lustre-change: https://review.whamcloud.com/51517 -Lustre-commit: 830bf7a1f8de73a4f46248e6b8d2bbcd944a1f09 - -Test-Parameters: trivial fstype=ldiskfs \ -clientdistro=el8.8 serverdistro=el8.8 testlist=sanity - -Test-Parameters: trivial fstype=zfs \ -clientdistro=el8.8 serverdistro=el8.8 testlist=sanity - -Change-Id: I66365dce63065a0a07958a182a3c705e9948d424 -Signed-off-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51518 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Yang Sheng -Reviewed-by: xinliang -Reviewed-by: Oleg Drokin ---- - lustre/ChangeLog | 4 ++-- - lustre/kernel_patches/targets/4.18-rhel8.8.target.in | 2 +- - lustre/kernel_patches/which_patch | 2 +- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/lustre/ChangeLog b/lustre/ChangeLog -index 57699d2232..4b21088869 100644 ---- a/lustre/ChangeLog -+++ b/lustre/ChangeLog -@@ -3,7 +3,7 @@ TBD Whamcloud - * See https://wiki.whamcloud.com/display/PUB/Lustre+Support+Matrix - for currently supported client and server kernel versions. - * Server primary kernels built and tested during release cycle: -- 4.18.0-477.10.1.el8 (RHEL8.8) -+ 4.18.0-477.15.1.el8 (RHEL8.8) - * Other server kernels known to build and work at some point (others may also work): - 3.10.0-862.14.4.el7 (RHEL7.5) - 3.10.0-957.27.2.el7 (RHEL7.6) -@@ -30,7 +30,7 @@ TBD Whamcloud - * Client primary kernels built and tested during release cycle: - 5.14.0-284.11.1.el9 (RHEL9.2) - 5.14.0-162.23.1.el9 (RHEL9.1) -- 4.18.0-477.10.1.el8 (RHEL8.8) -+ 4.18.0-477.15.1.el8 (RHEL8.8) - 5.4.0-37 (Ubuntu 20.04) - 5.14.21-150400.24.28 (SLES15 SP4) - * Other clients known to build on these kernels at some point (others may also work): -diff --git a/lustre/kernel_patches/targets/4.18-rhel8.8.target.in b/lustre/kernel_patches/targets/4.18-rhel8.8.target.in -index 172b7ca8c9..215a468fe4 100644 ---- a/lustre/kernel_patches/targets/4.18-rhel8.8.target.in -+++ b/lustre/kernel_patches/targets/4.18-rhel8.8.target.in -@@ -1,5 +1,5 @@ - lnxmaj="4.18.0" --lnxrel="477.10.1.el8_8" -+lnxrel="477.15.1.el8_8" - - KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm - SERIES=4.18-rhel8.8.series -diff --git a/lustre/kernel_patches/which_patch b/lustre/kernel_patches/which_patch -index 0047bf08eb..50ec106010 100644 ---- a/lustre/kernel_patches/which_patch -+++ b/lustre/kernel_patches/which_patch -@@ -25,6 +25,6 @@ PATCH SERIES FOR SERVER KERNELS: - 4.18-rhel8.5.series 4.18.0-348.23.1.el8 (RHEL 8.5) - 4.18-rhel8.6.series 4.18.0-372.32.1.el8 (RHEL 8.6) - 4.18-rhel8.7.series 4.18.0-425.3.1.el8 (RHEL 8.7) --4.18-rhel8.8.series 4.18.0-477.10.1.el8 (RHEL 8.8) -+4.18-rhel8.8.series 4.18.0-477.15.1.el8 (RHEL 8.8) - - See lustre/ChangeLog for supported client kernel versions. --- -2.33.0 - diff --git a/0027-LU-15740-tests-scale-fs_log_size-by-OSTCOUNT.patch b/0027-LU-15740-tests-scale-fs_log_size-by-OSTCOUNT.patch deleted file mode 100644 index 50d501e0ce14df6904eee377bd61cb083f488b9d..0000000000000000000000000000000000000000 --- a/0027-LU-15740-tests-scale-fs_log_size-by-OSTCOUNT.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 34e1409cad412086d509349f64dc9d77911d2fb8 Mon Sep 17 00:00:00 2001 -From: Andreas Dilger -Date: Fri, 24 Mar 2023 17:09:44 -0600 -Subject: [PATCH 27/61] LU-15740 tests: scale fs_log_size by OSTCOUNT - -The fs_log_size "free space skew" was being scaled by MDSCOUNT, -but in fact this parameter is only ever used to compare the OST -free space usage, so the OSTCOUNT should be used when scaling it. - -It is likely that the skew is actually caused by blocks allocated -by OST object directories and not llogs (no llogs used on OSTs for -many years), but it isn't worthwhile to rename the function. - -Lustre-change: https://review.whamcloud.com/50419 -Lustre-commit: fabec6f2cb39950a2f208567dac716e21880fa9f - -Test-Parameters: trivial testlist=runtests -Signed-off-by: Andreas Dilger -Change-Id: I97f05b10fa7ec367534b5bdce09feae5e93ebbe5 -Reviewed-by: Arshad Hussain -Reviewed-by: Alex Deiter -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51606 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: James Simmons -Reviewed-by: Oleg Drokin ---- - lustre/tests/replay-ost-single.sh | 20 ++++++++------------ - lustre/tests/replay-single.sh | 17 ++++++----------- - lustre/tests/test-framework.sh | 8 +++++--- - 3 files changed, 19 insertions(+), 26 deletions(-) - -diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh -index e6ba4d0430..5ce0b7f28d 100755 ---- a/lustre/tests/replay-ost-single.sh -+++ b/lustre/tests/replay-ost-single.sh -@@ -169,10 +169,6 @@ test_5() { - } - run_test 5 "Fail OST during iozone" - --kbytesfree() { -- calc_osc_kbytes kbytesfree --} -- - test_6() { - remote_mds_nodsh && skip "remote MDS with nodsh" && return 0 - -@@ -185,7 +181,7 @@ test_6() { - wait_destroy_complete || error "first wait_destroy_complete failed" - sync_all_data - -- local before=$(kbytesfree) -+ local before=$(calc_osc_kbytes kbytesfree) - dd if=/dev/urandom bs=4096 count=1280 of=$f || error "dd failed" - $LFS getstripe $f || error "$LFS getstripe $f failed" - local stripe_index=$(lfs getstripe -i $f) -@@ -200,13 +196,13 @@ test_6() { - wait_mds_ost_sync || error "second wait_mds_ost_sync failed" - - # retry till statfs returns useful results -- local after_dd=$(kbytesfree) -+ local after_dd=$(calc_osc_kbytes kbytesfree) - local i=0 - while (( $before <= $after_dd && $i < 20 )); do - sync - sleep 1 - let ++i -- after_dd=$(kbytesfree) -+ after_dd=$(calc_osc_kbytes kbytesfree) - done - - log "before_free: $before after_dd_free: $after_dd took $i seconds" -@@ -222,7 +218,7 @@ test_6() { - # let the delete happen - wait_mds_ost_sync || error "third wait_mds_ost_sync failed" - wait_delete_completed || error "second wait_delete_completed failed" -- local after=$(kbytesfree) -+ local after=$(calc_osc_kbytes kbytesfree) - log "free_before: $before free_after: $after" - (( $before <= $after + $(fs_log_size) )) || - error "$before > $after + logsize $(fs_log_size)" -@@ -238,18 +234,18 @@ test_7() { - wait_mds_ost_sync || error "wait_mds_ost_sync failed" - wait_destroy_complete || error "wait_destroy_complete failed" - -- local before=$(kbytesfree) -+ local before=$(calc_osc_kbytes kbytesfree) - dd if=/dev/urandom bs=4096 count=1280 of=$f || - error "dd to file failed: $?" - - sync -- local after_dd=$(kbytesfree) -+ local after_dd=$(calc_osc_kbytes kbytesfree) - local i=0 - while (( $before <= $after_dd && $i < 10 )); do - sync - sleep 1 - let ++i -- after_dd=$(kbytesfree) -+ after_dd=$(calc_osc_kbytes kbytesfree) - done - - log "before: $before after_dd: $after_dd took $i seconds" -@@ -264,7 +260,7 @@ test_7() { - # let the delete happen - wait_mds_ost_sync || error "wait_mds_ost_sync failed" - wait_delete_completed || error "wait_delete_completed failed" -- local after=$(kbytesfree) -+ local after=$(calc_osc_kbytes kbytesfree) - log "before: $before after: $after" - (( $before <= $after + $(fs_log_size) )) || - error "$before > $after + logsize $(fs_log_size)" -diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh -index c6641c0d0e..c05570a850 100755 ---- a/lustre/tests/replay-single.sh -+++ b/lustre/tests/replay-single.sh -@@ -3289,23 +3289,17 @@ test_88() { #bug 17485 - } - run_test 88 "MDS should not assign same objid to different files " - --function calc_osc_kbytes_used() { -- local kbtotal=$(calc_osc_kbytes kbytestotal) -- local kbfree=$(calc_osc_kbytes kbytesfree) -- echo $((kbtotal-kbfree)) --} -- - test_89() { - cancel_lru_locks osc - mkdir_on_mdt0 $DIR/$tdir || error "mkdir $DIR/$tdir failed" - rm -f $DIR/$tdir/$tfile - wait_mds_ost_sync || error "initial MDS-OST sync timed out" - wait_delete_completed || error "initial wait delete timed out" -- local blocks1=$(calc_osc_kbytes_used) -+ local before=$(calc_osc_kbytes kbytesfree) - local write_size=$(fs_log_size) - - $LFS setstripe -i 0 -c 1 $DIR/$tdir/$tfile -- [ $write_size -lt 1024 ] && write_size=1024 -+ (( $write_size >= 1024 )) || write_size=1024 - dd if=/dev/zero bs=${write_size}k count=10 of=$DIR/$tdir/$tfile - sync - stop ost1 -@@ -3323,10 +3317,11 @@ test_89() { - - wait_mds_ost_sync || error "MDS-OST sync timed out" - wait_delete_completed || error "wait delete timed out" -- local blocks2=$(calc_osc_kbytes_used) -+ local after=$(calc_osc_kbytes kbytesfree) - -- [ $((blocks2 - blocks1)) -le $(fs_log_size) ] || -- error $((blocks2 - blocks1)) blocks leaked -+ log "free_before: $before free_after: $after" -+ (( $before <= $after + $(fs_log_size) )) || -+ error "kbytesfree $before > $after + margin $(fs_log_size)" - } - run_test 89 "no disk space leak on late ost connection" - -diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh -index 4d556d05bd..825b7189d7 100755 ---- a/lustre/tests/test-framework.sh -+++ b/lustre/tests/test-framework.sh -@@ -918,18 +918,20 @@ unload_modules() { - } - - fs_log_size() { -- local facet=${1:-$SINGLEMDS} -+ local facet=${1:-ost1} - local size=0 -+ local mult=$OSTCOUNT - - case $(facet_fstype $facet) in -- ldiskfs) size=72;; # largest seen is 64, leave some headroom -+ ldiskfs) size=32;; # largest seen is 64 with multiple OSTs - # grant_block_size is in bytes, allow at least 2x max blocksize - zfs) size=$(lctl get_param osc.$FSNAME*.import | - awk '/grant_block_size:/ {print $2/512; exit;}') - ;; - esac - -- echo -n $((size * MDSCOUNT)) -+ [[ $facet =~ mds ]] && mult=$MDTCOUNT -+ echo -n $((size * mult)) - } - - fs_inode_ksize() { --- -2.33.0 - diff --git a/0028-LU-16943-tests-fix-replay-single-135-under-hard-fail.patch b/0028-LU-16943-tests-fix-replay-single-135-under-hard-fail.patch deleted file mode 100644 index f0b0f7c1bef4bd2a20c1662f829ae85631f99fdd..0000000000000000000000000000000000000000 --- a/0028-LU-16943-tests-fix-replay-single-135-under-hard-fail.patch +++ /dev/null @@ -1,84 +0,0 @@ -From dc943357276b3bec99d24c89d9b36f7b3cf20aeb Mon Sep 17 00:00:00 2001 -From: Jian Yu -Date: Fri, 14 Jul 2023 14:04:42 +0800 -Subject: [PATCH 28/61] LU-16943 tests: fix replay-single/135 under hard - failure mode - -This patch fixes replay-single test_135() to load libcfs module -on the failover partner node to avoid 'fail_val' setting error. -It also fixes the issue that not all of the OSTs are mounted after -failing back ost1. - -Lustre-change: https://review.whamcloud.com/51574 -Lustre-commit: 74140e5df4c094f7f0e923e1b82c464b18e8a7cc - -Test-Parameters: trivial testlist=replay-single -Test-Parameters: trivial fstype=zfs testlist=replay-single - -Test-Parameters: trivial env=FAILURE_MODE=HARD \ - clientcount=4 mdtcount=1 mdscount=2 osscount=2 \ - austeroptions=-R failover=true iscsi=1 \ - testlist=replay-single - -Change-Id: Id46c722a6db9d832829a739f41f7462b32a6d9d9 -Signed-off-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51608 -Reviewed-by: Oleg Drokin -Reviewed-by: Alex Deiter -Tested-by: jenkins -Tested-by: Maloo ---- - lustre/tests/replay-single.sh | 7 +++++++ - lustre/tests/test-framework.sh | 9 +++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh -index c05570a850..f631b73125 100755 ---- a/lustre/tests/replay-single.sh -+++ b/lustre/tests/replay-single.sh -@@ -4977,6 +4977,8 @@ test_135() { - - #define OBD_FAIL_TGT_REPLAY_RECONNECT 0x32d - # Make sure lock replay server side never completes and errors out. -+ do_rpc_nodes $(facet_active_host ost1) \ -+ load_module ../libcfs/libcfs/libcfs - do_facet ost1 "$LCTL set_param fail_val=20" - do_facet ost1 "$LCTL set_param fail_loc=0x32d" - -@@ -4993,8 +4995,13 @@ test_135() { - change_active ost1 - wait_for_facet ost1 - -+ do_rpc_nodes $(facet_active_host ost1) \ -+ load_module ../libcfs/libcfs/libcfs - do_facet ost1 "$LCTL set_param fail_loc=0" - mount_facet ost1 -+ unmountoss -+ mountoss -+ clients_up || clients_up || error "$LFS df $MOUNT failed" - echo blah > $DIR/$tdir/file.test2 - - rm -rf $DIR/$tdir -diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh -index 825b7189d7..2c92993117 100755 ---- a/lustre/tests/test-framework.sh -+++ b/lustre/tests/test-framework.sh -@@ -5033,6 +5033,15 @@ mountmds() { - done - } - -+unmountoss() { -+ local num -+ -+ for num in $(seq $OSTCOUNT); do -+ stop ost$num -f -+ rm -f $TMP/ost${num}active -+ done -+} -+ - mountoss() { - local num - local devname --- -2.33.0 - diff --git a/0029-LU-16517-build-pass-extra-configure-options-to-make-.patch b/0029-LU-16517-build-pass-extra-configure-options-to-make-.patch deleted file mode 100644 index d181bf3bee9ab0d11a2093c5ffa28d47c0e04a36..0000000000000000000000000000000000000000 --- a/0029-LU-16517-build-pass-extra-configure-options-to-make-.patch +++ /dev/null @@ -1,514 +0,0 @@ -From 5abc979eb64d8a78888aea63c0cf7e285fa0a4dd Mon Sep 17 00:00:00 2001 -From: Jian Yu -Date: Tue, 30 May 2023 23:40:09 -0700 -Subject: [PATCH 29/61] LU-16517 build: pass extra configure options to "make - debs" - -While running "make debs", the configure command in debian/rules -ignores some user defined configure options. This patch fixes -the issue by adding the detection of the extra options into -debian/rules. - -Lustre-change: https://review.whamcloud.com/50464 -Lustre-commit: 3989529f22f5c54a98e445674b4b3cc443a3af5f - -Test-Parameters: trivial clientdistro=ubuntu2004 - -Change-Id: Ia9db4e05abf33834cb3c853f4f0829dadc8d7400 -Signed-off-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51178 -Reviewed-by: Andreas Dilger -Reviewed-by: Alex Deiter -Reviewed-by: Oleg Drokin -Tested-by: Maloo -Tested-by: jenkins ---- - autoMakefile.am | 95 ++++++++++++++++++++++++++++++++ - debian/rules | 39 ++++++++----- - libcfs/autoconf/lustre-libcfs.m4 | 39 ++++++++++--- - lnet/autoconf/lustre-lnet.m4 | 12 ++++ - lustre/autoconf/lustre-core.m4 | 87 +++++++++++++++++++++-------- - lustre/ldlm/ldlm_lib.c | 2 +- - lustre/llite/llite_lib.c | 4 +- - 7 files changed, 228 insertions(+), 50 deletions(-) - -diff --git a/autoMakefile.am b/autoMakefile.am -index 8c2eeb7f4c..8a2cd04953 100644 ---- a/autoMakefile.am -+++ b/autoMakefile.am -@@ -302,6 +302,101 @@ debs: undef.h debs_common - if test "x@systemdsystemunitdir@" != "x"; then \ - export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \ - fi; \ -+ if test "x@ENABLE_PINGER@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \ -+ elif test "x@ENABLE_PINGER@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopinger"; \ -+ fi; \ -+ if test "x@ENABLE_CHECKSUM@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} checksum"; \ -+ elif test "x@ENABLE_CHECKSUM@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nochecksum"; \ -+ fi; \ -+ if test "x@ENABLE_FLOCK@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} flock"; \ -+ elif test "x@ENABLE_FLOCK@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noflock"; \ -+ fi; \ -+ if test "x@ENABLE_HEALTH_WRITE@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} health_write"; \ -+ elif test "x@ENABLE_HEALTH_WRITE@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nohealth_write"; \ -+ fi; \ -+ if test "x@ENABLE_LRU_RESIZE@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lru-resize"; \ -+ elif test "x@ENABLE_LRU_RESIZE@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolru-resize"; \ -+ fi; \ -+ if test "x@ENABLE_MINDF@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} mindf"; \ -+ elif test "x@ENABLE_MINDF@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nomindf"; \ -+ fi; \ -+ if test "x@ENABLE_FAIL_ALLOC@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} fail-alloc"; \ -+ elif test "x@ENABLE_FAIL_ALLOC@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nofail-alloc"; \ -+ fi; \ -+ if test "x@ENABLE_INVARIANTS@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} invariants"; \ -+ elif test "x@ENABLE_INVARIANTS@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noinvariants"; \ -+ fi; \ -+ if test "x@ENABLE_LU_REF@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} lu_ref"; \ -+ elif test "x@ENABLE_LU_REF@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolu_ref"; \ -+ fi; \ -+ if test "x@ENABLE_PGSTAT_TRACK@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pgstate-track"; \ -+ elif test "x@ENABLE_PGSTAT_TRACK@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopgstate-track"; \ -+ fi; \ -+ if test "x@ENABLE_LIBCFS_CDEBUG@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-cdebug"; \ -+ elif test "x@ENABLE_LIBCFS_CDEBUG@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-cdebug"; \ -+ fi; \ -+ if test "x@ENABLE_LIBCFS_TRACE@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-trace"; \ -+ elif test "x@ENABLE_LIBCFS_TRACE@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-trace"; \ -+ fi; \ -+ if test "x@ENABLE_LIBCFS_ASSERT@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libcfs-assert"; \ -+ elif test "x@ENABLE_LIBCFS_ASSERT@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibcfs-assert"; \ -+ fi; \ -+ if test "x@ENABLE_PANIC_DUMPLOG@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} panic_dumplog"; \ -+ elif test "x@ENABLE_PANIC_DUMPLOG@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nopanic_dumplog"; \ -+ fi; \ -+ if test "x@ENABLE_READLINE@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} readline"; \ -+ elif test "x@ENABLE_READLINE@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noreadline"; \ -+ fi; \ -+ if test "x@ENABLE_LIBPTHREAD@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} libpthread"; \ -+ elif test "x@ENABLE_LIBPTHREAD@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nolibpthread"; \ -+ fi; \ -+ if test "x@ENABLE_BACKOFF@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} backoff"; \ -+ elif test "x@ENABLE_BACKOFF@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \ -+ fi; \ -+ if test "x@ENABLE_GNI@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \ -+ elif test "x@ENABLE_GNI@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \ -+ fi; \ -+ if test "x@ENABLE_EFENCE@" = "xyes"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \ -+ elif test "x@ENABLE_EFENCE@" = "xno"; then \ -+ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} noefence"; \ -+ fi; \ - export KERNEL_OBJ="$(LINUX_OBJ)"; \ - export KERNEL_SRC="$(LINUX)"; \ - echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \ -diff --git a/debian/rules b/debian/rules -index 074b59ac39..344f255c04 100755 ---- a/debian/rules -+++ b/debian/rules -@@ -189,16 +189,18 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in - if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \ - export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ - fi; \ -- if echo "$${DEB_BUILD_PROFILES}" | grep -qw "gss"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gss"; \ -- elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nogss"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --disable-gss"; \ -- fi; \ -- if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \ -- elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \ -- fi; \ -+ options="gss crypto pinger checksum flock health_write lru-resize"; \ -+ options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \ -+ options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \ -+ options="$${options} panic_dumplog readline libpthread"; \ -+ options="$${options} backoff gni efence"; \ -+ for option in $${options}; do \ -+ if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \ -+ export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \ -+ elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \ -+ export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \ -+ fi; \ -+ done; \ - if [ -f "$${CONFIG_CACHE_FILE}" ]; then \ - export TMP_CACHE_FILE=$$(mktemp); \ - sed -e "/ac_cv_env/d" \ -@@ -490,11 +492,18 @@ kdist_config: prep-deb-files patch-stamp - if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \ - export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ - fi; \ -- if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \ -- elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \ -- export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \ -- fi; \ -+ options="gss crypto pinger checksum flock health_write lru-resize"; \ -+ options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \ -+ options="$${options} libcfs-cdebug libcfs-trace libcfs-assert"; \ -+ options="$${options} panic_dumplog readline libpthread"; \ -+ options="$${options} backoff gni efence"; \ -+ for option in $${options}; do \ -+ if echo "$${DEB_BUILD_PROFILES}" | grep -qw "$${option}"; then \ -+ export EXTRAFLAGS="$${EXTRAFLAGS} --enable-$${option}"; \ -+ elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "no$${option}"; then \ -+ export EXTRAFLAGS="$${EXTRAFLAGS} --disable-$${option}"; \ -+ fi; \ -+ done; \ - if [ -f "$${CONFIG_CACHE_FILE}" ]; then \ - export TMP_CACHE_FILE=$$(mktemp --tmpdir newconfig-XXXXXXXX.cache); \ - sed -e "/ac_cv_env/d" \ -diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 -index 66c97eb044..2e99cff179 100644 ---- a/libcfs/autoconf/lustre-libcfs.m4 -+++ b/libcfs/autoconf/lustre-libcfs.m4 -@@ -10,8 +10,12 @@ AC_ARG_ENABLE([libcfs_cdebug], - [disable libcfs CDEBUG, CWARN]), - [], [enable_libcfs_cdebug="yes"]) - AC_MSG_RESULT([$enable_libcfs_cdebug]) --AS_IF([test "x$enable_libcfs_cdebug" = xyes], -- [AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])]) -+AS_IF([test "x$enable_libcfs_cdebug" = xyes], [ -+ AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN]) -+ AC_SUBST(ENABLE_LIBCFS_CDEBUG, yes) -+], [ -+ AC_SUBST(ENABLE_LIBCFS_CDEBUG, no) -+]) - - AC_MSG_CHECKING([whether to enable ENTRY/EXIT]) - AC_ARG_ENABLE([libcfs_trace], -@@ -19,8 +23,12 @@ AC_ARG_ENABLE([libcfs_trace], - [disable libcfs ENTRY/EXIT]), - [], [enable_libcfs_trace="yes"]) - AC_MSG_RESULT([$enable_libcfs_trace]) --AS_IF([test "x$enable_libcfs_trace" = xyes], -- [AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])]) -+AS_IF([test "x$enable_libcfs_trace" = xyes], [ -+ AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT]) -+ AC_SUBST(ENABLE_LIBCFS_TRACE, yes) -+], [ -+ AC_SUBST(ENABLE_LIBCFS_TRACE, no) -+]) - - AC_MSG_CHECKING([whether to enable LASSERT, LASSERTF]) - AC_ARG_ENABLE([libcfs_assert], -@@ -28,8 +36,12 @@ AC_ARG_ENABLE([libcfs_assert], - [disable libcfs LASSERT, LASSERTF]), - [], [enable_libcfs_assert="yes"]) - AC_MSG_RESULT([$enable_libcfs_assert]) --AS_IF([test x$enable_libcfs_assert = xyes], -- [AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])]) -+AS_IF([test x$enable_libcfs_assert = xyes], [ -+ AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF]) -+ AC_SUBST(ENABLE_LIBCFS_ASSERT, yes) -+], [ -+ AC_SUBST(ENABLE_LIBCFS_ASSERT, no) -+]) - ]) # LIBCFS_CONFIG_CDEBUG - - # -@@ -44,8 +56,12 @@ AC_ARG_ENABLE([panic_dumplog], - [enable panic_dumplog]), - [], [enable_panic_dumplog="no"]) - AC_MSG_RESULT([$enable_panic_dumplog]) --AS_IF([test "x$enable_panic_dumplog" = xyes], -- [AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic])]) -+AS_IF([test "x$enable_panic_dumplog" = xyes], [ -+ AC_DEFINE(LNET_DUMP_ON_PANIC, 1, [use dumplog on panic]) -+ AC_SUBST(ENABLE_PANIC_DUMPLOG, yes) -+], [ -+ AC_SUBST(ENABLE_PANIC_DUMPLOG, no) -+]) - ]) # LIBCFS_CONFIG_PANIC_DUMPLOG - - # -@@ -2534,6 +2550,10 @@ AS_IF([test "x$enable_readline" = xyes], [ - AC_DEFINE(HAVE_LIBREADLINE, 1, - [readline library is available]) - ]) -+ -+ AC_SUBST(ENABLE_READLINE, yes) -+], [ -+ AC_SUBST(ENABLE_READLINE, no) - ]) - AC_SUBST(LIBREADLINE) - -@@ -2551,7 +2571,10 @@ AS_IF([test "x$enable_libpthread" = xyes], [ - AC_DEFINE([HAVE_LIBPTHREAD], 1, - [use libpthread for libcfs library]) - ]) -+ -+ AC_SUBST(ENABLE_LIBPTHREAD, yes) - ], [ -+ AC_SUBST(ENABLE_LIBPTHREAD, no) - AC_MSG_WARN([Using libpthread for libcfs library is disabled explicitly]) - ]) - AC_SUBST(PTHREAD_LIBS) -diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 -index 05dd808a6a..da6fd582b2 100644 ---- a/lnet/autoconf/lustre-lnet.m4 -+++ b/lnet/autoconf/lustre-lnet.m4 -@@ -20,6 +20,11 @@ AS_IF([test "x$enable_backoff" = xyes], [ - ], [ - AC_MSG_RESULT([no]) - ]) -+ -+ AC_SUBST(ENABLE_BACKOFF, yes) -+], [ -+ AC_SUBST(ENABLE_BACKOFF, no) -+ - ]) - ]) # LN_CONFIG_BACKOFF - -@@ -681,6 +686,10 @@ AS_IF([test "x$enable_gni" = xyes], [ - GNICPPFLAGS="$GNICPPFLAGS -DGNILND_USE_RCA=1" - ]) - EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save" -+ -+ AC_SUBST(ENABLE_GNI, yes) -+], [ -+ AC_SUBST(ENABLE_GNI, no) - ]) - AC_SUBST(GNICPPFLAGS) - AC_SUBST(GNILND) -@@ -1020,6 +1029,9 @@ AS_IF([test "$enable_efence" = yes], [ - LIBEFENCE="-lefence" - AC_DEFINE(HAVE_LIBEFENCE, 1, - [libefence support is requested]) -+ AC_SUBST(ENABLE_EFENCE, yes) -+], [ -+ AC_SUBST(ENABLE_EFENCE, no) - ]) - AC_SUBST(LIBEFENCE) - -diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 -index 524645f708..2927df790c 100644 ---- a/lustre/autoconf/lustre-core.m4 -+++ b/lustre/autoconf/lustre-core.m4 -@@ -137,8 +137,12 @@ AC_ARG_ENABLE([pinger], - [disable recovery pinger support]), - [], [enable_pinger="yes"]) - AC_MSG_RESULT([$enable_pinger]) --AS_IF([test "x$enable_pinger" != xno], -- [AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1,[Use the Pinger])]) -+AS_IF([test "x$enable_pinger" != xno], [ -+ AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1, [Use the Pinger]) -+ AC_SUBST(ENABLE_PINGER, yes) -+], [ -+ AC_SUBST(ENABLE_PINGER, no) -+]) - ]) # LC_CONFIG_PINGER - - # -@@ -153,8 +157,12 @@ AC_ARG_ENABLE([checksum], - [disable data checksum support]), - [], [enable_checksum="yes"]) - AC_MSG_RESULT([$enable_checksum]) --AS_IF([test "x$enable_checksum" != xno], -- [AC_DEFINE(ENABLE_CHECKSUM, 1, [do data checksums])]) -+AS_IF([test "x$enable_checksum" != xno], [ -+ AC_DEFINE(CONFIG_ENABLE_CHECKSUM, 1, [do data checksums]) -+ AC_SUBST(ENABLE_CHECKSUM, yes) -+], [ -+ AC_SUBST(ENABLE_CHECKSUM, no) -+]) - ]) # LC_CONFIG_CHECKSUM - - # -@@ -169,8 +177,12 @@ AC_ARG_ENABLE([flock], - [disable flock by default]), - [], [enable_flock="yes"]) - AC_MSG_RESULT([$enable_flock]) --AS_IF([test "x$enable_flock" != xno], -- [AC_DEFINE(ENABLE_FLOCK, 1, [enable flock by default])]) -+AS_IF([test "x$enable_flock" != xno], [ -+ AC_DEFINE(CONFIG_ENABLE_FLOCK, 1, [enable flock by default]) -+ AC_SUBST(ENABLE_FLOCK, yes) -+], [ -+ AC_SUBST(ENABLE_FLOCK, no) -+]) - ]) # LC_CONFIG_FLOCK - - # -@@ -185,8 +197,12 @@ AC_ARG_ENABLE([health_write], - [enable disk writes when doing health check]), - [], [enable_health_write="no"]) - AC_MSG_RESULT([$enable_health_write]) --AS_IF([test "x$enable_health_write" != xno], -- [AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health])]) -+AS_IF([test "x$enable_health_write" != xno], [ -+ AC_DEFINE(USE_HEALTH_CHECK_WRITE, 1, [Write when Checking Health]) -+ AC_SUBST(ENABLE_HEALTH_WRITE, yes) -+], [ -+ AC_SUBST(ENABLE_HEALTH_WRITE, no) -+]) - ]) # LC_CONFIG_HEALTH_CHECK_WRITE - - # -@@ -199,8 +215,12 @@ AC_ARG_ENABLE([lru_resize], - [enable lru resize support]), - [], [enable_lru_resize="yes"]) - AC_MSG_RESULT([$enable_lru_resize]) --AS_IF([test "x$enable_lru_resize" != xno], -- [AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support])]) -+AS_IF([test "x$enable_lru_resize" != xno], [ -+ AC_DEFINE(HAVE_LRU_RESIZE_SUPPORT, 1, [Enable lru resize support]) -+ AC_SUBST(ENABLE_LRU_RESIZE, yes) -+], [ -+ AC_SUBST(ENABLE_LRU_RESIZE, no) -+]) - ]) # LC_CONFIG_LRU_RESIZE - - # -@@ -3311,8 +3331,12 @@ AC_ARG_ENABLE([mindf], - [Make statfs report the minimum available space on any single OST instead of the sum of free space on all OSTs]), - [], [enable_mindf="no"]) - AC_MSG_RESULT([$enable_mindf]) --AS_IF([test "$enable_mindf" = "yes"], -- [AC_DEFINE([MIN_DF], 1, [Report minimum OST free space])]) -+AS_IF([test "$enable_mindf" = "yes"], [ -+ AC_DEFINE([MIN_DF], 1, [Report minimum OST free space]) -+ AC_SUBST(ENABLE_MINDF, yes) -+], [ -+ AC_SUBST(ENABLE_MINDF, no) -+]) - - AC_MSG_CHECKING([whether to randomly failing memory alloc]) - AC_ARG_ENABLE([fail_alloc], -@@ -3320,9 +3344,12 @@ AC_ARG_ENABLE([fail_alloc], - [disable randomly alloc failure]), - [], [enable_fail_alloc="yes"]) - AC_MSG_RESULT([$enable_fail_alloc]) --AS_IF([test "x$enable_fail_alloc" != xno], -- [AC_DEFINE([RANDOM_FAIL_ALLOC], 1, -- [enable randomly alloc failure])]) -+AS_IF([test "x$enable_fail_alloc" != xno], [ -+ AC_DEFINE([RANDOM_FAIL_ALLOC], 1, [enable randomly alloc failure]) -+ AC_SUBST(ENABLE_FAIL_ALLOC, yes) -+], [ -+ AC_SUBST(ENABLE_FAIL_ALLOC, no) -+]) - - AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)]) - AC_ARG_ENABLE([invariants], -@@ -3330,9 +3357,13 @@ AC_ARG_ENABLE([invariants], - [enable invariant checking (cpu intensive)]), - [], [enable_invariants="no"]) - AC_MSG_RESULT([$enable_invariants]) --AS_IF([test "x$enable_invariants" = xyes], -- [AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, -- [enable invariant checking])]) -+AS_IF([test "x$enable_invariants" = xyes], [ -+ AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, -+ [enable invariant checking]) -+ AC_SUBST(ENABLE_INVARIANTS, yes) -+], [ -+ AC_SUBST(ENABLE_INVARIANTS, no) -+]) - - AC_MSG_CHECKING([whether to track references with lu_ref]) - AC_ARG_ENABLE([lu_ref], -@@ -3340,9 +3371,13 @@ AC_ARG_ENABLE([lu_ref], - [enable lu_ref reference tracking code]), - [], [enable_lu_ref="no"]) - AC_MSG_RESULT([$enable_lu_ref]) --AS_IF([test "x$enable_lu_ref" = xyes], -- [AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1, -- [enable lu_ref reference tracking code])]) -+AS_IF([test "x$enable_lu_ref" = xyes], [ -+ AC_DEFINE([CONFIG_LUSTRE_DEBUG_LU_REF], 1, -+ [enable lu_ref reference tracking code]) -+ AC_SUBST(ENABLE_LU_REF, yes) -+], [ -+ AC_SUBST(ENABLE_LU_REF, no) -+]) - - AC_MSG_CHECKING([whether to enable page state tracking]) - AC_ARG_ENABLE([pgstate-track], -@@ -3350,9 +3385,13 @@ AC_ARG_ENABLE([pgstate-track], - [enable page state tracking]), - [], [enable_pgstat_track="no"]) - AC_MSG_RESULT([$enable_pgstat_track]) --AS_IF([test "x$enable_pgstat_track" = xyes], -- [AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1, -- [enable page state tracking code])]) -+AS_IF([test "x$enable_pgstat_track" = xyes], [ -+ AC_DEFINE([CONFIG_DEBUG_PAGESTATE_TRACKING], 1, -+ [enable page state tracking code]) -+ AC_SUBST(ENABLE_PGSTAT_TRACK, yes) -+], [ -+ AC_SUBST(ENABLE_PGSTAT_TRACK, no) -+]) - - PKG_PROG_PKG_CONFIG - AC_MSG_CHECKING([systemd unit file directory]) -diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c -index bf61555c33..1d7a29d76f 100644 ---- a/lustre/ldlm/ldlm_lib.c -+++ b/lustre/ldlm/ldlm_lib.c -@@ -465,7 +465,7 @@ int client_obd_setup(struct obd_device *obd, struct lustre_cfg *lcfg) - - cli->cl_supp_cksum_types = OBD_CKSUM_CRC32; - cli->cl_preferred_cksum_type = 0; --#ifdef ENABLE_CHECKSUM -+#ifdef CONFIG_ENABLE_CHECKSUM - /* Turn on checksumming by default. */ - cli->cl_checksum = 1; - /* -diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c -index dfb6b185b2..f67ea3f7eb 100644 ---- a/lustre/llite/llite_lib.c -+++ b/lustre/llite/llite_lib.c -@@ -162,10 +162,10 @@ static struct ll_sb_info *ll_init_sbi(void) - atomic_set(&sbi->ll_ra_info.ra_async_inflight, 0); - - set_bit(LL_SBI_VERBOSE, sbi->ll_flags); --#ifdef ENABLE_CHECKSUM -+#ifdef CONFIG_ENABLE_CHECKSUM - set_bit(LL_SBI_CHECKSUM, sbi->ll_flags); - #endif --#ifdef ENABLE_FLOCK -+#ifdef CONFIG_ENABLE_FLOCK - set_bit(LL_SBI_FLOCK, sbi->ll_flags); - #endif - --- -2.33.0 - diff --git a/0030-LU-15193-quota-expand-QUOTA_MAX_TRANSIDS-to-12.patch b/0030-LU-15193-quota-expand-QUOTA_MAX_TRANSIDS-to-12.patch deleted file mode 100644 index 8e3843fc1a341a5e9af9e7be47304a8e8bcc4ce3..0000000000000000000000000000000000000000 --- a/0030-LU-15193-quota-expand-QUOTA_MAX_TRANSIDS-to-12.patch +++ /dev/null @@ -1,89 +0,0 @@ -From c20d23cd92c5bc748a618e9ed96e6eddd794ab45 Mon Sep 17 00:00:00 2001 -From: Lei Feng -Date: Thu, 4 Nov 2021 19:41:06 +0800 -Subject: [PATCH 30/61] LU-15193 quota: expand QUOTA_MAX_TRANSIDS to 12 - -In some rare cases 12 quota ids are needed. -Usually (user, group) * (block, inode) * (inode, parent) = 8 qids -are needed. But with project id, -(user, group, project) * (block, inode) * (inode, parent) = 12 qids -are needed. - -Lustre-change: https://review.whamcloud.com/45456 -Lustre-commit: 61481796ac85e9ab2469b8d2f4cc75088c65d298 - -Change-Id: I4b3ee197f6e274abda06edf60b246f089fe28d10 -Signed-off-by: Lei Feng -Test-Parameters: trivial testlist=sanity-quota -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49611 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Stephane Thiell -Reviewed-by: Oleg Drokin -Reviewed-by: Andreas Dilger ---- - lustre/include/lustre_quota.h | 5 +++-- - lustre/tests/sanity-quota.sh | 31 +++++++++++++++++++++++++++++++ - 2 files changed, 34 insertions(+), 2 deletions(-) - -diff --git a/lustre/include/lustre_quota.h b/lustre/include/lustre_quota.h -index 4b674d8b12..6b98f4c9a2 100644 ---- a/lustre/include/lustre_quota.h -+++ b/lustre/include/lustre_quota.h -@@ -234,8 +234,9 @@ struct lquota_id_info { - * a single transaction for inode and block quota, which is chown transaction: - * original uid and gid, new uid and gid. - * -- * This value might need to be revised when directory quota is added. */ --#define QUOTA_MAX_TRANSIDS 8 -+ * Given a parent dir and a sub dir, with different uid, gid and project id, -+ * need x x = 12 ids */ -+#define QUOTA_MAX_TRANSIDS 12 - - /* all qids involved in a single transaction */ - struct lquota_trans { -diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh -index f36601ce5d..5b9ede2d26 100755 ---- a/lustre/tests/sanity-quota.sh -+++ b/lustre/tests/sanity-quota.sh -@@ -5414,6 +5414,37 @@ test_81() { - } - run_test 81 "Race qmt_start_pool_recalc with qmt_pool_free" - -+test_82() -+{ -+ (( $MDS1_VERSION >= $(version_code 2.14.55) )) || -+ skip "need MDS 2.14.55 or later" -+ is_project_quota_supported || -+ skip "skip project quota unsupported" -+ -+ setup_quota_test || error "setup quota failed with $?" -+ stack_trap cleanup_quota_test -+ quota_init -+ -+ local parent_dir="$DIR/$tdir.parent" -+ local child_dir="$parent_dir/child" -+ -+ mkdir -p $child_dir -+ stack_trap "chown -R 0:0 $parent_dir" -+ -+ chown $TSTUSR:$TSTUSR $parent_dir || -+ error "failed to chown on $parent_dir" -+ chown $TSTUSR2:$TSTUSRS2 $child_dir || -+ error "failed to chown on $parent_dir" -+ -+ $LFS project -p 1000 $parent_dir || -+ error "failed to set project id on $parent_dir" -+ $LFS project -p 1001 $child_dir || -+ error "failed to set project id on $child_dir" -+ -+ rmdir $child_dir || error "cannot remove child dir, test failed" -+} -+run_test 82 "verify more than 8 qids for single operation" -+ - quota_fini() - { - do_nodes $(comma_list $(nodes_list)) \ --- -2.33.0 - diff --git a/0031-LU-16916-tests-fix-client_evicted-not-to-ignore-EOPN.patch b/0031-LU-16916-tests-fix-client_evicted-not-to-ignore-EOPN.patch deleted file mode 100644 index a8c67788c0e16f7b7473b3f8c5969e1b944b0851..0000000000000000000000000000000000000000 --- a/0031-LU-16916-tests-fix-client_evicted-not-to-ignore-EOPN.patch +++ /dev/null @@ -1,76 +0,0 @@ -From ff9e29d3b534959261950e45595f970d7f39213f Mon Sep 17 00:00:00 2001 -From: Jian Yu -Date: Fri, 14 Jul 2023 13:22:18 +0800 -Subject: [PATCH 31/61] LU-16916 tests: fix client_evicted() not to ignore - EOPNOTSUPP - -After RHEL 9.x or Ubuntu 22.04 client is evicted, "lfs df" returns -error code 95 (EOPNOTSUPP), which is ignored in check_lfs_df_ret_val() -and then causes client_evicted() to ingore that error. - -This patch fixes client_evicted() to check the return value -from "lfs df" directly so as not to ignore EOPNOTSUPP. - -Lustre-change: https://review.whamcloud.com/51667 -Lustre-commit: a5a9ded43b72238c2df8e0a74f03151ea3d4ce99 - -Test-Parameters: trivial clientdistro=el9.2 testlist=replay-vbr -Test-Parameters: trivial clientdistro=el8.8 testlist=replay-vbr - -Change-Id: I633ae8769fc563b8068f433e2afae29463ac5553 -Signed-off-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51668 -Reviewed-by: Oleg Drokin -Reviewed-by: Andreas Dilger -Reviewed-by: Arshad Hussain -Tested-by: Maloo -Tested-by: jenkins ---- - lustre/tests/test-framework.sh | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh -index 2c92993117..6126541ef4 100755 ---- a/lustre/tests/test-framework.sh -+++ b/lustre/tests/test-framework.sh -@@ -3583,16 +3583,25 @@ wait_remote_prog () { - return $rc - } - --lfs_df_check() { -+_lfs_df_check() { - local clients=${1:-$CLIENTS} - local rc=0 - -- if [ -z "$clients" ]; then -+ if [[ -z "$clients" ]]; then - $LFS df $MOUNT > /dev/null || rc=$? - else - $PDSH $clients "$LFS df $MOUNT" > /dev/null || rc=$? - fi - -+ return $rc -+} -+ -+lfs_df_check() { -+ local clients=${1:-$CLIENTS} -+ local rc=0 -+ -+ _lfs_df_check "$clients" || rc=$? -+ - check_lfs_df_ret_val $rc - } - -@@ -3622,7 +3631,8 @@ client_up() { - } - - client_evicted() { -- ! client_up $1 -+ sleep 1 -+ ! _lfs_df_check $1 - } - - client_reconnect_try() { --- -2.33.0 - diff --git a/0032-LU-16626-build-remove-python2-dependencies.patch b/0032-LU-16626-build-remove-python2-dependencies.patch deleted file mode 100644 index 5c1451ad878660d49a0b1f734482c1dd7dc0b611..0000000000000000000000000000000000000000 --- a/0032-LU-16626-build-remove-python2-dependencies.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 53f40033ccf9eeb4155b18f4046f33b19252aa18 Mon Sep 17 00:00:00 2001 -From: Alex Deiter -Date: Thu, 9 Mar 2023 18:09:19 +0400 -Subject: [PATCH 32/61] LU-16626 build: remove python2 dependencies - -Fixed packaging issue caused by zfsobj2fid script. - -Lustre-change: https://review.whamcloud.com/50241 -Lustre-commit: 404a1e827b0a9d86864695c8699e1ca076be6c9d - -Test-Parameters: trivial -Signed-off-by: Alex Deiter -Change-Id: I4375038b0d2c2b42ac4080fe834d35bdd3ef54f8 -Reviewed-by: Minh Diep -Reviewed-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51426 -Reviewed-by: Oleg Drokin -Tested-by: jenkins -Tested-by: Maloo ---- - lustre/scripts/zfsobj2fid | 47 ++++++++++++++++++++++----------------- - 1 file changed, 26 insertions(+), 21 deletions(-) - -diff --git a/lustre/scripts/zfsobj2fid b/lustre/scripts/zfsobj2fid -index f7ae96bd17..a76095e1de 100755 ---- a/lustre/scripts/zfsobj2fid -+++ b/lustre/scripts/zfsobj2fid -@@ -1,4 +1,4 @@ --#!/usr/bin/env python2 -+#!/usr/bin/env python3 - - # Copyright (c) 2014, Lawrence Livermore National Security, LLC. - # Produced at the Lawrence Livermore National Laboratory. -@@ -27,21 +27,31 @@ - import sys - import subprocess - --def from_bytes(b): -- return sum(b[i] << i*8 for i in range(len(b))) -+def from_bytes(data): -+ return hex(sum(data[i] << i * 8 for i in range(len(data)))) - - def main(): - if len(sys.argv) != 3: -- print "Usage:", sys.argv[0], " " -+ print('Usage:', sys.argv[0], '', '') - return 1 - -- p = subprocess.Popen(["zdb", "-e", "-vvv", sys.argv[1], sys.argv[2]], -- stdout=subprocess.PIPE) -- pout, perr = p.communicate() -+ cmd = ['zdb', '-e', '-vvv', sys.argv[1], sys.argv[2]] -+ process = subprocess.Popen(cmd, -+ stdout=subprocess.PIPE, -+ stderr=subprocess.PIPE, -+ universal_newlines=True) -+ stdout, stderr = process.communicate() -+ result = process.returncode - -- b = bytearray() -+ if result != 0: -+ msg = 'Error %d on %s: %s %s' % (result, cmd, stdout, stderr) -+ raise RuntimeError(msg) -+ -+ lines = stdout.splitlines() -+ data = bytearray() - found_fid = False -- for line in pout.split('\n'): -+ -+ for line in lines: - part = line.split() - if not part or part[0] != 'trusted.fid': - continue -@@ -53,24 +63,19 @@ def main(): - if val == '\\': - val = fid[0:3] - fid = fid[3:] -- b.append(int(val, 8)) -+ data.append(int(val, 8)) - else: -- b.append(ord(val)) -+ data.append(ord(val)) - break - - if not found_fid: -- print "FID not found on", sys.argv[1], sys.argv[2] -+ print('FID not found on', sys.argv[1], sys.argv[2]) - return 1 - -- print '[' \ -- + hex(from_bytes(b[0:8])) \ -- + ':' \ -- + hex(from_bytes(b[8:12])) \ -- + ':' \ -- + hex(from_bytes(b[12:16])) \ -- + ']' -- -+ print('[%s:%s:%s]' % (from_bytes(data[0:8]), -+ from_bytes(data[8:12]), -+ from_bytes(data[12:16]))) - return 0 - - if __name__ == '__main__': -- sys.exit(main()) -+ sys.exit(main()) --- -2.33.0 - diff --git a/0033-LU-16943-tests-use-primary-ost1-server-in-replay-sin.patch b/0033-LU-16943-tests-use-primary-ost1-server-in-replay-sin.patch deleted file mode 100644 index e55124be8d0be22b443f2daa40e45ee341a94962..0000000000000000000000000000000000000000 --- a/0033-LU-16943-tests-use-primary-ost1-server-in-replay-sin.patch +++ /dev/null @@ -1,48 +0,0 @@ -From db9108300af2949a7ff334973f3df4486cec4a6a Mon Sep 17 00:00:00 2001 -From: Jian Yu -Date: Wed, 23 Aug 2023 18:01:20 -0700 -Subject: [PATCH 33/61] LU-16943 tests: use primary ost1 server in - replay-single/135 - -This patch fixes replay-single test_135() to make sure -the primary ost1 server is used at the beginning of the test. - -Lustre-change: https://review.whamcloud.com/52058 -Lustre-commit: cdd8b056bff0d48155eaf4b7732d1d8880ceda55 - -Test-Parameters: trivial testlist=replay-single - -Test-Parameters: trivial env=FAILURE_MODE=HARD \ - clientcount=4 mdtcount=1 mdscount=2 osscount=2 \ - austeroptions=-R failover=true iscsi=1 \ - testlist=replay-single,mmp - -Fixes: 81418be83ed8 ("LU-16943 tests: fix replay-single/135 under hard failure mode") -Change-Id: Ia25314255c9f00ba71687e1f757517f37031caed -Signed-off-by: Jian Yu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52059 -Reviewed-by: Oleg Drokin -Reviewed-by: Alex Deiter -Tested-by: jenkins -Tested-by: Maloo ---- - lustre/tests/replay-single.sh | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh -index f631b73125..c02bcc2c18 100755 ---- a/lustre/tests/replay-single.sh -+++ b/lustre/tests/replay-single.sh -@@ -4958,6 +4958,9 @@ run_test 134 "replay creation of a file created in a pool" - - # LU-14027 - test_135() { -+ # make sure we are using the primary server -+ [[ $(facet_active ost1) == "ost1" ]] || fail ost1 -+ - mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed" - - # All files to ost1 --- -2.33.0 - diff --git a/0034-LU-16585-build-remove-python2-dependencies.patch b/0034-LU-16585-build-remove-python2-dependencies.patch deleted file mode 100644 index 48f695d4e5e2dc89eab280c0a0f572acd8180e3f..0000000000000000000000000000000000000000 --- a/0034-LU-16585-build-remove-python2-dependencies.patch +++ /dev/null @@ -1,164 +0,0 @@ -From cfc219ced11adf837e3bd1e356217f33cbe68317 Mon Sep 17 00:00:00 2001 -From: Alex Deiter -Date: Wed, 22 Feb 2023 02:27:47 +0400 -Subject: [PATCH 34/61] LU-16585 build: remove python2 dependencies - -Fixed packaging issue casued by scripts and control files. - -Lustre-change: https://review.whamcloud.com/50084 -Lustre-commit: bea3f81f84fd16d2d403682ef25b8abe314acd0f - -Test-Parameters: trivial -Signed-off-by: Alex Deiter -Change-Id: I6c9b24bf811269928494af17c15627902e5fe27b -Reviewed-by: Patrick Farrell -Reviewed-by: Feng Lei -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52176 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - contrib/scripts/gerrit_checkpatch.py | 29 ++++++++++++++-------------- - debian/control | 2 +- - debian/control.main | 2 +- - 3 files changed, 17 insertions(+), 16 deletions(-) - -diff --git a/contrib/scripts/gerrit_checkpatch.py b/contrib/scripts/gerrit_checkpatch.py -index 9dbf1383ca..1563413abb 100755 ---- a/contrib/scripts/gerrit_checkpatch.py -+++ b/contrib/scripts/gerrit_checkpatch.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python2 -+#!/usr/bin/env python3 - # - # GPL HEADER START - # -@@ -33,6 +33,7 @@ Gerrit Checkpatch Reviewer Daemon - * POST reviews back to gerrit based on checkpatch output. - """ - -+from __future__ import print_function - import base64 - import fnmatch - import logging -@@ -41,7 +42,7 @@ import os - import requests - import subprocess - import time --import urllib -+from six.moves.urllib.parse import quote - - def _getenv_list(key, default=None, sep=':'): - """ -@@ -144,7 +145,7 @@ def parse_checkpatch_output(out, path_line_comments, warning_count): - except ValueError: - level, kind, message = None, None, None - -- if level != 'ERROR' and level != 'WARNING': -+ if level not in ('ERROR', 'WARNING'): - level, kind, message = None, None, None - - -@@ -155,9 +156,9 @@ def review_input_and_score(path_line_comments, warning_count): - """ - review_comments = {} - -- for path, line_comments in path_line_comments.iteritems(): -+ for path, line_comments in list(path_line_comments.items()): - path_comments = [] -- for line, comment_list in line_comments.iteritems(): -+ for line, comment_list in list(line_comments.items()): - message = '\n'.join(comment_list) - path_comments.append({'line': line, 'message': message}) - review_comments[path] = path_comments -@@ -194,7 +195,7 @@ def review_input_and_score(path_line_comments, warning_count): - - def _now(): - """_""" -- return long(time.time()) -+ return int(time.time()) - - - class Reviewer(object): -@@ -214,7 +215,7 @@ class Reviewer(object): - self.history_path = history_path - self.history_mode = 'rw' - self.history = {} -- self.timestamp = 0L -+ self.timestamp = 0 - self.post_enabled = True - self.post_interval = 10 - self.update_interval = 300 -@@ -292,7 +293,7 @@ class Reviewer(object): - for line in history_file: - epoch, change_id, revision, score = line.split() - if change_id == '-': -- self.timestamp = long(float(epoch)) -+ self.timestamp = int(float(epoch)) - else: - self.history[change_id + ' ' + revision] = score - -@@ -311,7 +312,7 @@ class Reviewer(object): - - if 'w' in self.history_mode: - with open(self.history_path, 'a') as history_file: -- print >> history_file, epoch, change_id, revision, score -+ print(epoch, change_id, revision, score, file=history_file) - - def in_history(self, change_id, revision): - """ -@@ -323,8 +324,8 @@ class Reviewer(object): - """ - GET one change by id. - """ -- path = ('/changes/' + urllib.quote(self.project, safe='') + '~' + -- urllib.quote(self.branch, safe='') + '~' + change_id + -+ path = ('/changes/' + quote(self.project, safe='') + '~' + -+ quote(self.branch, safe='') + '~' + change_id + - '?o=CURRENT_REVISION') - res = self._get(path) - if not res: -@@ -343,11 +344,11 @@ class Reviewer(object): - """ - query = dict(query) - project = query.get('project', self.project) -- query['project'] = urllib.quote(project, safe='') -+ query['project'] = quote(project, safe='') - branch = query.get('branch', self.branch) -- query['branch'] = urllib.quote(branch, safe='') -+ query['branch'] = quote(branch, safe='') - path = ('/changes/?q=' + -- '+'.join(k + ':' + v for k, v in query.iteritems()) + -+ '+'.join(k + ':' + v for k, v in list(query.items())) + - '&o=CURRENT_REVISION') - res = self._get(path) - if not res: -diff --git a/debian/control b/debian/control -index ac91ac2f24..836623edc4 100644 ---- a/debian/control -+++ b/debian/control -@@ -72,7 +72,7 @@ Package: lustre-iokit - Section: utils - Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 - Priority: optional --Depends: lustre-client-utils (= ${binary:Version}), python2, perl, sg3-utils -+Depends: lustre-client-utils (= ${binary:Version}), python3, perl, sg3-utils - Description: Collection of benchmark tools for the Lustre filesystem - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from -diff --git a/debian/control.main b/debian/control.main -index ac91ac2f24..836623edc4 100644 ---- a/debian/control.main -+++ b/debian/control.main -@@ -72,7 +72,7 @@ Package: lustre-iokit - Section: utils - Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 - Priority: optional --Depends: lustre-client-utils (= ${binary:Version}), python2, perl, sg3-utils -+Depends: lustre-client-utils (= ${binary:Version}), python3, perl, sg3-utils - Description: Collection of benchmark tools for the Lustre filesystem - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from --- -2.33.0 - diff --git a/0035-LU-15660-statahead-statahead-thread-doesn-t-stop.patch b/0035-LU-15660-statahead-statahead-thread-doesn-t-stop.patch deleted file mode 100644 index c58014eff9fa71dc1fc19912a7eb318aa92a4052..0000000000000000000000000000000000000000 --- a/0035-LU-15660-statahead-statahead-thread-doesn-t-stop.patch +++ /dev/null @@ -1,96 +0,0 @@ -From f7438d13b2aadbdf8e90e5b0b7732eeb20f3d475 Mon Sep 17 00:00:00 2001 -From: Yang Sheng -Date: Fri, 17 Jun 2022 20:30:34 +0800 -Subject: [PATCH 35/61] LU-15660 statahead: statahead thread doesn't stop - -Add a barrier to ensure sai_task changing can be seen -when access it without locking. Else the statahead -thread could sleep forever since wake_up was lost. - -Lustre-change: https://review.whamcloud.com/47673 -Lustre-commit: b977caa2dc7dddcec9e20d393ee79dfa9fe31c0d - -Signed-off-by: Yang Sheng -Change-Id: I211e99f1bdddaaaf028a205658f603fda034d389 -Reviewed-by: Neil Brown -Reviewed-by: Andreas Dilger -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52300 -Tested-by: jenkins -Tested-by: Maloo -Reviewed-by: Oleg Drokin ---- - lustre/llite/statahead.c | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c -index faf2860c8b..9df5137d9a 100644 ---- a/lustre/llite/statahead.c -+++ b/lustre/llite/statahead.c -@@ -1055,7 +1055,8 @@ static int ll_statahead_thread(void *arg) - if (!op_data) - GOTO(out, rc = -ENOMEM); - -- while (pos != MDS_DIR_END_OFF && sai->sai_task) { -+ /* matches smp_store_release() in ll_deauthorize_statahead() */ -+ while (pos != MDS_DIR_END_OFF && smp_load_acquire(&sai->sai_task)) { - struct lu_dirpage *dp; - struct lu_dirent *ent; - -@@ -1081,7 +1082,8 @@ static int ll_statahead_thread(void *arg) - - dp = page_address(page); - for (ent = lu_dirent_start(dp); -- ent != NULL && sai->sai_task && -+ /* matches smp_store_release() in ll_deauthorize_statahead() */ -+ ent != NULL && smp_load_acquire(&sai->sai_task) && - !sa_low_hit(sai); - ent = lu_dirent_next(ent)) { - __u64 hash; -@@ -1134,7 +1136,9 @@ static int ll_statahead_thread(void *arg) - fid_le_to_cpu(&fid, &ent->lde_fid); - - while (({set_current_state(TASK_IDLE); -- sai->sai_task; })) { -+ /* matches smp_store_release() in -+ * ll_deauthorize_statahead() */ -+ smp_load_acquire(&sai->sai_task); })) { - if (sa_has_callback(sai)) { - __set_current_state(TASK_RUNNING); - sa_handle_callback(sai); -@@ -1217,7 +1221,8 @@ static int ll_statahead_thread(void *arg) - * for file release to stop me. - */ - while (({set_current_state(TASK_IDLE); -- sai->sai_task; })) { -+ /* matches smp_store_release() in ll_deauthorize_statahead() */ -+ smp_load_acquire(&sai->sai_task); })) { - if (sa_has_callback(sai)) { - __set_current_state(TASK_RUNNING); - sa_handle_callback(sai); -@@ -1304,7 +1309,8 @@ void ll_deauthorize_statahead(struct inode *dir, void *key) - */ - struct task_struct *task = sai->sai_task; - -- sai->sai_task = NULL; -+ /* matches smp_load_acquire() in ll_statahead_thread() */ -+ smp_store_release(&sai->sai_task, NULL); - wake_up_process(task); - } - spin_unlock(&lli->lli_sa_lock); -@@ -1686,11 +1692,10 @@ static int start_statahead_thread(struct inode *dir, struct dentry *dentry, - GOTO(out, rc); - } - -- if (test_bit(LL_SBI_AGL_ENABLED, ll_i2sbi(parent->d_inode)->ll_flags) && -- agl) -+ if (test_bit(LL_SBI_AGL_ENABLED, sbi->ll_flags) && agl) - ll_start_agl(parent, sai); - -- atomic_inc(&ll_i2sbi(parent->d_inode)->ll_sa_total); -+ atomic_inc(&sbi->ll_sa_total); - sai->sai_task = task; - - wake_up_process(task); --- -2.33.0 - diff --git a/0036-LU-16042-tests-can-not-get-cache-size-on-Arm64.patch b/0036-LU-16042-tests-can-not-get-cache-size-on-Arm64.patch deleted file mode 100644 index 230feeca894d87d47312951b5460100dc12b2a16..0000000000000000000000000000000000000000 --- a/0036-LU-16042-tests-can-not-get-cache-size-on-Arm64.patch +++ /dev/null @@ -1,51 +0,0 @@ -From a9e47f3bf9255047890d9aa886954432fe058ef5 Mon Sep 17 00:00:00 2001 -From: Kevin Zhao -Date: Mon, 25 Jul 2022 15:53:44 +0800 -Subject: [PATCH 36/61] LU-16042 tests: can not get cache size on Arm64 - -This fix the test fail on Arm64, the cache size can not be -display on /proc/cpuinfo. And even in the VM and somee -older Arm64 CPU, we can not get the cachesize. So it's -better to fallback to a pre-set value here if we don't get -the cache size. - -Lustre-change: https://review.whamcloud.com/48030 -Lustre-commit: f276f1cb0859e8718448e69bd99ee305f5e62d42 - -Test-Parameters: trivial -Test-Parameters: clientarch=aarch64 clientdistro=el8.7 \ - testlist=sanity env=ONLY=155 - -Signed-off-by: Kevin Zhao -Change-Id: I17ce1d8accc69d1489db2071a2741b3927fff302 -Reviewed-by: Andreas Dilger -Reviewed-by: James Simmons -Signed-off-by: Xinliang Liu -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51179 -Tested-by: Maloo -Tested-by: jenkins -Reviewed-by: Oleg Drokin ---- - lustre/tests/sanity.sh | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 93f8c3b30c..7b4d43ef12 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -15602,6 +15602,12 @@ test_155_big_load() { - free_min_max - local cache_size=$(do_facet ost$((MAXI+1)) \ - "awk '/cache/ {sum+=\\\$4} END {print sum}' /proc/cpuinfo") -+ -+ # LU-16042: can not get the cache size on Arm64 VM here, fallback to a -+ # pre-set value -+ if [ -z "$cache_size" ]; then -+ cache_size=256 -+ fi - local large_file_size=$((cache_size * 2)) - - echo "OSS cache size: $cache_size KB" --- -2.33.0 - diff --git a/0037-LU-16662-autoconf-fix-configure-test-compile-for-CON.patch b/0037-LU-16662-autoconf-fix-configure-test-compile-for-CON.patch deleted file mode 100644 index 0f3224cb3461401121ddebef9a2099cffdfed0bf..0000000000000000000000000000000000000000 --- a/0037-LU-16662-autoconf-fix-configure-test-compile-for-CON.patch +++ /dev/null @@ -1,76 +0,0 @@ -From da20815eeddf748ec815071fec8a786f1bc7c37b Mon Sep 17 00:00:00 2001 -From: Xinliang Liu -Date: Thu, 6 Apr 2023 23:24:04 -0700 -Subject: [PATCH 37/61] LU-16662 autoconf: fix configure test compile for - CONFIG_KEYS - -This fixes below configure error on Linux v5.19+: -$ ./configure --disable-server -... -checking whether to enable gss keyring backend... yes -checking if Linux kernel was built with CONFIG_KEYS in or as module... -no -configure: WARNING: GSS keyring backend requires that CONFIG_KEYS be -enabled in your kernel. -checking for keyctl_search in -lkeyutils... yes -configure: error: Cannot enable gss_keyring. See above for details. -$ grep CONFIG_KEYS -rn /boot/config-* -6884:CONFIG_KEYS=y - -For in-tree IB support and without passing Linux src path when run -./configure, the LINUX_OBJ maybe just a soft link to O2IBPATH, they -are pointing to the same dir. E.g.: -O2IBPATH='/usr/src/kernels/6.1.8-3.0.0.7.oe1.aarch64' -LINUX_OBJ='/lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build' -$ ls -l /lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build -lrwxrwxrwx 1 root root 42 Feb 7 00:00 -/lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build -> -/usr/src/kernels/6.1.8-3.0.0.7.oe1.aarch64 -In this case, current configure will put kernel's Module.symvers to -variable KBUILD_EXTRA_SYMBOLS. This should be avoided after kernel -v5.19 which contains commit "b8422711080f modpost: make multiple export -error". This making multiple export symbol as an error from a warning -which can be seen in the config.log: -... -ERROR: modpost: vmlinux: 'init_uts_ns' exported twice. Previous export -was in vmlinux -... - -Lustre-change: https://review.whamcloud.com/50399 -Lustre-commit: 321a533b868908f37d01a4b787f5a463a02e427c - -Test-Parameters: trivial -Change-Id: I35295b3acc7fffb93716362f5d8c659eb922afcb -Signed-off-by: Xinliang Liu -Reviewed-by: Shaun Tancheff -Reviewed-by: James Simmons -Signed-off-by: Xinliang Liu ---- - lnet/autoconf/lustre-lnet.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 -index da6fd582b2..f1dce43dd3 100644 ---- a/lnet/autoconf/lustre-lnet.m4 -+++ b/lnet/autoconf/lustre-lnet.m4 -@@ -251,7 +251,7 @@ AS_IF([test $ENABLEO2IB = "no"], [ - O2IB_SYMVER=$LINUX_OBJ/Module.symvers - fi - if test -n "$O2IB_SYMVER"; then -- if test "$O2IB_SYMVER" != "$LINUX_OBJ/Module.symvers"; then -+ if test ! "$O2IB_SYMVER" -ef "$LINUX_OBJ/Module.symvers"; then - AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path O2IB]) - EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER" - AC_SUBST(EXTRA_SYMBOLS) -@@ -292,7 +292,7 @@ AC_SUBST(ENABLEO2IB) - - AS_IF([test $ENABLEO2IB != "no"], [ - EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE" -- if test $O2IBPATH != $LINUX_OBJ; then -+ if test ! $O2IBPATH -ef $LINUX_OBJ; then - KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $O2IBPATH/Module.symvers" - fi - --- -2.33.0 - diff --git a/0052-LU-16541-tests-Improve-test-64f.patch b/0052-LU-16541-tests-Improve-test-64f.patch deleted file mode 100644 index be634137910bfe679b129667f6baab841ba3265c..0000000000000000000000000000000000000000 --- a/0052-LU-16541-tests-Improve-test-64f.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 53e17f37ab36d4c70cff671115b6dfc5cf9b44db Mon Sep 17 00:00:00 2001 -From: Patrick Farrell -Date: Tue, 22 Aug 2023 12:32:52 -0400 -Subject: [PATCH 52/61] LU-16541 tests: Improve test 64f - -The buffered IO part of test 64f has several timing related -holes and other oddities. The use of multiop in the -background does not guarantee the RPC will not be sent, AND -the test doesn't kill it correctly. - -Clean this up and make a more reliable version of the test. -Hopefully this will resolve the failure issues, if not, a -better version of the test will allow debugging. - -Test-Parameters: trivial -Test-Parameters: testlist=sanity envdefinitions=ONLY=64f,ONLY_REPEAT=20 -Test-Parameters: clientarch=aarch64 testlist=sanity envdefinitions=ONLY=64f,ONLY_REPEAT=20 -Signed-off-by: Patrick Farrell -Change-Id: I25b825e1d9d516635ef8cbd26dd12809625c34df -Signed-off-by: Xinliang Liu ---- - lustre/tests/sanity.sh | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 7b4d43ef12..c2693abd2d 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -8953,18 +8953,23 @@ test_64f() { - - $LFS setstripe -c 1 -i 0 $DIR/$tfile || error "lfs setstripe failed" - -- local cmd="oO_WRONLY:w${write_bytes}_yc" -+ # Testing that buffered IO consumes grant on the client - -- $MULTIOP $DIR/$tfile $cmd & -- MULTIPID=$! -- sleep 1 -+ # Delay the RPC on the server so it's guaranteed to not complete even -+ # if the RPC is sent from the client -+ #define OBD_FAIL_PTLRPC_PAUSE_REQ 0x50a -+ $LCTL set_param fail_loc=0x50a fail_val=3 -+ dd if=/dev/zero of=$DIR/$tfile bs=$write_bytes count=1 conv=notrunc || -+ error "error writing to $DIR/$tfile with buffered IO" - - check_grants $osc_tgt $((init_grants - grants)) \ - "buffered io, not write rpc" - -- kill -USR1 $MULTIPID -- wait -+ # Clear the fail loc and do a sync on the client -+ $LCTL set_param fail_loc=0 fail_val=0 -+ sync - -+ # RPC is now known to have sent - check_grants $osc_tgt $((init_grants - grants + chunk)) \ - "buffered io, one RPC" - } --- -2.33.0 - diff --git a/0055-LU-14992-tests-add-more-mkdir_on_mdt0-calls.patch b/0055-LU-14992-tests-add-more-mkdir_on_mdt0-calls.patch deleted file mode 100644 index 8d556ba513b1bcc772cec81357a5d2269671f3c5..0000000000000000000000000000000000000000 --- a/0055-LU-14992-tests-add-more-mkdir_on_mdt0-calls.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e1528526b18088a6c03af79b240e9b41e7cabfea Mon Sep 17 00:00:00 2001 -From: Mr NeilBrown -Date: Mon, 28 Nov 2022 07:49:50 +1100 -Subject: [PATCH 55/61] LU-14992 tests: add more mkdir_on_mdt0 calls - -A previous patch changed some mkdir calls in test_133a to -mkdir_on_mdt0. This allows stats collected from mdt0 to -reflect the mkdir. - -However two mkdir calls were missed, so "crossdir_rename" stats can be -wrong. - -Test-Parameters: trivial mdscount=2 mdtcount=4 testlist=sanity env=ONLY=133a - -Fixes: f0324c5c2f ("LU-14992 tests: sanity/replay-vbr mkdir on MDT0") -Signed-off-by: Mr NeilBrown -Change-Id: I4e5c2e5504307462bff4012a13ef9deb24f8da8c -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49252 -Reviewed-by: Andreas Dilger -Reviewed-by: Oleg Drokin -Reviewed-by: Jian Yu -Tested-by: jenkins -Tested-by: Maloo -Signed-off-by: Xinliang Liu -(cherry picked from commit d56ea0c80a959ebd9b393f2da048cc179cb16127) ---- - lustre/tests/sanity.sh | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 3ebb944ab2..5e52f9c868 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -14158,8 +14158,8 @@ test_133a() { - check_stats $SINGLEMDS "rmdir" 1 - - local testdir1=$DIR/${tdir}/stats_testdir1 -- mkdir -p ${testdir} -- mkdir -p ${testdir1} -+ mkdir_on_mdt0 -p ${testdir} -+ mkdir_on_mdt0 -p ${testdir1} - touch ${testdir1}/test1 - mv ${testdir1}/test1 ${testdir} || error "file crossdir rename" - check_stats $SINGLEMDS "crossdir_rename" 1 --- -2.33.0 - diff --git a/0056-LU-15816-tests-use-correct-ost-host-to-manage-failur.patch b/0056-LU-15816-tests-use-correct-ost-host-to-manage-failur.patch deleted file mode 100644 index afeb9a9ed0cab9f6403fe9abae1d4198cb0b352d..0000000000000000000000000000000000000000 --- a/0056-LU-15816-tests-use-correct-ost-host-to-manage-failur.patch +++ /dev/null @@ -1,72 +0,0 @@ -From d64f9f6849d46b98fc1a1fbe52484cf805baf6a4 Mon Sep 17 00:00:00 2001 -From: Mr NeilBrown -Date: Fri, 25 Nov 2022 16:13:20 +1100 -Subject: [PATCH 56/61] LU-15816 tests: use correct ost host to manage failure - -sanity test_398m sets up striping across 2 OSTs. It ensures that -failing IO to either OST individually will fail the total IO. - -However it sends the command to fail IO for the second OST (OST1) to -the host managing the first OST (ost1). If the first 2 OSTs are on -the same host, this works. If not, it fails. - -Also there error messages when testing the second stripe say "first -stripe". - -Test-Parameters: trivial env=ONLY=398m -Signed-off-by: Mr NeilBrown -Change-Id: Ic7085dab2610fa2c044a966fd8de40def0438ca4 -Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49248 -Reviewed-by: Andreas Dilger -Reviewed-by: James Simmons -Reviewed-by: Oleg Drokin -Tested-by: jenkins -Tested-by: Maloo -Signed-off-by: Xinliang Liu -(cherry picked from commit 6e66cbdb5c8c08193c36262649667747127b6d90) ---- - lustre/tests/sanity.sh | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh -index 5e52f9c868..76f261b2d1 100755 ---- a/lustre/tests/sanity.sh -+++ b/lustre/tests/sanity.sh -@@ -24839,6 +24839,7 @@ test_398m() { # LU-13798 - # Set up failure on OST0, the first stripe: - #define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e - #NB: Fail val is ost # + 1, because we cannot use cfs_fail_val = 0 -+ # OST0 is on ost1, OST1 is on ost2. - # So this fail_val specifies OST0 - do_facet ost1 $LCTL set_param fail_loc=0x20e fail_val=1 - stack_trap "do_facet ost1 $LCTL set_param fail_loc=0" -@@ -24864,13 +24865,13 @@ test_398m() { # LU-13798 - # Clear file contents, maintain striping - echo > $DIR/$tfile - # Set up failure on OST1, second stripe: -- do_facet ost1 $LCTL set_param fail_loc=0x20e fail_val=2 -- stack_trap "do_facet ost1 $LCTL set_param fail_loc=0" -+ do_facet ost2 $LCTL set_param fail_loc=0x20e fail_val=2 -+ stack_trap "do_facet ost2 $LCTL set_param fail_loc=0" - - dd if=/dev/urandom of=$DIR/$tfile bs=8M count=8 oflag=direct && -- error "parallel dio write with failure on first stripe succeeded" -+ error "parallel dio write with failure on second stripe succeeded" - stack_trap "rm -f $DIR/$tfile" -- do_facet ost1 $LCTL set_param fail_loc=0 fail_val=0 -+ do_facet ost2 $LCTL set_param fail_loc=0 fail_val=0 - - # Place data in file for read - dd if=/dev/urandom of=$DIR/$tfile bs=8M count=8 oflag=direct || -@@ -24880,7 +24881,7 @@ test_398m() { # LU-13798 - #define OBD_FAIL_OST_BRW_READ_BULK 0x20f - do_facet ost2 $LCTL set_param fail_loc=0x20f fail_val=2 - dd if=$DIR/$tfile of=$DIR/$tfile.2 bs=8M count=8 iflag=direct && -- error "parallel dio read with error on first stripe succeeded" -+ error "parallel dio read with error on second stripe succeeded" - rm -f $DIR/$tfile.2 - do_facet ost2 $LCTL set_param fail_loc=0 fail_val=0 - } --- -2.33.0 - diff --git a/2.15.3.tar.gz b/2.15.4.tar.gz similarity index 77% rename from 2.15.3.tar.gz rename to 2.15.4.tar.gz index 68890f571280382a1d7c33d6fcff991bce89cb7a..7a8160f92141a397d3e4ad2766e86f7613689e42 100644 Binary files a/2.15.3.tar.gz and b/2.15.4.tar.gz differ diff --git a/lustre.spec b/lustre.spec index a91349bb088ed4adc82082b4b30a024d29f90afa..55176ee5f28160177170c19f0025b29a97385a56 100644 --- a/lustre.spec +++ b/lustre.spec @@ -49,7 +49,7 @@ %undefine with_lustre_tests %endif -%{!?version: %global version 2.15.3} +%{!?version: %global version 2.15.4} # if you want a custom kernel version set it variable with $ver.$arch %{!?kver: %global kver %(rpm -q --qf '%%{VERSION}-%%{RELEASE}.%%{ARCH}' `rpm -q kernel-devel | sort -rV|head -n 1`)} # cut epoch for kmodtool @@ -184,8 +184,8 @@ Summary: Lustre File System Name: %{lustre_name} -Version: 2.15.3 -Release: 3 +Version: 2.15.4 +Release: 1 License: GPL-2.0-only AND LGPL-2.1-or-later Group: System Environment/Kernel Source: https://github.com/lustre/lustre-release/archive/refs/tags/%{version}.tar.gz @@ -203,69 +203,29 @@ URL: https://wiki.whamcloud.com/ BuildRoot: %{_tmppath}/lustre-%{version}-root # patches -Patch01: 0001-Prepare-for-next-pointrelease.patch -Patch02: 0002-LU-15821-ldlm-Prioritize-blocking-callbacks.patch -Patch03: 0003-LU-14377-tests-make-parallel-scale-rr_alloc-less-str.patch -Patch04: 0004-LU-15123-tests-check-quota-reintegration-after-recov.patch -Patch05: 0005-LU-13081-tests-skip-sanity-test_151-test_156.patch -Patch06: 0006-LU-11785-tests-fix-conf-sanity-98-mount-check-on-64K.patch -Patch07: 0007-LU-11388-tests-replay-single-131b-to-refresh-grants.patch -Patch08: 0008-LU-16163-tests-skip-racer_on_nfs-for-NFSv3.patch -Patch09: 0009-LU-14294-tests-fixed-NFS-configuration-issue.patch -Patch10: 0010-LU-16717-mdt-treat-unknown-hash-type-as-sane-type.patch -Patch11: 0011-LU-15481-llog-Add-LLOG_SKIP_PLAIN-to-skip-llog-plain.patch -Patch12: 0012-LU-6612-utils-strengthen-llog_reader-vs-wrong-format.patch -Patch13: 0013-LU-16052-llog-handle-EBADR-for-catalog-processing.patch -Patch14: 0014-LU-16717-mdt-resume-dir-migration-with-bad_type.patch -Patch15: 0015-LU-14668-lnet-Lock-primary-NID-logic.patch -Patch16: 0016-LU-14668-lnet-Peers-added-via-kernel-API-should-be-p.patch -Patch17: 0017-LU-14668-lnet-don-t-delete-peer-created-by-Lustre.patch -Patch18: 0018-LU-14668-lnet-add-force-option-to-lnetctl-peer-del.patch -Patch19: 0019-LU-14668-lnet-add-lock_prim_nid-lnet-module-paramete.patch -Patch20: 0020-LU-14668-tests-verify-state-of-peer-added-with-lock_.patch -Patch21: 0021-LU-11787-test-Fix-checkfilemap-tests-for-64K-page.patch -Patch22: 0022-LU-15800-ofd-take-a-read-lock-for-fallocate.patch -Patch23: 0023-LU-16873-osd-update-OI_Scrub-file-with-new-magic.patch -Patch24: 0024-LU-15519-quota-fallocate-does-not-increase-projectid.patch -Patch25: 0025-LU-16060-osd-ldiskfs-copy-nul-byte-terminator-in-wri.patch -Patch26: 0026-LU-16934-kernel-update-RHEL-8.8-4.18.0-477.15.1.el8_.patch -Patch27: 0027-LU-15740-tests-scale-fs_log_size-by-OSTCOUNT.patch -Patch28: 0028-LU-16943-tests-fix-replay-single-135-under-hard-fail.patch -Patch29: 0029-LU-16517-build-pass-extra-configure-options-to-make-.patch -Patch30: 0030-LU-15193-quota-expand-QUOTA_MAX_TRANSIDS-to-12.patch -Patch31: 0031-LU-16916-tests-fix-client_evicted-not-to-ignore-EOPN.patch -Patch32: 0032-LU-16626-build-remove-python2-dependencies.patch -Patch33: 0033-LU-16943-tests-use-primary-ost1-server-in-replay-sin.patch -Patch34: 0034-LU-16585-build-remove-python2-dependencies.patch -Patch35: 0035-LU-15660-statahead-statahead-thread-doesn-t-stop.patch -Patch36: 0036-LU-16042-tests-can-not-get-cache-size-on-Arm64.patch -Patch37: 0037-LU-16662-autoconf-fix-configure-test-compile-for-CON.patch -Patch38: 0038-LU-16322-build-Add-client-build-support-for-openEule.patch -Patch39: 0039-LU-16481-build-add-server-support-for-openEuler.patch -Patch40: 0040-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch -Patch41: 0041-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch -Patch42: 0042-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch -Patch43: 0043-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch -Patch44: 0044-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch -Patch45: 0045-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch -Patch46: 0046-ldiskfs-add-support-for-oe2003.patch -Patch47: 0047-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch -Patch48: 0048-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch -Patch49: 0049-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch -Patch50: 0050-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch -Patch51: 0051-LU-16534-build-Prefer-timer_delete-_sync.patch -Patch52: 0052-LU-16541-tests-Improve-test-64f.patch -Patch53: 0053-LU-16788-tests-sanity-should-remove-temp-files.patch -Patch54: 0054-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch -Patch55: 0055-LU-14992-tests-add-more-mkdir_on_mdt0-calls.patch -Patch56: 0056-LU-15816-tests-use-correct-ost-host-to-manage-failur.patch -Patch57: 0057-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch -Patch58: 0058-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch -Patch59: 0059-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch -Patch60: 0060-Update-openEuler-22.03-kernels.patch -Patch61: 0061-Update-kernel-for-openEuler-20.03-LTS.patch -Patch62: 0062-ldiskfs-fix-build-for-oe2203sp3.patch -Patch63: 0001-Fix-sanity-running-stuck.patch +Patch01: 0001-LU-16322-build-Add-client-build-support-for-openEule.patch +Patch02: 0002-LU-16481-build-add-server-support-for-openEuler.patch +Patch03: 0003-LU-16824-ldiskfs-add-support-for-openEuler-22.03-LTS.patch +Patch04: 0004-LU-16976-ldiskfs-add-support-for-openEuler-22.03-SP2.patch +Patch05: 0005-lustre.spec.in-match-rpm-macro-openEuler-for-openEul.patch +Patch06: 0006-LU-15722-osd-ldiskfs-fix-IO-write-gets-stuck-for-64K.patch +Patch07: 0007-LU-15722-osd-ldiskfs-fix-write-stuck-for-64K-PAGE_SI.patch +Patch08: 0008-LU-15978-osp-fix-striped-directory-deletion-fails-fo.patch +Patch09: 0009-ldiskfs-add-support-for-oe2003.patch +Patch10: 0010-lustre.spec.in-Add-gcc-option-Wno-stringop-overflow.patch +Patch11: 0011-LU-16321-osd-Allow-fiemap-on-kernel-buffers.patch +Patch12: 0012-LU-13135-quota-improve-checks-in-OSDs-to-ignore-quot.patch +Patch13: 0013-LU-16893-libcfs-Remove-force_sig-usage-from-lfsck.patch +Patch14: 0014-LU-16534-build-Prefer-timer_delete-_sync.patch +Patch15: 0015-LU-16788-tests-sanity-should-remove-temp-files.patch +Patch16: 0016-LU-14992-tests-sanity-replay-vbr-mkdir-on-MDT0.patch +Patch17: 0017-LU-16571-utils-fix-parallel-lfs-migrate-b-on-hard-li.patch +Patch18: 0018-LU-14073-ldiskfs-don-t-test-LDISKFS_IOC_FSSETXATTR.patch +Patch19: 0019-LU-16019-llite-fully-disable-readahead-in-kernel-I-O.patch +Patch20: 0020-Update-openEuler-22.03-kernels.patch +Patch21: 0021-Update-kernel-for-openEuler-20.03-LTS.patch +Patch22: 0022-ldiskfs-fix-build-for-oe2203sp3.patch +Patch23: 0023-Fix-sanity-running-stuck.patch %if %{with lustre_modules} Requires: %{requires_kmod_name} = %{requires_kmod_version} @@ -940,6 +900,10 @@ rm -rf $RPM_BUILD_ROOT rm -rf %{_tmppath}/kmp %changelog +* Tue Dec 26 2023 Xinliang Liu - 2.15.4-1 +- Fix build for kernel-5.10.0-182.0.0.95.oe2203sp3 +- Update to 2.15.4 + * Mon Dec 18 2023 Xinliang Liu - 2.15.3-3 - Fix sanity runing stuck