Skip to content

Commit b46799a

Browse files
piastrysmfrench
authored andcommitted
CIFS: Fix wrong directory attributes after rename
When we requests rename we also need to update attributes of both source and target parent directories. Not doing it causes generic/309 xfstest to fail on SMB2 mounts. Fix this by marking these directories for force revalidating. Cc: <stable@vger.kernel.org> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
1 parent 5275580 commit b46799a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/cifs/inode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,12 @@ cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
17171717
target_dentry, to_name);
17181718
}
17191719

1720+
/* force revalidate to go get info when needed */
1721+
CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0;
1722+
1723+
source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime =
1724+
target_dir->i_mtime = current_fs_time(source_dir->i_sb);
1725+
17201726
cifs_rename_exit:
17211727
kfree(info_buf_source);
17221728
kfree(from_name);

0 commit comments

Comments
 (0)