Skip to contentSkip to conversation

btrfs-progs: Continue checking even we found something wrong in free space cache

PATCH In review Qu Wenruo 3 participants 4 messages Sep 4, 2018 – Sep 14, 2018 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: Continue checking even we found something wrong in free space cache

No need to abort checking, especially for RO check free space cache is meaningless, the errors in fs/extent tree is more interesting for developers.

So continue checking even something in free space cache is wrong.

---
 check/main.c | 1 -
 1 file changed, 1 deletion(-)
check/main.c +0 -1
index b361cd7e26a0..4f720163221e 100644
@@ -9885,7 +9885,6 @@ int cmd_check(int argc, char **argv)
 			error("errors found in free space tree");
 		else
 			error("errors found in free space cache");
-		goto out;
 	}
 
 	/*
Signature · 1 line
2.18.0
#1 lore raw
Quoted 17 lines · Qu Wenruo

No need to abort checking, especially for RO check free space cache is meaningless, the errors in fs/extent tree is more interesting for developers.

So continue checking even something in free space cache is wrong.

---
 check/main.c | 1 -
 1 file changed, 1 deletion(-)
check/main.c +0 -0
index b361cd7e26a0..4f720163221e 100644

check/main.c int cmd_check(int argc, char **argv) · line 9887

Quoted 3 lines
check/main.c +0 -0
@@ -9885,7 +9885,6 @@ int cmd_check(int argc, char **argv)
 			error("errors found in free space tree");
 		else
 			error("errors found in free space cache");

Please make it a warning and update the message so it says that it will continue despite the errors found.

I noticed that error handling in check_space_cache is a bit fishy, some errors are stored to 'ret' but ignored at the end of the function.

#2 lore raw
Quoted 13 lines · David Sterba
Quoted 12 lines · Qu Wenruo

No need to abort checking, especially for RO check free space cache is meaningless, the errors in fs/extent tree is more interesting for developers.

So continue checking even something in free space cache is wrong.

---
 check/main.c | 1 -
 1 file changed, 1 deletion(-)
Quoted 11 lines

check/main.c int cmd_check(int argc, char **argv) · line 9887

Quoted 8 lines
check/main.c +0 -0
index b361cd7e26a0..4f720163221e 100644
@@ -9885,7 +9885,6 @@ int cmd_check(int argc, char **argv)
 			error("errors found in free space tree");
 		else
 			error("errors found in free space cache");

Please make it a warning and update the message so it says that it will continue despite the errors found.

I'm fine to add warning, but isn't it the expected behavior?

In fact I'm quite surprised that when we found something wrong we just abort checking.

It's never the case for file/extent tree check. We always report all errors we found, not only the first error and exit.

Thanks,
Qu

Quoted 4 lines

I noticed that error handling in check_space_cache is a bit fishy, some errors are stored to 'ret' but ignored at the end of the function.

#3 lore raw
Quoted 28 lines · Qu Wenruo
Quoted 13 lines · David Sterba
Quoted 12 lines · Qu Wenruo

No need to abort checking, especially for RO check free space cache is meaningless, the errors in fs/extent tree is more interesting for developers.

So continue checking even something in free space cache is wrong.

---
 check/main.c | 1 -
 1 file changed, 1 deletion(-)
Quoted 11 lines

check/main.c int cmd_check(int argc, char **argv) · line 9887

Quoted 8 lines
check/main.c +0 -0
index b361cd7e26a0..4f720163221e 100644
@@ -9885,7 +9885,6 @@ int cmd_check(int argc, char **argv)
 			error("errors found in free space tree");
 		else
 			error("errors found in free space cache");

Please make it a warning and update the message so it says that it will continue despite the errors found.

Quoted 7 lines

I'm fine to add warning, but isn't it the expected behavior?

In fact I'm quite surprised that when we found something wrong we just abort checking.

It's never the case for file/extent tree check. We always report all errors we found, not only the first error and exit.

You're right, in context of 'check' this is the expected behaviour. So let's keep error().