Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1170965rbb; Mon, 26 Feb 2024 00:28:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWSnFj9J4nM7ODbP9B1ShCKMMp996hixiG1OkvLl5ZkVJNM2XdTf9JWfQGSxcApE8VVy3nG2xkGk9qe/syJZiQKyAxEBTvsAyoxfD8NyA== X-Google-Smtp-Source: AGHT+IGl2kRg3LPJReI9n+qkiAQTFZHJWdvkG/KkWXJm8VdWPP3VFRR3D3sv5gl+XPRFsK/b5xse X-Received: by 2002:a17:902:8e8c:b0:1dc:a844:a38b with SMTP id bg12-20020a1709028e8c00b001dca844a38bmr1026266plb.67.1708936090794; Mon, 26 Feb 2024 00:28:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708936090; cv=pass; d=google.com; s=arc-20160816; b=dfA2lj1bsM5B7jvtUcy+twpw8dg/CMbUBUW2vw4RdTV+Ods2hqPAh1ADPX0T8FduUq twsTyQeJojDEvlGKZRF1Wsx81E8AtyyAoD1MPeQ49PwzT7t2B8e96gicg4bBvwK9escs Yapc9Sin3qwbKNCADiwWDCH/q+U170l+vuUSKiOnQGyuSDszHnRNmEAN8KUBioXTHbL8 nmr9pPAitmNr5IlhD+bf/6+u9rTjWYFIwaWQTlIm4BB9jCLvrsmlmQvCRynJf1TrVIed frI5STHfwcMmm8W21Uf2rwYs7GiIWkPO9glsu92ny+UZyhtzoIKe9iIR4lEpohoTJHjj R03w== 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=RG8h9HtTqCH0xD/0lp/MK6evwSHkizYp8Z0N+/dsPdM=; fh=ZyYPrBDEfGhl5riTe0+ijx1ZQj6G66dM3WhtpoF4tns=; b=O16FqASPa7C1bH8xsGq9EM35tSBpIO4/bYe6tPFzMEYGLNkNSVwHEgoRflIbynQAGC RLBK4QjRhzqbO8wwEljIPEBdj+qO9Vm3WZwesdCvgVvNvrh1u4shV9S2GP7YIfUPfYPX mmxrjPL7NYAZfEAzZm1O6pbj2WoS7O90XaO1CJ0SxAK/FvkkMk+d/djfyYpWYxS0XnCe G0ZYMi/I06gmTKevE3SAbK9N0o9X5uLZ3S8+QUoIZQUz0yq0JHXyiKoWuyDuJihPsvdb SJIZ5xOPnBjj0BXCctMy2xlYHloDkuY4xiVem9FroBdwaTE00pORxfftUkLGI7t5U7jN WrNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=d4celLX0; 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-80759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x10-20020a170902ea8a00b001dbd4cd7db8si3198438plb.627.2024.02.26.00.28.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:28:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80759-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=@szeredi.hu header.s=google header.b=d4celLX0; 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-80759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80759-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 81681284072 for ; Mon, 26 Feb 2024 08:28:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 265501CD1E; Mon, 26 Feb 2024 08:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="d4celLX0" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 AB65E1CAA8 for ; Mon, 26 Feb 2024 08:27:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936052; cv=none; b=Eovj0erRwugdRJU7Ln5Rj1HY7PYgKwCogedgUshWilOCp3AcQyUXXn/ZsyyQ8L4orXxbnXevsY7m1X4HlSq3GuplptLn7SIWPSMKKN4AbqKLECqBQNKhUSUSGtm6c0IFzTp6raMh7/U0x1Z4LygPAOZc9ms82T0dokOWqc+lm9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708936052; c=relaxed/simple; bh=OgPr33qeJxSN1ACFIn4rsbOwqQ7JzF96ye/o470bEHc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OKZ0y6wgyvv0inxU7PWjjfTNWlc15v9cPrPntLAvVKgk7B1GD4CM4zNaUMv8H4m6TKsC0u2OarKTndlgcroG5Q144ePB8N498Iyqzm31b6lv+qCw4V1H/ZJ4mJM9LLxPVakg6cMQhBvEeYiDtesas+A22/IvU9ETZlq6zmNgC+U= 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=d4celLX0; arc=none smtp.client-ip=209.85.208.44 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-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-564fc495d83so3082880a12.0 for ; Mon, 26 Feb 2024 00:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1708936049; x=1709540849; 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=RG8h9HtTqCH0xD/0lp/MK6evwSHkizYp8Z0N+/dsPdM=; b=d4celLX0P6jBSCp8LLD68JLofuxG37dTOs9Ualsu0f/cldUauXiEPTNyDg3AqjrgTZ LUopENJZyRvP+kAYz7YvF0MQZ6X8NBE44orv5UzFr1LiOHPg1wRQuGomzQaDEAMTr6ux IBenw/kkiOuoxzX8uVX8BLHtRWbVz2y5JTW3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708936049; x=1709540849; 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=RG8h9HtTqCH0xD/0lp/MK6evwSHkizYp8Z0N+/dsPdM=; b=k3Tzr6nzp0CIScOS35IX1P6gVkV6qRE1LDN0mnNonOLFHdbDYZ9PG9tpLuVfjEfpVT w0vdn5878mlTm9BJ6ZFAEmjQ47MfrcNb+Poeg0sTT2yKX5Ue26nsMKxmU19D47dXtU2Y 6TGKgIwvHVMwHFDTk9QfjJuIbcUj3kpVZmJYYSFCLjZgnZWWrpFb+34Ec/MLcdVyjF63 6Tn/FNJXzxYOrCerEEtWjje8SN2lAIg0aKg17IXUzoETPBD0p7gsUB7x72MStTo+fEAX FUwb3HDcQ+EuvXlOsZ5bt+4kceKhRD90AIxsjv2kHEo9wUHVi0HwAjjzud/sPKMMFvOe AwdA== X-Forwarded-Encrypted: i=1; AJvYcCVfTBM7D3gNUMxJAJzFUok7dgqvczqeYS8WmxrsOwpVPgj1NORS1II6rTmU1ALVfmLZdNle3w+ufWRDkqPTDPv6GlAvsFVvppasfXtZ X-Gm-Message-State: AOJu0Yy+zexomjOwvBTQJL/UWHNZ9uDZDTRiBPWS6q/lzw+7wT6wttXG 5YZwVO/Z1yoyVAjS0a6Ygjd3/ogak8KFFK4LbC4uB24qyfIRxXfkN31x79CxIWFvfvsQKO7nFDU gjNFJyHH7eILKdA2A3mQl0Gng3f0RpjHe7r4HEQ== X-Received: by 2002:a17:906:3c7:b0:a3e:720a:b961 with SMTP id c7-20020a17090603c700b00a3e720ab961mr389723eja.34.1708936049011; Mon, 26 Feb 2024 00:27:29 -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> <20240222110138.ckai4sxiin3a74ku@quack3> <20240222160823.pclx6isoyaf7l64r@quack3> In-Reply-To: <20240222160823.pclx6isoyaf7l64r@quack3> From: Miklos Szeredi Date: Mon, 26 Feb 2024 09:27:17 +0100 Message-ID: Subject: Re: [Lsf-pc] [LSF TOPIC] statx extensions for subvol/snapshot filesystems & more To: Jan Kara Cc: Kent Overstreet , 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 Content-Type: text/plain; charset="UTF-8" On Thu, 22 Feb 2024 at 17:08, Jan Kara wrote: > > If we are going to start fixing userspace, then we better make sure to > > use the right interfaces, that won't have issues in the future. > > I agree we should give this a good thought which identification of a > filesystem is the best. To find mount boundaries statx.stx_mnt_id (especially with STATX_MNT_ID_UNIQUE) is perfect. By supplying stx_mnt_id to statmount(2) it's possible to get the device number associated with that filesystem (statmount.sb_dev_*). I think it's what Josef wants btrfs to return as st_dev. And statx could return that in stx_dev_*, with an interface feature flag, same as we've done with stx_mnt_id. I.e. STATX_DEV_NOHACK would force the vfs to replace anything the filesystem put in kstat.dev with sb->s_dev. Thanks, Miklos