proot
proot copied to clipboard
File locking using OFD Support is not working
Expected Behavior
fcntl + OFD based locking should work.
Actual Behavior
fcntl + OFD locking fails causing an issue for some operations, the use case application is sysrepoctl
. Is OFD support available in proot?
Steps to Reproduce the Problem
Tricky to repro as it needs some custom steps, as the opensource version of sysrepo doesn't support Debian packaging yet. Sorry, But I can actively provide necessary information.
- Install sysrepo packages
- Try uninstalling a module
- The operation fails with unable to lock the file
- Try the same in the host and it works,
strace
shows OFD is being used and looking at this OFD is the likely culprit but no way to confirm asstrace
doesn't work in proot. - Haven't tried disabling OFD in sysrepo but it might work.
Strace output from the guest shows below invocation.
fcntl(3, F_OFD_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
Specifications
- Proot/Care version: 5.1.0
- Kernel version: 4.13.0-39-generic
- Host distribution: Ubuntu
- Guest distribution: Ubuntu
Command Output
# sysrepoctl -u -m DN101 -L 4
[DBG] Setting log level for stderr logs to 4.
Uninstalling the module DN101...
[WRN] Unable to acquire the lock on fd 3:
[ERR] Unable to lock sysrepo-module-dependencies.lyb data file.
Error: Failed to initialize module dependencies context.
Uninstall operation failed.
Excellent bug report.