Skip to content

Commit

Permalink
nfsd4: simplify lock openmode check
Browse files Browse the repository at this point in the history
Note that the special handling for the lock stateid case is already done
by nfs4_check_openmode() (as of 0292191
"nfsd4: fix openmode checking on IO using lock stateid") so we no longer
need these two cases in the caller.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Aug 27, 2011
1 parent a9004ab commit 9afb978
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -3453,16 +3453,11 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
if (!nfsd4_has_session(cstate) &&
!same_clid(&clp->cl_clientid, lockclid))
return nfserr_bad_stateid;
/* stp is the open stateid */
status = nfs4_check_openmode(stp, lkflg);
if (status)
return status;
} else {
/* stp is the lock stateid */
status = nfs4_check_openmode(stp->st_openstp, lkflg);
if (status)
return status;
}
}
/* stp is the open stateid */
status = nfs4_check_openmode(stp, lkflg);
if (status)
return status;
}

if (nfs4_check_fh(current_fh, stp)) {
Expand Down

0 comments on commit 9afb978

Please sign in to comment.