summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-07-30 09:38:51 -0400
committerDavid Howells <dhowells@redhat.com>2019-07-30 09:38:51 -0400
commit37c0bbb3326674940e657118306ac52364314523 (patch)
treee982333ec1af00f573c6c8ea739d05ce05935394
parenta6eed4ab5dd4bfb696c1a3f49742b8d1846a66a0 (diff)
afs: Fix off-by-one in afs_rename() expected data version calculation
When afs_rename() calculates the expected data version of the target directory in a cross-directory rename, it doesn't increment it as it should, so it always thinks that the target inode is unexpectedly modified on the server. Fixes: a58823ac4589 ("afs: Fix application of status and callback to be under same lock") Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--fs/afs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index e640d67274be..20aa18b38a49 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -1804,7 +1804,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
1804 afs_end_vnode_operation(&fc); 1804 afs_end_vnode_operation(&fc);
1805 goto error_rehash; 1805 goto error_rehash;
1806 } 1806 }
1807 new_data_version = new_dvnode->status.data_version; 1807 new_data_version = new_dvnode->status.data_version + 1;
1808 } else { 1808 } else {
1809 new_data_version = orig_data_version; 1809 new_data_version = orig_data_version;
1810 new_scb = &scb[0]; 1810 new_scb = &scb[0];