public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* XFS attr2 mount option removal may break system boot
@ 2025-10-13 19:08 Oleksandr Natalenko
  2025-10-13 21:29 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Natalenko @ 2025-10-13 19:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-xfs, Carlos Maiolino, Darrick J. Wong, Pavel Reichl,
	Vlastimil Babka, Thorsten Leemhuis

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

Hello.

In v6.18, the attr2 XFS mount option is removed. This may silently break system boot if the attr2 option is still present in /etc/fstab for rootfs.

Consider Arch Linux that is being set up from scratch with / being formatted as XFS. The genfstab command that is used to generate /etc/fstab produces something like this by default:

/dev/sda2 on / type xfs (rw,relatime,attr2,discard,inode64,logbufs=8,logbsize=32k,noquota)

Once the system is set up and rebooted, there's no deprecation warning seen in the kernel log:

# cat /proc/cmdline
root=UUID=77b42de2-397e-47ee-a1ef-4dfd430e47e9 rootflags=discard rd.luks.options=discard quiet

# dmesg | grep -i xfs
[    2.409818] SGI XFS with ACLs, security attributes, realtime, scrub, repair, quota, no debug enabled
[    2.415341] XFS (sda2): Mounting V5 Filesystem 77b42de2-397e-47ee-a1ef-4dfd430e47e9
[    2.442546] XFS (sda2): Ending clean mount

Although as per the deprecation intention, it should be there.

Vlastimil (in Cc) suggests this is because xfs_fs_warn_deprecated() doesn't produce any warning by design if the XFS FS is set to be rootfs and gets remounted read-write during boot. This imposes two problems:

1) a user doesn't see the deprecation warning; and
2) with v6.18 kernel, the read-write remount fails because of unknown attr2 option rendering system unusable:

systemd[1]: Switching root.
systemd-remount-fs[225]: /usr/bin/mount for / exited with exit status 32.

# mount -o rw /
mount: /: fsconfig() failed: xfs: Unknown parameter 'attr2'.

Thorsten (in Cc) suggested reporting this as a user-visible regression.

From my PoV, although the deprecation is in place for 5 years already, it may not be visible enough as the warning is not emitted for rootfs. Considering the amount of systems set up with XFS on /, this may impose a mass problem for users.

Vlastimil suggested making attr2 option a complete noop instead of removing it.

Please check.

Thank you.

-- 
Oleksandr Natalenko, MSE

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: XFS attr2 mount option removal may break system boot
  2025-10-13 19:08 XFS attr2 mount option removal may break system boot Oleksandr Natalenko
@ 2025-10-13 21:29 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2025-10-13 21:29 UTC (permalink / raw)
  To: Oleksandr Natalenko
  Cc: linux-kernel, linux-xfs, Carlos Maiolino, Pavel Reichl,
	Vlastimil Babka, Thorsten Leemhuis

On Mon, Oct 13, 2025 at 09:08:38PM +0200, Oleksandr Natalenko wrote:
> Hello.
> 
> In v6.18, the attr2 XFS mount option is removed. This may silently break system boot if the attr2 option is still present in /etc/fstab for rootfs.
> 
> Consider Arch Linux that is being set up from scratch with / being
> formatted as XFS. The genfstab command that is used to generate
> /etc/fstab produces something like this by default:
> 
> /dev/sda2 on / type xfs (rw,relatime,attr2,discard,inode64,logbufs=8,logbsize=32k,noquota)

As in, /etc/fstab captures ALL the output of /proc/mounts, including the
strings that reflect filesystem state even if not explicitly provided by
whoever mounted the fs?  Is your actual fstab contents:

/dev/sda2	/	relatime,attr2,discard,inode64,logbufs=8,logbsize=32k,noquota	0	0

(aka logbufs/inode64/logbsize/sunit/swidth and the ones the vfs puts in
there on its own)

That's pretty messed up, but open-parsing stringly typed data structures
with unclear RMW semantics is always going to be a trash fire.

> Once the system is set up and rebooted, there's no deprecation warning seen in the kernel log:
> 
> # cat /proc/cmdline
> root=UUID=77b42de2-397e-47ee-a1ef-4dfd430e47e9 rootflags=discard rd.luks.options=discard quiet
> 
> # dmesg | grep -i xfs
> [    2.409818] SGI XFS with ACLs, security attributes, realtime, scrub, repair, quota, no debug enabled
> [    2.415341] XFS (sda2): Mounting V5 Filesystem 77b42de2-397e-47ee-a1ef-4dfd430e47e9
> [    2.442546] XFS (sda2): Ending clean mount
> 
> Although as per the deprecation intention, it should be there.
> 
> Vlastimil (in Cc) suggests this is because xfs_fs_warn_deprecated() doesn't produce any warning by design if the XFS FS is set to be rootfs and gets remounted read-write during boot. This imposes two problems:
> 
> 1) a user doesn't see the deprecation warning; and
> 2) with v6.18 kernel, the read-write remount fails because of unknown attr2 option rendering system unusable:

...aaand that's the second failed deprecation in the kernel in the past
month because someone missed a detail somewhere for years and nobody
noticed.

> systemd[1]: Switching root.
> systemd-remount-fs[225]: /usr/bin/mount for / exited with exit status 32.
> 
> # mount -o rw /
> mount: /: fsconfig() failed: xfs: Unknown parameter 'attr2'.
> 
> Thorsten (in Cc) suggested reporting this as a user-visible regression.
> 
> From my PoV, although the deprecation is in place for 5 years already,
> it may not be visible enough as the warning is not emitted for rootfs.
> Considering the amount of systems set up with XFS on /, this may
> impose a mass problem for users.
> 
> Vlastimil suggested making attr2 option a complete noop instead of removing it.
> 
> Please check.

Heh.  Yep, that's a bug.

--D

> Thank you.
> 
> -- 
> Oleksandr Natalenko, MSE



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-13 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 19:08 XFS attr2 mount option removal may break system boot Oleksandr Natalenko
2025-10-13 21:29 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox