Skip to content

Commit

Permalink
NFSv4.1: Fix layoutcommit error handling
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 28, 2012
1 parent 05e9cfb commit e59d27e
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6112,21 +6112,22 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
return;

switch (task->tk_status) { /* Just ignore these failures */
case NFS4ERR_DELEG_REVOKED: /* layout was recalled */
case NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */
case NFS4ERR_BADLAYOUT: /* no layout */
case NFS4ERR_GRACE: /* loca_recalim always false */
case -NFS4ERR_DELEG_REVOKED: /* layout was recalled */
case -NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */
case -NFS4ERR_BADLAYOUT: /* no layout */
case -NFS4ERR_GRACE: /* loca_recalim always false */
task->tk_status = 0;
}

if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) {
rpc_restart_call_prepare(task);
return;
}

if (task->tk_status == 0)
break;
case 0:
nfs_post_op_update_inode_force_wcc(data->args.inode,
data->res.fattr);
break;
default:
if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) {
rpc_restart_call_prepare(task);
return;
}
}
}

static void nfs4_layoutcommit_release(void *calldata)
Expand Down

0 comments on commit e59d27e

Please sign in to comment.