Re: [PATCH (backport)] fanotify: fix handling of events on child sub-directory

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

 



On Wed, Nov 28, 2018 at 1:03 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Nov 28, 2018 at 12:02:07PM +0100, Greg KH wrote:
> > On Tue, Nov 27, 2018 at 05:23:54PM +0100, Jan Kara wrote:
> > > On Tue 27-11-18 16:25:41, Amir Goldstein wrote:
> > > > On Tue, Nov 27, 2018 at 1:42 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> > > > >
> > > > > On Tue, Nov 27, 2018 at 12:24 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> > > > > >
> > > > > > On Tue, Nov 27, 2018 at 11:09 AM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> > > > > > >
> > > > > > > Hi Amir,
> > > > > > >
> > > > > > > Here's a backport of this patch to 4.18 and earlier.  Tested good with
> > > > > > > ltp/fanotify09.
> > > > > >
> > > > > > AFAICS this backport is identical to my v4.19 backport and yes, it looks fine.
> > > > > > I just missed the fact that my v4.19 does apply cleanly on v4.18 or I would
> > > > > > have asked Greg to apply it.
> > > > >
> > > > > Where's your v4.19 backport?  I don't see it only any list.
> > > >
> > > > Hmm, I replied to this message with a patch, but my reply is not in the archive:
> > > > https://www.spinics.net/lists/stable-commits/msg103743.html
> > > >
> > > > So I guess my backport patch is nowhere....
> > > > I did also CC Greg and Jan, so maybe Greg can say what went wrong?
> > >
> > > Yes, and at least I have received your email.
> >
> > I have it too, it's in my queue.  So, should I take Amir's patch or this
> > one?
>
> Oh nevermind, they are the same, I've added Amir's patch now...

Two notes:
1. You can apply same patch to v4.18 (Miklos tested it).
2. Patches are not the same on the line:
Miklos:
-       else if (p_inode->i_fsnotify_mask & mask) {
+       } else if (p_inode->i_fsnotify_mask & mask & ~FS_EVENT_ON_CHILD) {
Amir:
-       else if (p_inode->i_fsnotify_mask & mask) {
+       } else if (p_inode->i_fsnotify_mask & mask & ALL_FSNOTIFY_EVENTS) {

Miklos' patch is more accurate than mine.
OTOH, my patch keeps the code more similar in master and stable.
The difference is insignificant from user perspective.
Its a very very minor optimization that my backport did not get right.

If we want to have the best of both worlds (correctness and similar to master)
you may apply this commit from upstream before my backport patch:
007d1e8395ea fsnotify: generalize handling of extra event flags

This patch removes FS_EVENT_ON_CHILD from ALL_FSNOTIFY_EVENTS.
I verified that it applies cleanly on 4.19.y and 4.18.y.

That would be my preferred option.

Thanks,
Amir.



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux