From 1ae1eb9f6ec09cc32d7015877ffefd23387c27a4 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Tue, 23 Sep 2025 11:05:50 -0400 Subject: [PATCH] nfsrahead: modify get_device_info logic (RHEL-115964) Resolves: RHEL-115964 Signed-off-by: Steve Dickson --- ...srahead-Modify-get_device_info-logic.patch | 60 +++++++++++++++++++ nfs-utils.spec | 6 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 nfs-utils-2.8.3-nfsrahead-Modify-get_device_info-logic.patch diff --git a/nfs-utils-2.8.3-nfsrahead-Modify-get_device_info-logic.patch b/nfs-utils-2.8.3-nfsrahead-Modify-get_device_info-logic.patch new file mode 100644 index 0000000..4b0e5a2 --- /dev/null +++ b/nfs-utils-2.8.3-nfsrahead-Modify-get_device_info-logic.patch @@ -0,0 +1,60 @@ +commit 162a0093a86411c4ce46d44660c57b98e4879701 +Author: Thiago Becker +Date: Wed Sep 10 08:21:47 2025 -0500 + + nfsrahead: modify get_device_info logic + + There are a few reports of failures by nfsrahead to set the read ahead + when the nfs mount information is not available when the udev event + fires. This was alleviated by retrying to read mountinfo multiple times, + but some cases where still failing to find the device information. To + further alleviate this issue, this patch adds a 50ms delay between + attempts. To not incur into unecessary delays, the logic in + get_device_info is reworked. + + While we are in this, remove a second loop of reptitions of + get_device_info. + + Signed-off-by: Thiago Becker + Signed-off-by: Steve Dickson + +diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c +index 8a11cf1a..b7b889ff 100644 +--- a/tools/nfsrahead/main.c ++++ b/tools/nfsrahead/main.c +@@ -117,9 +117,11 @@ out_free_device_info: + + static int get_device_info(const char *device_number, struct device_info *device_info) + { +- int ret = ENOENT; +- for (int retry_count = 0; retry_count < 10 && ret != 0; retry_count++) ++ int ret = get_mountinfo(device_number, device_info, MOUNTINFO_PATH); ++ for (int retry_count = 0; retry_count < 5 && ret != 0; retry_count++) { ++ usleep(50000); + ret = get_mountinfo(device_number, device_info, MOUNTINFO_PATH); ++ } + + return ret; + } +@@ -135,7 +137,7 @@ static int conf_get_readahead(const char *kind) { + + int main(int argc, char **argv) + { +- int ret = 0, retry, opt; ++ int ret = 0, opt; + struct device_info device; + unsigned int readahead = 128, log_level, log_stderr = 0; + +@@ -163,11 +165,7 @@ int main(int argc, char **argv) + if ((argc - optind) != 1) + xlog_err("expected the device number of a BDI; is udev ok?"); + +- for (retry = 0; retry <= 10; retry++ ) +- if ((ret = get_device_info(argv[optind], &device)) == 0) +- break; +- +- if (ret != 0 || device.fstype == NULL) { ++ if ((ret = get_device_info(argv[optind], &device)) != 0 || device.fstype == NULL) { + xlog(D_GENERAL, "unable to find device %s\n", argv[optind]); + goto out; + } diff --git a/nfs-utils.spec b/nfs-utils.spec index 0a461e5..cbce3a2 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser Name: nfs-utils URL: http://linux-nfs.org/ Version: 2.8.3 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 # group all 32bit related archs @@ -31,6 +31,7 @@ Patch009: nfs-utils-2.8.3-nfsdctl-Warning-Clean-Up.patch # RHEL 10.2 # Patch010: nfs-utils-2.8.3-rpc-statd-service-dependency.patch +Patch011: nfs-utils-2.8.3-nfsrahead-Modify-get_device_info-logic.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch102: nfs-utils-1.2.5-idmap-errmsg.patch @@ -445,6 +446,9 @@ rm -rf /etc/systemd/system/rpc-*.requires %{_mandir}/*/nfsiostat.8.gz %changelog +* Tue Sep 23 2025 Steve Dickson 2.8.3-2 +- nfsrahead: modify get_device_info logic (RHEL-115964) + * Thu Sep 18 2025 Scott Mayhew 2.8.3-1 - Fix dependency definition in rpc-statd.service (RHEL-96937)