nfsd41: allow non-reclaim open-by-fh's in 4.1
authorMi Jinlong <mijinlong@cn.fujitsu.com>
Wed, 23 Nov 2011 02:48:40 +0000 (10:48 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 6 Dec 2011 21:19:04 +0000 (16:19 -0500)
With NFSv4.0 it was safe to assume that open-by-filehandles were always
reclaims.

With NFSv4.1 there are non-reclaim open-by-filehandle operations, so we
should ensure we're only insisting on reclaims in the
OPEN_CLAIM_PREVIOUS case.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c

index fa383361bc610bdbd3689f16d734f6ea1628d45d..9415bc415ce8a6013cfd3f4e1dae4cdc21010050 100644 (file)
@@ -266,10 +266,6 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
 {
        __be32 status;
 
-       /* Only reclaims from previously confirmed clients are valid */
-       if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
-               return status;
-
        /* We don't know the target directory, and therefore can not
        * set the change info
        */
@@ -373,6 +369,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                        break;
                case NFS4_OPEN_CLAIM_PREVIOUS:
                        open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
+                       status = nfs4_check_open_reclaim(&open->op_clientid);
+                       if (status)
+                               goto out;
                case NFS4_OPEN_CLAIM_FH:
                case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
                        status = do_open_fhandle(rqstp, &cstate->current_fh,