From nobody Sun Dec 26 02:40:19 2021 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 A162A1906932; Sun, 26 Dec 2021 02:40:19 +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 4JM4ll2qqJz4Wsj; Sun, 26 Dec 2021 02:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 368D322804; Sun, 26 Dec 2021 02:40:19 +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 1BQ2eJR2087921; Sun, 26 Dec 2021 02:40:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BQ2eJcS087913; Sun, 26 Dec 2021 02:40:19 GMT (envelope-from git) Date: Sun, 26 Dec 2021 02:40:19 GMT Message-Id: <202112260240.1BQ2eJcS087913@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: 4adb1ced83f4 - stable/12 - nfscl: Fix must_commit handling for mirrored pNFS mounts 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/12 X-Git-Reftype: branch X-Git-Commit: 4adb1ced83f4685c9c287aebebed1bf75f4ac20a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640486419; 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=/eI0ecE8EhulY0frqah5VgjtXCrhs4OM2YTrdfa6EDE=; b=WtCac/GxMn/oGi7gd5vWcqwSIMCsCNMFa9TMwDjqI3hxjaPH4wq0ZBZcW6zevd+vIHQMhQ IaFG/jvo+fHu0VpDteWCFvoZ7nD6dR6Riku9xJSJDSa0xXFXpcYy4zSfUWmi9QkfV3Tewz 9HRNBQUolARPbz84D+uNrakXCaBp+EfPEBb1YFzI3io1iv5161NkWJt5mq4GnMxZmC1dmA 6k5O7yaEufJlC5LpXW8l1CU5LPKliaBl5hUTKOU6rvLEo36BfvQazGQBnj5zXGtLk8N+9t ouXv6Qfq5Bzl7LFvMcgbq/PP+Ps5V/zwrYNT0Q9+2xYIlMfgpcf8O3mryInbkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640486419; a=rsa-sha256; cv=none; b=WhDr8B5RS2cs7UHAmPu0oEjiydmOoV9VaW7vPnDGtbP6odA4ecY0kzHWEk14e8vN/qrrQ0 WlkYKBVSwcJZE4VQxdc1W1oMtuYGmZ9qDeppPK7mIRdlj6BpQPm3zu4bXeXN0uFts1fpXf x8SbwQBKFOWFGYY5RWu2/rRtnFri9DB8VztnruTia6E26yIoP5q3Dcv3O2gMidOtcBxfqN rIqLO4APkXEvQJLqjnbk1MWq/UGJQ54PIWnXQvQQJqT8YKw4qD3ECW8K8KJBiw3/sMOVFo OyXcQb17xcfTdc8m5iWLxnS/w+ptG7Bm41FOfyoznUgUIx7SZpR3PjKC4fmVsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=4adb1ced83f4685c9c287aebebed1bf75f4ac20a commit 4adb1ced83f4685c9c287aebebed1bf75f4ac20a Author: Rick Macklem AuthorDate: 2021-12-12 23:40:30 +0000 Commit: Rick Macklem CommitDate: 2021-12-26 02:36:55 +0000 nfscl: Fix must_commit handling for mirrored pNFS mounts For pNFS mounts to mirrored Flexible File layout pNFS servers, the "must_commit" component in the nfsclwritedsdorpc structure must be checked and the "must_commit" argument passed into nfscl_doiods() must be updated. Technically, only writes to the DS with a writeverf change must be redone, but since this occurrence will be rare, the must_commit argument to nfscl_doiosd() is set to 1, so all writes to all DSs will be redone. This bug would affect few, since use of mirrored pNFS servers is rare and "writeverf" rarely changes. Normally "writeverf" only changes when a NFS server reboots. (cherry picked from commit 24947b701d07634434b3208b0a0c970235f9d16e) --- sys/fs/nfsclient/nfs_clrpcops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index d30ca62c673e..a11a1474207c 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5833,6 +5833,10 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, timo); if (error == 0 && tdrpc->err != 0) error = tdrpc->err; + if (rwaccess != NFSV4OPEN_ACCESSREAD && + docommit == 0 && *must_commit == 0 && + tdrpc->must_commit == 1) + *must_commit = 1; } free(drpc, M_TEMP); if (error == 0) { @@ -6574,8 +6578,8 @@ nfsio_writedsmir(vnode_t vp, int *iomode, int *must_commit, NFSCL_DEBUG(4, "nfsio_writedsmir: nfs_pnfsio=%d\n", ret); } if (ret != 0) - error = nfsrpc_writedsmir(vp, iomode, must_commit, stateidp, - dsp, off, len, fhp, m, vers, minorvers, cred, p); + error = nfsrpc_writedsmir(vp, iomode, &drpc->must_commit, + stateidp, dsp, off, len, fhp, m, vers, minorvers, cred, p); NFSCL_DEBUG(4, "nfsio_writedsmir: error=%d\n", error); return (error); }