Skip to content

Commit fd09b7d

Browse files
author
Steve French
committed
smb3: Do not send SMB3 SET_INFO if nothing changed
An earlier commit had a typo which prevented the optimization from working: commit 18dd8e1 ("Do not send SMB3 SET_INFO request if nothing is changing") Thank you to Metze for noticing this. Also clear a reserved field in the FILE_BASIC_INFO struct we send that should be zero (all the other fields in that struct were set or cleared explicitly already in cifs_set_file_info). Reviewed-by: Pavel Shilovsky <[email protected]> CC: Stable <[email protected]> # 4.9.x+ Reported-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent d258650 commit fd09b7d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/cifs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,8 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
11201120
if (!server->ops->set_file_info)
11211121
return -ENOSYS;
11221122

1123+
info_buf.Pad = 0;
1124+
11231125
if (attrs->ia_valid & ATTR_ATIME) {
11241126
set_time = true;
11251127
info_buf.LastAccessTime =

fs/cifs/smb2inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ smb2_set_file_info(struct inode *inode, const char *full_path,
283283
int rc;
284284

285285
if ((buf->CreationTime == 0) && (buf->LastAccessTime == 0) &&
286-
(buf->LastWriteTime == 0) && (buf->ChangeTime) &&
286+
(buf->LastWriteTime == 0) && (buf->ChangeTime == 0) &&
287287
(buf->Attributes == 0))
288288
return 0; /* would be a no op, no sense sending this */
289289

0 commit comments

Comments
 (0)