All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Cc: trondmy@kernel.org
Subject: [PATCH 03/10] NFSD: Clean up nfsd_vfs_write()
Date: Sun,  2 Jan 2022 12:35:29 -0500	[thread overview]
Message-ID: <164114492897.7344.10040354999721400314.stgit@bazille.1015granger.net> (raw)
In-Reply-To: <164114486506.7344.16096063573748374893.stgit@bazille.1015granger.net>

The RWF_SYNC and !RWF_SYNC arms are now exactly alike except that
the RWF_SYNC arm resets the boot verifier twice in a row. Fix that
redundancy and de-duplicate the code.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/vfs.c |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 316ed702d518..8f0ac710fd1a 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -997,22 +997,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf,
 
 	iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt);
 	since = READ_ONCE(file->f_wb_err);
-	if (flags & RWF_SYNC) {
-		if (verf)
-			nfsd_copy_boot_verifier(verf,
-					net_generic(SVC_NET(rqstp),
-					nfsd_net_id));
-		host_err = vfs_iter_write(file, &iter, &pos, flags);
-		if (host_err < 0)
-			nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
-						 nfsd_net_id));
-	} else {
-		if (verf)
-			nfsd_copy_boot_verifier(verf,
-					net_generic(SVC_NET(rqstp),
-					nfsd_net_id));
-		host_err = vfs_iter_write(file, &iter, &pos, flags);
-	}
+	if (verf)
+		nfsd_copy_boot_verifier(verf,
+				net_generic(SVC_NET(rqstp),
+				nfsd_net_id));
+	host_err = vfs_iter_write(file, &iter, &pos, flags);
 	if (host_err < 0) {
 		nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
 					 nfsd_net_id));


  parent reply	other threads:[~2022-01-02 17:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-02 17:35 [PATCH 00/10] Write verifier fixes and clean-ups Chuck Lever
2022-01-02 17:35 ` [PATCH 01/10] NFSD: Fix verifier returned in stable WRITEs Chuck Lever
2022-01-02 17:35 ` [PATCH 02/10] nfsd: Replace use of rwsem with errseq_t Chuck Lever
2022-01-02 17:35 ` Chuck Lever [this message]
2022-01-02 17:35 ` [PATCH 04/10] NFSD: De-duplicate net_generic(SVC_NET(rqstp), nfsd_net_id) Chuck Lever
2022-01-02 17:35 ` [PATCH 05/10] NFSD: De-duplicate net_generic(nf->nf_net, nfsd_net_id) Chuck Lever
2022-01-02 17:35 ` [PATCH 06/10] nfsd: Add a tracepoint for errors in nfsd4_clone_file_range() Chuck Lever
2022-01-02 17:35 ` [PATCH 07/10] NFSD: Write verifier might go backwards Chuck Lever
2022-01-02 17:36 ` [PATCH 08/10] NFSD: Clean up the nfsd_net::nfssvc_boot field Chuck Lever
2022-01-02 17:36 ` [PATCH 09/10] NFSD: Rename boot verifier functions Chuck Lever
2022-01-02 17:36 ` [PATCH 10/10] NFSD: Trace boot verifier resets Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164114492897.7344.10040354999721400314.stgit@bazille.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.