Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1674539rwp; Thu, 13 Jul 2023 14:54:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2i0gk+RBy2fzR22KulFhEx2HtFkKFCm6DDfmHZvcSiKa3rDE2CZ7gs7K19GNadDT3542y X-Received: by 2002:a17:902:d481:b0:1b8:9215:9163 with SMTP id c1-20020a170902d48100b001b892159163mr3563018plg.6.1689285274825; Thu, 13 Jul 2023 14:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689285274; cv=none; d=google.com; s=arc-20160816; b=onMQrWFinG/j/rIr6efqoton8rjsvRwtof0bcf19SEZWd1gatGnnowpnJJPdy30K9h APy/DZ6dmo4dO+E9DFP0TqVXvfA4U2zN2pfedHec0hE9QqFtfSf0ITqXemnK+6TcHgsR sA8c2AYS/5PokHylOhO8mO9vb3uPBUXphMA+uGe49nmRE0I7/jAge06uIekHZkNbTdnP /rW0X+cIbzMqRn28nMza4QQ5B0hHjvWxJEXQ3FRh75Jh+co0v+sRJ8fP/pKcdITFpR8M JpsX92mwq+UVjFBNppD7P5X3WbpQGXLpNCGGBogRpn6OnABzFsF7ibtVLv+YYKTQNI1N iujQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3Z9ExxShnMFQ+6I5uZ5HSYqKDhYmMF4V08BZ/iO202I=; fh=yn9+bGdmZSSS/WHK6BYNnZrSTJBTXxMOlkZ49FqdllQ=; b=D5O/w+lzHEtHaZNBeffQ5vARtlWSE5bC3tL+4aBo8KRDmZJz0n+URpe+6fd0Oqp5fx LWZ5MXgroODeZXxgKI6L5PQ/dLdu6MUTujyAWEj8nD5Hg5G1jzhFaLTQTisCGn2VEcNh 0ivw67lS6mdkljhdGGJwxcMiqFA1p3QbJqa2AIqmCZsVVODQe5jVDY7Xf/MHZEL9fxsF m3s4h8cqI39S6RtZnaWmptYkKcujy/vTtkKBbwO4LAlYloiYzZIVqfgTFQBFU0J/KeM3 H3wIQPFGZhCEfqF3gim/TliuDSlFKe3OE1m3rBWWQ/wn70NFG39D5BFd4bOJfGK4KFnC qJIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=h96b3lCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170903120600b001b9d5d4d75dsi6248908plh.112.2023.07.13.14.54.20; Thu, 13 Jul 2023 14:54:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=h96b3lCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbjGMVe6 (ORCPT + 99 others); Thu, 13 Jul 2023 17:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbjGMVe5 (ORCPT ); Thu, 13 Jul 2023 17:34:57 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 186322D60 for ; Thu, 13 Jul 2023 14:34:31 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso1352264f8f.0 for ; Thu, 13 Jul 2023 14:34:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; t=1689284069; x=1691876069; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3Z9ExxShnMFQ+6I5uZ5HSYqKDhYmMF4V08BZ/iO202I=; b=h96b3lCadCzWegH3hy0ZB2qQb2VZ9g0nshLIbNVzMENhuzrBxLTtfdh7mmX90L1hwe RZfzF4Aa5SynwDTuf1h66O484szaN5D9Kl6XuazI2Ihx4qpiFs3t5c/PsFAPpgQJOIGL X0GmfjEclYmAKt73DrMFCY70GggFKLYn2hzgI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689284069; x=1691876069; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Z9ExxShnMFQ+6I5uZ5HSYqKDhYmMF4V08BZ/iO202I=; b=YUoHn43RvQq378YPU8nkRPGZ8rDyDgZHk4tlYn7l2TnFlHJEzPDhlOtGC+bp15uTgz 9mRkeHFeshrqP62nFyUHeZURDUmYAZnUeg9j2ijn+8qd+cKrZL7/ljrSqHtdjrD+p/AX 3FCBIod1oOtwmNhq0OFXKA9MF2F2/0EU4CyZh9yI80rQmRQSGFs9NclTH8zuAXWXmXvN Cs4Y+Uhhrf1M3LHMijbhDtzgmdx/SBqrE3g1zTKKXHy93+GGBG70aPoR9R6Rsejn4yvL mdOda2r8YO6U2QI1KMLjMrTVH/LI35Gkk7ai0NHC6PzIM0e30+7BwcbfYVCdj7JKz+0Z W9HA== X-Gm-Message-State: ABy/qLYxTXLYPhtzwZNKRJVvPKTjXSrRcmPz1fJL2pICdLRwwZRB0xfr 1MdN1wKXg0rZnIEX5OL01r9OmTml5HTiQi7CMe8UXw== X-Received: by 2002:a05:6000:c2:b0:314:2fe5:b4cf with SMTP id q2-20020a05600000c200b003142fe5b4cfmr2116161wrx.53.1689284069583; Thu, 13 Jul 2023 14:34:29 -0700 (PDT) MIME-Version: 1.0 References: <20230710183338.58531-1-ivan@cloudflare.com> <2023071039-negate-stalemate-6987@gregkh> In-Reply-To: From: Ivan Babrou Date: Thu, 13 Jul 2023 14:34:18 -0700 Message-ID: Subject: Re: [PATCH] kernfs: attach uuid for every kernfs and report it in fsid To: Amir Goldstein Cc: Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org, kernel-team@cloudflare.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Tejun Heo , Hugh Dickins , Andrew Morton , Christoph Hellwig , Jan Kara , Zefan Li , Johannes Weiner , Christian Brauner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 11, 2023 at 10:44=E2=80=AFPM Amir Goldstein wrote: > > > I agree. I think it was a good decision. > > > I have some followup questions though. > > > > > > I guess your use case cares about the creation of cgroups? > > > as long as the only way to create a cgroup is via vfs > > > vfs_mkdir() -> ... cgroup_mkdir() > > > fsnotify_mkdir() will be called. > > > Is that a correct statement? > > > > As far as I'm aware, this is the only way. We have the cgroups mailing > > list CC'd to confirm. > > > > I checked systemd and docker as real world consumers and both use > > mkdir and are visible in fanotify with this patch applied. > > > > > Because if not, then explicit fsnotify_mkdir() calls may be needed > > > similar to tracefs/debugfs. > > > > > > I don't think that the statement holds for dieing cgroups, > > > so explicit fsnotify_rmdir() are almost certainly needed to make > > > inotify/fanotify monitoring on cgroups complete. > > > > > > I am on the fence w.r.t making the above a prerequisite to merging > > > your patch. > > > > > > One the one hand, inotify monitoring of cgroups directory was already > > > possible (I think?) with the mentioned shortcomings for a long time. > > > > > > On the other hand, we have an opportunity to add support to fanotify > > > monitoring of cgroups directory only after the missing fsnotify hooks > > > are added, making fanotify API a much more reliable option for > > > monitoring cgroups. > > > > > > So I am leaning towards requiring the missing fsnotify hooks before > > > attaching a unique fsid to cgroups/kernfs. > > > > Unless somebody responsible for cgroups says there's a different way > > to create cgroups, I think this requirement doesn't apply. > > > > I was more concerned about the reliability of FAN_DELETE for > dieing cgroups without an explicit rmdir() from userspace. I checked the code and cgroups are destroyed in cgroup_destroy_locked, which is only called from two places: * In cgroup_mkdir (only on failure) * In cgroup_rmdir See: https://elixir.bootlin.com/linux/v6.5-rc1/A/ident/cgroup_destroy_locke= d We should be covered here.