All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: German Maglione <gmaglione@redhat.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [Virtio-fs] [virtiofsd][virtiofsd-rs] unlink an openfile over NFS
Date: Wed, 1 Dec 2021 17:10:54 -0500	[thread overview]
Message-ID: <Yafy7hF56oPn9h4/@redhat.com> (raw)
In-Reply-To: <CAJh=p+6o8_2UekwO0nQ8+sjcgpcEzGhFrTsiTjN4n72R3vNAGw@mail.gmail.com>

On Wed, Dec 01, 2021 at 01:06:23PM +0100, German Maglione wrote:
> Hi,
> 
> I was working on [1] (related to [2]), and I saw that both versions
> (C and rust) of virtiofsd make the NFs client to "silly rename" an open
> file that were unlinked, because we keep each file open as O_PATH in the
> lo_do_lookup/do_lookup function. David pointed me to this problem, and I
> confirmed that this is the case.
> 
> This fires the silly rename in the nfs client. I'm talking with
> Bruce Fields (nfs team) to see how to move the silly rename functionality
> to the nfs server and outside the directory tree [4], to avoid having
> non-really-empty
> dirs full of .nfsxxx files. But it is not an easy task.
> Also, this will not solve some potential issues with the resource usage:
> disk space and open file limits (I hit this limit a couple of times during
> my
> tests). And, in some cases could be worst, more than one guest sharing the
> same
> exported dir, one guest just 'ls' or 'find' while the other 'rm' some files.
> (The 'find' command will open all files, btw)
> 
> Vivek, I saw in [5] that you mentioned that this could be fixed introducing
> synchronous, could you elaborate a bit or point me to some code?

Hi German,

Right now forget messages are asynchronous. They are sent to server and
client does not wait for any reply. That means when unlink() returns,
it is possible that a FORGET message is in progress and has not finished
yet.

Idea behind synchronous FORGET messages is that it will generate a reply
and client will wait for it. Given inode on server should be gone,
I am not sure how much sense does it make. But anyway conceputaully
that's the idea. If we want for FORGET message to finish, that will
mean that O_PATH fd opened by virtiofsd is closed and we will not
have NFS silly rename issue (atleast due to virtiofsd). If virtiofs
client has file open, then issue will still happen.

I think using file handles in virtiofsd_rs (--inode-file-handles) is
a reasonable solution for this problem. Trying to add synchronous
FORGET might be overkill.

Thanks
Vivek
> 
> Thanks,
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=2018072
> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1908490
> [4] https://wiki.linux-nfs.org/wiki/index.php/Server-side_silly_rename
> [5]
> https://sourceforge.net/p/fuse/mailman/fuse-devel/?viewmonth=202101&viewday=4
> 
> 
> -- 
> German


  reply	other threads:[~2021-12-01 22:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 12:06 [Virtio-fs] [virtiofsd][virtiofsd-rs] unlink an openfile over NFS German Maglione
2021-12-01 22:10 ` Vivek Goyal [this message]
2021-12-02 15:03   ` German Maglione
2021-12-02 15:51     ` Vivek Goyal
2021-12-02 17:52       ` Hanna Reitz
2021-12-02 20:14         ` Vivek Goyal
2021-12-03  9:39           ` Hanna Reitz
2021-12-03 14:09             ` Vivek Goyal
2021-12-07 15:41               ` German Maglione

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yafy7hF56oPn9h4/@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=gmaglione@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=miklos@szeredi.hu \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.