Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5136679imm; Tue, 18 Sep 2018 05:03:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaH6BanoonNePeqqZmt00aonHZ+rpCO91eLZ0uzOt8CxUunUU0PBYR9Evyn00QVW4UlgEbq X-Received: by 2002:a63:2605:: with SMTP id m5-v6mr26451609pgm.225.1537272232712; Tue, 18 Sep 2018 05:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537272232; cv=none; d=google.com; s=arc-20160816; b=Qiub8PHg6aNSDenoqa3amKZo7qDf6wM7I3zVQdfmaHNwpWZdJotHGIMjlT3KlDVnYn K+vKnf4xth/wPC06bg0xeaJMh6EM6O1eppOuuFCus0avhT0gIu7WIXd4gR+8LNsdmBCJ 6jl+CdVu3cq3jlnn5U+K9K8/Rt+P9qNpLKmnzHmbmtlnoCYrx2Tb8m5LEdYB4q6EmrW5 y01PpWRYS4XG5dNxLptdHnbBqu8FVwbrhVg79hwlXTE2Elw3fM7tUKRaQkQukQcaUuqi Fq2KJL0g3NHQvt2/NVC1Rah7c/7eXT6vvMO1yxhgSIsnTyfGbWd/o37YTdwzKclIoSYm xU2g== 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=0Cjwhv5QdZtdLtvZJDJ+BXukkojj1hvJJNUvuw7wz7U=; b=H1V6U2cumvOOWDBBZWkXDasM9aRm0GPqayDHXHj4KTL3OZRwMiN1ZXaCsHBTkD2uSC t4W5LGYUWtVhmHxul/e3QsVbThOauQW6bYPtSOloiOWr3fjvEM3bds52xhm1TiCnN3/+ ASWmXaSCjHysFDNqPsMi9/qfCWiFohacvq10iT7MnkXWgbCXF1W931uKYOtgm5UiW6Pi EVOIFOrWYCHVDtueK11NOoTgvIBom41yvNBEHDLsLg9eXs909Zmam2v2oGyIJfE3CW2v lpC5NPgiCvXAwI9cSqMR37uEYlKKkg4DycIbDy/HYIScmMeQjB+YejfycmmvBcxxSxWs U1mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QdtwIrgR; 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 s59-v6si18537482plb.341.2018.09.18.05.03.32; Tue, 18 Sep 2018 05:03:52 -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=QdtwIrgR; 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 S1729600AbeIRRfH (ORCPT + 99 others); Tue, 18 Sep 2018 13:35:07 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:35167 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727757AbeIRRfH (ORCPT ); Tue, 18 Sep 2018 13:35:07 -0400 Received: by mail-yb1-f196.google.com with SMTP id o63-v6so681755yba.2; Tue, 18 Sep 2018 05:02:50 -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=0Cjwhv5QdZtdLtvZJDJ+BXukkojj1hvJJNUvuw7wz7U=; b=QdtwIrgRcgRdGbGC9iqv18MILaGt0xKxHP0sZC3A/YUMa3ZJsboqchRqvGuCuTn1Qs ns1k5j67tF9/JR+e1v5T52svU7BdOFXc5E13h6CdgWHRRvQeAW/nE2TUr5KJGFCddIkO yWXY2zOjZE3hYdon3LaUpsoXKy+Zn/a9+xlSqnVMDe5bNRbPbxFsbqkAQJ2Nmu9UQO0t hwrVCQ99vlZzE40yWHtft6bKc9PUCvhW5veBvusDJbR/5x4AR+N8lbMrIews2LnWYV5x zhQWNu6KlCUXSxLwfFdnBX2Y2Y3loiqljTUa5+J8c7CHccLIAWsbOsLDwTV/SBQdtkEz 13OQ== 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=0Cjwhv5QdZtdLtvZJDJ+BXukkojj1hvJJNUvuw7wz7U=; b=pdU8qDj/JPVX5y1FipJ/AevgHXQhYQoHY9PAfMs8C6H1uy5kGFAZZaPpmyyBpaq/h6 anGlPlJmvWXfPDyCiAqZaJq42z1PoQX5oFVKIETKa37qk81OS3hN6tta1rhNxC3TtxdL 1h4Mwrwj0ax4mhtugySUnrl0CYnkqCArtIvi9bQ1Q2nnIlridR2YleH5ktdnQcFeASev WYjOiHWCD+7pM9C49KIsgAElmn4KRiKwTeQQFtGPTyoRqm1raEooutaiFWl31fMYEAY0 Vto7ImYoNMWvoHPjwQXrrDrSALzkj8aE2U1u248sHmYUUk7NxobZVI55tP0kLGnaCRQi 8ERA== X-Gm-Message-State: APzg51DzGPx+DWH3Zfxh586tMhTUV/1J0gb9rx5Rv/VCbM9iAME04PzU oLVvPrt2xibAbHt52cUvZ5YZscwiD5ggPnZ+vXc= X-Received: by 2002:a25:240a:: with SMTP id k10-v6mr7024293ybk.325.1537272169447; Tue, 18 Sep 2018 05:02:49 -0700 (PDT) MIME-Version: 1.0 References: <20180917141950.111841-1-nixiaoming@huawei.com> In-Reply-To: From: Amir Goldstein Date: Tue, 18 Sep 2018 15:02:38 +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 12:50 PM Nixiaoming wrote: > > On Tue, Sep 18, 2018 3:07 PM Amir Goldstein > >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. > > > Should I do this: > 1 git cherry-pick 5225fe1e19c74f4d7a4a4cc98ff6ef5872c8e620 > Git cherry-pick 0d1a226f5c18012f19ed6eabfab46f0f125ec190 > Manually handle patch conflicts > 2 Add a new flag "FAN_EVENT_INFO_TID" into fanotify_data.flags > 3 Incorporate "bool audit" into fanotify_data.flags > 4 Submit 4 patches > No there is stuff in my patches that is irrelevant. Let me prepare a clean patch for fanotify_data.flags and you can work on top of that. I'll try to post it later today. Thanks, Amir.