]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/cifs-fix-wrong-directory-attributes-after-rename.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / cifs-fix-wrong-directory-attributes-after-rename.patch
1 From b46799a8f28c43c5264ac8d8ffa28b311b557e03 Mon Sep 17 00:00:00 2001
2 From: Pavel Shilovsky <pshilovsky@samba.org>
3 Date: Mon, 18 Aug 2014 20:49:58 +0400
4 Subject: CIFS: Fix wrong directory attributes after rename
5
6 From: Pavel Shilovsky <pshilovsky@samba.org>
7
8 commit b46799a8f28c43c5264ac8d8ffa28b311b557e03 upstream.
9
10 When we requests rename we also need to update attributes
11 of both source and target parent directories. Not doing it
12 causes generic/309 xfstest to fail on SMB2 mounts. Fix this
13 by marking these directories for force revalidating.
14
15 Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
16 Signed-off-by: Steve French <smfrench@gmail.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 fs/cifs/inode.c | 6 ++++++
21 1 file changed, 6 insertions(+)
22
23 --- a/fs/cifs/inode.c
24 +++ b/fs/cifs/inode.c
25 @@ -1717,6 +1717,12 @@ unlink_target:
26 target_dentry, to_name);
27 }
28
29 + /* force revalidate to go get info when needed */
30 + CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0;
31 +
32 + source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime =
33 + target_dir->i_mtime = current_fs_time(source_dir->i_sb);
34 +
35 cifs_rename_exit:
36 kfree(info_buf_source);
37 kfree(from_name);