smb3: fix performance regression with setting mtime
authorSteve French <stfrench@microsoft.com>
Mon, 24 Feb 2020 23:37:39 +0000 (17:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:12:07 +0000 (16:12 +0200)
commit52571c063299413e2fa89c312622751b28221a92
treec265ddfa831f738bfa642e962c1ba6cec5c3d719
parentcd3f438fbb9cb60da32dd2b665f7dc9baba1c4ad
smb3: fix performance regression with setting mtime

commit cf5371ae460eb8e484e4884747af270c86c3c469 upstream.

There are cases when we don't want to send the SMB2 flush operation
(e.g. when user specifies mount parm "nostrictsync") and it can be
a very expensive operation on the server.  In most cases in order
to set mtime, we simply need to flush (write) the dirtry pages from
the client and send the writes to the server not also send a flush
protocol operation to the server.

Fixes: aa081859b10c ("cifs: flush before set-info if we have writeable handles")
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/inode.c