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 08:50:14 +0000 (10:50 +0200)
commit9b35348318d13f28219d1a08019d36335cff1475
tree19645c4dd198a8fa6c298bf3f632b433c7457afb
parent40888c31aca3a46f266f1f121679f8e1982df085
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