Skip to content

Commit e59d27e

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFSv4.1: Fix layoutcommit error handling
Firstly, task->tk_status will always return negative error values, so the current tests for 'NFS4ERR_DELEG_REVOKED' etc. are all being ignored. Secondly, clean up the code so that we only need to test task->tk_status once! Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
1 parent 05e9cfb commit e59d27e

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

‎fs/nfs/nfs4proc.c‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6112,21 +6112,22 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
61126112
return;
61136113

61146114
switch (task->tk_status) { /* Just ignore these failures */
6115-
case NFS4ERR_DELEG_REVOKED: /* layout was recalled */
6116-
case NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */
6117-
case NFS4ERR_BADLAYOUT: /* no layout */
6118-
case NFS4ERR_GRACE: /* loca_recalim always false */
6115+
case -NFS4ERR_DELEG_REVOKED: /* layout was recalled */
6116+
case -NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */
6117+
case -NFS4ERR_BADLAYOUT: /* no layout */
6118+
case -NFS4ERR_GRACE: /* loca_recalim always false */
61196119
task->tk_status = 0;
6120-
}
6121-
6122-
if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) {
6123-
rpc_restart_call_prepare(task);
6124-
return;
6125-
}
6126-
6127-
if (task->tk_status == 0)
6120+
break;
6121+
case 0:
61286122
nfs_post_op_update_inode_force_wcc(data->args.inode,
61296123
data->res.fattr);
6124+
break;
6125+
default:
6126+
if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) {
6127+
rpc_restart_call_prepare(task);
6128+
return;
6129+
}
6130+
}
61306131
}
61316132

61326133
static void nfs4_layoutcommit_release(void *calldata)

0 commit comments

Comments
 (0)