Skip to contentSkip to conversation

F2fs failed on fresh installation 1st boot

f2fs-dev Chris Ruehl 2 participants 6 messages Sep 12, 2020 – Sep 17, 2020 F2FS file system

lore
Share & tools
lore
#0 lore raw

Hi,

we encounter random crash on new installed partition at first boot.
Kernel: 4.9.235
Kernel: 5.4.64 (blow)
f2fs-tools: 1.4.0

[    1.520829] mmc1: new DDR MMC card at address 0001 
[    1.526223] mmcblk1: mmc1:0001 DG4008 7.28 GiB 
[    1.531037] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB 
[    1.537244] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB 
[    1.543416] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (247:0) 
[    1.554445]  mmcblk1: p1 p2 
[    1.572323] F2FS-fs (mmcblk1p2): Mismatch valid blocks 512 vs. 508 
[    1.578552] F2FS-fs (mmcblk1p2): Failed to initialize F2FS segment manager (-117) 
[    1.586374] VFS: Cannot open root device "mmcblk1p2" or unknown-block(179,2): error -117 
[    1.594496] Please append a correct "root=" boot option; here are the available partitions:

I reboot into the installation SDCard and run the fsck.f2fs with no errors

root@ba81ba8b6125:~# fsck.f2fs /dev/mmcblk1p2
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 7520000 (3671 MB)
Info: MKFS version
  "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP Sat 
Sep 12 10:56:24 HKT 2020"
Info: FSCK version
  from "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP 
Sat Sep 12 10:56:24 HKT 2020"
    to "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP 
Sat Sep 12 10:56:24 HKT 2020"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 7520000 (3671 MB)
Info: CKPT version = 14f987b7
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..] [0x7]
[FSCK] valid_block_count matching with CP             [Ok..] [0x1c29f]
[FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x596b]
[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x596b]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x5953]
[FSCK] free segment_count matched with CP             [Ok..] [0x625]
[FSCK] next block offset is free                      [Ok..]

[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Ok..]

Done: 5.592724 secs

Regards
Chris

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

#1 lore raw

Update

Quoted 61 lines · Chris Ruehl

Hi,

we encounter random crash on new installed partition at first boot.
Kernel: 4.9.235
Kernel: 5.4.64 (blow)
f2fs-tools: 1.4.0

[    1.520829] mmc1: new DDR MMC card at address 0001

[    1.526223] mmcblk1: mmc1:0001 DG4008 7.28 GiB

[    1.531037] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB

[    1.537244] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB

[    1.543416] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (247:0) [    1.554445]  mmcblk1: p1 p2

[    1.572323] F2FS-fs (mmcblk1p2): Mismatch valid blocks 512 vs. 508

[    1.578552] F2FS-fs (mmcblk1p2): Failed to initialize F2FS segment manager (-117) [    1.586374] VFS: Cannot open root device "mmcblk1p2" or unknown-block(179,2): error -117 [    1.594496] Please append a correct "root=" boot option; here are the available partitions:

I reboot into the installation SDCard and run the fsck.f2fs with no errors

root@ba81ba8b6125:~# fsck.f2fs /dev/mmcblk1p2
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 7520000 (3671 MB)
Info: MKFS version
   "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP Sat 
Sep 12 10:56:24 HKT 2020"
Info: FSCK version
   from "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP 
Sat Sep 12 10:56:24 HKT 2020"
     to "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP 
Sat Sep 12 10:56:24 HKT 2020"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 7520000 (3671 MB)
Info: CKPT version = 14f987b7
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..] [0x7] [FSCK] valid_block_count matching with CP             [Ok..] [0x1c29f] [FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x596b] [FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x596b] [FSCK] valid_inode_count matched with CP              [Ok..] [0x5953] [FSCK] free segment_count matched with CP             [Ok..] [0x625] [FSCK] next block offset is free                      [Ok..] [FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 5.592724 secs

Quoted 8 lines

Regards
Chris

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

CONFIG_HIMEM is not set
CONFIG_PREEMPT_NONE is set.

Problem not seen when set
CONFIG_PREEMPT

If that help to point to the bug.

-Chris

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

#2 lore raw

Hi Chris,

Quoted 8 lines · Chris Ruehl

Update

Quoted 6 lines · Chris Ruehl

Hi,

we encounter random crash on new installed partition at first boot.
Kernel: 4.9.235
Kernel: 5.4.64 (blow)

You mean: on both 4.9 and 5.4, you will encounter the crash?

Quoted 15 lines
Quoted 15 lines

f2fs-tools: 1.4.0

[    1.520829] mmc1: new DDR MMC card at address 0001

[    1.526223] mmcblk1: mmc1:0001 DG4008 7.28 GiB

[    1.531037] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB

[    1.537244] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB

[    1.543416] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (247:0) [    1.554445]  mmcblk1: p1 p2

[    1.572323] F2FS-fs (mmcblk1p2): Mismatch valid blocks 512 vs. 508

Quoted 8 lines
Quoted 8 lines

[    1.578552] F2FS-fs (mmcblk1p2): Failed to initialize F2FS segment manager (-117)
[    1.586374] VFS: Cannot open root device "mmcblk1p2" or unknown-block(179,2):
error -117
[    1.594496] Please append a correct "root=" boot option; here are the available partitions:

I reboot into the installation SDCard and run the fsck.f2fs with no errors

We can see that both f2fs kernel module and fsck.f2fs will check consistency of SIT table, and I don't see any obvious difference in between them... :(

kernel-f2fs:

https://elixir.bootlin.com/linux/v5.4.64/source/fs/f2fs/segment.h#L699

f2fs-tools:

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/tree/fsck/mount.c#n2012

Could you please apply below patch to check which segment has inconsistent blocks:

fs/f2fs/segment.c +6 -2
index 13ecd2c2c361..3599da395809 100644
@@ -4380,6 +4380,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
 	unsigned int readed, start_blk = 0;
 	int err = 0;
 	block_t total_node_blocks = 0;
+	bool corrupted = false;
 
 	do {
 		readed = f2fs_ra_meta_pages(sbi, start_blk, BIO_MAX_PAGES,
@@ -4402,7 +4403,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
 
 			err = check_block_count(sbi, start, &sit);
 			if (err)
-				return err;
+				corrupted = true;
 			seg_info_from_raw_sit(se, &sit);
 			if (IS_NODESEG(se->type))
 				total_node_blocks += se->valid_blocks;
@@ -4448,7 +4449,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
 
 		err = check_block_count(sbi, start, &sit);
 		if (err)
-			break;
+			corrupted = true;
 		seg_info_from_raw_sit(se, &sit);
 		if (IS_NODESEG(se->type))
 			total_node_blocks += se->valid_blocks;
@@ -4477,6 +4478,9 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
 		err = -EFSCORRUPTED;
 	}
 
+	if (corrupted)
+		err = -EFSCORRUPTED;
+
 	return err;
 }
 
fs/f2fs/segment.h +8 -2
index 47b888ad913b..af6fd623fb01 100644
@@ -719,8 +719,14 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
 	} while (cur_pos < usable_blks_per_seg);
 
 	if (unlikely(GET_SIT_VBLOCKS(raw_sit) != valid_blocks)) {
-		f2fs_err(sbi, "Mismatch valid blocks %d vs. %d",
-			 GET_SIT_VBLOCKS(raw_sit), valid_blocks);
+		f2fs_err(sbi, "Mismatch valid blocks %d vs. %d in segno:%u",
+			segno, GET_SIT_VBLOCKS(raw_sit), valid_blocks);
+		for (cur_pos = 0; cur_pos < SIT_VBLOCK_MAP_SIZE; cur_pos += 4)
+			f2fs_info(sbi, "%u %u %u %u",
+				raw_sit->valid_map[cur_pos],
+				raw_sit->valid_map[cur_pos + 1],
+				raw_sit->valid_map[cur_pos + 2],
+				raw_sit->valid_map[cur_pos + 3]);
 		set_sbi_flag(sbi, SBI_NEED_FSCK);
 		return -EFSCORRUPTED;
 	}

Thanks,

Quoted 52 lines
Quoted 35 lines
root@ba81ba8b6125:~# fsck.f2fs /dev/mmcblk1p2
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 7520000 (3671 MB)
Info: MKFS version
    "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP Sat
Sep 12 10:56:24 HKT 2020"
Info: FSCK version
    from "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP
Sat Sep 12 10:56:24 HKT 2020"
      to "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP
Sat Sep 12 10:56:24 HKT 2020"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 7520000 (3671 MB)
Info: CKPT version = 14f987b7
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..] [0x7] [FSCK] valid_block_count matching with CP             [Ok..] [0x1c29f] [FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x596b] [FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x596b] [FSCK] valid_inode_count matched with CP              [Ok..] [0x5953] [FSCK] free segment_count matched with CP             [Ok..] [0x625] [FSCK] next block offset is free                      [Ok..] [FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 5.592724 secs

Quoted 8 lines

Regards
Chris

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

CONFIG_HIMEM is not set
CONFIG_PREEMPT_NONE is set.

Problem not seen when set
CONFIG_PREEMPT

If that help to point to the bug.

Quoted 8 lines

-Chris

_______________________________________________
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

#3 lore raw

Hi Chao,

Quoted 120 lines · Chao Yu

Hi Chris,

Quoted 8 lines · Chris Ruehl

Update

Quoted 6 lines · Chris Ruehl

Hi,

we encounter random crash on new installed partition at first boot.
Kernel: 4.9.235
Kernel: 5.4.64 (blow)

You mean: on both 4.9 and 5.4, you will encounter the crash?

Quoted 15 lines
Quoted 15 lines

f2fs-tools: 1.4.0

[    1.520829] mmc1: new DDR MMC card at address 0001

[    1.526223] mmcblk1: mmc1:0001 DG4008 7.28 GiB

[    1.531037] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB

[    1.537244] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB

[    1.543416] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (247:0) [    1.554445]  mmcblk1: p1 p2

[    1.572323] F2FS-fs (mmcblk1p2): Mismatch valid blocks 512 vs. 508

Quoted 8 lines
Quoted 8 lines

[    1.578552] F2FS-fs (mmcblk1p2): Failed to initialize F2FS segment manager (-117)
[    1.586374] VFS: Cannot open root device "mmcblk1p2" or unknown-block(179,2):
error -117
[    1.594496] Please append a correct "root=" boot option; here are the available partitions:

I reboot into the installation SDCard and run the fsck.f2fs with no errors

We can see that both f2fs kernel module and fsck.f2fs will check consistency of SIT table, and I don't see any obvious difference in between them... :(

kernel-f2fs:

https://elixir.bootlin.com/linux/v5.4.64/source/fs/f2fs/segment.h#L699

f2fs-tools:

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/tree/fsck/mount.c#n2012

Could you please apply below patch to check which segment has inconsistent blocks:

fs/f2fs/segment.c +1 -0
index 13ecd2c2c361..3599da395809 100644
@@ -4380,6 +4380,7 @@ static int build_sit_entries(struct f2fs_sb_info 
 *sbi)
      unsigned int readed, start_blk = 0;
      int err = 0;
      block_t total_node_blocks = 0;
+    bool corrupted = false;
 
      do {

         readed = f2fs_ra_meta_pages(sbi, start_blk, BIO_MAX_PAGES,

fs/f2fs/segment.c +1 -1
@@ -4402,7 +4403,7 @@ static int build_sit_entries(struct f2fs_sb_info 
 *sbi)
 
              err = check_block_count(sbi, start, &sit);
              if (err)
-                return err;
+                corrupted = true;
              seg_info_from_raw_sit(se, &sit);
              if (IS_NODESEG(se->type))

                 total_node_blocks += se->valid_blocks;

fs/f2fs/segment.c +1 -1
@@ -4448,7 +4449,7 @@ static int build_sit_entries(struct f2fs_sb_info 
 *sbi)
 
          err = check_block_count(sbi, start, &sit);
          if (err)
-            break;
+            corrupted = true;
          seg_info_from_raw_sit(se, &sit);
          if (IS_NODESEG(se->type))

             total_node_blocks += se->valid_blocks;

fs/f2fs/segment.c +3 -0
@@ -4477,6 +4478,9 @@ static int build_sit_entries(struct f2fs_sb_info 
 *sbi)
          err = -EFSCORRUPTED;
      }
 
+    if (corrupted)
+        err = -EFSCORRUPTED;
+
      return err;
  }
fs/f2fs/segment.h +8 -2
index 47b888ad913b..af6fd623fb01 100644
@@ -719,8 +719,14 @@ static inline int check_block_count(struct 
 f2fs_sb_info *sbi,
      } while (cur_pos < usable_blks_per_seg);
 
      if (unlikely(GET_SIT_VBLOCKS(raw_sit) != valid_blocks)) {
-        f2fs_err(sbi, "Mismatch valid blocks %d vs. %d",
-             GET_SIT_VBLOCKS(raw_sit), valid_blocks);
+        f2fs_err(sbi, "Mismatch valid blocks %d vs. %d in segno:%u",
+            segno, GET_SIT_VBLOCKS(raw_sit), valid_blocks);
+        for (cur_pos = 0; cur_pos < SIT_VBLOCK_MAP_SIZE; cur_pos += 4)
+            f2fs_info(sbi, "%u %u %u %u",
+                raw_sit->valid_map[cur_pos],
+                raw_sit->valid_map[cur_pos + 1],
+                raw_sit->valid_map[cur_pos + 2],
+                raw_sit->valid_map[cur_pos + 3]);
          set_sbi_flag(sbi, SBI_NEED_FSCK);
          return -EFSCORRUPTED;

     }

Quoted 62 lines

Thanks,

Quoted 60 lines
Quoted 35 lines
root@ba81ba8b6125:~# fsck.f2fs /dev/mmcblk1p2
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 7520000 (3671 MB)
Info: MKFS version
    "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP Sat
Sep 12 10:56:24 HKT 2020"
Info: FSCK version
    from "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP
Sat Sep 12 10:56:24 HKT 2020"
      to "Linux version 5.4.64 (xxx) (gcc version 8.3.0 (Debian 8.3.0-2)) #74 SMP
Sat Sep 12 10:56:24 HKT 2020"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 7520000 (3671 MB)
Info: CKPT version = 14f987b7
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..] [0x7] [FSCK] valid_block_count matching with CP             [Ok..] [0x1c29f] [FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x596b] [FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x596b] [FSCK] valid_inode_count matched with CP              [Ok..] [0x5953] [FSCK] free segment_count matched with CP             [Ok..] [0x625] [FSCK] next block offset is free                      [Ok..] [FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 5.592724 secs

Quoted 8 lines

Regards
Chris

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

CONFIG_HIMEM is not set
CONFIG_PREEMPT_NONE is set.../uboot.d/u-boot.imx-6dl2g

Problem not seen when set
CONFIG_PREEMPT

If that help to point to the bug.

-Chris

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

I must say sorry for the noise, I checked the Ram and CPU, we have a bad RAM which can't follow the 992Mhz and causes the problem, once limit the CPU speed to 800Mhz the problem is gone. Both 4.9 & 5.4

Please consider this bug as false-positive.

Regards
Chris

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

#4 lore raw

Hi Chris,

Quoted 3 lines · Chris Ruehl

I must say sorry for the noise, I checked the Ram and CPU, we have a bad RAM which can't follow the 992Mhz and causes the problem, once limit the CPU speed to 800Mhz the problem is gone. Both 4.9 & 5.4

Okay, out of curiosity, the frequency 992Mhz has exceed the frequency limitation of RAM?

Quoted 2 lines

Please consider this bug as false-positive.

Alright, let us know if you have any issue on f2fs use.

Thanks,

Quoted 6 lines

Regards
Chris
.

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

#5 lore raw
Quoted 9 lines · Chao Yu

Hi Chris,

Quoted 3 lines · Chris Ruehl

I must say sorry for the noise, I checked the Ram and CPU, we have a bad RAM which can't follow the 992Mhz and causes the problem, once limit the CPU speed to 800Mhz the problem is gone. Both 4.9 & 5.4

Okay, out of curiosity, the frequency 992Mhz has exceed the frequency limitation of RAM?

Its a problem with the PCB, not the RAM and the frequency. We take out the CPU for investigation and found some aging on the balls and pads. Likely to much humidity.

Quoted 7 lines
Quoted 3 lines

Please consider this bug as false-positive.

Alright, let us know if you have any issue on f2fs use.

Thanks,

we have new rollout on rk3399 with ddr4 and 8G eMMC 5.4 - 8 bit bus tests run with 4.9 4.19 and 5.4 plus rt patch, no problems here.

Quoted 7 lines
Quoted 7 lines

Regards
Chris
.

Signature · 13 lines
GTSYS Limited RFID Technology
9/F, Unit E, R07, Kwai Shing Industrial Building Phase 2,
42-46 Tai Lin Pai Road, Kwai Chung, N.T., Hong Kong
Tel (852) 9079 9521

Disclaimer: https://www.gtsys.com.hk/email/classified.html



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