Return-Path: Received: from mx2.suse.de ([195.135.220.15]:49212 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726857AbeJDPiW (ORCPT ); Thu, 4 Oct 2018 11:38:22 -0400 Date: Thu, 4 Oct 2018 10:46:08 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , linux-fsdevel@vger.kernel.org, nixiaoming Subject: Re: [PATCH v3 7/8] fanotify: support reporting thread id instead of process id Message-ID: <20181004084608.GB11529@quack2.suse.cz> References: <20181003212539.2384-1-amir73il@gmail.com> <20181003212539.2384-8-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181003212539.2384-8-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 04-10-18 00:25:38, Amir Goldstein wrote: > In order to identify which thread triggered the event in a > multi-threaded program, add the FAN_EVENT_INFO_TID flag in fanotify_init > to opt-in for reporting the event creator's thread id information. > > Signed-off-by: nixiaoming > Signed-off-by: Amir Goldstein ... > diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h > index afddd7e0d5a1..05b696b4856b 100644 > --- a/include/linux/fanotify.h > +++ b/include/linux/fanotify.h > @@ -18,7 +18,10 @@ > #define FANOTIFY_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ > FAN_CLASS_PRE_CONTENT) > > +#define FANOTIFY_EVENT_INFO_FLAGS (FAN_EVENT_INFO_TID) > + > #define FANOTIFY_INIT_FLAGS (FANOTIFY_CLASS_BITS | \ > + FANOTIFY_EVENT_INFO_FLAGS | \ > FAN_CLOEXEC | FAN_NONBLOCK | \ > FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS) Is there reason to define FANOTIFY_EVENT_INFO_FLAGS? But I guess you prepare with this for further changes you want to do? Just that at this point it looks a bit silly and I cannot really think of a reason why we'd like to distinguish flags in FANOTIFY_EVENT_INFO_FLAGS from other flags in FANOTIFY_INIT_FLAGS... Honza -- Jan Kara SUSE Labs, CR