diff options
author | Steve French <smfrench@gmail.com> | 2016-09-26 14:23:08 -0500 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-02-23 03:54:13 +0000 |
commit | 5731ddb7187dc24ca5c65cc7fc5e91e447d06af6 (patch) | |
tree | a762396bf0652be5379e5ef0a55ced8383bf8ee9 | |
parent | d02e327b875605d50f6dcab62c08cf9ccd667225 (diff) | |
download | linux-stable-5731ddb7187dc24ca5c65cc7fc5e91e447d06af6.tar.gz linux-stable-5731ddb7187dc24ca5c65cc7fc5e91e447d06af6.tar.bz2 linux-stable-5731ddb7187dc24ca5c65cc7fc5e91e447d06af6.zip |
Do not send SMB3 SET_INFO request if nothing is changing
commit 18dd8e1a65ddae2351d0f0d6dd4a334f441fc5fa upstream.
[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@primarydata.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | fs/cifs/smb2inode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index f970c5d5b253..549676f7b811 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 */ + tlink = cifs_sb_tlink(cifs_sb); if (IS_ERR(tlink)) return PTR_ERR(tlink); + rc = smb2_open_op_close(xid, tlink_tcon(tlink), cifs_sb, full_path, FILE_WRITE_ATTRIBUTES, FILE_OPEN, 0, buf, SMB2_OP_SET_INFO); |