From nobody Sun Dec 12 23:44:10 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 4DBA318EBF3A; Sun, 12 Dec 2021 23:44:11 +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 4JC1SV6p66z3L6Y; Sun, 12 Dec 2021 23:44:10 +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 CADA7243C; Sun, 12 Dec 2021 23:44:10 +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 1BCNiAvg006314; Sun, 12 Dec 2021 23:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BCNiAur006313; Sun, 12 Dec 2021 23:44:10 GMT (envelope-from git) Date: Sun, 12 Dec 2021 23:44:10 GMT Message-Id: <202112122344.1BCNiAur006313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 24947b701d07 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 24947b701d07634434b3208b0a0c970235f9d16e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639352651; 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=h3OMyG2PSQFoJcVWY1MZoU3ASX8QZXjyE7Cj9KVwiHg=; b=JKHQt/YW3GAlFCfPfTiQHuEkG7lNhOp+vuCkG6HQZ8LxtSB7VvD6EFo/BO/j2Dnzgp573i +C/7/PEsicG29yxqGc/lgvWwSnR8JrGHYhZVyIv2pbbo6Vv2Jk65zrxsouTWeMRYQMBHQi HSdZibzJPPGsS8epkaUUPAQ5ZzR1D1SfU5O/hkfqZQgce1gcoHpsJfxEeEIA3pCZptuka4 GRE6K0tUipvsFKDSf9gUNN4gY1je4X1GUsN+BEueFcr6dDQD4Sh84FdgGouUEfe3XZPA8v +RZ3U28lkovOcpKQqcDpKVCxwlI3df4FPpWVHlDb/uK4VaOOBu6UU03RiwYQSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639352651; a=rsa-sha256; cv=none; b=TmCy/D2JMEYrHB8c/EDg7hOEDwVJBCNPNihnx0aPOlTGJ5jrNbrHEMmRflAt7L4G2JpL1Z cm1x1UlTISnJN0bolAiAWY8yPIfdw8XHlsDyrD6ELL0/9lRBmFQ854nW/AVhB6hQK/8gJy CbqsYzJFrWFgb9fD9T6vGYzu8fAoNnA76bEu2JvRqUXWpDAt1YRHEBTlR5PEKjuNbF6/YA 3m9zNwY1YsP3B+Ohsut02xEm4H43cKQfk1XRljdq5WpUnUjJISw7Ez/NrOP1lnWTGlP495 UzUNURMzCPCMtKk2zSaskJqZnhZBQD+Wkv3rjlEjV22H9mZYH058ksjDP89/uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=24947b701d07634434b3208b0a0c970235f9d16e commit 24947b701d07634434b3208b0a0c970235f9d16e Author: Rick Macklem AuthorDate: 2021-12-12 23:40:30 +0000 Commit: Rick Macklem CommitDate: 2021-12-12 23:40:30 +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. MFC after: 2 weeks --- 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 56ce2a5e2077..e7558b85a46f 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -6253,6 +6253,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) { @@ -7001,8 +7005,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); }