From 8449bd91ba45c47614231a9bfe141e700dec8bb9 Mon Sep 17 00:00:00 2001 From: Vitaliy Kuznetsov Date: Sat, 18 Feb 2023 11:28:37 +0300 Subject: [PATCH] LU-16558 mdt: Fix max limit for "max_mod_rpcs_in_flight" This minor fix fixes a bug with the definition of the maximum limit for the mdt_max_mod_rpcs_in_flight parameter when it is changed. Fixes: f16c31ccd9 ("LU-16454 mdt: Add a per-MDT "max_mod_rpcs_in_flight") Signed-off-by: Vitaliy Kuznetsov Change-Id: I5576da1dbcaa0b4202af4b02023a46991f443a4b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50010 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_lproc.c | 2 +- lustre/tests/conf-sanity.sh | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 487666d..ccc17a2 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -1461,7 +1461,7 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj, if (rc) return rc; - if (val < 1 || val > OBD_MAX_RIF_DEFAULT) + if (val < 1 || val > OBD_MAX_RIF_MAX) return -ERANGE; if (mdt_max_mod_rpcs_changed(mdt)) { diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index c3e823b..965699d 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -7196,33 +7196,36 @@ check_max_mod_rpcs_in_flight() { } get_mdt_max_mod_rpcs_in_flight_val() { - local tmp_value - local host_d="$1" + local max_mrif + local facet="$1" - tmp_value=$($LCTL get_param -n \ - mdt.*.max_mod_rpcs_in_flight) - if [[ $tmp_value ]]; then - echo $tmp_value + # It will be enough to get one value from one MDT + max_mrif=$(do_facet $facet \ + "$LCTL get_param -n \ + mdt.$FSNAME-MDT*.max_mod_rpcs_in_flight | head -n 1") + if [[ $max_mrif ]]; then + echo $max_mrif else - tmp_value=$(do_facet $host_d \ + max_mrif=$(do_facet $facet \ cat /sys/module/mdt/parameters/max_mod_rpcs_per_client) - echo $tmp_value + echo $max_mrif fi } set_mdt_max_mod_rpcs_in_flight() { local lctl_op - local value_d="$1" - local host_d="$2" + local max_mrif="$1" + local facet="$2" lctl_op=$($LCTL get_param \ mdt.*.max_mod_rpcs_in_flight) if [[ $lctl_op ]]; then - $LCTL set_param \ - mdt.$FSNAME-MDT0000.max_mod_rpcs_in_flight=$value_d + do_facet $facet \ + "$LCTL set_param \ + mdt.$FSNAME-MDT*.max_mod_rpcs_in_flight=$max_mrif" else - do_facet $host_d \ - "echo $value_d > \ + do_facet $facet \ + "echo $max_mrif > \ /sys/module/mdt/parameters/max_mod_rpcs_per_client" echo "the deprecated max_mod_rpcs_per_client \ parameter was involved" -- 1.8.3.1