aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-05-30 09:09:28 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-06-04 15:42:02 -0400
commitba5378b66f5eb20e464796c5b088c0961fb5f618 (patch)
tree8fafd0f7135dbfdc824f3e1ecd9528199a2a6ad4 /fs/nfsd
parent931ee56c67573eb4e51c8a4e78598d965b8b059e (diff)
nfsd: fix setting of NFS4_OO_CONFIRMED in nfsd4_open
In the NFS4_OPEN_CLAIM_PREVIOUS case, we should only mark it confirmed if the nfs4_check_open_reclaim check succeeds. In the NFS4_OPEN_CLAIM_DELEG_PREV_FH and NFS4_OPEN_CLAIM_DELEGATE_PREV cases, I see no point in declaring the openowner confirmed when the operation is going to fail anyway, and doing so might allow the client to game things such that it wouldn't need to confirm a subsequent open with the same owner. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 16e71d033ea5..8fc901acf1d3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -430,12 +430,12 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
430 goto out; 430 goto out;
431 break; 431 break;
432 case NFS4_OPEN_CLAIM_PREVIOUS: 432 case NFS4_OPEN_CLAIM_PREVIOUS:
433 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
434 status = nfs4_check_open_reclaim(&open->op_clientid, 433 status = nfs4_check_open_reclaim(&open->op_clientid,
435 cstate->minorversion, 434 cstate->minorversion,
436 nn); 435 nn);
437 if (status) 436 if (status)
438 goto out; 437 goto out;
438 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
439 case NFS4_OPEN_CLAIM_FH: 439 case NFS4_OPEN_CLAIM_FH:
440 case NFS4_OPEN_CLAIM_DELEG_CUR_FH: 440 case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
441 status = do_open_fhandle(rqstp, cstate, open); 441 status = do_open_fhandle(rqstp, cstate, open);
@@ -445,7 +445,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
445 break; 445 break;
446 case NFS4_OPEN_CLAIM_DELEG_PREV_FH: 446 case NFS4_OPEN_CLAIM_DELEG_PREV_FH:
447 case NFS4_OPEN_CLAIM_DELEGATE_PREV: 447 case NFS4_OPEN_CLAIM_DELEGATE_PREV:
448 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
449 dprintk("NFSD: unsupported OPEN claim type %d\n", 448 dprintk("NFSD: unsupported OPEN claim type %d\n",
450 open->op_claim_type); 449 open->op_claim_type);
451 status = nfserr_notsupp; 450 status = nfserr_notsupp;