diff options
author | David Howells <dhowells@redhat.com> | 2023-11-01 22:03:28 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-11-24 14:52:01 +0000 |
commit | b590eb41be766c5a63acc7e8896a042f7a4e8293 (patch) | |
tree | 2c5df4d705e855d81c3c6d627cb977b830426353 | |
parent | 0167236e7d66c5e1e85d902a6abc2529b7544539 (diff) | |
download | linux-b590eb41be766c5a63acc7e8896a042f7a4e8293.tar.gz linux-b590eb41be766c5a63acc7e8896a042f7a4e8293.tar.bz2 linux-b590eb41be766c5a63acc7e8896a042f7a4e8293.zip |
afs: Fix file locking on R/O volumes to operate in local mode
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
-rw-r--r-- | fs/afs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c index 95d713074dc8..e95fb4cb4fcd 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -407,6 +407,8 @@ static int afs_validate_fc(struct fs_context *fc) return PTR_ERR(volume); ctx->volume = volume; + if (volume->type != AFSVL_RWVOL) + ctx->flock_mode = afs_flock_mode_local; } return 0; |