Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing syscalls on virtualbox share filesystem #18

Open
the8472 opened this issue Feb 2, 2021 · 2 comments
Open

failing syscalls on virtualbox share filesystem #18

the8472 opened this issue Feb 2, 2021 · 2 comments

Comments

@the8472
Copy link

the8472 commented Feb 2, 2021

Copying to a virtualbox filesystem leads to xcp printing an error and not copying the files.

[pid 31325] statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_TYPE|STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|STATX_BTIME|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0755, stx_size=20701696, ...}) = 0
[pid 31325] openat(AT_FDCWD, "/media/sf_c/temp/test.out", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
[pid 31325] ftruncate(4, 20701696)      = 0
[pid 31325] flistxattr(3, NULL, 0)      = -1 EOPNOTSUPP (Operation not supported)

after adding --no-perms

[pid 31423] openat(AT_FDCWD, "/media/sf_c/temp/test.out", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4
[pid 31423] ftruncate(4, 20701696)      = 0
[pid 31423] statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_TYPE|STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|STATX_BTIME|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0755, stx_size=20701696, ...}) = 0
[pid 31423] copy_file_range(3, NULL, 4, NULL, 20701696, 0) = -1 EINVAL (Invalid argument)

kernel 5.10.11

@tarka
Copy link
Owner

tarka commented Feb 4, 2021

Hi @the8472, thanks for the report. I haven't used VB shared volumes before, could you give me some more information about the setup you're using and I'll reproduce locally:

  • OS/version
  • Filesystems used
  • How the shared filesystem is created/mounted.

Thanks,
Steve

@the8472
Copy link
Author

the8472 commented Feb 4, 2021

OS: Arch Linux guest system with kernel 5.10.11 and the virtualbox-guest-utils package installed.

Filesystem: vboxsf, which is the 9p-based host-to-guest share mechanism used by virtualbox. Since Linux 5.6 the guest driver for that is in mainline

Setup

  1. host: you can either use the GUI or the VBoxManage CLI to setup a shared folder. In the GUI it's under virtual machine properties -> shared folders. You need to specify some directory which needs to be shared, as writable and give it a label such as foo.
  2. guest mkdir /mnt/bar (root)
  3. guest mount -t vboxsf foo /mnt/bar (root or member of the vboxsf group)
  4. guest xcp /tmp/test.in /mnt/bar/

I think all that's needed to fix this is to treat the syscall error codes in the strace output above as if the calls aren't available. Note that the rust standard library already does automatic fallback to userspace copy if copy_file_range returns EINVAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants