From: J. Bruce Fields Date: Mon, 22 Aug 2011 15:39:07 +0000 (-0400) Subject: nfsd4: simplify lock openmode check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;ds=sidebyside;h=9afb978400e65ea6a3200b3e163606ce86e13c25;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git nfsd4: simplify lock openmode check Note that the special handling for the lock stateid case is already done by nfs4_check_openmode() (as of 02921914170e3b7fea1cd82dac9713685d2de5e2 "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 --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 14c8dd64e136..aafc41a0a8d0 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -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)) {