]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
CIFS: Respect O_SYNC and O_DIRECT flags during reconnect
authorPavel Shilovsky <pshilov@microsoft.com>
Wed, 13 Nov 2019 01:16:35 +0000 (17:16 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 11 Feb 2020 20:03:48 +0000 (20:03 +0000)
commit97c39ca8cf497077e063a821a03e58dece77ae8c
tree2a216448672586b3f19c35cafdf313e761a624cb
parent970405d201c855ba4ace20bbf548c5ee6e69ef28
CIFS: Respect O_SYNC and O_DIRECT flags during reconnect

commit 44805b0e62f15e90d233485420e1847133716bdc upstream.

Currently the client translates O_SYNC and O_DIRECT flags
into corresponding SMB create options when openning a file.
The problem is that on reconnect when the file is being
re-opened the client doesn't set those flags and it causes
a server to reject re-open requests because create options
don't match. The latter means that any subsequent system
call against that open file fail until a share is re-mounted.

Fix this by properly setting SMB create options when
re-openning files after reconnects.

Fixes: 1013e760d10e6: ("SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags")
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/file.c