Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7048239pxv; Fri, 30 Jul 2021 08:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZnCA6/cKOqrAd7owr2mxa72rLKD/UnyVNjG5vjDttwcKNdZigYGFKwclpQmYsyF44j9WJ X-Received: by 2002:a17:906:4b43:: with SMTP id j3mr3224466ejv.524.1627660147824; Fri, 30 Jul 2021 08:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627660147; cv=none; d=google.com; s=arc-20160816; b=k2ImFouq6qYCNTaJ7qKWtCqFAl/FJmYn2mBnS5OwoF7WqA2n1nH4llHMderYFV/WnD RqyIk1LUwHKhwbLGjbdwV+YDpUAF9UkL6b3l3JWYXKV9SzPA4fh1r8R/WOcXXkGYd1Rr WGQLakVVdLLnudFCA4uK5AkN4/FAjUs62Kl1C08Pavf+F/5dhZVKi8FT/ALmdbCSpzNl wrIazdn9XJLjAM1ppr0egSiREU/IEfLnYeI7OkF2mLomt/vBTDsUIdw9bD6DIUBcK8/x A4dq2Jl7fi3y0kGqbaB5Rj80/wULpCQkF7qNyGG7kzlrdf8vxkMY2qgr52JOSVTI6psf DrJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Wsj/Pez/9epYa0hBXbqjfBiQqpTk+YWXSs2MW1qmBqw=; b=z2fhMBbsPbNGiqUzAP8Caj7vnejuYuq6F5+rg3MudTxdjY3tF603ZqKg9CMyj4cNzi rSrC9WuI9dz9bOKmldngqZUKVKhraak71g0WbdMBu/ITNCRoOarLCyvle/b4/n18qDI/ 8yeVPN/iymP7OvUy0JfCM44jj+jfhEbEF5eHPXrVAzpdjH/kAf/1MnL2lBQqs5OinsvY ojbqtYSTM7zpVLrPE//6OuwqPvMAcReOQDnjRujpv1emhwXjGvWYlYxU41YJQ7Mz5lE5 lz5mCG2H8RCBXQUCcwF+u0mYh1LfgzdmimavjJqe6BLH410hG2zJsFOjQwnTQBhuxz3v ncvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=Hy91ASeh; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si2122577ejg.350.2021.07.30.08.48.35; Fri, 30 Jul 2021 08:49:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=Hy91ASeh; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232032AbhG3Ps2 (ORCPT + 99 others); Fri, 30 Jul 2021 11:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbhG3PsY (ORCPT ); Fri, 30 Jul 2021 11:48:24 -0400 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23EB4C061765 for ; Fri, 30 Jul 2021 08:48:19 -0700 (PDT) Received: by mail-qk1-x731.google.com with SMTP id 184so9852941qkh.1 for ; Fri, 30 Jul 2021 08:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Wsj/Pez/9epYa0hBXbqjfBiQqpTk+YWXSs2MW1qmBqw=; b=Hy91ASehghHCgZZDIsSoxj4lJjkdmriEMvJaXHxmI5YyvnCAOjVkD/QGeQVvZ4s9C0 1Yqwcl92x4TH5WtPcb3GOZzF5qo7yfTBUk6tcXMCkfp6K0T5R6w3sY1I+VDN+2t4Owwp L3VeF/W13n0e1CKMjDNv8Mvy+eQwklJ3tPivXIbEHhoH60MLKmTyFaEfOvT0H7b2nm0R UqjAEU0ObrF7PoMmEcjQswMjEW5cIrgl/MKCibakwHsyHC2VvifJOtIV7mFJy2tigvAf rzgPCXA1G5AbhRPtV4UPCUZ4pERZInzHOhT1/H1330736WuUsDeyl+ynSjTKLf0ppduA KFbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Wsj/Pez/9epYa0hBXbqjfBiQqpTk+YWXSs2MW1qmBqw=; b=aXONhqYsIu870J8g1jUEIJVgASjQmqpVpT65Cu8XN/35iic83wXnWksS444OCbZXOi 1SFCR8braVQ0bo+pHkohoztBeFoj+gh4ovYDRoMG4/tj2MHnjbtRIY/Ts6P/mYZqNM2t q6xU5Qidu0pvxgFyekmJdZL2PXPAup24MCdTdhhK5ZdxcAUowAcu1tXjhBxFeIz0+C+g IG+VYqB+52rwBb59BFTrE4shlXAgsMwG9UOJRWGVIlLgT276BTfcqMfdd/xIACC4sUtb r5pWhfCW7Eq7zb39m467t1zASlhWc7zdZigqKWRkHq7Cfe0G1Y2B9wm1TDhJqj9U+jPD f6pA== X-Gm-Message-State: AOAM530VqtPBBgQvSmMZRsWLfpgxkejaqopY8sxKfbgwrN9rBUPQOx1C vqk3xer68wfwCVPsu8XRe3+1ZA== X-Received: by 2002:a37:8a44:: with SMTP id m65mr2971594qkd.72.1627660098177; Fri, 30 Jul 2021 08:48:18 -0700 (PDT) Received: from [192.168.1.45] (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id l4sm1102787qkd.77.2021.07.30.08.48.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jul 2021 08:48:17 -0700 (PDT) Subject: Re: [PATCH/RFC 00/11] expose btrfs subvols in mount table correctly To: "J. Bruce Fields" , Qu Wenruo Cc: NeilBrown , Zygo Blaxell , Neal Gompa , Wang Yugui , Christoph Hellwig , Chuck Lever , Chris Mason , David Sterba , Alexander Viro , linux-fsdevel , linux-nfs@vger.kernel.org, Btrfs BTRFS References: <162745567084.21659.16797059962461187633@noble.neil.brown.name> <162751265073.21659.11050133384025400064@noble.neil.brown.name> <20210729023751.GL10170@hungrycats.org> <162752976632.21659.9573422052804077340@noble.neil.brown.name> <20210729232017.GE10106@hungrycats.org> <162761259105.21659.4838403432058511846@noble.neil.brown.name> <341403c0-a7a7-f6c8-5ef6-2d966b1907a8@gmx.com> <162762468711.21659.161298577376336564@noble.neil.brown.name> <20210730151748.GA21825@fieldses.org> From: Josef Bacik Message-ID: Date: Fri, 30 Jul 2021 11:48:15 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210730151748.GA21825@fieldses.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 7/30/21 11:17 AM, J. Bruce Fields wrote: > On Fri, Jul 30, 2021 at 02:23:44PM +0800, Qu Wenruo wrote: >> OK, forgot it's an opt-in feature, then it's less an impact. >> >> But it can still sometimes be problematic. >> >> E.g. if the user want to put some git code into one subvolume, while >> export another subvolume through NFS. >> >> Then the user has to opt-in, affecting the git subvolume to lose the >> ability to determine subvolume boundary, right? > > Totally naive question: is it be possible to treat different subvolumes > differently, and give the user some choice at subvolume creation time > how this new boundary should behave? > > It seems like there are some conflicting priorities that can only be > resolved by someone who knows the intended use case. > This is the crux of the problem. We have no real interfaces or anything to deal with this sort of paradigm. We do the st_dev thing because that's the most common way that tools like find or rsync use to determine they've wandered into a "different" volume. This exists specifically because of usescases like Zygo's, where he's taking thousands of snapshots and manually excluding them from find/rsync is just not reasonable. We have no good way to give the user information about what's going on, we just have these old shitty interfaces. I asked our guys about filling up /proc/self/mountinfo with our subvolumes and they had a heart attack because we have around 2-4k subvolumes on machines, and with monitoring stuff in place we regularly read /proc/self/mountinfo to determine what's mounted and such. And then there's NFS which needs to know that it's walked into a new inode space. This is all super shitty, and mostly exists because we don't have a good way to expose to the user wtf is going on. Personally I would be ok with simply disallowing NFS to wander into subvolumes from an exported fs. If you want to export subvolumes then export them individually, otherwise if you walk into a subvolume from NFS you simply get an empty directory. This doesn't solve the mountinfo problem where a user may want to figure out which subvol they're in, but this is where I think we could address the issue with better interfaces. Or perhaps Neil's idea to have a common major number with a different minor number for every subvol. Either way this isn't as simple as shoehorning it into automount and being done with it, we need to take a step back and think about how should this actually look, taking into account we've got 12 years of having Btrfs deployed with existing usecases that expect a certain behavior. Thanks, Josef