diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-01-11 12:32:26 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2017-01-12 15:51:18 -0500 |
commit | c733c49c32624f927f443be6dbabb387006bbe42 (patch) | |
tree | 83c9a32ce32d2b9b67b1a80b1efa57e9cfc95863 | |
parent | 2dfc61736482441993bfb7dfaa971113b53f107c (diff) |
NFSv4: Don't apply change_info4 twice on rename within a directory
If a file is renamed, but stays in the same directory, we will still receive
2 change_info4 structures describing the change to that directory, but we
only want to apply it once.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 4010c33151ad..1e797bf74aaf 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4159,8 +4159,11 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, | |||
4159 | if (nfs4_async_handle_error(task, res->server, NULL, &data->timeout) == -EAGAIN) | 4159 | if (nfs4_async_handle_error(task, res->server, NULL, &data->timeout) == -EAGAIN) |
4160 | return 0; | 4160 | return 0; |
4161 | 4161 | ||
4162 | update_changeattr(old_dir, &res->old_cinfo); | 4162 | if (task->tk_status == 0) { |
4163 | update_changeattr(new_dir, &res->new_cinfo); | 4163 | update_changeattr(old_dir, &res->old_cinfo); |
4164 | if (new_dir != old_dir) | ||
4165 | update_changeattr(new_dir, &res->new_cinfo); | ||
4166 | } | ||
4164 | return 1; | 4167 | return 1; |
4165 | } | 4168 | } |
4166 | 4169 | ||