Merge tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields: "Smaller bugfixes and cleanup, including a fix for a failures of kerberized NFSv4.1 mounts, and Scott Mayhew's work addressing ACK storms that can affect some high-availability NFS setups" * tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux: nfsd: add new io class tracepoint nfsd: give up on CB_LAYOUTRECALLs after two lease periods nfsd: Fix nfsd leaks sunrpc module references lockd: constify nlmsvc_binding structure lockd: use to_delayed_work nfsd: use to_delayed_work Revert "svcrdma: Do not send XDR roundup bytes for a write chunk" lockd: Register callbacks on the inetaddr_chain and inet6addr_chain nfsd: Register callbacks on the inetaddr_chain and inet6addr_chain sunrpc: Add a function to close temporary transports immediately nfsd: don't base cl_cb_status on stale information nfsd4: fix gss-proxy 4.1 mounts for some AD principals nfsd: fix unlikely NULL deref in mach_creds_match nfsd: minor consolidation of mach_cred handling code nfsd: helper for dup of possibly NULL string svcrpc: move some initialization to common code nfsd: fix a warning message nfsd: constify nfsd4_callback_ops structure nfsd: recover: constify nfsd4_client_tracking_ops structures svcrdma: Do not send XDR roundup bytes for a write chunk
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
#include "nfsd.h"
|
||||
#include "vfs.h"
|
||||
#include "trace.h"
|
||||
|
||||
#define NFSDDBG_FACILITY NFSDDBG_FILEOP
|
||||
|
||||
@@ -997,16 +998,23 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
|
||||
struct raparms *ra;
|
||||
__be32 err;
|
||||
|
||||
trace_read_start(rqstp, fhp, offset, vlen);
|
||||
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
ra = nfsd_init_raparms(file);
|
||||
|
||||
trace_read_opened(rqstp, fhp, offset, vlen);
|
||||
err = nfsd_vfs_read(rqstp, file, offset, vec, vlen, count);
|
||||
trace_read_io_done(rqstp, fhp, offset, vlen);
|
||||
|
||||
if (ra)
|
||||
nfsd_put_raparams(file, ra);
|
||||
fput(file);
|
||||
|
||||
trace_read_done(rqstp, fhp, offset, vlen);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1022,24 +1030,31 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||
{
|
||||
__be32 err = 0;
|
||||
|
||||
trace_write_start(rqstp, fhp, offset, vlen);
|
||||
|
||||
if (file) {
|
||||
err = nfsd_permission(rqstp, fhp->fh_export, fhp->fh_dentry,
|
||||
NFSD_MAY_WRITE|NFSD_MAY_OWNER_OVERRIDE);
|
||||
if (err)
|
||||
goto out;
|
||||
trace_write_opened(rqstp, fhp, offset, vlen);
|
||||
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, cnt,
|
||||
stablep);
|
||||
trace_write_io_done(rqstp, fhp, offset, vlen);
|
||||
} else {
|
||||
err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_WRITE, &file);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
trace_write_opened(rqstp, fhp, offset, vlen);
|
||||
if (cnt)
|
||||
err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen,
|
||||
cnt, stablep);
|
||||
trace_write_io_done(rqstp, fhp, offset, vlen);
|
||||
fput(file);
|
||||
}
|
||||
out:
|
||||
trace_write_done(rqstp, fhp, offset, vlen);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user