Commit 9a7e59763ef23145088decdb714d35dfdefe868b

Authored by Pavel Shilovsky
Committed by Greg Kroah-Hartman
1 parent e6fc2f0c1d

CIFS: Fix wrong directory attributes after rename

commit b46799a8f28c43c5264ac8d8ffa28b311b557e03 upstream.

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.

Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

... ... @@ -1713,6 +1713,12 @@
1713 1713 target_dentry, to_name);
1714 1714 }
1715 1715  
  1716 + /* force revalidate to go get info when needed */
  1717 + CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0;
  1718 +
  1719 + source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime =
  1720 + target_dir->i_mtime = current_fs_time(source_dir->i_sb);
  1721 +
1716 1722 cifs_rename_exit:
1717 1723 kfree(info_buf_source);
1718 1724 kfree(from_name);