diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-09-09 11:26:58 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-09-13 18:30:35 -0400 |
commit | 97b7e3b6d4ae838694b43f66b4f0b32b5ec7635b (patch) | |
tree | 7bb209faaea34e873a2648efaf3acb12919f7dfa /fs/nfsd/nfs4state.c | |
parent | f459e4535904e16ca9f0cc202c78345c332bbbad (diff) |
nfsd4: fix test_stateid for delegation stateid's
Test_stateid should handle delegation stateid's as well.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 24685a02690f..30387f3d9881 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3261,28 +3261,26 @@ static int is_delegation_stateid(stateid_t *stateid) | |||
3261 | 3261 | ||
3262 | __be32 nfs4_validate_stateid(stateid_t *stateid, bool has_session) | 3262 | __be32 nfs4_validate_stateid(stateid_t *stateid, bool has_session) |
3263 | { | 3263 | { |
3264 | struct nfs4_ol_stateid *stp = NULL; | 3264 | struct nfs4_stid *s; |
3265 | __be32 status = nfserr_stale_stateid; | 3265 | struct nfs4_ol_stateid *ols; |
3266 | __be32 status; | ||
3266 | 3267 | ||
3267 | if (STALE_STATEID(stateid)) | 3268 | if (STALE_STATEID(stateid)) |
3268 | goto out; | 3269 | return nfserr_stale_stateid; |
3269 | |||
3270 | status = nfserr_expired; | ||
3271 | stp = find_ol_stateid(stateid); | ||
3272 | if (!stp) | ||
3273 | goto out; | ||
3274 | status = nfserr_bad_stateid; | ||
3275 | if (stp->st_stateowner->so_is_open_owner | ||
3276 | && !openowner(stp->st_stateowner)->oo_confirmed) | ||
3277 | goto out; | ||
3278 | 3270 | ||
3279 | status = check_stateid_generation(stateid, &stp->st_stid.sc_stateid, has_session); | 3271 | s = find_stateid(stateid); |
3272 | if (!s) | ||
3273 | return nfserr_stale_stateid; | ||
3274 | status = check_stateid_generation(stateid, &s->sc_stateid, has_session); | ||
3280 | if (status) | 3275 | if (status) |
3281 | goto out; | 3276 | return status; |
3282 | 3277 | if (!(s->sc_type & (NFS4_OPEN_STID | NFS4_LOCK_STID))) | |
3283 | status = nfs_ok; | 3278 | return nfs_ok; |
3284 | out: | 3279 | ols = openlockstateid(s); |
3285 | return status; | 3280 | if (ols->st_stateowner->so_is_open_owner |
3281 | && !openowner(ols->st_stateowner)->oo_confirmed) | ||
3282 | return nfserr_bad_stateid; | ||
3283 | return nfs_ok; | ||
3286 | } | 3284 | } |
3287 | 3285 | ||
3288 | /* | 3286 | /* |