public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* inotify: notify IN_DELETE_SELF when file is deleted or inode deleted ?
@ 2012-06-29 14:06 Pierre PEIFFER
  2012-07-06 18:16 ` Eric Paris
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre PEIFFER @ 2012-06-29 14:06 UTC (permalink / raw)
  To: linux-kernel

Hi,

By playing with inotify (on user side) to know whether the file I'm 
using is deleted by someone else,  I have noted that I do not receive 
the IN_DELETE_SELF event, exactly because I'm using it. By checking into 
kernel area, I see that at unlink(), an IN_ATTRIB event is sent, but 
IN_DELETE_SELF is, indeed, sent only when the inode is deleted.

But such IN_ATTRIB event doesn't tell to the user what has changed among 
permissions, timestamps, link count, etc...
So it doesn't much help. Of course, I have noted that I can monitor the 
parent directory for IN_DELETE and then check which file has been 
deleted; few more stuff to do but it works, no pb.

But I'm still wondering after reading in the man.:
            IN_DELETE_SELF    Watched file/directory was itself deleted.
Is this really the expected behavior ? Shouldn't the kernel trig such 
event at unlink() ? Or is inotify clearly inode oriented ?

Thanks,

Pierre

PS: keep me in cc, I'm not subscribed to the list.

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

* Re: inotify: notify IN_DELETE_SELF when file is deleted or inode deleted ?
  2012-06-29 14:06 inotify: notify IN_DELETE_SELF when file is deleted or inode deleted ? Pierre PEIFFER
@ 2012-07-06 18:16 ` Eric Paris
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Paris @ 2012-07-06 18:16 UTC (permalink / raw)
  To: Pierre PEIFFER; +Cc: linux-kernel

It is inode oriented.  Makes it a pain to work with, but that's how it
is.  Sorry!

On Fri, Jun 29, 2012 at 10:06 AM, Pierre PEIFFER
<pierre.peiffer@stericsson.com> wrote:
> Hi,
>
> By playing with inotify (on user side) to know whether the file I'm using is
> deleted by someone else,  I have noted that I do not receive the
> IN_DELETE_SELF event, exactly because I'm using it. By checking into kernel
> area, I see that at unlink(), an IN_ATTRIB event is sent, but IN_DELETE_SELF
> is, indeed, sent only when the inode is deleted.
>
> But such IN_ATTRIB event doesn't tell to the user what has changed among
> permissions, timestamps, link count, etc...
> So it doesn't much help. Of course, I have noted that I can monitor the
> parent directory for IN_DELETE and then check which file has been deleted;
> few more stuff to do but it works, no pb.
>
> But I'm still wondering after reading in the man.:
>            IN_DELETE_SELF    Watched file/directory was itself deleted.
> Is this really the expected behavior ? Shouldn't the kernel trig such event
> at unlink() ? Or is inotify clearly inode oriented ?
>
> Thanks,
>
> Pierre
>
> PS: keep me in cc, I'm not subscribed to the list.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2012-07-06 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 14:06 inotify: notify IN_DELETE_SELF when file is deleted or inode deleted ? Pierre PEIFFER
2012-07-06 18:16 ` Eric Paris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox