Skip to contentSkip to conversation

fsck.f2fs: fix to skip repairing initialized i_gc_failures

PATCH In review Chao Yu 3 participants 5 messages Nov 26, 2018 – Nov 27, 2018

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 fsck.f2fs: fix to skip repairing initialized i_gc_failures

From: Chao Yu <[email protected]>

As Michael reported:

after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line:

Quoted 1 line

[FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00

In old kernel, we initialized i_gc_failures as 0x01, let's skip resetting such unchanged initialized value to avoid unnecessary repairing.

---
 fsck/fsck.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fsck/fsck.c +3 -1
index 970d150..db0e72f 100644
@@ -941,7 +941,9 @@ skip_blkcnt_fix:
 	}
 
 	i_gc_failures = le16_to_cpu(node_blk->i.i_gc_failures);
-	if (ftype == F2FS_FT_REG_FILE && i_gc_failures) {
+
+	/* old kernel initialized i_gc_failures as 0x01, skip repairing */
+	if (ftype == F2FS_FT_REG_FILE && i_gc_failures > 1) {
 
 		DBG(1, "Regular Inode: 0x%x [%s] depth: %d\n\n",
 				le32_to_cpu(node_blk->footer.ino), en,
Signature · 8 lines
2.18.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#1 lore raw
Quoted 25 lines · Chao Yu

From: Chao Yu <[email protected]>

As Michael reported:

after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line:

Quoted 1 line

[FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00

In old kernel, we initialized i_gc_failures as 0x01, let's skip resetting such unchanged initialized value to avoid unnecessary repairing.

---
 fsck/fsck.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fsck/fsck.c +0 -0
index 970d150..db0e72f 100644

fsck/fsck.c skip_blkcnt_fix: · line 946

Quoted 7 lines
fsck/fsck.c +3 -1
@@ -941,7 +941,9 @@ skip_blkcnt_fix:
 	}
 
 	i_gc_failures = le16_to_cpu(node_blk->i.i_gc_failures);
-	if (ftype == F2FS_FT_REG_FILE && i_gc_failures) {
+
+	/* old kernel initialized i_gc_failures as 0x01, skip repairing */
+	if (ftype == F2FS_FT_REG_FILE && i_gc_failures > 1) {

This will break the current implementation.

Quoted 5 lines
fsck/fsck.c +0 -0
 		DBG(1, "Regular Inode: 0x%x [%s] depth: %d\n\n",
 				le32_to_cpu(node_blk->footer.ino), en,
Signature · 1 line
2.18.0
#2 lore raw
Quoted 28 lines · Jaegeuk Kim
Quoted 27 lines · Chao Yu

From: Chao Yu <[email protected]>

As Michael reported:

after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line:

Quoted 1 line

[FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00

In old kernel, we initialized i_gc_failures as 0x01, let's skip resetting such unchanged initialized value to avoid unnecessary repairing.

---
 fsck/fsck.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fsck/fsck.c +0 -0
index 970d150..db0e72f 100644
@@ -941,7 +941,9 @@ skip_blkcnt_fix:
 	}
 
Quoted 7 lines

fsck/fsck.c skip_blkcnt_fix: · line 946

Quoted 5 lines
fsck/fsck.c +3 -1
 	i_gc_failures = le16_to_cpu(node_blk->i.i_gc_failures);
-	if (ftype == F2FS_FT_REG_FILE && i_gc_failures) {
+
+	/* old kernel initialized i_gc_failures as 0x01, skip repairing */
+	if (ftype == F2FS_FT_REG_FILE && i_gc_failures > 1) {

This will break the current implementation.

Yeah, but I doubt that after repairing i_gc_failures, old kernel can still continue creating inodes in where .i_gc_failures equals to 0x01, then fsck will report such info each time..., can we relief fsck in such condition?

Thanks,

Quoted 9 lines
Quoted 6 lines
fsck/fsck.c +0 -0
 		DBG(1, "Regular Inode: 0x%x [%s] depth: %d\n\n",
 				le32_to_cpu(node_blk->footer.ino), en,
Signature · 1 line
2.18.0

.

#3 lore raw
Quoted 37 lines · Chao Yu
Quoted 28 lines · Jaegeuk Kim
Quoted 27 lines · Chao Yu

From: Chao Yu <[email protected]>

As Michael reported:

after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line:

Quoted 1 line

[FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00

In old kernel, we initialized i_gc_failures as 0x01, let's skip resetting such unchanged initialized value to avoid unnecessary repairing.

---
 fsck/fsck.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fsck/fsck.c +0 -0
index 970d150..db0e72f 100644
@@ -941,7 +941,9 @@ skip_blkcnt_fix:
 	}
 
Quoted 7 lines

fsck/fsck.c skip_blkcnt_fix: · line 946

Quoted 5 lines
fsck/fsck.c +3 -1
 	i_gc_failures = le16_to_cpu(node_blk->i.i_gc_failures);
-	if (ftype == F2FS_FT_REG_FILE && i_gc_failures) {
+
+	/* old kernel initialized i_gc_failures as 0x01, skip repairing */
+	if (ftype == F2FS_FT_REG_FILE && i_gc_failures > 1) {

This will break the current implementation.

Quoted 3 lines

Yeah, but I doubt that after repairing i_gc_failures, old kernel can still continue creating inodes in where .i_gc_failures equals to 0x01, then fsck will report such info each time..., can we relief fsck in such condition?

How about adding another preen mode?

For example,
- 2: same as 0, but skip some checks for old kernel

Quoted 12 lines

Thanks,

Quoted 9 lines
Quoted 6 lines
fsck/fsck.c +0 -0
 		DBG(1, "Regular Inode: 0x%x [%s] depth: %d\n\n",
 				le32_to_cpu(node_blk->footer.ino), en,
Signature · 1 line
2.18.0

.

#4 lore raw
Quoted 38 lines · Jaegeuk Kim
Quoted 37 lines · Chao Yu
Quoted 35 lines · Jaegeuk Kim
Quoted 25 lines · Chao Yu

From: Chao Yu <[email protected]>

As Michael reported:

after updating to f2fs-tools 1.12.0, a routine fsck of my file systems took quite a while and output ten-thousands instances of the following line:

Quoted 1 line

[FIX] (fsck_chk_inode_blk: 954) --> Regular: 0xXYZ reset i_gc_failures from 0x1 to 0x00

In old kernel, we initialized i_gc_failures as 0x01, let's skip resetting such unchanged initialized value to avoid unnecessary repairing.

---
 fsck/fsck.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fsck/fsck.c +0 -0
index 970d150..db0e72f 100644

fsck/fsck.c skip_blkcnt_fix: · line 946

Quoted 7 lines
fsck/fsck.c +3 -1
@@ -941,7 +941,9 @@ skip_blkcnt_fix:
 	}
 
 	i_gc_failures = le16_to_cpu(node_blk->i.i_gc_failures);
-	if (ftype == F2FS_FT_REG_FILE && i_gc_failures) {
+
+	/* old kernel initialized i_gc_failures as 0x01, skip repairing */
+	if (ftype == F2FS_FT_REG_FILE && i_gc_failures > 1) {

This will break the current implementation.

Quoted 8 lines
Quoted 3 lines

Yeah, but I doubt that after repairing i_gc_failures, old kernel can still continue creating inodes in where .i_gc_failures equals to 0x01, then fsck will report such info each time..., can we relief fsck in such condition?

How about adding another preen mode?

For example,
- 2: same as 0, but skip some checks for old kernel

Good idea, let me change to add this in v2. :)

Thanks,

Quoted 16 lines
Quoted 13 lines

Thanks,

Quoted 9 lines
Quoted 6 lines
fsck/fsck.c +0 -0
 		DBG(1, "Regular Inode: 0x%x [%s] depth: %d\n\n",
 				le32_to_cpu(node_blk->footer.ino), en,
Signature · 1 line
2.18.0

.

.