diff mbox

[2/2] CIFS: Fix wrong directory attributes after rename

Message ID 1408380598-11737-2-git-send-email-pshilovsky@samba.org (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Aug. 18, 2014, 4:49 p.m. UTC
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>
---
 fs/cifs/inode.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Steve French Aug. 19, 2014, 3:34 a.m. UTC | #1
The two patches have been merged into cifs-2.6.git for-next

On Mon, Aug 18, 2014 at 11:49 AM, Pavel Shilovsky <pshilovsky@samba.org> wrote:
> 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>
> ---
>  fs/cifs/inode.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 2029e7c..cf69c95 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1720,6 +1720,12 @@ unlink_target:
>                                     target_dentry, to_name);
>         }
>
> +       /* force revalidate to go get info when needed */
> +       CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0;
> +
> +       source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime =
> +               target_dir->i_mtime = current_fs_time(source_dir->i_sb);
> +
>  cifs_rename_exit:
>         kfree(info_buf_source);
>         kfree(from_name);
> --
> 1.8.3.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 2029e7c..cf69c95 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1720,6 +1720,12 @@  unlink_target:
 				    target_dentry, to_name);
 	}
 
+	/* force revalidate to go get info when needed */
+	CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0;
+
+	source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime =
+		target_dir->i_mtime = current_fs_time(source_dir->i_sb);
+
 cifs_rename_exit:
 	kfree(info_buf_source);
 	kfree(from_name);