* ufs filesystem cannot mount NetBSD/arm64 partition
@ 2024-01-15 22:05 Bruno Haible
2024-01-15 22:22 ` Al Viro
0 siblings, 1 reply; 8+ messages in thread
From: Bruno Haible @ 2024-01-15 22:05 UTC (permalink / raw)
To: Evgeniy Dushistov; +Cc: linux-fsdevel
To: Evgeniy Dushistov <dushistov@mail.ru>
CC: linux-fsdevel@vger.kernel.org
Subject: ufs filesystem cannot mount NetBSD/arm64 partition
The disk obtained by
$ wget http://nycdn.netbsd.org/pub/NetBSD-daily/netbsd-9/latest/evbarm-aarch64/binary/gzimg/arm64.img.gz
$ gunzip arm64.img
contains two partitions, as shown by
$ fdisk arm64.img
Device Boot Start End Sectors Size Id Type
arm64.img1 * 32768 196607 163840 80M c W95 FAT32 (LBA)
arm64.img2 196608 2366335 2169728 1G a9 NetBSD
The second partition is of type ufs, with subtype 44bsd (as all NetBSD UFS
partitions). But Linux cannot mount them.
How to reproduce:
# kpartx -av arm64.img
add map loopXXp1 ...
add map loopXXp2 ...
# mount -r -t ufs -o ufstype=44bsd /dev/mapper/loopXXp2 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mapper/loopXXp2, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
# dmesg
...
[ 285.212612] ufs: UFSD (fs/ufs/super.c, 797): ufs_fill_super:
[ 285.212619] ufs: ENTER
[ 285.212622] ufs: UFSD (fs/ufs/super.c, 812): ufs_fill_super:
[ 285.212625] ufs: flag 1
[ 285.212629] ufs: UFSD (fs/ufs/super.c, 387): ufs_parse_options:
[ 285.212632] ufs: ENTER
[ 285.212636] ufs: UFSD (fs/ufs/super.c, 852): ufs_fill_super:
[ 285.212639] ufs: ufstype=44bsd
[ 285.212739] ufs: ufs_fill_super(): fragment size 8192 is too large
[ 285.212745] ufs: UFSD (fs/ufs/super.c, 1300): ufs_fill_super:
[ 285.212749] ufs: EXIT (FAILED)
Reproduced on Ubuntu 23.10 with a vanilla linux-6.7.0.
Whereas this partition can be mounted fine on FreeBSD, NetBSD, OpenBSD.
FreeBSD 11:
# mount -r -t ufs /dev/ada1s2 /mnt
NetBSD 9.3:
# mount -r -t ffs /dev/wd1a /mnt
OpenBSD 7.4:
# mount -r -t ffs /dev/wd1j /mnt
The source code line which emits the
ufs: ufs_fill_super(): fragment size 8192 is too large
error is obviously linux/fs/ufs/super.c:1083.
Bruno
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 22:05 ufs filesystem cannot mount NetBSD/arm64 partition Bruno Haible
@ 2024-01-15 22:22 ` Al Viro
2024-01-15 22:33 ` Al Viro
0 siblings, 1 reply; 8+ messages in thread
From: Al Viro @ 2024-01-15 22:22 UTC (permalink / raw)
To: Bruno Haible; +Cc: Evgeniy Dushistov, linux-fsdevel
On Mon, Jan 15, 2024 at 11:05:51PM +0100, Bruno Haible wrote:
> Whereas this partition can be mounted fine on FreeBSD, NetBSD, OpenBSD.
> FreeBSD 11:
> # mount -r -t ufs /dev/ada1s2 /mnt
> NetBSD 9.3:
> # mount -r -t ffs /dev/wd1a /mnt
> OpenBSD 7.4:
> # mount -r -t ffs /dev/wd1j /mnt
>
> The source code line which emits the
> ufs: ufs_fill_super(): fragment size 8192 is too large
> error is obviously linux/fs/ufs/super.c:1083.
Lovely... Does it really have 8Kb fragments? That would be painful
to deal with - a plenty of places in there assume that fragment fits
into a page...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 22:22 ` Al Viro
@ 2024-01-15 22:33 ` Al Viro
2024-01-15 23:08 ` Matthew Wilcox
2024-01-15 23:28 ` Bruno Haible
0 siblings, 2 replies; 8+ messages in thread
From: Al Viro @ 2024-01-15 22:33 UTC (permalink / raw)
To: Bruno Haible; +Cc: Evgeniy Dushistov, linux-fsdevel
On Mon, Jan 15, 2024 at 10:22:20PM +0000, Al Viro wrote:
> On Mon, Jan 15, 2024 at 11:05:51PM +0100, Bruno Haible wrote:
>
> > Whereas this partition can be mounted fine on FreeBSD, NetBSD, OpenBSD.
> > FreeBSD 11:
> > # mount -r -t ufs /dev/ada1s2 /mnt
> > NetBSD 9.3:
> > # mount -r -t ffs /dev/wd1a /mnt
> > OpenBSD 7.4:
> > # mount -r -t ffs /dev/wd1j /mnt
> >
> > The source code line which emits the
> > ufs: ufs_fill_super(): fragment size 8192 is too large
> > error is obviously linux/fs/ufs/super.c:1083.
>
> Lovely... Does it really have 8Kb fragments? That would be painful
> to deal with - a plenty of places in there assume that fragment fits
> into a page...
FWIW, theoretically it might be possible to make that comparison with
PAGE_SIZE instead of 4096 and require 16K or 64K pages for the kernel
in question; that ought to work, modulo bugs in completely untested
cases ;-/
Support with 4K pages is a different story - that would take much
more surgery in fs/ufs.
Constraints:
* fragment and block sizes are powers of 2.
* block:fragment is 1, 2, 4 or 8.
Violating those is not an option for any kernel.
* fragment fits into page.
Could be worked around, but not easily.
BTW, can NetBSD/i386 mount the same image?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 22:33 ` Al Viro
@ 2024-01-15 23:08 ` Matthew Wilcox
2024-01-15 23:25 ` Al Viro
2024-01-15 23:29 ` Bruno Haible
2024-01-15 23:28 ` Bruno Haible
1 sibling, 2 replies; 8+ messages in thread
From: Matthew Wilcox @ 2024-01-15 23:08 UTC (permalink / raw)
To: Al Viro; +Cc: Bruno Haible, Evgeniy Dushistov, linux-fsdevel
On Mon, Jan 15, 2024 at 10:33:00PM +0000, Al Viro wrote:
> On Mon, Jan 15, 2024 at 10:22:20PM +0000, Al Viro wrote:
> > On Mon, Jan 15, 2024 at 11:05:51PM +0100, Bruno Haible wrote:
> >
> > > Whereas this partition can be mounted fine on FreeBSD, NetBSD, OpenBSD.
> > > FreeBSD 11:
> > > # mount -r -t ufs /dev/ada1s2 /mnt
> > > NetBSD 9.3:
> > > # mount -r -t ffs /dev/wd1a /mnt
> > > OpenBSD 7.4:
> > > # mount -r -t ffs /dev/wd1j /mnt
> > >
> > > The source code line which emits the
> > > ufs: ufs_fill_super(): fragment size 8192 is too large
> > > error is obviously linux/fs/ufs/super.c:1083.
> >
> > Lovely... Does it really have 8Kb fragments? That would be painful
> > to deal with - a plenty of places in there assume that fragment fits
> > into a page...
Wouldn't surprise me if netbsd/arm64 had decided to go with 64kB
PAGE_SIZE and 8kB fragments ...
> FWIW, theoretically it might be possible to make that comparison with
> PAGE_SIZE instead of 4096 and require 16K or 64K pages for the kernel
> in question; that ought to work, modulo bugs in completely untested
> cases ;-/
>
> Support with 4K pages is a different story - that would take much
> more surgery in fs/ufs.
Possibly not too much more. With large folios, we're most of the way
to being able to support this. If there's real interest, we can look
at supporting large folios in UFS.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 23:08 ` Matthew Wilcox
@ 2024-01-15 23:25 ` Al Viro
2024-01-15 23:29 ` Bruno Haible
1 sibling, 0 replies; 8+ messages in thread
From: Al Viro @ 2024-01-15 23:25 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Bruno Haible, Evgeniy Dushistov, linux-fsdevel
On Mon, Jan 15, 2024 at 11:08:45PM +0000, Matthew Wilcox wrote:
> Wouldn't surprise me if netbsd/arm64 had decided to go with 64kB
> PAGE_SIZE and 8kB fragments ...
>
> > FWIW, theoretically it might be possible to make that comparison with
> > PAGE_SIZE instead of 4096 and require 16K or 64K pages for the kernel
> > in question; that ought to work, modulo bugs in completely untested
> > cases ;-/
> >
> > Support with 4K pages is a different story - that would take much
> > more surgery in fs/ufs.
>
> Possibly not too much more. With large folios, we're most of the way
> to being able to support this. If there's real interest, we can look
> at supporting large folios in UFS.
Metadata handling will take some work. I've done some untangling in
prep to that (see #work.ufs), but that's not all. And fun around
tail unpacking is also not quite there.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 23:08 ` Matthew Wilcox
2024-01-15 23:25 ` Al Viro
@ 2024-01-15 23:29 ` Bruno Haible
2024-01-15 23:36 ` Al Viro
1 sibling, 1 reply; 8+ messages in thread
From: Bruno Haible @ 2024-01-15 23:29 UTC (permalink / raw)
To: Al Viro, Matthew Wilcox; +Cc: Evgeniy Dushistov, linux-fsdevel
Matthew Wilcox wrote:
> Wouldn't surprise me if netbsd/arm64 had decided to go with 64kB
> PAGE_SIZE and 8kB fragments ...
getpagesize() on NetBSD 9.3/arm64 is 4096.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 23:29 ` Bruno Haible
@ 2024-01-15 23:36 ` Al Viro
0 siblings, 0 replies; 8+ messages in thread
From: Al Viro @ 2024-01-15 23:36 UTC (permalink / raw)
To: Bruno Haible; +Cc: Matthew Wilcox, Evgeniy Dushistov, linux-fsdevel
On Tue, Jan 16, 2024 at 12:29:54AM +0100, Bruno Haible wrote:
> Matthew Wilcox wrote:
> > Wouldn't surprise me if netbsd/arm64 had decided to go with 64kB
> > PAGE_SIZE and 8kB fragments ...
>
> getpagesize() on NetBSD 9.3/arm64 is 4096.
It's not impossible to do on Linux side; the main trouble is in the
Cthulhu-awful set of helpers that needs to be untangled before we
can realistically do any kind of massage in there. What I want to
do one of those days is to do an iomap conversion and see how well
does that work. ETOOMUCHOTHERSHITE...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ufs filesystem cannot mount NetBSD/arm64 partition
2024-01-15 22:33 ` Al Viro
2024-01-15 23:08 ` Matthew Wilcox
@ 2024-01-15 23:28 ` Bruno Haible
1 sibling, 0 replies; 8+ messages in thread
From: Bruno Haible @ 2024-01-15 23:28 UTC (permalink / raw)
To: Al Viro; +Cc: Evgeniy Dushistov, linux-fsdevel
Al Viro asked:
> can NetBSD/i386 mount the same image?
Yes, it mounts fine in
- NetBSD 9.3/x86_64 (PAGESIZE=4096)
- NetBSD 8.0/i386 (PAGESIZE=4096)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-01-15 23:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15 22:05 ufs filesystem cannot mount NetBSD/arm64 partition Bruno Haible
2024-01-15 22:22 ` Al Viro
2024-01-15 22:33 ` Al Viro
2024-01-15 23:08 ` Matthew Wilcox
2024-01-15 23:25 ` Al Viro
2024-01-15 23:29 ` Bruno Haible
2024-01-15 23:36 ` Al Viro
2024-01-15 23:28 ` Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).