Module Name:    src
Committed By:   mlelstv
Date:           Sat Feb 22 09:27:05 UTC 2025

Modified Files:
        src/sys/nfs: nfs_socket.c

Log Message:
Poll for interrupted NFS operations if the waiting process hasn't
issued the operation and then won't get the interrupt signal itself.


To generate a diff of this commit:
cvs rdiff -u -r1.202 -r1.203 src/sys/nfs/nfs_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/nfs/nfs_socket.c
diff -u src/sys/nfs/nfs_socket.c:1.202 src/sys/nfs/nfs_socket.c:1.203
--- src/sys/nfs/nfs_socket.c:1.202	Mon Feb  5 21:46:06 2024
+++ src/sys/nfs/nfs_socket.c	Sat Feb 22 09:27:05 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_socket.c,v 1.202 2024/02/05 21:46:06 andvar Exp $	*/
+/*	$NetBSD: nfs_socket.c,v 1.203 2025/02/22 09:27:05 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.202 2024/02/05 21:46:06 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.203 2025/02/22 09:27:05 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -914,6 +914,16 @@ nfs_rcvlock(struct nfsmount *nmp, struct
 
 	KASSERT(nmp == rep->r_nmp);
 
+	/*
+	 * For interruptible mounts, we need to poll
+	 * if we are not the process that issued the
+	 * operation as we won't get the signal.
+	 */
+	if (nmp->nm_flag & NFSMNT_INT) {
+		if (rep->r_lwp != curlwp)
+			slptimeo = hz;
+	}
+
 	if (nmp->nm_flag & NFSMNT_SOFT)
 		slptimeo = nmp->nm_retry * nmp->nm_timeo;
 

Reply via email to