diff options
-rw-r--r-- | fs/nfsd/nfs4state.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d6ca2be306dc..16fcb656f47f 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2087,6 +2087,14 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl | |||
2087 | status = check_stateid_generation(stateid, stidp); | 2087 | status = check_stateid_generation(stateid, stidp); |
2088 | if (status) | 2088 | if (status) |
2089 | goto out; | 2089 | goto out; |
2090 | status = nfs4_check_delegmode(dp, flags); | ||
2091 | if (status) | ||
2092 | goto out; | ||
2093 | renew_client(dp->dl_client); | ||
2094 | if (flags & DELEG_RET) | ||
2095 | unhash_delegation(dp); | ||
2096 | if (filpp) | ||
2097 | *filpp = dp->dl_vfs_file; | ||
2090 | } else { /* open or lock stateid */ | 2098 | } else { /* open or lock stateid */ |
2091 | stp = find_stateid(stateid, flags); | 2099 | stp = find_stateid(stateid, flags); |
2092 | if (!stp) { | 2100 | if (!stp) { |
@@ -2101,23 +2109,12 @@ nfs4_preprocess_stateid_op(struct svc_fh *current_fh, stateid_t *stateid, int fl | |||
2101 | status = check_stateid_generation(stateid, stidp); | 2109 | status = check_stateid_generation(stateid, stidp); |
2102 | if (status) | 2110 | if (status) |
2103 | goto out; | 2111 | goto out; |
2104 | } | ||
2105 | if (stp) { | ||
2106 | status = nfs4_check_openmode(stp, flags); | 2112 | status = nfs4_check_openmode(stp, flags); |
2107 | if (status) | 2113 | if (status) |
2108 | goto out; | 2114 | goto out; |
2109 | renew_client(stp->st_stateowner->so_client); | 2115 | renew_client(stp->st_stateowner->so_client); |
2110 | if (filpp) | 2116 | if (filpp) |
2111 | *filpp = stp->st_vfs_file; | 2117 | *filpp = stp->st_vfs_file; |
2112 | } else { | ||
2113 | status = nfs4_check_delegmode(dp, flags); | ||
2114 | if (status) | ||
2115 | goto out; | ||
2116 | renew_client(dp->dl_client); | ||
2117 | if (flags & DELEG_RET) | ||
2118 | unhash_delegation(dp); | ||
2119 | if (filpp) | ||
2120 | *filpp = dp->dl_vfs_file; | ||
2121 | } | 2118 | } |
2122 | status = nfs_ok; | 2119 | status = nfs_ok; |
2123 | out: | 2120 | out: |