linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: akpm@linux-foundation.org, john@johnmccutchan.com,
	rlove@rlove.org, viro@zeniv.linux.org.uk
Subject: How SHOULD inotify and hardlinks play together?
Date: Wed, 15 Apr 2009 17:49:08 -0400	[thread overview]
Message-ID: <1239832148.2562.42.camel@localhost.localdomain> (raw)

touch /tmp/file1 /tmp/file2
ln /tmp/file2 /tmp/hardlinktofile2

[A] Set up one inotify watch on /tmp/file2
[B] Set up another inotify watch on /tmp/hardlinktofile2

(they are both watching the same inode/data)

mv /tmp/file1 /tmp/file2

Right now, today, both [A] and [B] are going to get DELETE_SELF and
IGNORED messages and are not going to get any more notifications.

That might be fine for [A] since the pathname it ask to watch doesn't
exist any more (although I argue the inode still does), but that isn't
right for [B] since /tmp/hardlinktofile2 is still there, still it's own
inode, and still able to receive events, be modified, be read, be
deleted, whatever.  But after that mv operation neither [A] nor [B] will
get any more events what-so-ever.

So the question is, should inotify continue to clear all watches on an
inode when something else is moved on top if it even if i_nlink isn't
going to 0?  If not, should inotify continue to send a DELETE_SELF like
it does today?  Should it instead send an ATTRIB like it does when you
add a hard link?

-Eric


                 reply	other threads:[~2009-04-15 21:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1239832148.2562.42.camel@localhost.localdomain \
    --to=eparis@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=john@johnmccutchan.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlove@rlove.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).