Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp248361rdb; Thu, 22 Feb 2024 02:25:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVSwSxdwzsXPmuEWywuIJQetQi5TNQ3ADibE4JzVzlU7yY44iYULbKZUuHK4VpbnDmR+nhYE8Kj5GIVMP9RKmFK0r+phEMYOswuA/eEsw== X-Google-Smtp-Source: AGHT+IG/Ks4SE3X9fWRCDtP1QmXbhaj9bMWPzNSgIQPAqB6VqXJlV4ZFigg3jr3KS5qenWI3lZcy X-Received: by 2002:a05:620a:1453:b0:787:7ee8:c4bd with SMTP id i19-20020a05620a145300b007877ee8c4bdmr6526175qkl.53.1708597550655; Thu, 22 Feb 2024 02:25:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708597550; cv=pass; d=google.com; s=arc-20160816; b=A/znPg4g2U4sRKopSImkfIIQ6fz+U+W49awoH1rGkwdfMD114jnYxMhPZEjQck1Lgi li3jBrYU/06JYE/RLIwo/HdLojqRtCKFVxfsM/4dQTGv2tJ2/BqdK+DN0ybOFQ35HhP4 Hynxx/YBfPNJG57tQoGtCe3OVbOOT0Vz2GzmkgnmMnuw2u5/R1jjf73+hFnkZhbhp5T3 pgyfMIcqYdGBP+zh/Fadz5LY78q/i1ySRaB1AZgwTVCvBE41dDtaS6zQQDs2syoEbcIV qKNdaugWJsdWiJNpMqqqPqWkLGc8bIlqMI/RhGSycTw6tjPvIHn1zvN+9qCNUvWaxqjW cNfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=LyfCMikxUhIuPNypfCt5bvQkByB+IHG2Wh6701iMNSM=; fh=ox77pi5gpDkx7JUw7g2qOiknUOsYwEkm7zf8hz5W3p8=; b=Mx+mDJ7ilbVkdRZlSm+15M+yPTBJca8JWJWdR09BLUGzmUYF8teNIuNbac9Sm8zBUI bjfHcsv75ycZoQUMXhhD7KJ94TkdIPpyipzSVp4Vyj1JEyQnOQ+mPMe6EZP++HVKuAdp p/e9jA1GbPvWxlOKzRaaupttoiILJ6T08G+BebfgxFmxNRXJpZX5pd5DRwqlgz9RDLAB Hz7vwKnhtNCJ6OLsomHdbPUJAAUeEyJh0+NSkXVWf+rkXgnaxdT9S68Q6HkAINtdlDSM 78omMX5upMebg9zD7Rq/4/iXtBD11WNdi21Vu1FtvCOX9CYfveSHyq0svDlII1hv2ptA sqcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=WnfM+8S3; arc=pass (i=1 spf=pass spfdomain=szeredi.hu dkim=pass dkdomain=szeredi.hu dmarc=pass fromdomain=szeredi.hu); spf=pass (google.com: domain of linux-kernel+bounces-76319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n7-20020a05620a222700b00785c9b769e9si12736469qkh.33.2024.02.22.02.25.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 02:25:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=WnfM+8S3; arc=pass (i=1 spf=pass spfdomain=szeredi.hu dkim=pass dkdomain=szeredi.hu dmarc=pass fromdomain=szeredi.hu); spf=pass (google.com: domain of linux-kernel+bounces-76319-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76319-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7B19C1C2392E for ; Thu, 22 Feb 2024 10:25:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7053E3D994; Thu, 22 Feb 2024 10:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="WnfM+8S3" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA8CF39FE1 for ; Thu, 22 Feb 2024 10:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708597527; cv=none; b=ane8wMT2KVXOeiZwhMxPfBlDSxdVzEk8dn3cPLvoJvJGzOvBYvcx0qTz/53W2pZk3egBmZqVvMtaFvqpbSzmiOACr9F4jZ0xwwbXFeCIgFxveUXcczyRoFpSjDCJ3nTn+82TaHbKcmfzsMeaebTvmBM7zbH1xktXqEHbr5VdeNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708597527; c=relaxed/simple; bh=Q13FOxl27CAz/cOTAlE9oo3H7aFDqQ5nK/tKyITOrFs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=M5+SM1rTHN4xvdKamOeMhwNNp7PmlcEv2GjjgGUbUTC3a52QO92Co6p3tHmx/fRotXIa+HxSN83cT+cKaMuABz/Udkfm8eIG3PSIociF47NHOSOVawzegd24yAWr0WAXZMRrTxBZzP5hn9SBVEb2zdd7t+ZB2+YEvX1rIBUd3V4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu; spf=pass smtp.mailfrom=szeredi.hu; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b=WnfM+8S3; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=szeredi.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=szeredi.hu Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a3e891b5e4eso503377366b.0 for ; Thu, 22 Feb 2024 02:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1708597524; x=1709202324; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LyfCMikxUhIuPNypfCt5bvQkByB+IHG2Wh6701iMNSM=; b=WnfM+8S3I+Dr88qLq4kCqj+X036LnuGPezrubt0xQ9wK+cM6RD/dS1U1Ai60s/2fgA Lst5hinMbtZOpeJLhoLOIjsvrBoHsE49GHWOC16Okii0zw8JMqg5Sta+AJAZLqOM4BXN lduMk3X/a164Ri8zqfbY1YEQ0kpQ0+mykI8lk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708597524; x=1709202324; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LyfCMikxUhIuPNypfCt5bvQkByB+IHG2Wh6701iMNSM=; b=Nxzyk/jD1VJv7EDDkJ1GgNK2m9kRKg3FGpLvJuhCCVdtYQnkNcjJRS1+5dQP/B1wYg 7f8NdRzP8xLKA21D27xOL8FKyZ1nNAR7jJ5DIGd5LFFxUfaKuLvHXDSSDGSTcdJE3Nfn M3ETs+lUIOf/hXA+xrcMsjvs/KnbQi6/J/kFfC5a45qjA+VGXgRFNIPYPt1u+r6+mXIW ijqOLaHsviRKLG1OZprxTHJZdPcZafvyw2e+b7R39/hQK2WkpVNLHJfTyUaEceaPrGFs QzfT+uLP8UVuMsCtTT1YaVrsYCXRhKNEm1LPKWdKGG/h1xnWVrcawinmGnNqVXrGwqfe oToA== X-Forwarded-Encrypted: i=1; AJvYcCXr15pGRTwwPoV6bHAOlq6bcJzk9p22wgqcEkLh7r9+wjR0G9R+j01qRIzlkPNUER+LHjBaTaVRXwnxVodbFS/LixKodcpJjAwRhbGU X-Gm-Message-State: AOJu0YxfMQI8xBFU8GXGcsLKUgFIzIcFTii3ibgcq2usl4sUAz9tiqjC 6o3Z8yfJ1D5t0oizweZ/xXBZX8oNDZFExoyv2X507yJyVAKjc+s5qMS28IsQtGWwLJyzxJxGIvJ Iev19xUPnnGJoh+FVHgIfTDRKSPG+wozDfwFFCA== X-Received: by 2002:a17:906:cc83:b0:a3f:52dc:6a21 with SMTP id oq3-20020a170906cc8300b00a3f52dc6a21mr2403270ejb.14.1708597524017; Thu, 22 Feb 2024 02:25:24 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <2uvhm6gweyl7iyyp2xpfryvcu2g3padagaeqcbiavjyiis6prl@yjm725bizncq> <20240221210811.GA1161565@perftesting> In-Reply-To: From: Miklos Szeredi Date: Thu, 22 Feb 2024 11:25:12 +0100 Message-ID: Subject: Re: [LSF TOPIC] statx extensions for subvol/snapshot filesystems & more To: Kent Overstreet Cc: Josef Bacik , linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, lsf-pc@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" On Thu, 22 Feb 2024 at 10:42, Kent Overstreet wrote: > Yeah no, you can't crap multiple 64 bit inode number spaces into 64 > bits: pigeonhole principle. Obviously not. And I have no idea about the inode number allocation strategy of bcachefs and how many bits would be needed for subvolumes, etc.. I was just telling what overlayfs does and why. It's a pragmatic solution that works. I'd very much like to move to better interfaces, but creating good interfaces is never easy. > We need something better than "hacks". That's the end goal, obviously. But we also need to take care of legacy. Always have. > This isn't a serious proposal. If not, then what is? BTW to expand on the st_dev_v2 idea, it can be done by adding a STATX_DEV_V2 query mask. That way userspace can ask for the uniform stx_dev if it wants, knowing full well that stx_ino will be non-unique within that filesystem. Then kernel is free to return with or without STATX_DEV_V2, which is basically what you proposed. Except it's now negotiated and not forced upon legacy interfaces. The other issue is adding subvolume ID. You seem to think that it's okay to add that to statx and let userspace use (st_ino, st_subvoid) to identify the inode. I'm saying this is wrong, because it doesn't work in the general case. It doesn't work for overlayfs, for example, and we definitely want to avoid having userspace do filesystem specific things *if it isn't absolutely necessary*. So for example "tar" should not care about subvolumes as long as it's not been explicitly told to care. And that means for hard link detection if should using the file handle + st_dev_v2 instead of st_ino + st_subvolid + st_dev_v2. So if that field is added to statx it must come with a stern warning about this type of usage. Thanks, Miklos