From nobody Fri Jul 15 01:49:43 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LkZ6b6zSJz4WVdr; Fri, 15 Jul 2022 01:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LkZ6b6Qhpz3yRJ; Fri, 15 Jul 2022 01:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657849783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WyAv5iIwLhuOz24JNNiVh0e9acuZQLzPm1lIGJHQ+TA=; b=ebblSmn5YU9o+0BbuIa/xjMgL+FTtbd2KHluVITpeQiEfNcdsQyatgF01NIrhdP7PBqPfk EiQAkFKVLvqOIDCO1iAV5fhMvvdNDcz8aIeauw3xgpjT0qxy8xNfL3onwTUgEijsXGkX9I UXC+hPWSx1Hl9ZRW18FJyA0kZ5jpTZU3ThxNmgPyMh14/1BJD6LRxto9mbc4TCT4+tFFno peX/3wHwGxSuE8me8QNim7HzILCC98fs5+1+0u358/qRy0k5AYLfsjo6j7esX5suseZe3B UC+PmfvPGf2xT6HGD4VZHRXrynTJQ0HJAyDXiW/IGKGjbqVxLRnzSJ3FC5ryeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LkZ6b588QzQ5C; Fri, 15 Jul 2022 01:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26F1nhFt034838; Fri, 15 Jul 2022 01:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26F1nhRv034837; Fri, 15 Jul 2022 01:49:43 GMT (envelope-from git) Date: Fri, 15 Jul 2022 01:49:43 GMT Message-Id: <202207150149.26F1nhRv034837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 02915e5ff91f - stable/13 - mount_nfs: Warn that intr, soft are not safe for NFSv4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02915e5ff91f45bf7454c35a24a54bcda83d47ac Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657849783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WyAv5iIwLhuOz24JNNiVh0e9acuZQLzPm1lIGJHQ+TA=; b=cUBFhfmMtXcIuP8E0FZX7tvf+96Da8bgICLUVpmy4rt0Tf0m+WDahjqjBwylnp8VLNbUgY I/y5cQm0SIdFndMUjchY/HawLvnoRRZu+zD6VLO2rR3mQAL9PX4sV1Fv4eZyL0qsyq2jg3 E3nREkVPtaNxnoHRrbm5YjaMMyXc7y6NQwpNJM/tb6bBUonuMYMOU56k1BHi9HnQtClfSx VCr6cgKIVzGz9VFYkdSAvyO/ENb9sma+XdjcYn0zBONRue7NPFMXApUZRMmVj66rCQED4v M+aCo2/LtGnUuzHtMX7nVQyqoXwQIqZCL6nsMAUMQq6tlgJPoQlrgyposZ3r0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657849783; a=rsa-sha256; cv=none; b=y1c4qLwycMlRrE1eN/8CqVTmzqpn3B23Ft2JFPGTGcAlb5YF7SJuoceu34FMi8vr7Fl9Eb 9kLKEDgTBZz6DF4BtoQ3SZhaZdzoEJTD8Nxw4n3ZZ2f+LT9UaUPdkaTYR0wh6cZd69OeV8 8yAGbufLt8963kCTudII9E0dUT7paPtQ6IViYyk0Ylz7rJ59xiC8V+eHpd1qbzqzv1LJx2 xhd8QmcJ4ryRvAovgHrz9vM9omvHVVM+aJyh7vQ42fPZtYiFvcdqSVzgcGuRJUBRw4FXcc qmXvKkRZOiT+MbRtjmvaA2sZUz1gs+NcOJzQSsfP2YmFM5eAfJPcnpq9P8J7tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=02915e5ff91f45bf7454c35a24a54bcda83d47ac commit 02915e5ff91f45bf7454c35a24a54bcda83d47ac Author: Rick Macklem AuthorDate: 2022-07-01 21:43:17 +0000 Commit: Rick Macklem CommitDate: 2022-07-15 01:45:43 +0000 mount_nfs: Warn that intr, soft are not safe for NFSv4 If the "intr" and/or "soft" mount options are used for NFSv4 mounts, the protocol can be broken when the operation returns without waiting for the RPC reply. The likelyhood of failure increases for NFSv4.1/4.2 mounts, since the session slot will be broken when an RPC reply is not processed. This is mentioned in the BUGS section of "man mount_nfs", but more needs to be done. This patch adds code that generates a warning message when the mount is done. PR: 260011 (cherry picked from commit c0d14b0220ae22d25462cef191f20e9f04c5e87e) --- sbin/mount_nfs/mount_nfs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 6ea861193df8..284b34323885 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -160,7 +161,9 @@ main(int argc, char *argv[]) char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], gssn[MAXHOSTNAMELEN + 50]; const char *gssname, *nmount_errstr; + bool softintr; + softintr = false; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); @@ -210,6 +213,7 @@ main(int argc, char *argv[]) case 'i': printf("-i deprecated, use -o intr\n"); build_iovec(&iov, &iovlen, "intr", NULL, 0); + softintr = true; break; case 'L': printf("-L deprecated, use -o nolockd\n"); @@ -366,6 +370,10 @@ main(int argc, char *argv[]) "value -- %s", val); } pass_flag_to_nmount=0; + } else if (strcmp(opt, "soft") == 0) { + softintr = true; + } else if (strcmp(opt, "intr") == 0) { + softintr = true; } if (pass_flag_to_nmount) { build_iovec(&iov, &iovlen, opt, @@ -395,6 +403,7 @@ main(int argc, char *argv[]) case 's': printf("-s deprecated, use -o soft\n"); build_iovec(&iov, &iovlen, "soft", NULL, 0); + softintr = true; break; case 'T': nfsproto = IPPROTO_TCP; @@ -433,6 +442,11 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + /* Warn that NFSv4 mounts only work correctly as hard mounts. */ + if (mountmode == V4 && softintr) + warnx("Warning, options soft and/or intr cannot be safely used" + " for NFSv4. See the BUGS section of mount_nfs(8)"); + spec = *argv++; mntname = *argv;