From nobody Thu Jun 02 19:12:57 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 86B821B48ED2; Thu, 2 Jun 2022 19:12:58 +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 4LDbJB0k7Yz3pyg; Thu, 2 Jun 2022 19:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654197178; 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=wPXBbCSUCEgMWTGageWl2K1/cprf4X+jRcjW0+Xm8FQ=; b=gZ+jyzF4x4+w+K2LEoogfBv4SxdThclN33DT1BG2UNPnh+zh4IzHUFjE8KkF9PPY4g5u2x br91PX+Sg7qKZ3Q/1MbEHV8WeJgJRmSPK/YSlrgc+KdiEQSoPe0pu7mxrZgoBsIuW/x2vH dDyIkC+EOgK1vnrFpMTxMAaY6N5s5F8pWiW9k79HrjDFO894nsaIyj7Boj1CZQ8/QlSGPr 9i3PkxuQhmdC4WOwxoYS4oR6qvp5oSNEfU1v/77Zrdf6TZtUvfQ6JJq3xSOthBP9d8W4iw Dyyo6q9B3hbwmG6Svsiia5HaipsfP7ldrMGfAfj7StSmAj+3ScCHvNVbemaE/A== 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 D63B91A749; Thu, 2 Jun 2022 19:12:57 +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 252JCvse067276; Thu, 2 Jun 2022 19:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 252JCvET067275; Thu, 2 Jun 2022 19:12:57 GMT (envelope-from git) Date: Thu, 2 Jun 2022 19:12:57 GMT Message-Id: <202206021912.252JCvET067275@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: 56b64e28e11c - main - nfscl: Do not flush when a write delegation is held 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: 56b64e28e11ce4f474b5d352ae3c0e218c345948 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654197178; 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=wPXBbCSUCEgMWTGageWl2K1/cprf4X+jRcjW0+Xm8FQ=; b=FP3ICtmOqZcpCP+114INKqFEHGY7kzwosDbSvh1tnJJSx+D6OeMCjtYOPsZUef8wnHvCEg DrbF5nduVDHGA6D9Fh62tVwZr9FkWLBvfExML8WdKAV9+0J3hzrZUG16Q+uGHFHKpqdMhu 31F1ttCiYX6NFMS7aFVdI6kNG+wSCX1Mcou3DcJGg6ANms+71b+UKeys+oOcoEBsajsbfR ANCtxhjmUdC3nq4eGLRVaTG3mNE6/yAmp7vtltna3Z3xxqYNtUP5YO8H9bgZbMr5I+4A9b RY3oZI2jgWDnG4XtI3dBLsZTUZdLgmxB9rAt9G9WpOe+atEFGlMA74HBPDJn1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654197178; a=rsa-sha256; cv=none; b=Z+M+ZxEe9UDj8D8sQMkQXrrI0BU844nA3kQM5AyROo6mfVwdM0RvhxUxFnUab4jvSCdr39 Qq20semHV77oFWoF/p4HSoJ0+74hvozZfg/vWNZa7U3rVbKtQN9jwDrZ1e/bzMtdlXn3ae 0l2Z3Rgl2HTHA++/DwQLU3hE7+gIICYKZvNcaNBqYngVC3jbUA64U/sZeqjKxf6lb3EO+o EI6KUNM6zUqNA/6tghgB+2A6yuU0xQE7aXefhdj9k1Eyaif6eb3k7C08zsLCiSnwQAjeVG 7pdtqjyTQs0iuwzF4UkdpiM5TmWdPMZPFr87MQ02pt0ciwHJFYoRXNtN7VrCLg== 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=56b64e28e11ce4f474b5d352ae3c0e218c345948 commit 56b64e28e11ce4f474b5d352ae3c0e218c345948 Author: Rick Macklem AuthorDate: 2022-06-02 19:11:55 +0000 Commit: Rick Macklem CommitDate: 2022-06-02 19:11:55 +0000 nfscl: Do not flush when a write delegation is held When a NFSv4 byte range write lock is unlocked, all data modifications need to be flushed to the server to satisfy the coherency requirements for byte range locking. However, if a write delegation for the file is held by the client, flushing is not required, since no other NFSv4 client can have the file NFSv4 Opened. Found by inspection as suggested by a similar change that was done to the Linux NFSv4 client. --- sys/fs/nfsclient/nfs_clstate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 3b65828d5958..7a0d323a788a 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -1468,6 +1468,12 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, */ dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); if (dp != NULL) { + /* No need to flush if it is a write delegation. */ + if ((dp->nfsdl_flags & NFSCLDL_WRITE) != 0) { + nfscl_clrelease(clp); + NFSUNLOCKCLSTATE(); + return (0); + } LIST_FOREACH(lp, &dp->nfsdl_lock, nfsl_list) { if (!NFSBCMP(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN))