aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index bbaf3c9bfe5a..d227f85b5ed2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -603,8 +603,8 @@ STALE_CLIENTID(clientid_t *clid)
603{ 603{
604 if (clid->cl_boot == boot_time) 604 if (clid->cl_boot == boot_time)
605 return 0; 605 return 0;
606 dprintk("NFSD stale clientid (%08x/%08x)\n", 606 dprintk("NFSD stale clientid (%08x/%08x) boot_time %08lx\n",
607 clid->cl_boot, clid->cl_id); 607 clid->cl_boot, clid->cl_id, boot_time);
608 return 1; 608 return 1;
609} 609}
610 610
@@ -2965,8 +2965,9 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
2965 if (lock->lk_is_new) { 2965 if (lock->lk_is_new) {
2966 if (!sop->so_is_open_owner) 2966 if (!sop->so_is_open_owner)
2967 return nfserr_bad_stateid; 2967 return nfserr_bad_stateid;
2968 if (!same_clid(&clp->cl_clientid, lockclid)) 2968 if (!(flags & HAS_SESSION) &&
2969 return nfserr_bad_stateid; 2969 !same_clid(&clp->cl_clientid, lockclid))
2970 return nfserr_bad_stateid;
2970 /* stp is the open stateid */ 2971 /* stp is the open stateid */
2971 status = nfs4_check_openmode(stp, lkflg); 2972 status = nfs4_check_openmode(stp, lkflg);
2972 if (status) 2973 if (status)
@@ -3507,7 +3508,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3507 struct nfs4_file *fp; 3508 struct nfs4_file *fp;
3508 3509
3509 status = nfserr_stale_clientid; 3510 status = nfserr_stale_clientid;
3510 if (STALE_CLIENTID(&lock->lk_new_clientid)) 3511 if (!nfsd4_has_session(cstate) &&
3512 STALE_CLIENTID(&lock->lk_new_clientid))
3511 goto out; 3513 goto out;
3512 3514
3513 /* validate and update open stateid and open seqid */ 3515 /* validate and update open stateid and open seqid */
@@ -3661,7 +3663,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3661 nfs4_lock_state(); 3663 nfs4_lock_state();
3662 3664
3663 status = nfserr_stale_clientid; 3665 status = nfserr_stale_clientid;
3664 if (STALE_CLIENTID(&lockt->lt_clientid)) 3666 if (!nfsd4_has_session(cstate) && STALE_CLIENTID(&lockt->lt_clientid))
3665 goto out; 3667 goto out;
3666 3668
3667 if ((status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0))) { 3669 if ((status = fh_verify(rqstp, &cstate->current_fh, S_IFREG, 0))) {