diff options
-rw-r--r-- | fs/nfs/delegation.c | 18 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 15 |
2 files changed, 16 insertions, 17 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 968225a88015..d4f669f0683e 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -68,7 +68,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ | |||
68 | { | 68 | { |
69 | struct inode *inode = state->inode; | 69 | struct inode *inode = state->inode; |
70 | struct file_lock *fl; | 70 | struct file_lock *fl; |
71 | int status; | 71 | int status = 0; |
72 | 72 | ||
73 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { | 73 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
74 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) | 74 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
@@ -76,21 +76,9 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ | |||
76 | if (nfs_file_open_context(fl->fl_file) != ctx) | 76 | if (nfs_file_open_context(fl->fl_file) != ctx) |
77 | continue; | 77 | continue; |
78 | status = nfs4_lock_delegation_recall(state, fl); | 78 | status = nfs4_lock_delegation_recall(state, fl); |
79 | if (status >= 0) | 79 | if (status < 0) |
80 | continue; | 80 | break; |
81 | switch (status) { | ||
82 | default: | ||
83 | printk(KERN_ERR "%s: unhandled error %d.\n", | ||
84 | __func__, status); | ||
85 | case -NFS4ERR_EXPIRED: | ||
86 | /* kill_proc(fl->fl_pid, SIGLOST, 1); */ | ||
87 | case -NFS4ERR_STALE_CLIENTID: | ||
88 | nfs4_schedule_state_recovery(NFS_SERVER(inode)->nfs_client); | ||
89 | goto out_err; | ||
90 | } | ||
91 | } | 81 | } |
92 | return 0; | ||
93 | out_err: | ||
94 | return status; | 82 | return status; |
95 | } | 83 | } |
96 | 84 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4674f8092da8..d326193c9785 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3630,8 +3630,19 @@ int nfs4_lock_delegation_recall(struct nfs4_state *state, struct file_lock *fl) | |||
3630 | goto out; | 3630 | goto out; |
3631 | do { | 3631 | do { |
3632 | err = _nfs4_do_setlk(state, F_SETLK, fl, 0); | 3632 | err = _nfs4_do_setlk(state, F_SETLK, fl, 0); |
3633 | if (err != -NFS4ERR_DELAY) | 3633 | switch (err) { |
3634 | break; | 3634 | default: |
3635 | printk(KERN_ERR "%s: unhandled error %d.\n", | ||
3636 | __func__, err); | ||
3637 | case 0: | ||
3638 | goto out; | ||
3639 | case -NFS4ERR_EXPIRED: | ||
3640 | case -NFS4ERR_STALE_CLIENTID: | ||
3641 | nfs4_schedule_state_recovery(server->nfs_client); | ||
3642 | goto out; | ||
3643 | case -NFS4ERR_DELAY: | ||
3644 | break; | ||
3645 | } | ||
3635 | err = nfs4_handle_exception(server, err, &exception); | 3646 | err = nfs4_handle_exception(server, err, &exception); |
3636 | } while (exception.retry); | 3647 | } while (exception.retry); |
3637 | out: | 3648 | out: |