All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] Deleting files when using NFS as a shared folder
@ 2021-08-02 10:18 Gal Hammer
  2021-08-02 10:36 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 9+ messages in thread
From: Gal Hammer @ 2021-08-02 10:18 UTC (permalink / raw)
  To: virtio-fs

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

Hello,

When using NFS as a shared folder (mount type nfs4) with a Linux guest I
have the following issue:

Guest:
$ ls -la /mnt/shared
total 8
drwxr-xrwx.  2  135  135 4096 Aug  2 13:08 .
dr-xr-xr-x. 17 root   root    224 May 23 10:58 ..
-rw-r--rw-.  1  135  135   27 Aug  2 13:07 readme.txt

Host:
$ rm readme.txt

Guest:
$ ls -la /mnt/shared
total 8
drwxr-xrwx.  2  135  135 4096 Aug  2 13:10 .
dr-xr-xr-x. 17 root   root    224 May 23 10:58 ..
-rw-r--rw-.  1  135  135   27 Aug  2 13:07 .nfs0000000001b600d000000005

Guest:
$ cat /mnt/shared/readme.txt
This is a readme.txt file.

So it seems that the virtiofsd has a reference to the file which the guest
is not aware of and is unable to send a FUSE_FORGET message. This results
in a file not actually deleted (renamed to .nfsXXX) and is still accessible
by the guest.

I have a similar problem when deleting a file from a Windows guest side.
The FUSE_READDIR(PLUS) commands add a reference count to files which the OS
doesn't have a file context for. However I was able to solve it (for now?)
by keeping track of returned files' inodes.

Is this behaviour current and by design?

Thanks,

    Gal.

[-- Attachment #2: Type: text/html, Size: 3559 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-04 13:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 10:18 [Virtio-fs] Deleting files when using NFS as a shared folder Gal Hammer
2021-08-02 10:36 ` Dr. David Alan Gilbert
2021-08-02 10:44   ` Gal Hammer
2021-08-02 10:49     ` Max Reitz
2021-08-02 11:30       ` Gal Hammer
2021-08-02 16:34         ` Max Reitz
2021-08-02 21:15           ` Vivek Goyal
2021-08-04  9:08             ` Gal Hammer
2021-08-04 13:35               ` Vivek Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.