mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 10:19:47 +00:00
NFSv4: Handle NFS4ERR_GRACE when recovering an expired lease.
If our lease expires, and the server reboots while we're recovering, we need to be able to wait until the grace period is over. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
c8b7ae3d32
commit
a9ed2e2583
1 changed files with 19 additions and 7 deletions
|
@ -1488,7 +1488,7 @@ static int _nfs4_open_expired(struct nfs_open_context *ctx, struct nfs4_state *s
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline int nfs4_do_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
|
||||
static int nfs4_do_open_expired(struct nfs_open_context *ctx, struct nfs4_state *state)
|
||||
{
|
||||
struct nfs_server *server = NFS_SERVER(state->inode);
|
||||
struct nfs4_exception exception = { };
|
||||
|
@ -1496,10 +1496,16 @@ static inline int nfs4_do_open_expired(struct nfs_open_context *ctx, struct nfs4
|
|||
|
||||
do {
|
||||
err = _nfs4_open_expired(ctx, state);
|
||||
if (err != -NFS4ERR_DELAY)
|
||||
break;
|
||||
nfs4_handle_exception(server, err, &exception);
|
||||
switch (err) {
|
||||
default:
|
||||
goto out;
|
||||
case -NFS4ERR_GRACE:
|
||||
case -NFS4ERR_DELAY:
|
||||
nfs4_handle_exception(server, err, &exception);
|
||||
err = 0;
|
||||
}
|
||||
} while (exception.retry);
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -4049,10 +4055,16 @@ static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request
|
|||
if (test_bit(NFS_DELEGATED_STATE, &state->flags) != 0)
|
||||
return 0;
|
||||
err = _nfs4_do_setlk(state, F_SETLK, request, 0);
|
||||
if (err != -NFS4ERR_DELAY)
|
||||
break;
|
||||
nfs4_handle_exception(server, err, &exception);
|
||||
switch (err) {
|
||||
default:
|
||||
goto out;
|
||||
case -NFS4ERR_GRACE:
|
||||
case -NFS4ERR_DELAY:
|
||||
nfs4_handle_exception(server, err, &exception);
|
||||
err = 0;
|
||||
}
|
||||
} while (exception.retry);
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue