lkml.org 
[lkml]   [2010]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: A possible flaw in the fsnotify design.
From
Date
On Tue, 2010-11-16 at 01:44 +0300, Alexey Zaytsev wrote:
> On Tue, Nov 16, 2010 at 01:11, Eric Paris <eparis@redhat.com> wrote:
> > On Tue, 2010-11-16 at 01:05 +0300, Alexey Zaytsev wrote:
> >> Just some thoughts.
> >>
> >> Consider the situation: Files A and B both point to the same inode.
> >> File A is being watched, but the user won't get notifications if B is
> >> modified.
> >
> > That's not true. Users watch inodes, not files (this is true for both
> > inotify and fanotify). Give it a try, it works.
> >
>
> debian-i386:~/tmp# touch a
> debian-i386:~/tmp# ../fanotify a &
> debian-i386:~/tmp# link a b
> debian-i386:~/tmp# ls -li
> total 0
> 3433 -rw-r--r-- 2 root root 0 Nov 15 22:37 a
> 3433 -rw-r--r-- 2 root root 0 Nov 15 22:37 b
> debian-i386:~/tmp# echo 123 > b
> /root/tmp/b: pid=2143 mask = 20 open
> /root/tmp/b: pid=2143 mask = a modify 0 - 4 close(writable) 0 - 4
>
> Am I doing something wrong? Same thing happens if I watch the mount point.

Maybe I don't understand the problem, you watched the inode behind A.
You made changes accessing this inode via B, you got notification about
those changes. Isn't that what you wanted?



\
 
 \ /
  Last update: 2010-11-15 23:55    [W:0.065 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site