btrfs-progs: check: allow force v1 space cache cleanup even the fs has v2 space cache enabled
PATCH 1/1 btrfs-progs: check: allow force v1 space cache cleanup even the fs has v2 space cache enabled
There are cases where v1 free space cache is still left while user has already enabled v2 cache.
In that case, we still want to force v1 space cache cleanup in btrfs-check.
This patch will remove the v2 check if we're cleaning up v1 cache, allowing us to cleanup the leftover.
--- check/main.c | 6 ------ 1 file changed, 6 deletions(-)
check/main.c +0 -6
@@ -9917,12 +9917,6 @@ static int do_clear_free_space_cache(int clear_version)int ret =0 ;if (clear_version ==1 ) { -if (btrfs_fs_compat_ro (gfs_info,FREE_SPACE_TREE )) { -error ( -"free space cache v2 detected, use --clear-space-cache v2" ); - ret =1 ; - goto close_out; - } ret =clear_free_space_cache ();if (ret) {error ("failed to clear free space cache" );
Signature · 1 line
2.29.2
Quoted 33 lines · Qu Wenruo
There are cases where v1 free space cache is still left while user has already enabled v2 cache.
In that case, we still want to force v1 space cache cleanup in btrfs-check.
This patch will remove the v2 check if we're cleaning up v1 cache, allowing us to cleanup the leftover.
Signed-off-by Qu Wenruo <[email protected]>---
check/main.c| 6 ------1 file changed, 6 deletions(-)check/main.c +0
-6@@ -9917,12 +9917,6 @@ static int do_clear_free_space_cache(int clear_version)int ret =0 ;if (clear_version ==1 ) { -if (btrfs_fs_compat_ro (gfs_info,FREE_SPACE_TREE )) { -error ( -"free space cache v2 detected, use --clear-space-cache v2" ); - ret =1 ; - goto close_out; - } ret =clear_free_space_cache ();if (ret) {error ("failed to clear free space cache" );Signature · 1 line
2.29.2
Maybe we should keep the message but make it not fatal?
Something like "free space cache v2 detected, use --clear-space-cache v2 to clear it. Proceeding in clearing potential v1 leftovers as asked..."?
Regards,
Stéphane.
Quoted 33 lines · Stéphane Lesimple
Quoted 31 lines · Qu Wenruo
There are cases where v1 free space cache is still left while user has already enabled v2 cache.
In that case, we still want to force v1 space cache cleanup in btrfs-check.
This patch will remove the v2 check if we're cleaning up v1 cache, allowing us to cleanup the leftover.
Signed-off-by Qu Wenruo <[email protected]>---
check/main.c| 6 ------1 file changed, 6 deletions(-)check/main.c +0
-6@@ -9917,12 +9917,6 @@ static int do_clear_free_space_cache(int clear_version)int ret =0 ;if (clear_version ==1 ) { -if (btrfs_fs_compat_ro (gfs_info,FREE_SPACE_TREE )) { -error ( -"free space cache v2 detected, use --clear-space-cache v2" ); - ret =1 ; - goto close_out; - } ret =clear_free_space_cache ();if (ret) {error ("failed to clear free space cache" );
Quoted 8 lines
Quoted 2 lines
Signature · 1 line
2.29.2Maybe we should keep the message but make it not fatal? Something like "free space cache v2 detected, use --clear-space-cache v2 to clear it. Proceeding in clearing potential v1 leftovers as asked..."?
This sounds like a good option, thanks. I'll update the patch when I commit it.