Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2705714rwd; Fri, 26 May 2023 10:01:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wtGeFBdfVK/Y66tdNmxJHPZBUGRhPdUsyhgiOhpaumVzdxFB7BVjCQfTpUPVeEY72LWBU X-Received: by 2002:a05:6a00:982:b0:64d:f5a:3fd2 with SMTP id u2-20020a056a00098200b0064d0f5a3fd2mr4260883pfg.28.1685120504622; Fri, 26 May 2023 10:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120504; cv=none; d=google.com; s=arc-20160816; b=Tj3r+N5eq3IJRwXv7DFOQEKpadnp9CrnWHHqbeyfpODNg5PP0X4YxAWub2161eBgIe CT0blP7FbNP7cAPonIkjxpvjacVBRN6vbkfP4vMA1im/QllZVUL5HySlg/vpzS4Vi6h7 VFrS05tvuxabCu9bJa8EbfMqaZIoSaOhkZ8+rGU1HbFThpFNVBU4XXA86L4pGE+2RAE8 eRwNisHo5nYtK43okZaSaR1Updm89psY1gKLKFILUrZLlz9fO9TNC5xK2dnneH/tP2AX cd3AhCSqWUCalFQ+Tnc+z4cDmjr/3+5lpkgjffJFE7gF2m/sSf7o6b3m62BNIdxoXuQt gC8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ssfx/WZy2GjxYHxHv8bsjWxJDXauQ1VOyV13gqmg8Ug=; b=w36pac3CrDD8RKJrqWbLvFWspqwugXMaNGL3gdztH63iC5vXXqFRFKjdAe9gcIVOLv kT2jVxUgTPR94+ukwQtz4zd5UxjeQaTAGNULf5h0qozdDzUPfCiXHuCLvrI8bU20v4yp sUT9yDNStafC5AZtIIWWQ5YMiA1aba1KhRFPbI+NKOpSCEA2fvP390KGPHICTp0YEiC9 DHzl0AQyDaegJ7G+b4OtLSSg2NlCIAzUMh7ZZQ2JDP9HVRXARt4OaZRACWUmaDnfMo8p 7bhARSWrsV3JjZYtGeOW+naBZzzPwnuGJWoSCZtPvSKu18kO1Z7eEwutSmOQqOpaAacc SeSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=g8vn7bbw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k24-20020aa79738000000b006455d53001fsi4482126pfg.40.2023.05.26.10.01.26; Fri, 26 May 2023 10:01:44 -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=@digikod.net header.s=20191114 header.b=g8vn7bbw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbjEZQkf (ORCPT + 99 others); Fri, 26 May 2023 12:40:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjEZQkd (ORCPT ); Fri, 26 May 2023 12:40:33 -0400 Received: from smtp-190b.mail.infomaniak.ch (smtp-190b.mail.infomaniak.ch [185.125.25.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1756FBC for ; Fri, 26 May 2023 09:40:31 -0700 (PDT) Received: from smtp-3-0001.mail.infomaniak.ch (unknown [10.4.36.108]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4QSVz13cjDzMqfBn; Fri, 26 May 2023 18:40:29 +0200 (CEST) Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4QSVyz2XFlzMppDv; Fri, 26 May 2023 18:40:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1685119229; bh=qgneZctsmZu9NYVEqwCZ63IYebRwqPZkfQJshIM+ino=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=g8vn7bbw22o6LUCPBxp8u7iUChoXbXrE80j7X4tDjpPDGZ0CJMqSE7T8+XlA+teCx ImuLqBbgQ0molZYHgkbRsstgprjuS6zYERZMvEKj3KrStLFOhClSCU2A/jKXfrDii2 i+FZof4I6D1lcDjYLsiTvh8LNbXn8dOv0y65+dPw= Message-ID: <8249dd59-ce08-2253-1697-301ad082d905@digikod.net> Date: Fri, 26 May 2023 18:40:26 +0200 MIME-Version: 1.0 User-Agent: Subject: Re: [PATCH v1 1/5] hostfs: Fix ephemeral inodes Content-Language: en-US To: Richard Weinberger Cc: anton ivanov , Johannes Berg , Christopher Obbard , Guenter Roeck , =?UTF-8?Q?G=c3=bcnther_Noack?= , kuba , James Morris , Jeff Xu , Kees Cook , Paul Moore , Ritesh Raj Sarraf , "Serge E. Hallyn" , Shuah Khan , Sjoerd Simons , Willem de Bruijn , linux-fsdevel , linux-kernel , linux-kselftest , LSM , stable References: <20230309165455.175131-1-mic@digikod.net> <20230309165455.175131-2-mic@digikod.net> <133970354.9328381.1684703636966.JavaMail.zimbra@nod.at> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= In-Reply-To: <133970354.9328381.1684703636966.JavaMail.zimbra@nod.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 21/05/2023 23:13, Richard Weinberger wrote: > ----- Ursprüngliche Mail ----- >> Von: "Mickaël Salaün" >> hostfs creates a new inode for each opened or created file, which created >> useless inode allocations and forbade identifying a host file with a kernel >> inode. >> >> Fix this uncommon filesystem behavior by tying kernel inodes to host >> file's inode and device IDs. Even if the host filesystem inodes may be >> recycled, this cannot happen while a file referencing it is open, which >> is the case with hostfs. It should be noted that hostfs inode IDs may >> not be unique for the same hostfs superblock because multiple host's >> (backed) superblocks may be used. >> >> Delete inodes when dropping them to force backed host's file descriptors >> closing. >> >> This enables to entirely remove ARCH_EPHEMERAL_INODES, and then makes >> Landlock fully supported by UML. This is very useful for testing >> (ongoing and backported) changes. > > Removing ARCH_EPHEMERAL_INODES should be a patch on its own, IMHO. OK, I'll do that in the next series. > >> These changes also factor out and simplify some helpers thanks to the >> new hostfs_inode_update() and the hostfs_iget() revamp: read_name(), >> hostfs_create(), hostfs_lookup(), hostfs_mknod(), and >> hostfs_fill_sb_common(). >> >> A following commit with new Landlock tests check this new hostfs inode >> consistency. >> >> Cc: Anton Ivanov >> Cc: Johannes Berg >> Cc: Richard Weinberger >> Cc: # 5.15.x: ce72750f04d6: hostfs: Fix writeback of >> dirty pages >> Cc: # 5.15+ > > I'm not sure whether this patch qualifies as stable material. > While I fully agree that the current behavoir is odd, nothing user visible > is really broken so far. I added the ARCH_EPHEMERAL_INODES knob to avoid unexpected behavior. Thanks to that there is no regression for Landlock, but it's unfortunate that we could not use UML to test old kernel versions. According to this odd behavior, I guess some user space may not work with hostfs because of this issue, hence this Cc. I can remove it if you think it is not the case. > >> Signed-off-by: Mickaël Salaün >> Link: https://lore.kernel.org/r/20230309165455.175131-2-mic@digikod.net > > Other than that, patch looks good to me. Good, I'll send a new series with your suggestions. > > Thanks, > //richard