All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: John Muir <john@jmuir.com>
Cc: fuse-devel <fuse-devel@lists.sourceforge.net>,
	Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [fuse-devel] Difference between invalidating and deleting dentry
Date: Tue, 01 Nov 2016 13:21:02 -0700	[thread overview]
Message-ID: <87y413gde9.fsf@thinkpad.rath.org> (raw)
In-Reply-To: <D37E01C3-5CD6-4EE0-B796-0C5A1D5F8CA1@jmuir.com> (John Muir's message of "Mon, 31 Oct 2016 07:36:59 -0700")

On Oct 31 2016, John Muir <john@jmuir.com> wrote:
>> On 2016.10.08, at 21:37 , Nikolaus Rath <Nikolaus@rath.org> wrote:
>> 
>> fuse_lowlevel_notify_inval_entry:
>>   Notify to invalidate parent attributes and the dentry matching
>>   parent/name
>> 
>> fuse_lowlevel_notify_delete:
>>   Notify to invalidate parent attributes and delete the dentry matching
>>   parent/name if the dentry's inode number matches child (otherwise it
>>   will invalidate the matching dentry).
>> 
>> 
>> But what exactly is the difference between deleting and invalidating a
>> dentry? In each case, isn't the resulting behavior the same, in that the
>> next time someone tries to access this (parent_inode,entry_name)
>> combination a lookup() request will be send to the FUSE process?
>
>
> These are aimed at networked file-systems where changes can be initiated at the other end.
>
> The first clears the cached data for that dentry, so that next time
> the file lookup occurs the file is still in existence but there is no
> cached data, forcing the request to go down to the user-space
> file-system. This would be used during remote rename.
>
> The second actually removes the dentry in the VFS in the kernel. This
> would be used during remote deletion.

Alright, seems there are as many different opinions on this as there are
replies. So I tried to make sense of the code myself.

I think Miklos and Amir are correct: the only difference between the
functions is a call to fsnotify.

At least as of kernel 4.8, both notify_delete and notify_inval_inode
result in a call to fuse_reverse_inval_entry() in the kernel. And that
function calls fuse_invalidate_attr (to invalidate the attributes of the
parent) and fuse_invalidate_entry (which removes the dentry from the
hash via d_invalidate *and* marks it as stale).

The only difference is that when reverse_inval_entry is entered via
notify_delete, it attempts to call d_delete (after the call to
d_invalidate), which seems to have the effect of only calling
fsnotify_nameremove().

John, are we missing something?

Best,
Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

      reply	other threads:[~2016-11-01 20:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  4:37 Difference between invalidating and deleting dentry Nikolaus Rath
2016-10-10  8:16 ` [fuse-devel] " Amir Goldstein
2016-10-10 15:45   ` Nikolaus Rath
2016-10-10 15:55     ` Michael Theall
2016-10-10 15:57       ` Amir Goldstein
2016-10-10 16:11         ` Michael Theall
2016-10-10 16:10       ` Nikolaus Rath
2016-10-19  1:51         ` Nikolaus Rath
2016-10-19  5:53           ` Amir Goldstein
2016-10-19  8:01             ` Miklos Szeredi
2016-10-19  8:32               ` Amir Goldstein
2016-10-19  8:38                 ` Miklos Szeredi
2016-10-19 21:00                   ` Nikolaus Rath
2016-10-19 20:55             ` [fuse-devel] " Nikolaus Rath
2016-10-31 14:36 ` John Muir
2016-11-01 20:21   ` Nikolaus Rath [this message]

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=87y413gde9.fsf@thinkpad.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=john@jmuir.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.