afs: Fix file locking on R/O volumes to operate in local mode
authorDavid Howells <dhowells@redhat.com>
Wed, 1 Nov 2023 22:03:28 +0000 (22:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Dec 2023 06:33:05 +0000 (07:33 +0100)
commitceca54f1f0ff6ddc23412951d829b9c34b0246c3
tree04950b2d937954a6c4780fafedb21b24b202668d
parent844a4272a462fb02a5245315258ba5a6808db840
afs: Fix file locking on R/O volumes to operate in local mode

[ Upstream commit b590eb41be766c5a63acc7e8896a042f7a4e8293 ]

AFS doesn't really do locking on R/O volumes as fileservers don't maintain
state with each other and thus a lock on a R/O volume file on one
fileserver will not be be visible to someone looking at the same file on
another fileserver.

Further, the server may return an error if you try it.

Fix this by doing what other AFS clients do and handle filelocking on R/O
volume files entirely within the client and don't touch the server.

Fixes: 6c6c1d63c243 ("afs: Provide mount-time configurable byte-range file locking emulation")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/super.c