Repository navigation
|
Hello there, In Azure Files, when opening a file for writing, it is marked as exclusive, meaning that any other operation trying to write into it, will get an error. Therefore my question: is there any functionality to enqueue Thanks! :) |
Replies: 1 comment 1 reply
|
Hi, We are always happy to see that our works are also useful in other projects! Coming to the questions. NFS4.0 protocol has a concept of Share reservations, which defines which private static class AzureOperationExecutor extends MDSOperationExecutor {
@Override
public AbstractNFSv4Operation getOperation(nfs_argop4 op) {
if (op.argop == nfs_opnum4.OP_OPEN &&
op.opopen.share_access.value == OPEN4_SHARE_ACCESS_WRITE) {
// tweak share deny
op.opopen.share_deny.value = OPEN4_SHARE_DENY_BOTH;
}
return super.getOperation(op);
}
}
NFSServerV41 nfs4 =
new NFSServerV41.Builder()
.withOperationExecutor(new AzureOperationExecutor())
...
.build();The code above is of course just an idea and probably should make it right :) A cleaner solution might be exposing some kind of file system capabilities to define the default behaviour. I hope this helps. |
Hi,
We are always happy to see that our works are also useful in other projects!
Coming to the questions. NFS4.0 protocol has a concept of Share reservations, which defines which
concurrent access is allowed. There is
share_accessandshare_deny. Theshare_accessspecifies the access mode which is wanted, i.e. open for read or open for write, while
denydefines which concurrent access is allowed, i.e. other readers or other writers.The POSIX standard doesn't provide a way to specify
share_deny, thus, typically, theNFS clients can't specify it. However, nfs4j supports it. The quick-and-dirty workaround
will be to set
_args.opopen.share_deny.valuetoOPEN4_SHARE_DENY_BOTHif
share_accessis