smb3: Do not send SMB3 SET_INFO if nothing changed
authorSteve French <stfrench@microsoft.com>
Fri, 3 Aug 2018 01:28:18 +0000 (20:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:20:05 +0000 (09:20 +0200)
commit707b0d2d9d3ae4b9cde197ffa1b237e29833b2a1
tree5698e4d651bf5de02728ab09c715de31bcf90f7c
parenta94703ff8e3647f8a9a3a92a468450299a7b77e9
smb3: Do not send SMB3 SET_INFO if nothing changed

commit fd09b7d3b352105f08b8e02f7afecf7e816380ef upstream.

An earlier commit had a typo which prevented the
optimization from working:

commit 18dd8e1a65dd ("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 <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org> # 4.9.x+
Reported-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/inode.c
fs/cifs/smb2inode.c