Skip to content

Allow FreeBSD mount NetBSD's FFSv2 WAPBL read-only#2279

Open
ricardobranco777 wants to merge 1 commit into
freebsd:mainfrom
ricardobranco777:netbsd
Open

Allow FreeBSD mount NetBSD's FFSv2 WAPBL read-only#2279
ricardobranco777 wants to merge 1 commit into
freebsd:mainfrom
ricardobranco777:netbsd

Conversation

@ricardobranco777

@ricardobranco777 ricardobranco777 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
ufs: Allow read-only mounting of NetBSD FFSv2 WAPBL filesystems

Skip UFS2 fs_metaspace upper-bound validation that rejects NetBSD FFSv2
WAPBL filesystems due to differing superblock layouts.

Detect the condition during mount instead and permit read-only mounts
while rejecting read-write mounts with EROFS.  This follows NetBSD's
recommendation for systems without WAPBL support and avoids modifying
unsupported journal metadata.

Fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296022

@asomers

asomers commented Jun 12, 2026

Copy link
Copy Markdown
Member

This patch may be sufficient to mount, but what guarantees are there that it will work correctly? That all types of metadata will be readable, and that performing writes on FreeBSD won't render the volume corrupt from NetBSD's perspective? It will take a very detailed understanding of both operating systems' on-disk formats to answer those questions.
cc @realchonk @mckusick .

@ricardobranco777

ricardobranco777 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

This patch may be sufficient to mount, but what guarantees are there that it will work correctly? That all types of metadata will be readable, and that performing writes on FreeBSD won't render the volume corrupt from NetBSD's perspective? It will take a very detailed understanding of both operating systems' on-disk formats to answer those questions. cc @realchonk @mckusick .

fs_unrefs is used only once in sys/ufs/ufs/ufs_gjournal.c. Ditto for fs_providersize in sys/geom/label/g_label_ufs.c. These code paths are touched only if the user runs gjournal label on the device.

fs_metaspace seems safe for read-only mounts but I'm not so sure for read-write.

I'd be honoured to have a review by Marshall Kirk McKusick. :)

Skip UFS2 fs_metaspace upper-bound validation that rejects NetBSD FFSv2
WAPBL filesystems due to differing superblock layouts.

Detect the condition during mount instead and permit read-only mounts
while rejecting read-write mounts with EROFS.  This follows NetBSD's
recommendation for systems without WAPBL support and avoids modifying
unsupported journal metadata.

PR:	296022
Signed-off-by: Ricardo Branco <rbranco@suse.de>
@ricardobranco777 ricardobranco777 changed the title Make FreeBSD mount NetBSD FFSv2 with WAPBL Allow FreeBSD mount NetBSD's FFSv2 WAPBL read-only Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants