Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45E81C43334 for ; Mon, 20 Jun 2022 20:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343810AbiFTUei (ORCPT ); Mon, 20 Jun 2022 16:34:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245505AbiFTUei (ORCPT ); Mon, 20 Jun 2022 16:34:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 509DB19288; Mon, 20 Jun 2022 13:34:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D67A761030; Mon, 20 Jun 2022 20:34:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D76C7C341C4; Mon, 20 Jun 2022 20:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655757276; bh=AXFiRQNpSy49E3iCKEeM6ZOAc94p/GsSzEDPQKkOYuE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D93r15oTo7FEKYtvjHMVNpqI/v+7Bicd/IhSl1bvtieqrAH2vn5lcEpqNbzG+C4cf MCNO/khU75rxIKnF1j2rYL6BCpj3izcN1YDD7tiRf7ZAnqvWRE9NKIxjcy6DC67CKg pyHkp/wzUGr+81BUQ2jFWeYBxsu9kzRgzcBrQ5uA= Date: Mon, 20 Jun 2022 22:34:33 +0200 From: Greg KH To: Amir Goldstein Cc: Matthew Bobrowski , linux-fsdevel , Jan Kara , stable Subject: Re: [PATCH v2 2/2] fsnotify: consistent behavior for parent not watching children Message-ID: References: <20220511190213.831646-1-amir73il@gmail.com> <20220511190213.831646-3-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Jun 20, 2022 at 05:16:16PM +0300, Amir Goldstein wrote: > On Wed, May 11, 2022 at 10:02 PM Amir Goldstein wrote: > > > > The logic for handling events on child in groups that have a mark on > > the parent inode, but without FS_EVENT_ON_CHILD flag in the mask is > > duplicated in several places and inconsistent. > > > > Move the logic into the preparation of mark type iterator, so that the > > parent mark type will be excluded from all mark type iterations in that > > case. > > > > This results in several subtle changes of behavior, hopefully all > > desired changes of behavior, for example: > > > > - Group A has a mount mark with FS_MODIFY in mask > > - Group A has a mark with ignore mask that does not survive FS_MODIFY > > and does not watch children on directory D. > > - Group B has a mark with FS_MODIFY in mask that does watch children > > on directory D. > > - FS_MODIFY event on file D/foo should not clear the ignore mask of > > group A, but before this change it does > > > > And if group A ignore mask was set to survive FS_MODIFY: > > - FS_MODIFY event on file D/foo should be reported to group A on account > > of the mount mark, but before this change it is wrongly ignored > > > > Fixes: 2f02fd3fa13e ("fanotify: fix ignore mask logic for events on child and on dir") > > Reported-by: Jan Kara > > Link: https://lore.kernel.org/linux-fsdevel/20220314113337.j7slrb5srxukztje@quack3.lan/ > > Signed-off-by: Amir Goldstein > > --- > > Greg, > > FYI, this needs the previous commit to apply to 5.18.y: What is "this" here? What git id? > e730558adffb fsnotify: consistent behavior for parent not watching children > 14362a254179 fsnotify: introduce mark type iterator > > They won't apply to earlier versions and this is a fix for a very minor bug > that existed forever, so no need to bother. So what exactly needs to be applied in what order and to what trees? confused, greg k-h