Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4872772imm; Tue, 18 Sep 2018 00:07:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY3XqTT0+I4sLQxjRK1ISzGEXsDn0KE/isfeOhkh0Yp1OWg9ddDvc491cduzv3msaFvP+w0 X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr28219386pla.180.1537254452412; Tue, 18 Sep 2018 00:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537254452; cv=none; d=google.com; s=arc-20160816; b=DyLjO8U7+Xq0fx8o45ETp2lGQZWkEW7NNkzaFhzx5hVR8WYDZ8EOgIsg8cJnMlCHhK JevbI1WXyW1ibK5RF8mr9gqWiiU9BTylHoQP23BtKaYnC6V6W+gaj1EtYatOF0cR8ZWu odQVXxKXitcrnpbv6VgXaanJzX2UZgYB6drQ6NDapOfkylQWjPRD5Pjg8zqeDSMxRPme rXKY4ob8cHdgvsU3H/8Hi8Eag1njbqsnmJLDqzhMp4DErWnmfbsaYZtIM5LdiRCsr44n GJyVdcYe+3JLbJzXhEzaXevswRalVE2nARkS2f7d6wOdZgG2Qc5bM2s7OmU13/3ND14j Wm5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=U/IkB6St4PGGv0Hq4a0jCpOBNWJAKtxu+EXnbktDY28=; b=p/U2ugZ8/Y3SdrtqAlS6BYFApCd0FO2QssmFx8A3xdJDg295Ew8bnSFm5XGtUqayhr sBkUGFcoy7TA6TQLiHXenbBL7WzClBJd8rVcYQQUP5BUvbjRwGGKMb/JjYfASyrND+fY RndG5qy9MTKR/xMhkzM05/Y6hAQ0WRMjjYmYHMdIRLsfC2igcQBuIqJQCnwz9YOyynXH SgORLf4YGxhexFFqmvOkvc45/F/asY3xbYMG3J4EyMrGeVrdnWfqrNvrtJfZDTTzJ2jT gItmcTPx1QRWRdrJQtypWP73N3S9YcV4V3N1IwCMQ8wG7UV+zSoLYMsocK5ymhqKMGuf OX4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r+bO/pE0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u22-v6si19290861plk.443.2018.09.18.00.07.16; Tue, 18 Sep 2018 00:07:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="r+bO/pE0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbeIRMiZ (ORCPT + 99 others); Tue, 18 Sep 2018 08:38:25 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:46932 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbeIRMiZ (ORCPT ); Tue, 18 Sep 2018 08:38:25 -0400 Received: by mail-yb1-f196.google.com with SMTP id y20-v6so370065ybi.13; Tue, 18 Sep 2018 00:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U/IkB6St4PGGv0Hq4a0jCpOBNWJAKtxu+EXnbktDY28=; b=r+bO/pE0u/Q09rd/gvaEoxLSp6eKUn+5+wgkmePVAlmMyDm/ByI2akOehGuWwlZWg9 KEebq0sQVaXcNZuFe6rZX+81ZBCCxxwfiiK5Bcz+g3ssphPRjrg3wrn+RV03cNUMVAPl dBktG/oOP/lKjpE34S0ADfcQq9qB0KQ+sl0hRYGQ5Qt3n380k+YSoiBR4rV+uHZ391SW x3GjFOt8ajkkWOy0DFAnY4Bm8Jjn19dmL48q55UeQ09aBZZoy7V6PpB/TAK6W0S4iykS Xmk0f7wFvkJeHTflsmRDgivhveTFzQ9gbht7LrVjH26Lh2W4VOir0JFPGagrWMIFpbZw nWOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U/IkB6St4PGGv0Hq4a0jCpOBNWJAKtxu+EXnbktDY28=; b=V4Z0CR33H+FevLPho1W+0MX7HzG8JYAIr2Dx30lyIB2IUf4eUNCOFzI+W01WPYxH43 X3NxsCcoSb2bO26utXrcrpc+zGbslhUYSpT+AUVEm+0F5GUrxyamIlWm+FYvKL6khB4y Aq9F4Ubkizb6bMntK71EUlkAB0yfJmY3wgS9Z2cr7hn/ire9EQgb0OkkfmMnFgBFsLQJ VnIEgVLvAJ6vAGctXaHFBVGJyYRgXeFsydC7dnaNGq2ZRkLdik8Nqyppr3YXyMqwl6D6 hz/Ul9oC+NWnQqtSrGC5Py7ZtH6/eVGoLEQyTxCRLFcKJZ6+AjZn6f1Dg0wLdHjO9oFQ GYLQ== X-Gm-Message-State: APzg51Dzt3d8UJIcaLYBlS9ssDPBnJvtEwBb08076wXjIwk3KveUiUCI BJsppTQX6TDGfuizi2aoLxHOmbTg+W9W8MR3xCA= X-Received: by 2002:a25:af94:: with SMTP id g20-v6mr4897772ybh.320.1537254430090; Tue, 18 Sep 2018 00:07:10 -0700 (PDT) MIME-Version: 1.0 References: <20180917141950.111841-1-nixiaoming@huawei.com> In-Reply-To: From: Amir Goldstein Date: Tue, 18 Sep 2018 10:06:58 +0300 Message-ID: Subject: Re: [PATCH v2] fanotify reports the thread id of the event trigger To: nixiaoming@huawei.com Cc: Steve Grubb , Jan Kara , linux-fsdevel , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 6:01 AM Nixiaoming wrote: > > On Mon, Sep 17, 2018 11:51 PM Amir Goldstein wrote: > >On Mon, Sep 17, 2018 at 6:05 PM nixiaoming wrote: ... > >> diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h > >> index b8f4182..44c659f 100644 > >> --- a/include/linux/fsnotify_backend.h > >> +++ b/include/linux/fsnotify_backend.h > >> @@ -193,6 +193,7 @@ struct fsnotify_group { > >> unsigned int max_marks; > >> struct user_struct *user; > >> bool audit; > >> + bool should_report_tid; > > > >For brevity I would call that report_tid, but not insisting. > > > > Whether it is better to change to "unsigned int flags" > Save "group->fanotify_data.flags=flags;" in "fanotify_init" > Determine whether "group->fanotify_data.flags" contains "FAN_EVENT_INFO_TID" in "fanotify_alloc_event"; > > At the same time, if there are other flags that need to be used later, there is no need to add new members. > > By the way, whether or not "bool audit" can also be included by flags > I strongly agree. Didn't want to impose this change on you, but in fact, I already did that in my own patch set, so you can use my patches as reference: https://github.com/amir73il/linux/commit/5225fe1e19c74f4d7a4a4cc98ff6ef5872c8e620 https://github.com/amir73il/linux/commit/0d1a226f5c18012f19ed6eabfab46f0f125ec190 If you do this you need to separate your change into 2 patches. First make the fanotify_data.flags change collecting the pieces from both my patches. Then make your TID change using fanotify_data.flags. Thanks, Amir.