Re: [RFC PATCH] fanotify: wake-up all waiters on release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On (25/06/23 12:52), Jan Kara wrote:
> > My another silly idea was, fsnotify_put_mark_wake() is called in a loop
> > and it tests group->shutdown locklessly, as far as I can tell, so maybe
> > there is a speculative load and we use stale/"cached" group->shutdown
> > value w/o ever waking up ->notification_waitq.  Am running out of ideas.
> 
> Well, but atomic_dec_and_test() in fsnotify_put_mark_wake() should be a
> full memory barrier so such reordering should not be possible?

You are right, as always.  Generated code looks fine:

...
     61f:       f0 41 ff 4e 6c          lock decl 0x6c(%r14)
     624:       75 1f                   jne    645 <fsnotify_finish_user_wait+0x55>
     626:       41 80 7e 44 01          cmpb   $0x1,0x44(%r14)
     62b:       75 18                   jne    645 <fsnotify_finish_user_wait+0x55>
...

->shutdown fetch is always done after atomic-dec.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux