]> git.baikalelectronics.ru Git - kernel.git/commit
smb3: do not error on fsync when readonly
authorSteve French <stfrench@microsoft.com>
Wed, 10 Nov 2021 07:47:48 +0000 (01:47 -0600)
committerSteve French <stfrench@microsoft.com>
Wed, 10 Nov 2021 22:28:27 +0000 (16:28 -0600)
commit49c9b3d515a48447521717bf64f504bf07ae0520
tree9a62b86152ec698032bec5ab399a76ab323e5c2e
parent1c681d6a949a4d3f00d3ff4a227bad5537a07c2e
smb3: do not error on fsync when readonly

Linux allows doing a flush/fsync on a file open for read-only,
but the protocol does not allow that.  If the file passed in
on the flush is read-only try to find a writeable handle for
the same inode, if that is not possible skip sending the
fsync call to the server to avoid breaking the apps.

Reported-by: Julian Sikorski <belegdol@gmail.com>
Tested-by: Julian Sikorski <belegdol@gmail.com>
Suggested-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/file.c