Skip to content

Commit 9542446

Browse files
author
J. Bruce Fields
committed
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 <[email protected]>
1 parent 003278e commit 9542446

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,6 @@ static __be32
485485
nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
486486
union nfsd4_op_u *u)
487487
{
488-
if (!cstate->current_fh.fh_dentry)
489-
return nfserr_nofilehandle;
490-
491488
u->getfh = &cstate->current_fh;
492489
return nfs_ok;
493490
}
@@ -535,9 +532,6 @@ static __be32
535532
nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
536533
union nfsd4_op_u *u)
537534
{
538-
if (!cstate->current_fh.fh_dentry)
539-
return nfserr_nofilehandle;
540-
541535
fh_dup2(&cstate->save_fh, &cstate->current_fh);
542536
if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) {
543537
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,
703697
union nfsd4_op_u *u)
704698
{
705699
struct nfsd4_link *link = &u->link;
706-
__be32 status = nfserr_nofilehandle;
700+
__be32 status;
707701

708-
if (!cstate->save_fh.fh_dentry)
709-
return status;
710702
status = nfsd_link(rqstp, &cstate->current_fh,
711703
link->li_name, link->li_namelen, &cstate->save_fh);
712704
if (!status)
@@ -850,10 +842,8 @@ nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
850842
union nfsd4_op_u *u)
851843
{
852844
struct nfsd4_rename *rename = &u->rename;
853-
__be32 status = nfserr_nofilehandle;
845+
__be32 status;
854846

855-
if (!cstate->save_fh.fh_dentry)
856-
return status;
857847
if (opens_in_grace(SVC_NET(rqstp)) &&
858848
!(cstate->save_fh.fh_export->ex_flags & NFSEXP_NOSUBTREECHECK))
859849
return nfserr_grace;

0 commit comments

Comments
 (0)