diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:29 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:34 -0400 |
| commit | 202b50dc127cf4714ffdcc6a64f1648373f9414f (patch) | |
| tree | 672286049ecbf9af1b189c1ac12a5850fd3879e1 | |
| parent | f0dd2136da6d2070e12bfa6d199b136318e666c7 (diff) | |
[PATCH] NFSv4: Ensure that propagate NFSv4 state errors to the reclaim code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
| -rw-r--r-- | fs/nfs/nfs4proc.c | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 3f281a857e38..91e7fe867d58 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -269,14 +269,9 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta | |||
| 269 | int err; | 269 | int err; |
| 270 | do { | 270 | do { |
| 271 | err = _nfs4_open_reclaim(sp, state); | 271 | err = _nfs4_open_reclaim(sp, state); |
| 272 | switch (err) { | 272 | if (err != -NFS4ERR_DELAY) |
| 273 | case 0: | 273 | break; |
| 274 | case -NFS4ERR_STALE_CLIENTID: | 274 | nfs4_handle_exception(server, err, &exception); |
| 275 | case -NFS4ERR_STALE_STATEID: | ||
| 276 | case -NFS4ERR_EXPIRED: | ||
| 277 | return err; | ||
| 278 | } | ||
| 279 | err = nfs4_handle_exception(server, err, &exception); | ||
| 280 | } while (exception.retry); | 275 | } while (exception.retry); |
| 281 | return err; | 276 | return err; |
| 282 | } | 277 | } |
| @@ -508,6 +503,20 @@ out_stale: | |||
| 508 | goto out_nodeleg; | 503 | goto out_nodeleg; |
| 509 | } | 504 | } |
| 510 | 505 | ||
| 506 | static inline int nfs4_do_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state, struct dentry *dentry) | ||
| 507 | { | ||
| 508 | struct nfs_server *server = NFS_SERVER(dentry->d_inode); | ||
| 509 | struct nfs4_exception exception = { }; | ||
| 510 | int err; | ||
| 511 | |||
| 512 | do { | ||
| 513 | err = _nfs4_open_expired(sp, state, dentry); | ||
| 514 | if (err == -NFS4ERR_DELAY) | ||
| 515 | nfs4_handle_exception(server, err, &exception); | ||
| 516 | } while (exception.retry); | ||
| 517 | return err; | ||
| 518 | } | ||
| 519 | |||
| 511 | static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state) | 520 | static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *state) |
| 512 | { | 521 | { |
| 513 | struct nfs_inode *nfsi = NFS_I(state->inode); | 522 | struct nfs_inode *nfsi = NFS_I(state->inode); |
| @@ -520,7 +529,7 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta | |||
| 520 | continue; | 529 | continue; |
| 521 | get_nfs_open_context(ctx); | 530 | get_nfs_open_context(ctx); |
| 522 | spin_unlock(&state->inode->i_lock); | 531 | spin_unlock(&state->inode->i_lock); |
| 523 | status = _nfs4_open_expired(sp, state, ctx->dentry); | 532 | status = nfs4_do_open_expired(sp, state, ctx->dentry); |
| 524 | put_nfs_open_context(ctx); | 533 | put_nfs_open_context(ctx); |
| 525 | return status; | 534 | return status; |
| 526 | } | 535 | } |
| @@ -2842,12 +2851,32 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *r | |||
| 2842 | 2851 | ||
| 2843 | static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request) | 2852 | static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request) |
| 2844 | { | 2853 | { |
| 2845 | return _nfs4_do_setlk(state, F_SETLK, request, 1); | 2854 | struct nfs_server *server = NFS_SERVER(state->inode); |
| 2855 | struct nfs4_exception exception = { }; | ||
| 2856 | int err; | ||
| 2857 | |||
| 2858 | do { | ||
| 2859 | err = _nfs4_do_setlk(state, F_SETLK, request, 1); | ||
| 2860 | if (err != -NFS4ERR_DELAY) | ||
| 2861 | break; | ||
| 2862 | nfs4_handle_exception(server, err, &exception); | ||
| 2863 | } while (exception.retry); | ||
| 2864 | return err; | ||
| 2846 | } | 2865 | } |
| 2847 | 2866 | ||
| 2848 | static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request) | 2867 | static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request) |
| 2849 | { | 2868 | { |
| 2850 | return _nfs4_do_setlk(state, F_SETLK, request, 0); | 2869 | struct nfs_server *server = NFS_SERVER(state->inode); |
| 2870 | struct nfs4_exception exception = { }; | ||
| 2871 | int err; | ||
| 2872 | |||
| 2873 | do { | ||
| 2874 | err = _nfs4_do_setlk(state, F_SETLK, request, 0); | ||
| 2875 | if (err != -NFS4ERR_DELAY) | ||
| 2876 | break; | ||
| 2877 | nfs4_handle_exception(server, err, &exception); | ||
| 2878 | } while (exception.retry); | ||
| 2879 | return err; | ||
| 2851 | } | 2880 | } |
| 2852 | 2881 | ||
| 2853 | static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) | 2882 | static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock *request) |
