Bug 210795 - fsck.f2fs - 1.14.0 - error when not /dev/vgXX/lvYYY path provided - [ASSERT] (init_sb_info:1017) !strcmp((char *)sb->devs[i].path, (char *)c.devices[i].path)
Summary: fsck.f2fs - 1.14.0 - error when not /dev/vgXX/lvYYY path provided - [ASSERT] ...
Status: RESOLVED DOCUMENTED
Alias: None
Product: File System
Classification: Unclassified
Component: f2fs (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for f2fs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-20 05:28 UTC by Tomas Thiemel
Modified: 2023-09-29 14:51 UTC (History)
1 user (show)

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


Attachments

Description Tomas Thiemel 2020-12-20 05:28:58 UTC
Summary: fsck.f2fs version 1.14.0 has an error when not /dev/vgXX/lvYYY path provided: "ASSERT] (init_sb_info:1017) !strcmp((char *)sb->devs[i].path, (char *)c.devices[i].path)"


Comment: only /dev/vgftp1a/VIRTUALa goes ok, the rest from the list below (including /dev/dm-15) throws an error.


Problem: when fsck enabled in /etc/fstab (6th field is non-zero value), bootup fails due to FSCK error (OS Gentoo)


Details:

ftp1 ~ # find /dev/ -type l |while read i; do ls -als $i; done|grep dm-15
0 lrwxrwxrwx 1 root root 8 Dec 20 06:20 /dev/vgftp1a/VIRTUALa -> ../dm-15
0 lrwxrwxrwx 1 root root 11 Dec 20 06:20 /dev/disk/by-uuid/f6d10195-322c-4844-8c9d-0f9208b2928b -> ../../dm-15
0 lrwxrwxrwx 1 root root 11 Dec 20 06:20 /dev/disk/by-label/VIRTUAL -> ../../dm-15
0 lrwxrwxrwx 1 root root 11 Dec 20 06:20 /dev/disk/by-id/dm-uuid-LVM-fDvtRBj3wclGxpSKSfh63QVaqCC05s2l3ASPKi48wLYF7PamZ6fBWpRM7zA2d7HR -> ../../dm-15
0 lrwxrwxrwx 1 root root 11 Dec 20 06:20 /dev/disk/by-id/dm-name-vgftp1a-VIRTUALa -> ../../dm-15
0 lrwxrwxrwx 1 root root 8 Dec 20 06:20 /dev/block/253:15 -> ../dm-15
0 lrwxrwxrwx 1 root root 8 Dec 20 06:20 /dev/mapper/vgftp1a-VIRTUALa -> ../dm-15

ftp1 ~ # ls -als /dev/dm-15
0 brw-rw---- 1 root disk 253, 15 Dec 20 06:20 /dev/dm-15




ftp1 ~ # uname -a
Linux ftp1.wifizabreh.net 5.9.15-xeon #2 SMP Sat Dec 19 02:48:01 CET 2020 x86_64 Intel(R) Xeon(R) CPU E3-1265L V2 @ 2.50GHz GenuineIntel GNU/Linux


ftp1 ~ # eix f2fs
[I] sys-fs/f2fs-tools
     Available versions:  1.14.0(0/8) {selinux}
     Installed versions:  1.14.0(0/8)(06:03:10 AM 12/20/2020)(-selinux)
     Homepage:            https://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/about/
     Description:         Tools for Flash-Friendly File System (F2FS)


ftp1 ~ # fsck.f2fs  --dry-run /dev/disk/by-label/VIRTUAL
Info: Dry run
Info: [/dev/disk/by-label/VIRTUAL] Disk Model: SanDisk SDSSDXPS
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 209715200 (102400 MB)
Info: MKFS version
  "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: FSCK version
  from "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
    to "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: superblock features = 828 :  extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
[ASSERT] (init_sb_info:1017) !strcmp((char *)sb->devs[i].path, (char *)c.devices[i].path)


ftp1 ~ # fsck.f2fs  --dry-run /dev/dm-15
Info: Dry run
Info: [/dev/dm-15] Disk Model: SanDisk SDSSDXPS
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 209715200 (102400 MB)
Info: MKFS version
  "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: FSCK version
  from "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
    to "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: superblock features = 828 :  extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
[ASSERT] (init_sb_info:1017) !strcmp((char *)sb->devs[i].path, (char *)c.devices[i].path)



ftp1 ~ # fsck.f2fs  --dry-run /dev/vgftp1a/VIRTUALa
Info: Dry run
Info: [/dev/vgftp1a/VIRTUALa] Disk Model: SanDisk SDSSDXPS
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 209715200 (102400 MB)
Info: MKFS version
  "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: FSCK version
  from "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
    to "Linux version 5.9.15-xeon (root@ftp1.wifizabreh.net) (gcc (Gentoo 9.3.0-r2 p4) 9.3.0, GNU ld (Gentoo 2.33.1 p2) 2.33.1) #2 SMP Sat Dec 19 02:48:01 CET 2020"
Info: superblock features = 828 :  extra_attr inode_checksum sb_checksum
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: Device[0] : /dev/vgftp1a/VIRTUALa blkaddr = 0--13fffff
Info: [/dev/vgftp1b/VIRTUALb] Disk Model: SanDisk SDSSDXPS
Info: Device[1] : /dev/vgftp1b/VIRTUALb blkaddr = 1400000--27fffff
Info: total FS sectors = 335544320 (163840 MB)
Info: CKPT version = 6d2e3efb
Info: Checked valid nat_bits in checkpoint
Info: checkpoint state = 1c5 :  trimmed nat_bits crc compacted_summary unmount

[FSCK] Unreachable nat entries                        [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking                [Ok..]
[FSCK] Hard link checking for regular file            [Ok..] [0x0]
[FSCK] valid_block_count matching with CP             [Ok..] [0x1dd6635]
[FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x78a6]
[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x78a6]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x94]
[FSCK] free segment_count matched with CP             [Ok..] [0x4fac]
[FSCK] next block offset is free                      [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 27.694741 secs
Comment 1 Chao Yu 2020-12-21 01:18:21 UTC
> Info: Device[0] : /dev/vgftp1a/VIRTUALa blkaddr = 0--13fffff
> Info: [/dev/vgftp1b/VIRTUALb] Disk Model: SanDisk SDSSDXPS
> Info: Device[1] : /dev/vgftp1b/VIRTUALb blkaddr = 1400000--27fffff

You can see that in f2fs superblock, we record original paths of multipath
instead of paths symlinks point to, when you use fsck.f2fs /dev/xxx to check
multiple devices of f2fs image, fsck can only compare paths stored in superblock with parameters we passed, otherwise it will trigger ASSERT warning.

So we can only use

fsck.f2fs  --dry-run /dev/vgftp1a/VIRTUALa

to check f2fs image, rather than using

fsck.f2fs  --dry-run /dev/dm-15

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