nfsd4: move check_stateid_generation check
authorJ. Bruce Fields <bfields@citi.umich.edu>
Sat, 21 Feb 2009 19:11:50 +0000 (11:11 -0800)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 18 Mar 2009 21:30:51 +0000 (17:30 -0400)
No change in behavior.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4state.c

index b7e2f25..d6ca2be 100644 (file)
@@ -2084,6 +2084,9 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
                        goto out;
                }
                stidp = &dp->dl_stateid;
                        goto out;
                }
                stidp = &dp->dl_stateid;
+               status = check_stateid_generation(stateid, stidp);
+               if (status)
+                       goto out;
        } else { /* open or lock stateid */
                stp = find_stateid(stateid, flags);
                if (!stp) {
        } else { /* open or lock stateid */
                stp = find_stateid(stateid, flags);
                if (!stp) {
@@ -2095,10 +2098,10 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl
                if (!stp->st_stateowner->so_confirmed)
                        goto out;
                stidp = &stp->st_stateid;
                if (!stp->st_stateowner->so_confirmed)
                        goto out;
                stidp = &stp->st_stateid;
+               status = check_stateid_generation(stateid, stidp);
+               if (status)
+                       goto out;
        }
        }
-       status = check_stateid_generation(stateid, stidp);
-       if (status)
-               goto out;
        if (stp) {
                status = nfs4_check_openmode(stp, flags);
                if (status)
        if (stp) {
                status = nfs4_check_openmode(stp, flags);
                if (status)