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 71339C77B73 for ; Fri, 26 May 2023 16:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231604AbjEZQkh (ORCPT ); Fri, 26 May 2023 12:40:37 -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 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