Skip to content

Commit b590eb4

Browse files
committed
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: 6c6c1d6 ("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
1 parent 0167236 commit b590eb4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/afs/super.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ static int afs_validate_fc(struct fs_context *fc)
407407
return PTR_ERR(volume);
408408

409409
ctx->volume = volume;
410+
if (volume->type != AFSVL_RWVOL)
411+
ctx->flock_mode = afs_flock_mode_local;
410412
}
411413

412414
return 0;

0 commit comments

Comments
 (0)