proot icon indicating copy to clipboard operation
proot copied to clipboard

File locking using OFD Support is not working

Open tkc17 opened this issue 5 years ago • 1 comments

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.

  1. Install sysrepo packages
  2. Try uninstalling a module
  3. The operation fails with unable to lock the file
  4. 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 as strace doesn't work in proot.
  5. 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.

tkc17 avatar Dec 04 '19 13:12 tkc17

Excellent bug report.

oxr463 avatar Dec 04 '19 14:12 oxr463