Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp264203rdb; Thu, 22 Feb 2024 03:03:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWDLye0LBP8wSPg26CI5GauatLDKWibKplHEuHCCjCVYjWgz/JgBI/N4yYpGgKSIJYOyoq9jd+fzD3cGnObEdV11WZWMtZkXlLK+eK0eg== X-Google-Smtp-Source: AGHT+IFp56BGat6kxlGTnkMOJ00FwemrOs4TAGwhUrxP3MdHKAb4ipYUGhGkHP/PQWQcx7wPJmwp X-Received: by 2002:a05:6a21:2d0c:b0:1a0:d2ca:d3b6 with SMTP id tw12-20020a056a212d0c00b001a0d2cad3b6mr1474216pzb.34.1708599726347; Thu, 22 Feb 2024 03:02:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708599726; cv=pass; d=google.com; s=arc-20160816; b=L5bw2WmMYzHS7RsJT+ADJ094GCWuTbFQk2wTT8xspaqvqWQVnBEkVeSvriOb1LLgXt 6xzHqjMhzN9CUYGc/HsnJwWMgC4UPVLdIRqWgPEbvTUH5tV+ufOwxP2ghh8GasNvMzFv j75PJ2R25OdjiExIOqSdz+TaOMoCOPXk7m4ZCbms47O+aMx+B0y7jno0SdoQnp7sbmn2 QXCenxGREIMJmjHBijzHCWtcg7lrZAMHNE0aH2Nz+nzNBcMGJ6D0vGCGCXLFB6rUB7bO vWuI2GPhXpWfEroQbqA1gcLP8Rwj2leYBM0FiQZgRYJPoQvMjC5FG4LzrUf1eJQnmQMT E4pw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=57n3UQkx8/XYTnaB10q60NOgFC3ggZDEpt6Gg1dxT1o=; fh=25rxrAZ5Q+HiBUTZsrWlz9cSFO2UPliGrw0+d9PjdFE=; b=I2mkKAaMhXm/ajEF2YC2P/xgp036Rtvr3PnqIuHOjUDDS3MLTb0rNPez8Io6rXkxkK RZSD6YO5XF/yXSnmrE7dHdOHThyOSMo76K6pBq9YVUMJ9MUNSSsF7D4Bzjrw3bntb1CY /aMdar9SWMZOgV/V7/Z/0a8HBITIddEM9BXB5aa3FBUDYlAKmslxfz0rPy9U0o1K1qds 9JEtN6mfh5HvLbZUy003EVhobOKS7l+yulEzXEhMnkn8Pbeq6K0ER712PWJZdfLGNgHn FHc//WjrAQGcFaFWLzd310YyZmLJbfTRS4ahn7HOTvXblbWHA/6xix0VwLygEonnUmGd b3/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TDUdQYpm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TDUdQYpm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-76375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76375-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ka29-20020a056a00939d00b006e054abc62dsi1535536pfb.142.2024.02.22.03.02.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:02:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TDUdQYpm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TDUdQYpm; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-76375-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76375-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0BA1A287DD7 for ; Thu, 22 Feb 2024 11:02:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FEB1405E6; Thu, 22 Feb 2024 11:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="TDUdQYpm"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="UHp0fn4H"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="TDUdQYpm"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="UHp0fn4H" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 88432182D2; Thu, 22 Feb 2024 11:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708599709; cv=none; b=hKNXjB9ZVuyciq6fo71YNCVPxTE1w7tYgucbeXGyPCtlGq9/ZJj/jO8j6QBchhJCyYzpXQg5nRtyf6yGmU9jlR2TRerJjieOxwNQzXt/wXe0vx6xk/DSXJNcziFwXZ06O33c0/00kqebBjpHoJwbWOvyftVxcDCk2isZ9L5C9kc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708599709; c=relaxed/simple; bh=uypqJ4fFQ77C+nUKIm+0Q6hsjDxZIHQh+EoFhOxiisU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e1WlnazthpxsqdlzI07J8FeoprafxAsekiYDhvS6L5N+XnV+d+OHY2OV84YWhcYDwa7qRT4ZaTpsgPuY9zNQOY3nN7C58Iu+ZunqlgwIJw6IfnJDXhgf8G0bwdGJTSN1xLJH4yAnJIwDlgmm0L3Sh5R4CRZPLUkbS/z6atlpRDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=TDUdQYpm; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=UHp0fn4H; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=TDUdQYpm; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=UHp0fn4H; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 620301FB9A; Thu, 22 Feb 2024 11:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708599703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=57n3UQkx8/XYTnaB10q60NOgFC3ggZDEpt6Gg1dxT1o=; b=TDUdQYpmzi2LnpQDGxgFVneXvhJPUrBy1zz7J4cI/HqcRStOy37Njl5UytajVBojefqVEc vMmWM9Vn3uy3A4chu1o0y2wI3hQ6IfUdGP97Ck6I+z8l4XxnlUg9IKBBkWD5NZe7KbaGpx P+p4LHlYh2vMZF59LhfFMxSmYlqT2XI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708599703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=57n3UQkx8/XYTnaB10q60NOgFC3ggZDEpt6Gg1dxT1o=; b=UHp0fn4Hfcs/SmbunYu7BfAuZ3N2FGlDCmXctHYuAGXnvbApAxULRsNgAmWe48PGYFs3kl L0nrxLNLlfFUuNDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708599703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=57n3UQkx8/XYTnaB10q60NOgFC3ggZDEpt6Gg1dxT1o=; b=TDUdQYpmzi2LnpQDGxgFVneXvhJPUrBy1zz7J4cI/HqcRStOy37Njl5UytajVBojefqVEc vMmWM9Vn3uy3A4chu1o0y2wI3hQ6IfUdGP97Ck6I+z8l4XxnlUg9IKBBkWD5NZe7KbaGpx P+p4LHlYh2vMZF59LhfFMxSmYlqT2XI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708599703; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=57n3UQkx8/XYTnaB10q60NOgFC3ggZDEpt6Gg1dxT1o=; b=UHp0fn4Hfcs/SmbunYu7BfAuZ3N2FGlDCmXctHYuAGXnvbApAxULRsNgAmWe48PGYFs3kl L0nrxLNLlfFUuNDw== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 5573B13419; Thu, 22 Feb 2024 11:01:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 6IXYFJcp12XxNQAAn2gu4w (envelope-from ); Thu, 22 Feb 2024 11:01:43 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E8EB4A0807; Thu, 22 Feb 2024 12:01:38 +0100 (CET) Date: Thu, 22 Feb 2024 12:01:38 +0100 From: Jan Kara To: Kent Overstreet Cc: Miklos Szeredi , Josef Bacik , linux-kernel@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org, lsf-pc@lists.linux-foundation.org, linux-btrfs@vger.kernel.org Subject: Re: [Lsf-pc] [LSF TOPIC] statx extensions for subvol/snapshot filesystems & more Message-ID: <20240222110138.ckai4sxiin3a74ku@quack3> References: <2uvhm6gweyl7iyyp2xpfryvcu2g3padagaeqcbiavjyiis6prl@yjm725bizncq> <20240221210811.GA1161565@perftesting> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -3.80 X-Spamd-Result: default: False [-3.80 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[8]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Flag: NO On Thu 22-02-24 04:42:07, Kent Overstreet wrote: > On Thu, Feb 22, 2024 at 10:14:20AM +0100, Miklos Szeredi wrote: > > On Wed, 21 Feb 2024 at 22:08, Josef Bacik wrote: > > > > > > On Wed, Feb 21, 2024 at 04:06:34PM +0100, Miklos Szeredi wrote: > > > > On Wed, 21 Feb 2024 at 01:51, Kent Overstreet wrote: > > > > > > > > > > Recently we had a pretty long discussion on statx extensions, which > > > > > eventually got a bit offtopic but nevertheless hashed out all the major > > > > > issues. > > > > > > > > > > To summarize: > > > > > - guaranteeing inode number uniqueness is becoming increasingly > > > > > infeasible, we need a bit to tell userspace "inode number is not > > > > > unique, use filehandle instead" > > > > > > > > This is a tough one. POSIX says "The st_ino and st_dev fields taken > > > > together uniquely identify the file within the system." > > > > > > > > > > Which is what btrfs has done forever, and we've gotten yelled at forever for > > > doing it. We have a compromise and a way forward, but it's not a widely held > > > view that changing st_dev to give uniqueness is an acceptable solution. It may > > > have been for overlayfs because you guys are already doing something special, > > > but it's not an option that is afforded the rest of us. > > > > Overlayfs tries hard not to use st_dev to give uniqueness and instead > > partitions the 64bit st_ino space within the same st_dev. There are > > various fallback cases, some involve switching st_dev and some using > > non-persistent st_ino. > > Yeah no, you can't crap multiple 64 bit inode number spaces into 64 > bits: pigeonhole principle. > > We need something better than "hacks". I agree we should have a better long-term plan than finding ways how to cram things into 64-bits inos. However I don't see a realistic short-term solution other than that. To explicit: Currently, tar and patch and very likely other less well-known tools are broken on bcachefs due to non-unique inode numbers. If you want ot fix them, either you find ways how bcachefs can cram things into 64-bit ino_t or you go and modify these tools (or prod maintainers or whatever) to not depend on ino_t for uniqueness. The application side of things isn't going to magically fix itself by us telling "bad luck, ino_t isn't unique anymore". > > What overlayfs does may or may not be applicable to btrfs/bcachefs, > > but that's not my point. My point is that adding a flag to statx does > > not solve anything. You can't just say that from now on btrfs > > doesn't have use unique st_ino/st_dev because we've just indicated > > that in statx and everything is fine. That will trigger the > > no-regressions rule and then it's game over. At least I would expect > > that to happen. > > > > What we can do instead is introduce a new API that is better, > > This isn't a serious proposal. I think for "unique inode identifier" we don't even have to come up with new APIs. The file handle + fsid pair is an established way to do this, fanotify successfully uses this as object identifier and Amir did quite some work for this to be usable for vast majority of filesystems (including virtual ones). The problem is with rewriting all these applications to use it. If statx flag telling whether inode numbers are unique helps with that, sure we can add it, but that seems like a trivial part of the problem. Honza -- Jan Kara SUSE Labs, CR