Possible bug in smb2_set_file_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Steve,

I'm wondering if this patch:

>commit 18dd8e1a65ddae2351d0f0d6dd4a334f441fc5fa
>Author: Steve French <smfrench@xxxxxxxxx>
>Date:   Mon Sep 26 14:23:08 2016 -0500
>
>    Do not send SMB3 SET_INFO request if nothing is changing
>
>    [CIFS] We had cases where we sent a SMB2/SMB3 setinfo request with >all
>    timestamp (and DOS attribute) fields marked as 0 (ie do not change)
>    e.g. on chmod or chown.
>
>    Signed-off-by: Steve French <steve.french@xxxxxxxxxxxxxxx>
>    CC: Stable <stable@xxxxxxxxxxxxxxx>
>---
> fs/cifs/smb2inode.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
>index 4f0231e685a92..1238cd3552f9c 100644
>--- a/fs/cifs/smb2inode.c
>+++ b/fs/cifs/smb2inode.c
>@@ -266,9 +266,15 @@ smb2_set_file_info(struct inode *inode, const char
>*full_path,
>        struct tcon_link *tlink;
>        int rc;
>
>+       if ((buf->CreationTime == 0) && (buf->LastAccessTime == 0) &&
>+           (buf->LastWriteTime == 0) && (buf->ChangeTime) &&
>+           (buf->Attributes == 0))
>+               return 0; /* would be a no op, no sense sending this */
>+

Should this contain (buf->ChangeTime == 0) instead of
(buf->ChangeTime).

Am I missing something?

metze

Attachment: signature.asc
Description: OpenPGP digital signature


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux