Commit 33388b3a authored by Chuck Lever's avatar Chuck Lever

NFSD: Clean up nfsd_vfs_write()

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: default avatarChuck Lever <chuck.lever@oracle.com>
parent 555dbf1a
...@@ -997,22 +997,11 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, ...@@ -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); iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt);
since = READ_ONCE(file->f_wb_err); since = READ_ONCE(file->f_wb_err);
if (flags & RWF_SYNC) { if (verf)
if (verf) nfsd_copy_boot_verifier(verf,
nfsd_copy_boot_verifier(verf, net_generic(SVC_NET(rqstp),
net_generic(SVC_NET(rqstp), nfsd_net_id));
nfsd_net_id)); host_err = vfs_iter_write(file, &iter, &pos, flags);
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 (host_err < 0) { if (host_err < 0) {
nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp), nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp),
nfsd_net_id)); nfsd_net_id));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment