mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
NFSv4.1/pnfs: Play safe w.r.t. close() races when return-on-close is set
If we have an OPEN_DOWNGRADE and CLOSE race with one another, we want to ensure that the layout is forgotten by the client, so that we start afresh with a new layoutget. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
4ff376feaf
commit
3c13cb5b64
1 changed files with 5 additions and 5 deletions
|
@ -2661,7 +2661,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
|
|||
switch (task->tk_status) {
|
||||
case 0:
|
||||
res_stateid = &calldata->res.stateid;
|
||||
if (calldata->arg.fmode == 0 && calldata->roc)
|
||||
if (calldata->roc)
|
||||
pnfs_roc_set_barrier(state->inode,
|
||||
calldata->roc_barrier);
|
||||
renew_lease(server, calldata->timestamp);
|
||||
|
@ -2735,11 +2735,11 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
|
|||
goto out_no_action;
|
||||
}
|
||||
|
||||
if (calldata->arg.fmode == 0) {
|
||||
if (calldata->arg.fmode == 0)
|
||||
task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
|
||||
if (calldata->roc)
|
||||
pnfs_roc_get_barrier(inode, &calldata->roc_barrier);
|
||||
}
|
||||
if (calldata->roc)
|
||||
pnfs_roc_get_barrier(inode, &calldata->roc_barrier);
|
||||
|
||||
calldata->arg.share_access =
|
||||
nfs4_map_atomic_open_share(NFS_SERVER(inode),
|
||||
calldata->arg.fmode, 0);
|
||||
|
|
Loading…
Reference in a new issue