Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp983465pxb; Thu, 15 Apr 2021 10:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPcABOLwyViD/mOWJ/qYtkYKIw7DF2dtyOoAblYbg+iu+E88mMHo3LwzgvANThCEQ+YW+J X-Received: by 2002:a17:902:c111:b029:e9:97c0:d7c6 with SMTP id 17-20020a170902c111b02900e997c0d7c6mr4942515pli.31.1618509379024; Thu, 15 Apr 2021 10:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618509379; cv=none; d=google.com; s=arc-20160816; b=ugos+LJiSlOFwmB/gRbY+ZcMvPC7kLcqvH4iAnWpFtogIkFPrEy5dCcepMrirG+W9r PLnqcncz20dOnj0f7D24/k7om0Z9cZaDz8nARVysi/DISHkz3s77xRyDaS42dwwa3Edu Aj/oDLlK7eHkukToo9TIeC/rzRko9kwx6xzKVPzH+2eMOhK1vZNGu0ZETtJYstsG/KOi hyt1ptQ50wGfamqDS7RRRbJlmDR38ptE0Lx2H2GQQT9rpEiGcAFEf66u4tNK3xPpVSt+ RCZxNbaWdn9QlTFM5ZrWUVnl8t9h3jOVev+7+UZWfHpV4/PBlsqFD3bNRaEpkOz7V6c1 K5mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Bf3U0/zEXYo7WhOu97q0H+impnnmKvBjy6qn9Rg2xps=; b=GqOui9SwTIpWOAcLUY3dHmIqG8cdQ0Xm8B6qNOPMr00B3G6T3BXXBz67WMKnOKCiFP du36Enmb0Ox5e558yBWgZ2FvSSJoU2crAft8unudzNWWC/65vUdYWYvdD+UgGFFf+mmo SjiGxZPZ5Hvm153yb83JTyeVuF2xLACus1pu+dk3gAT4Cu/zhVyMbWiaa8tmsyJf8p+8 vIClADyGTnHtUycEjak/YBIEPGDANGAv9sbJ8miHCUnBCdQ4ZOqfPjo7yBHEukUhPeQz E4u+71vB8ovVlvOxTx1EawxCoN1vanevU/rSYu7XPO3c4Jm06K0PS0Bqa9xuf4pLangY YD+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a+DebjSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si3250697pfm.286.2021.04.15.10.56.06; Thu, 15 Apr 2021 10:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a+DebjSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234314AbhDORyC (ORCPT + 99 others); Thu, 15 Apr 2021 13:54:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234221AbhDORyB (ORCPT ); Thu, 15 Apr 2021 13:54:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CE22861139; Thu, 15 Apr 2021 17:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618509217; bh=uykpJSftt6neycgE9UZPf5383PYs5+NZsn9IZWyvBls=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a+DebjSlUjLnchww5EDoaY79Eih/5pj2kts+TQDF8lOdiutpciCSifK84L9QXoGuh RCrGzfgzSNpAZ+NeG3MPAjLysjOVnRJMGXPlybpG7DvUYF4HxZiT+w8dAvEnTGUaPJ Y2z8tdI/HAbu3xJLZYccCvRAUO68z4aLYKUl/YLmkNnH9m7PgY4nC1If0iPVp8YDTE Wpj8JPULx8hDrlo9gKeofoliQud3+SpsRZWTNtHVTutFntOa6vxqcbvKcEm6nbBQlS QdfX23MKqQi9ELJvJTvpkY/vQbqMyywLTBW19pURWr2FehLnGfiruE3FynmCcrGFyQ i1D9GkCI9fkcQ== Received: by mail-qk1-f169.google.com with SMTP id f19so8408061qka.8; Thu, 15 Apr 2021 10:53:37 -0700 (PDT) X-Gm-Message-State: AOAM533wzFPjdCO4bqrDrc4+1n+BERT99soGLx3wwjII9mbB950Sjbh0 /jEfvOZR7HhZMPIUK3A0q0w00gikEhWVmGE+s1I= X-Received: by 2002:a37:d202:: with SMTP id f2mr4665987qkj.273.1618509217042; Thu, 15 Apr 2021 10:53:37 -0700 (PDT) MIME-Version: 1.0 References: <1408071538-14354-1-git-send-email-mcgrof@do-not-panic.com> <20140815092950.GZ18016@ZenIV.linux.org.uk> In-Reply-To: From: Luis Chamberlain Date: Thu, 15 Apr 2021 10:53:25 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v3 0/2] vfs / btrfs: add support for ustat() To: Filipe Manana , David Sterba Cc: Al Viro , Chris Mason , Josef Bacik , Christoph Hellwig , Linux FS Devel , Btrfs BTRFS , "linux-kernel@vger.kernel.org" , Jeff Mahoney , Luis Chamberlain Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 23, 2017 at 3:31 PM Jeff Mahoney wrote: > > On 8/15/14 5:29 AM, Al Viro wrote: > > On Thu, Aug 14, 2014 at 07:58:56PM -0700, Luis R. Rodriguez wrote: > > > >> Christoph had noted that this seemed associated to the problem > >> that the btrfs uses different assignments for st_dev than s_dev, > >> but much as I'd like to see that changed based on discussions so > >> far its unclear if this is going to be possible unless strong > >> commitment is reached. > > Resurrecting a dead thread since we've been carrying this patch anyway > since then. > > > Explain, please. Whose commitment and commitment to what, exactly? > > Having different ->st_dev values for different files on the same > > fs is a bloody bad idea; why does btrfs do that at all? If nothing else, > > it breaks the usual "are those two files on the same fs?" tests... > > It's because btrfs snapshots would have inode number collisions. > Changing the inode numbers for snapshots would negate a big benefit of > btrfs snapshots: the quick creation and lightweight on-disk > representation due to metadata sharing. > > The thing is that ustat() used to work. Your commit 0ee5dc676a5f8 > (btrfs: kill magical embedded struct superblock) had a regression: > Since it replaced the superblock with a simple dev_t, it rendered the > device no longer discoverable by user_get_super. We need a list_head to > attach for searching. > > There's an argument that this is hacky. It's valid. The only other > feedback I've heard is to use a real superblock for subvolumes to do > this instead. That doesn't work either, due to things like freeze/thaw > and inode writeback. Ultimately, what we need is a single file system > with multiple namespaces. Years ago we just needed different inode > namespaces, but as people have started adopting btrfs for containers, we > need more than that. I've heard requests for per-subvolume security > contexts. I'd imagine user namespaces are on someone's wish list. A > working df can be done with ->d_automount, but the way btrfs handles > having a "canonical" subvolume location has always been a way to avoid > directory loops. I'd like to just automount subvolumes everywhere > they're referenced. One solution, for which I have no code yet, is to > have something like a superblock-light that we can hang things like a > security context, a user namespace, and an anonymous dev. Most file > systems would have just one. Btrfs would have one per subvolume. > > That's a big project with a bunch of discussion. 4 years have gone by and this patch is still being carried around for btrfs. Other than resolving this ustat() issue for btrfs are there new reasons to support this effort done to be done properly? Are there other filesystems that would benefit? I'd like to get an idea of the stakeholder here before considering taking this on or not. Luis