public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] Revert "nfsrahead: enable event-driven mountinfo monitoring and skip non-NFS devices"
Date: Tue, 10 Mar 2026 08:36:23 -0400	[thread overview]
Message-ID: <20260310123623.53580-1-steved@redhat.com> (raw)

Process 869 (nfsrahead) of user 0 dumped core.
 Module /usr/libexec/nfsrahead from rpm nfs-utils-2.8.6-0.fc43.x86_64
 Module libpcre2-8.so.0 from rpm pcre2-10.47-1.fc43.x86_64
 Module libselinux.so.1 from rpm libselinux-3.9-5.fc43.x86_64
 Module libblkid.so.1 from rpm util-linux-2.41.3-7.fc43.x86_64
 Module libmount.so.1 from rpm util-linux-2.41.3-7.fc43.x86_64
 Stack trace of thread 869:
 #0  0x00007f1a867653cc __pthread_kill_implementation (libc.so.6 + 0x743cc)
 #1  0x00007f1a8670b15e raise (libc.so.6 + 0x1a15e)
 #2  0x00007f1a866f26d0 abort (libc.so.6 + 0x16d0)
 #3  0x00007f1a866f373b __libc_message_impl.cold (libc.so.6 + 0x273b)
 #4  0x00007f1a8676f665 malloc_printerr (libc.so.6 + 0x7e665)
 #5  0x00007f1a8676f684 malloc_printerr_tail (libc.so.6 + 0x7e684)
 #6  0x00005624543b1d32 main (/usr/libexec/nfsrahead + 0xd32)
 #7  0x00007f1a866f45b5 __libc_start_call_main (libc.so.6 + 0x35b5)
 #8  0x00007f1a866f4668 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x3668)
 #9  0x00005624543b1fb5 _start (/usr/libexec/nfsrahead + 0xfb5)
ELF object binary architecture: AMD x86-64

https://bodhi.fedoraproject.org/updates/FEDORA-2026-e033b6bafe

This reverts commit 0f5fe65d83f7455112aea82bf96f99523cb03ca7.
---
 tools/nfsrahead/main.c | 55 +-----------------------------------------
 1 file changed, 1 insertion(+), 54 deletions(-)

diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c
index 78cd2581..b7b889ff 100644
--- a/tools/nfsrahead/main.c
+++ b/tools/nfsrahead/main.c
@@ -3,7 +3,6 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
-#include <time.h>
 
 #include <libmount/libmount.h>
 #include <sys/sysmacros.h>
@@ -18,8 +17,6 @@
 #define CONF_NAME "nfsrahead"
 #define NFS_DEFAULT_READAHEAD 128
 
-#define MNT_NM_TIMEOUT 10000
-
 /* Device information from the system */
 struct device_info {
 	char *device_number;
@@ -120,57 +117,7 @@ out_free_device_info:
 
 static int get_device_info(const char *device_number, struct device_info *device_info)
 {
-	int ret;
-	struct libmnt_monitor *mn = NULL;
-	struct timespec start, now;
-	int remaining_ms = MNT_NM_TIMEOUT;
-
-	/*
-	 * Fast-path rejection:
-	 * NFS backing devices always use the anonymous block device major number (0).
-	 * If the device number does not start with "0:", it is a physical block device
-	 * and will never be an NFS mount. Exit immediately to prevent blocking udev.
-	 */
-	if (strncmp(device_number, "0:", 2) != 0)
-		return -ENODEV;
-
-	ret = get_mountinfo(device_number, device_info, MOUNTINFO_PATH);
-	if (ret == 0)
-		return 0;
-
-	mn = mnt_new_monitor();
-	if (!mn)
-		goto fallback;
-
-	if (mnt_monitor_enable_kernel(mn, 1) < 0) {
-		mnt_unref_monitor(mn);
-		goto fallback;
-	}
-
-	clock_gettime(CLOCK_MONOTONIC, &start);
-
-	while (remaining_ms > 0) {
-		int rc = mnt_monitor_wait(mn, remaining_ms);
-		if (rc > 0) {
-			ret = get_mountinfo(device_number, device_info, MOUNTINFO_PATH);
-			if (ret == 0) {
-				mnt_unref_monitor(mn);
-				return 0;
-			}
-		} else {
-			break;
-		}
-
-		clock_gettime(CLOCK_MONOTONIC, &now);
-		long elapsed_ms = (now.tv_sec - start.tv_sec) * 1000 +
-				  (now.tv_nsec - start.tv_nsec) / 1000000;
-		remaining_ms = MNT_NM_TIMEOUT - elapsed_ms;
-	}
-
-	mnt_unref_monitor(mn);
-	return ret;
-
-fallback:
+	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);
-- 
2.53.0


             reply	other threads:[~2026-03-10 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 12:36 Steve Dickson [this message]
2026-03-10 13:28 ` [PATCH] Revert "nfsrahead: enable event-driven mountinfo monitoring and skip non-NFS devices" Aaron Tomlin
2026-03-10 15:53   ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260310123623.53580-1-steved@redhat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox