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

Stale file handle in the guest after changing file on the host #187

Open
Romeus opened this issue Oct 19, 2024 · 3 comments
Open

Stale file handle in the guest after changing file on the host #187

Romeus opened this issue Oct 19, 2024 · 3 comments

Comments

@Romeus
Copy link

Romeus commented Oct 19, 2024

Prerequisites

Vng is built from source and installed in a virtual environment:

(virtme) hedin@laptop:~/prj$ vng --version
virtme-ng 1.31+5.g1da4504

Host OS version:
hedin@laptop:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Reproducer

  1. Build the latest linux-next and run it:
    (virtme) hedin@laptop:~/prj$ vng -r kernel_builds/linux-next-virtme/
    _ _
    __ ()_ | | _ __ ___ ___ _ __ __ _
    \ \ / / | | | _ _ \ / _ ____| _ \ / _ |
    \ V /| | | | |
    | | | | | | /
    | | | | (| |
    _/ |
    || _|| || |_|_
    | || ||__ |
    |___/
    kernel version: 6.12.0-rc3-next-20241018-virtme x86_64
    (CTRL+d to exit)

  2. Create a file on the host:
    hedin@laptop:~$ echo "123" > test.txt

  3. Check it on the guest:
    hedin@virtme-ng:~$ cat test.txt
    123

  4. Modify it on the host by adding something:
    hedin@laptop:~$ vim test.txt

  5. Check the changes in the guest:
    hedin@virtme-ng:~$ cat test.txt
    cat: test.txt: Stale file handle

  6. Close the editor in the host and check file on the guest one more time:
    hedin@virtme-ng:~$ cat test.txt
    cat: test.txt: Stale file handle

  7. List files in the guest:
    hedin@virtme-ng:~$ ls
    ls: cannot access 'test.txt': Stale file handle

  8. Remove the file from the host:
    hedin@laptop:~$ rm test.txt

  9. The error in the guest disappeared

@arighi
Copy link
Owner

arighi commented Oct 19, 2024

Interesting, this looks like a virtiofs bug, if you run vng --force-9p it doesn't seem to happen. I'll investigate a bit to see if it's a known bug.

@Romeus
Copy link
Author

Romeus commented Oct 19, 2024

I checked it using:
vng --force-9p -r kernel_builds/linux-next-virtme/
and the issue disappeared. So, I guess that you are right - this is virtiofs-related bug.

@marcosps
Copy link
Collaborator

I've seen this issue for quite some time already but I though it was related to some issue I'm my distro. Good to know this problem doesn't happen only on my machine :)

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

3 participants