xfs: allow ro mounts if rtdev or logdev are read-only
authorHans Holmberg <Hans.Holmberg@wdc.com>
Wed, 30 Apr 2025 08:35:34 +0000 (08:35 +0000)
committerCarlos Maiolino <cem@kernel.org>
Wed, 30 Apr 2025 18:53:52 +0000 (20:53 +0200)
commitbfecc4091e07a47696ac922783216d9e9ea46c97
tree4dc7bc78986f934c625d1361c9162fc3986c2948
parent5088aad3d32cc0b1c96cbe3e718569ffc0aca4ba
xfs: allow ro mounts if rtdev or logdev are read-only

Allow read-only mounts on rtdevs and logdevs that are marked as
read-only and make sure those mounts can't be remounted read-write.

Use the sb_open_mode helper to make sure that we don't try to open
devices with write access enabled for read-only mounts.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_super.c