diff options
author | J. Bruce Fields <bfields@redhat.com> | 2017-09-15 16:02:52 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2017-10-04 16:25:00 -0400 |
commit | 9542446048e01871fd323cba9a1d468b46cfceea (patch) | |
tree | 2a3e25af504a9d2763d478333a34ef0306cece11 /fs/nfsd | |
parent | 003278e431bffa4070d18c821eff1d95867f24db (diff) |
nfsd: remove unnecessary nofilehandle checks
These checks should have already be done centrally in
nfsd4_proc_compound, the checks in each individual operation are
unnecessary.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 3c69db7d4905..7aff6d383d34 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -485,9 +485,6 @@ static __be32 | |||
485 | nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 485 | nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
486 | union nfsd4_op_u *u) | 486 | union nfsd4_op_u *u) |
487 | { | 487 | { |
488 | if (!cstate->current_fh.fh_dentry) | ||
489 | return nfserr_nofilehandle; | ||
490 | |||
491 | u->getfh = &cstate->current_fh; | 488 | u->getfh = &cstate->current_fh; |
492 | return nfs_ok; | 489 | return nfs_ok; |
493 | } | 490 | } |
@@ -535,9 +532,6 @@ static __be32 | |||
535 | nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 532 | nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
536 | union nfsd4_op_u *u) | 533 | union nfsd4_op_u *u) |
537 | { | 534 | { |
538 | if (!cstate->current_fh.fh_dentry) | ||
539 | return nfserr_nofilehandle; | ||
540 | |||
541 | fh_dup2(&cstate->save_fh, &cstate->current_fh); | 535 | fh_dup2(&cstate->save_fh, &cstate->current_fh); |
542 | if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { | 536 | if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { |
543 | memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); | 537 | memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); |
@@ -703,10 +697,8 @@ nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
703 | union nfsd4_op_u *u) | 697 | union nfsd4_op_u *u) |
704 | { | 698 | { |
705 | struct nfsd4_link *link = &u->link; | 699 | struct nfsd4_link *link = &u->link; |
706 | __be32 status = nfserr_nofilehandle; | 700 | __be32 status; |
707 | 701 | ||
708 | if (!cstate->save_fh.fh_dentry) | ||
709 | return status; | ||
710 | status = nfsd_link(rqstp, &cstate->current_fh, | 702 | status = nfsd_link(rqstp, &cstate->current_fh, |
711 | link->li_name, link->li_namelen, &cstate->save_fh); | 703 | link->li_name, link->li_namelen, &cstate->save_fh); |
712 | if (!status) | 704 | if (!status) |
@@ -850,10 +842,8 @@ nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
850 | union nfsd4_op_u *u) | 842 | union nfsd4_op_u *u) |
851 | { | 843 | { |
852 | struct nfsd4_rename *rename = &u->rename; | 844 | struct nfsd4_rename *rename = &u->rename; |
853 | __be32 status = nfserr_nofilehandle; | 845 | __be32 status; |
854 | 846 | ||
855 | if (!cstate->save_fh.fh_dentry) | ||
856 | return status; | ||
857 | if (opens_in_grace(SVC_NET(rqstp)) && | 847 | if (opens_in_grace(SVC_NET(rqstp)) && |
858 | !(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK)) | 848 | !(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK)) |
859 | return nfserr_grace; | 849 | return nfserr_grace; |