NFSv4.1: Don't trust attributes if a pNFS LAYOUTCOMMIT is outstanding
If a LAYOUTCOMMIT is outstanding, then chances are that the metadata server may still be returning incorrect values for the change attribute, ctime, mtime and/or size. Just ignore those attributes for now, and wait for the LAYOUTCOMMIT rpc call to finish. Reported-by: shaobingqing <shaobingqing@bwstor.com.cn> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
@@ -7780,10 +7780,7 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
|
||||
case -NFS4ERR_BADLAYOUT: /* no layout */
|
||||
case -NFS4ERR_GRACE: /* loca_recalim always false */
|
||||
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) {
|
||||
@@ -7798,6 +7795,8 @@ static void nfs4_layoutcommit_release(void *calldata)
|
||||
struct nfs4_layoutcommit_data *data = calldata;
|
||||
|
||||
pnfs_cleanup_layoutcommit(data);
|
||||
nfs_post_op_update_inode_force_wcc(data->args.inode,
|
||||
data->res.fattr);
|
||||
put_rpccred(data->cred);
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user