Bug 219417 - Mount of clean filesystem fails (6.6.54 and later)
Summary: Mount of clean filesystem fails (6.6.54 and later)
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: JFS (show other bugs)
Hardware: Intel Linux
: P3 normal
Assignee: Dave Kleikamp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-22 11:43 UTC by dezifit
Modified: 2024-10-24 20:39 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
[PATCH] jfs: Fix sanity check in dbMount (876 bytes, patch)
2024-10-22 14:44 UTC, Dave Kleikamp
Details | Diff

Description dezifit 2024-10-22 11:43:22 UTC
After a kernel update from 6.6.51 to 6.6.54 some systems fail to mount clean JFS filesystems at boot (from initramfs) and drop into the emergency console.  

In this case fsck shows that the filesystem is clean and nonetheless mount fails with result:  
`mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1`

Forcing a file system check with "fsck -f" makes no difference.
Tested also with 6.6.55, 6.6.56 as well as kernels from 6.11 series.

The initramfs environment (created with dracut) seems innocent, as it is able to mount another JFS partition on the same device. For example:
* /root (JFS) on /dev/sda1 fails,
* /home (JFS) on /dev/sda2 mounts just fine.

Hardware and affected filesystems also seem innocent, as switching back to the last working kernel version (6.6.51) always is able to boot.

The same issue happens on different hardware, with legacy Bios as well as (U)EFI, but not on all systems with the used Linux distribution (Void Linux).

Because of the limited initramfs environment debugging is difficult and "dmesg" shows no addtional informations. Any idea howto trace or solve the problem would be very appreciated.
Comment 1 dave.kleikamp 2024-10-22 14:02:26 UTC
On 10/22/24 6:43AM, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=219417
> 
>              Bug ID: 219417
>             Summary: Mount of clean filesystem fails (6.6.54 and later)
>             Product: File System
>             Version: 2.5
>            Hardware: Intel
>                  OS: Linux
>              Status: NEW
>            Severity: normal
>            Priority: P3
>           Component: JFS
>            Assignee: shaggy@kernel.org
>            Reporter: dezifit@gmx.de
>          Regression: No
> 
> After a kernel update from 6.6.51 to 6.6.54 some systems fail to mount clean
> JFS filesystems at boot (from initramfs) and drop into the emergency console.

Can you try reverting commit c1ba4b8ca799 ("jfs: fix out-of-bounds in 
dbNextAG() and diAlloc()")?

It is the only change to the jfs code between 6.6.51 and 6.6.54.

Thanks,
Shaggy

> 
> In this case fsck shows that the filesystem is clean and nonetheless mount
> fails with result:
> `mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1`
> 
> Forcing a file system check with "fsck -f" makes no difference.
> Tested also with 6.6.55, 6.6.56 as well as kernels from 6.11 series.
> 
> The initramfs environment (created with dracut) seems innocent, as it is able
> to mount another JFS partition on the same device. For example:
> * /root (JFS) on /dev/sda1 fails,
> * /home (JFS) on /dev/sda2 mounts just fine.
> 
> Hardware and affected filesystems also seem innocent, as switching back to
> the
> last working kernel version (6.6.51) always is able to boot.
> 
> The same issue happens on different hardware, with legacy Bios as well as
> (U)EFI, but not on all systems with the used Linux distribution (Void Linux).
> 
> Because of the limited initramfs environment debugging is difficult and
> "dmesg"
> shows no addtional informations. Any idea howto trace or solve the problem
> would be very appreciated.
>
Comment 2 Dave Kleikamp 2024-10-22 14:44:34 UTC
Created attachment 307038 [details]
[PATCH] jfs: Fix sanity check in dbMount

Better yet, please try this patch.
Comment 3 seraph@xs4all.nl 2024-10-23 05:43:18 UTC
I'm having the same issue, jfs filesystem mounts fine with 6.6.52 but fails to mount with no discernible error in syslog or dmesg after an upgrade to 6.6.58.

I'll try the patch provided as soon as I have some spare time.
Comment 4 dezifit 2024-10-23 08:21:20 UTC
(In reply to Dave Kleikamp from comment #2)
> Created attachment 307038 [details]
> [PATCH] jfs: Fix sanity check in dbMount
> 
> Better yet, please try this patch.

Tried the patch and it fixed the problem on both tested machines.
Comment 5 seraph@xs4all.nl 2024-10-23 08:31:14 UTC
(In reply to Dave Kleikamp from comment #2)
> Created attachment 307038 [details]
> [PATCH] jfs: Fix sanity check in dbMount
> 
> Better yet, please try this patch.

Works for me as well.
Comment 6 Dave Kleikamp 2024-10-24 20:39:58 UTC
Fixed upstream by commit 67373ca8404f ("jfs: Fix sanity check in dbMount").

It should work its way into the stable trees soon.

Note You need to log in before you can comment on or make changes to this bug.