From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 698DAC7EE2D for ; Sun, 21 May 2023 21:14:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbjEUVOJ convert rfc822-to-8bit (ORCPT ); Sun, 21 May 2023 17:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjEUVOD (ORCPT ); Sun, 21 May 2023 17:14:03 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 368E6B4; Sun, 21 May 2023 14:14:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 224F8616B2D5; Sun, 21 May 2023 23:13:58 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rrieuuPGfCQW; Sun, 21 May 2023 23:13:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 5F4AA616B2E1; Sun, 21 May 2023 23:13:57 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id o4O3u6pDXA4P; Sun, 21 May 2023 23:13:57 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 34319616B2D5; Sun, 21 May 2023 23:13:57 +0200 (CEST) Date: Sun, 21 May 2023 23:13:56 +0200 (CEST) From: Richard Weinberger To: =?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?= 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 Message-ID: <133970354.9328381.1684703636966.JavaMail.zimbra@nod.at> In-Reply-To: <20230309165455.175131-2-mic@digikod.net> References: <20230309165455.175131-1-mic@digikod.net> <20230309165455.175131-2-mic@digikod.net> Subject: Re: [PATCH v1 1/5] hostfs: Fix ephemeral inodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: hostfs: Fix ephemeral inodes Thread-Index: tKJAlvYqiwgTPVoEW6hlXkXRgBTN3A== Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ----- 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. > 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. > 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. Thanks, //richard