From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 034EB390219 for ; Sat, 4 Apr 2026 08:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775293157; cv=none; b=mmH69nNro+2+9X3xWoRsqJiek4ZvjLqZy2jP/LPS9S761vKdzTlus5MwJAyiH8qIW4rheJombTk5nTZql8zmanz6MLhbrcypDCsf+Hq+PhyAs7Q3XYyOz2BPdYNmkps8Zsm1AFXEg0gws2E3Z4P2gWZCp6XZPXeGSpYcV0Mrw8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775293157; c=relaxed/simple; bh=uDJtadNJQtVClJNGz6Fgvc0qOOD8ZBGg7n46C9beoAI=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=MjAEvHEJxbBZkIRkJ2vTo53L0/jFTxnE7gvejsLQutlvY+eYW1G1aVnFd+2OcKg3NRfGcdp5Mp6N5yR8aJBCwnn/QroCAMHaIp+YcTcup0jE/12ZkXBnWTfjZ0sEEyN+U+io4o4V6tJNti0D7YKKt3IbZNJwpOFvwMQxq6b3HHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=APBqtasz; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="APBqtasz" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-35d96be7c13so1524250a91.0 for ; Sat, 04 Apr 2026 01:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775293153; x=1775897953; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=+kz27emeQpXLA53ZgoxFIbwzHRJwb1l4CVdcohSXzQg=; b=APBqtasz4vbMdgpdGFkn84GpE9pncljnTKRYGWy7OCdn73MGUaNpbH9ICK96iyOXtP qWoPSebTch8oB9S1Lf1cGZXyuoln8KMRojTscs/tvHggnAc1658CtOLRA+BeqA4bnj1q GHVvYJlh9WMG+Y3h+drLI5mzEtjbUyEYaL0c4DaZyLwQlE8/sswI1ax3IL3uGpELKLkL onydV9tbS6vcy0lEFYyEmX7XAE8G9lK5jJYlMHVQ9WFEPzb2sgCkilQOauIjxB2+LrJ5 kgZ0dNOqE/vIlViK3nseWYVMGvwEwJSl8FgRfQUk5hlWiYLU9uAuWLuXCUocIcQ7s1PP NSHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775293153; x=1775897953; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+kz27emeQpXLA53ZgoxFIbwzHRJwb1l4CVdcohSXzQg=; b=aWFcLW1WUSWGfGTfKVFLT7VhvpAr+jS1KqdtgdZXnx16D4mnWQiUMMWRpbE4rUOPGk MDlXa40jCswrOzRsTQxt3YVcW9rLuoGe7lIWT3ku5buqCW+ar3//bMWKiA0+MwN1vdda EkatZ8+DxoM33rxEMJ6nKq5EeKUALci3D8OAxrVXEiUJvEaIBj40NbOmlThjurJicWfD MauLp7D+2igh0i0T32eoo8Tmp3haV5q1v3KN1HKmOFd7swu6xtycWMsqEJlLZCnybdwM tiF2h0PmKeeow5zjr/mWr1JYrYGeuB16+GbRZ1SAJm4kYyBI06n5dNsL9QGTa33EdtZU KRYQ== X-Forwarded-Encrypted: i=1; AJvYcCVXfeTvFTCs21Ql2xZzx1oirq3PMEBO6tB/btkRE+5kNeckg2oPc47eV+pMBhcVOeaFfaYfSb+alReGzg==@vger.kernel.org X-Gm-Message-State: AOJu0YyznE9PChluaLgx7Qdq7sg1Fn7lhaq7v8ZbXOwbaejp6XknAm2R AeF4ERhKwQK2jJ/jMtaKcD2lQfxQV7ec16S/T28r7xCn74fn05XhB1F1 X-Gm-Gg: AeBDies6w3UtgIrIkzf+b8UoeHJ3KET61i70x4RjMyYbj/Wg2vtstM9BaKqJeBqwj/N wsorzdC8TBd1f+/FXRJUtXI4BITUpNbvzzdPh9/ZxMu02cMhQal9J+xvIopakRPsAoYx3dUV+iV /z13Kx9bzjX6eD6GpYcXz9ytW/UQ4CLJPbLQ1WJMBqKAA8iEISqRvs0mFRqHH3H5gk0W/LyKBj/ KPQzarxxtWYc0l5gXBPLxLzNRwRZ17OeQdvGG+zOao9iTCyEwmYRcBj1WE2J4hlZtiuXPqha5Qq lJ9PI6QLjYqAKbxI2tv+65kQaQVrZAPVtHroCx3zM04K9Z02AzOO6nwxdZwfgLUINjP+mTrJq+1 CZoT8snIXR/yqEF+/kSnHUcd9WetW+h+3ZbLqb7U/QEkvjVnCahs1l4nk+IrafcqugWLmtmrFG3 7y2fHpOMOs4x/0hUb4RUN//LOYSOg= X-Received: by 2002:a17:90b:52cf:b0:35c:195e:112f with SMTP id 98e67ed59e1d1-35dd68b3edamr8054586a91.18.1775293152635; Sat, 04 Apr 2026 01:59:12 -0700 (PDT) Received: from [192.168.50.90] ([116.87.14.48]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c76c6491fe0sm6489143a12.11.2026.04.04.01.59.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Apr 2026 01:59:12 -0700 (PDT) Message-ID: <5bda3d00-df35-4ea1-b313-2fef6e5c5682@gmail.com> Date: Sat, 4 Apr 2026 16:59:08 +0800 Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/3] ext4: derive f_fsid from block device to avoid collisions From: Anand Jain To: Theodore Tso , Christoph Hellwig , "Darrick J. Wong" Cc: linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, Anand Jain References: <33e8eb64c304a4d42b60f608c26497bf9a2e9e19.1774092915.git.asj@kernel.org> <20260323041624.GA11453@mac.lan> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Ted, Christoph, Darrick, As I prepare v3, I'd appreciate your final thoughts on the mount option naming and its necessity for ext4. For the new option, I am considering: -o nodup_f_fsid -o unique_f_fsid Context: Currently, ext4's f_fsid is consistent across reboots but fails to be unique when dealing with cloned filesystems (sharing the same UUID). Per statfs(2) [1], the primary requirement is that the (f_fsid, ino) pair uniquely identifies a file. The man page makes no explicit guarantee regarding consistency across mount cycles or reboots. Proposal: With this fix, f_fsid becomes f(uuid, dev_t). This ensures OS-wide uniqueness and maintains consistency as long as the underlying dev_t remains stable. Dilemma: While statfs(2) [1] suggests f_fsid is "some random stuff," we know userspace (NFS, systemd) often treats it as a persistent handle. Do you prefer one of the names above, or is there a more idiomatic ext4 naming convention I should follow? Given the ambiguity in the man page, is gating this behind an -o option necessary, or should we consider making uniqueness the default behavior? [1] ---------- statfs(2) Nobody knows what f_fsid is supposed to contain (but see below). The f_fsid field Solaris, Irix, and POSIX have a system call statvfs(2) that returns a struct statvfs (defined in ) containing an unsigned long f_fsid. Linux, SunOS, HP-UX, 4.4BSD have a system call statfs() that returns a struct statfs (defined in ) containing a fsid_t f_fsid, where fsid_t is defined as struct { int val[2]; }. The same holds for FreeBSD, except that it uses the include file . The general idea is that f_fsid contains some random stuff such that the pair (f_fsid,ino) uniquely determines a file. Some operating systems use (a variation on) the device number, or the device number combined with the filesystem type. Several operating systems restrict giving out the f_fsid field to the superuser only (and zero it for unprivileged users), because this field is used in the filehandle of the filesystem when NFS-exported, and giving it out is a security concern. Under some operating systems, the fsid can be used as the second argument to the sysfs(2) system call. ---------- Thanks, Anand