All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Avati <avati@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Ric Wheeler <rwheeler@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Brian Foster <bfoster@redhat.com>,
	David Howells <dhowells@redhat.com>,
	Eric Paris <eparis@redhat.com>,
	Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux NFS list <linux-nfs@vger.kernel.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Steven Whitehouse <swhiteho@redhat.com>,
	"mszeredi@suse.cz" <mszeredi@suse.cz>
Subject: Re: [PATCH 4/4] fuse: drop dentry on failed revalidate
Date: Wed, 07 Aug 2013 09:31:08 -0700	[thread overview]
Message-ID: <5202764C.2000709@redhat.com> (raw)
In-Reply-To: <CAJfpegsD8cgnW59crKABjTE1E5aNpmyO=91ubtNxxp=LnwjgDg@mail.gmail.com>

On 8/7/13 8:44 AM, Miklos Szeredi wrote:
> On Tue, Aug 6, 2013 at 10:06 PM, Anand Avati <avati@redhat.com> wrote:
>> On 8/6/13 7:30 AM, Miklos Szeredi wrote:
>>>
>>> From: Anand Avati <avati@redhat.com>
>>>
>>> Drop a subtree when we find that it has moved or been delated.  This can
>>> be
>>> done as long as there are no submounts under this location.
>>>
>>> If the directory was moved and we come across the same directory in a
>>> future lookup it will be reconnected by d_materialise_unique().
>>>
>>> Signed-off-by: Anand Avati <avati@redhat.com>
>>> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
>>> ---
>>>    fs/fuse/dir.c | 7 ++++++-
>>>    1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
>>> index 131d14b..4ba5893 100644
>>> --- a/fs/fuse/dir.c
>>> +++ b/fs/fuse/dir.c
>>> @@ -226,8 +226,13 @@ static int fuse_dentry_revalidate(struct dentry
>>> *entry, unsigned int flags)
>>>                  if (!err) {
>>>                          struct fuse_inode *fi = get_fuse_inode(inode);
>>>                          if (outarg.nodeid != get_node_id(inode)) {
>>> +                               int ret = 0;
>>> +
>>> +                               if (check_submounts_and_drop(entry) != 0)
>>> +                                       ret = 1;
>>> +
>>>                                  fuse_queue_forget(fc, forget,
>>> outarg.nodeid, 1);
>>> -                               return 0;
>>> +                               return ret;
>>
>>
>> If outarg.nodeid != get_node_id(inode), then we have to return 0 no matter
>> what (whether we successfully dropped the entry or not), no?
>
> If we return 0 in that case (we failed to invalidate the dentry), then
> the VFS will call d_invalidate() which will fail.  The result is the
> same...
>
>> Or are you
>> trying to forcefully keep the path to reach the submount alive? If so, we
>> still fail in inode_permission() .. -> getattr() of the dir inode, no?
>
> Yes.  But the path to the mountpoint should still be reachable (for
> the purpose of unmounting for example).  I'm including an interesting
> discussion between Al and Linus about this (mailing lists weren't
> CC-d, but I don't think they'd mind).


Thanks for attaching the thread. Was very educative! I still do not 
quite understand - will umount() still work when 
inode_permission()[->getattr()] on the ancestors fail (with ESTALE 
etc.)? Wouldn't path resolution itself abort and fail and therefore 
do_umount() never called? I understand that the path to the mountpoint 
being reachable through the dentry chain is a necessity for umounting, 
but is just that really sufficient?

Avati

WARNING: multiple messages have this Message-ID (diff)
From: Anand Avati <avati-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Miklos Szeredi <miklos-sUDqSbJrdHQHWmgEVkV9KA@public.gmane.org>
Cc: Ric Wheeler <rwheeler-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	Brian Foster <bfoster-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Linux-Fsdevel
	<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux NFS list
	<linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Trond Myklebust
	<Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
	Steven Whitehouse
	<swhiteho-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"mszeredi-AlSwsSmVLrQ@public.gmane.org"
	<mszeredi-AlSwsSmVLrQ@public.gmane.org>
Subject: Re: [PATCH 4/4] fuse: drop dentry on failed revalidate
Date: Wed, 07 Aug 2013 09:31:08 -0700	[thread overview]
Message-ID: <5202764C.2000709@redhat.com> (raw)
In-Reply-To: <CAJfpegsD8cgnW59crKABjTE1E5aNpmyO=91ubtNxxp=LnwjgDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 8/7/13 8:44 AM, Miklos Szeredi wrote:
> On Tue, Aug 6, 2013 at 10:06 PM, Anand Avati <avati-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> On 8/6/13 7:30 AM, Miklos Szeredi wrote:
>>>
>>> From: Anand Avati <avati-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>>
>>> Drop a subtree when we find that it has moved or been delated.  This can
>>> be
>>> done as long as there are no submounts under this location.
>>>
>>> If the directory was moved and we come across the same directory in a
>>> future lookup it will be reconnected by d_materialise_unique().
>>>
>>> Signed-off-by: Anand Avati <avati-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>> Signed-off-by: Miklos Szeredi <mszeredi-AlSwsSmVLrQ@public.gmane.org>
>>> ---
>>>    fs/fuse/dir.c | 7 ++++++-
>>>    1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
>>> index 131d14b..4ba5893 100644
>>> --- a/fs/fuse/dir.c
>>> +++ b/fs/fuse/dir.c
>>> @@ -226,8 +226,13 @@ static int fuse_dentry_revalidate(struct dentry
>>> *entry, unsigned int flags)
>>>                  if (!err) {
>>>                          struct fuse_inode *fi = get_fuse_inode(inode);
>>>                          if (outarg.nodeid != get_node_id(inode)) {
>>> +                               int ret = 0;
>>> +
>>> +                               if (check_submounts_and_drop(entry) != 0)
>>> +                                       ret = 1;
>>> +
>>>                                  fuse_queue_forget(fc, forget,
>>> outarg.nodeid, 1);
>>> -                               return 0;
>>> +                               return ret;
>>
>>
>> If outarg.nodeid != get_node_id(inode), then we have to return 0 no matter
>> what (whether we successfully dropped the entry or not), no?
>
> If we return 0 in that case (we failed to invalidate the dentry), then
> the VFS will call d_invalidate() which will fail.  The result is the
> same...
>
>> Or are you
>> trying to forcefully keep the path to reach the submount alive? If so, we
>> still fail in inode_permission() .. -> getattr() of the dir inode, no?
>
> Yes.  But the path to the mountpoint should still be reachable (for
> the purpose of unmounting for example).  I'm including an interesting
> discussion between Al and Linus about this (mailing lists weren't
> CC-d, but I don't think they'd mind).


Thanks for attaching the thread. Was very educative! I still do not 
quite understand - will umount() still work when 
inode_permission()[->getattr()] on the ancestors fail (with ESTALE 
etc.)? Wouldn't path resolution itself abort and fail and therefore 
do_umount() never called? I understand that the path to the mountpoint 
being reachable through the dentry chain is a necessity for umounting, 
but is just that really sufficient?

Avati
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-08-07 16:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06 14:29 [PATCH 0/4] [RFC] safely drop directory dentry on failed revalidate Miklos Szeredi
2013-08-06 14:29 ` Miklos Szeredi
2013-08-06 14:30 ` [PATCH 1/4] vfs: check submounts and drop atomically Miklos Szeredi
2013-08-06 14:30 ` [PATCH 2/4] vfs: check unlinked ancestors before mount Miklos Szeredi
2013-08-06 14:30   ` Miklos Szeredi
2013-08-06 16:08   ` Miklos Szeredi
2013-08-06 14:30 ` [PATCH 3/4] fuse: use d_materialise_unique() Miklos Szeredi
2013-08-06 14:30 ` [PATCH 4/4] fuse: drop dentry on failed revalidate Miklos Szeredi
2013-08-06 14:30   ` Miklos Szeredi
2013-08-06 20:06   ` Anand Avati
2013-08-07 15:44     ` Miklos Szeredi
2013-08-07 15:44       ` Miklos Szeredi
2013-08-07 16:31       ` Anand Avati [this message]
2013-08-07 16:31         ` Anand Avati
2013-08-08 14:46         ` Miklos Szeredi
2013-08-08 14:46           ` Miklos Szeredi

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=5202764C.2000709@redhat.com \
    --to=avati@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfoster@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=eparis@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mszeredi@suse.cz \
    --cc=rwheeler@redhat.com \
    --cc=swhiteho@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.