Commit bd9bb95
committed
smb3: fix broken cached reads when posix locks
JIRA: https://issues.redhat.com/browse/RHEL-57983
Conflicts:
- Code difference due to missing 3ee1a1f ("cifs: Cut over
to using netfslib").
commit e4be320
Author: Steve French <stfrench@microsoft.com>
Date: Thu Aug 15 18:31:36 2024 -0500
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: 85160e0 ("CIFS: Implement caching mechanism for mandatory brlocks")
Cc: stable@vger.kernel.org
Cc: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Reported-by: abartlet@samba.org
Reported-by: Kevin Ottens <kevin.ottens@enioka.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Paulo Alcantara <paalcant@redhat.com>1 parent f9865f5 commit bd9bb95
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4486 | 4486 | | |
4487 | 4487 | | |
4488 | 4488 | | |
4489 | | - | |
4490 | | - | |
4491 | | - | |
| 4489 | + | |
4492 | 4490 | | |
4493 | 4491 | | |
4494 | 4492 | | |
| |||
0 commit comments