Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit e4be320e authored by Steve French's avatar Steve French
Browse files

smb3: fix broken cached reads when posix locks

Mandatory locking is enforced for cached reads, which violates
default posix semantics, and also it is enforced inconsistently.
This affected recent versions of libreoffice, and can be
demonstrated by opening a file twice from the same client,
locking it from handle one and trying to read from it from
handle two (which fails, returning EACCES).

There is already a mount option "forcemandatorylock"
(which defaults to off), so with this change only when the user
intentionally specifies "forcemandatorylock" on mount will we
break posix semantics on read to a locked range (ie we will
only fail in this case, if the user mounts with
"forcemandatorylock").

An earlier patch fixed the write path.

Fixes: 85160e03

 ("CIFS: Implement caching mechanism for mandatory brlocks")
Cc: stable@vger.kernel.org
Cc: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Reported-by: default avatar <abartlet@samba.org>
Reported-by: default avatarKevin Ottens <kevin.ottens@enioka.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 47ac09b9
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment