Skip to contentSkip to conversation

update_data_blkaddr assert during resize.f2fs in Nura initramfs

f2fs-dev Federico Amedeo Izzo via Linux-f2fs-devel 1 participant 3 messages Nov 1 – Nov 2

lore
Share & tools
lore
#0 lore raw

Hello,

I am a member of Nura (formerly postmarketOS), a Linux distribution for mobile devices. Our system optionally supports F2FS as filesystem; developers can enable it instead of the default ext4 when building an image for their device. I noticed a regression on fsck.f2fs/resize.f2fs from f2fs-tools 1.17.0 resulting in a corrupted filesystem making impossible to boot a fresh Nura F2FS installation.

Our setup to install Nura on Android devices is to create a small image containing a GPT table, a FAT32 EFI boot partition and a ext4/F2FS root partition. This image is flashed on the userdata partition using fastboot and gets resized by the initramfs during the first boot to make the rootfs use all the available space in the userdata partition.

The fsck or resize operation is corrupting the filesystem, resulting in an assert during update_data_blkaddr(). See the commands we use in the Nura initramfs and the corresponding logs at the bottom of this message.

Note: We recently introduced the -F option to run the resize non-interactively, as we run it in the initramfs during boot as described above.

I hope you can help us solve this issue and restore the F2FS functionality on new installations. I am available for making further tests or investigations.

Thank you very much,
Federico Amedeo Izzo

### Command: fsck.f2fs -p /dev/loop0p2
Info: Use default preen mode
Info: MKFS version
"Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"
Info: FSCK version
from "Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"

    to "Linux version 7.2.9 (pmos@build) (Alpine clang version 23.1.3, LLD 23.1.3) #3-postmarketos-qcom-sc7280 SMP PREEMPT Sat Oct 17 01:53:13 UTC "

Info: superblock features = 828 : extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 700160 (2735 MB)
Info: CKPT version = 39bb7788
Info: Casefold: linear_lookup [enable]
Info: checkpoint state = 145 : trimmed crc compacted_summary unmount
Info: No error was reported

### Command: resize.f2fs -F /dev/loop0p2
Info: Force to resize
Info: MKFS version
"Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"
Info: FSCK version
from "Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"

    to "Linux version 7.2.9 (pmos@build) (Alpine clang version 23.1.3, LLD 23.1.3) #3-postmarketos-qcom-sc7280 SMP PREEMPT Sat Oct 17 01:53:13 UTC "

Info: superblock features = 828 : extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 700160 (2735 MB)
Info: CKPT version = 39bb7788
Info: reszie wanted target FS sectors = 55974510 (218650 MB)
Info: flush_journal_entries() n_nats: 25, n_sits: 0
Info: Duplicate valid checkpoint to mirror position 1024 -> 512
Info: Write valid nat_bits in checkpoint
Info: write_checkpoint() cur_cp:1
Not enough space to migrate blocksTry to do defragement: Skip
[update_data_blkaddr:2527] NAT and SIT is inconsistent: ino: 3871, nid: 3871, blkaddr: 838754, segtype: 0[ASSERT] (update_data_blkaddr:2529) 0

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#1 lore raw

Hi Federico,

Quoted 19 lines · On 11/01, Federico Amedeo Izzo via Linux-f2fs-devel wrote:

Hello,

I am a member of Nura (formerly postmarketOS), a Linux distribution for mobile devices. Our system optionally supports F2FS as filesystem; developers can enable it instead of the default ext4 when building an image for their device. I noticed a regression on fsck.f2fs/resize.f2fs from f2fs-tools 1.17.0 resulting in a corrupted filesystem making impossible to boot a fresh Nura F2FS installation.

Our setup to install Nura on Android devices is to create a small image containing a GPT table, a FAT32 EFI boot partition and a ext4/F2FS root partition. This image is flashed on the userdata partition using fastboot and gets resized by the initramfs during the first boot to make the rootfs use all the available space in the userdata partition.

The fsck or resize operation is corrupting the filesystem, resulting in an assert during update_data_blkaddr(). See the commands we use in the Nura initramfs and the corresponding logs at the bottom of this message.

Quoted 5 lines

Note: We recently introduced the -F option to run the resize non-interactively, as we run it in the initramfs during boot as described above.

I hope you can help us solve this issue and restore the F2FS functionality on new installations. I am available for making further tests or investigations.

If possible, can you share the image that you're trying to resize?

Thanks,

Quoted 44 lines

Thank you very much,
Federico Amedeo Izzo

### Command: fsck.f2fs -p /dev/loop0p2
Info: Use default preen mode
Info: MKFS version
"Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"
Info: FSCK version
from "Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"

    to "Linux version 7.2.9 (pmos@build) (Alpine clang version 23.1.3, LLD 23.1.3) #3-postmarketos-qcom-sc7280 SMP PREEMPT Sat Oct 17 01:53:13 UTC "

Info: superblock features = 828 : extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 700160 (2735 MB)
Info: CKPT version = 39bb7788
Info: Casefold: linear_lookup [enable]
Info: checkpoint state = 145 : trimmed crc compacted_summary unmount
Info: No error was reported

### Command: resize.f2fs -F /dev/loop0p2
Info: Force to resize
Info: MKFS version
"Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"
Info: FSCK version
from "Linux version 7.2.11-arch1-1 (linux@archlinux) (gcc (GCC) 16.2.1 20260810, GNU ld (GNU Binutils) 2.47) #1 SMP PREEMPT_DYNAMIC Fri, 16 Oct 2026 00:28:58 +0000"

    to "Linux version 7.2.9 (pmos@build) (Alpine clang version 23.1.3, LLD 23.1.3) #3-postmarketos-qcom-sc7280 SMP PREEMPT Sat Oct 17 01:53:13 UTC "

Info: superblock features = 828 : extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 700160 (2735 MB)
Info: CKPT version = 39bb7788
Info: reszie wanted target FS sectors = 55974510 (218650 MB)
Info: flush_journal_entries() n_nats: 25, n_sits: 0
Info: Duplicate valid checkpoint to mirror position 1024 -> 512
Info: Write valid nat_bits in checkpoint
Info: write_checkpoint() cur_cp:1
Not enough space to migrate blocksTry to do defragement: Skip
[update_data_blkaddr:2527] NAT and SIT is inconsistent: ino: 3871, nid: 3871, blkaddr: 838754, segtype: 0[ASSERT] (update_data_blkaddr:2529) 0

Quoted 4 lines

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
Quoted 7 lines · Jaegeuk Kim

Hi Federico,

If possible, can you share the image that you're trying to resize?

Thanks,

Hi Jaegeuk,

Sure, you can download a zip archive from here:
https://nextcloud.postmarketos.org/s/G3AixpnQSBcMk3q

It contains two files:
* fairphone-fp5-userdata-gpt.img: The GPT image containing boot and root partitions, usually flashed to the userdata Android partition
* fairphone-fp5-rootfs-f2fs.img: just the f2fs root partition, extracted from the phone using U-Boot UMS after flashing userdata, before running the first boot resize operation.

Keep in mind that this phone (Fairphone 5) has UFS storage, so it uses 4096B sectors.

Thanks,
Federico

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel