[PATCH 1/2] btrfs-progs: find-root: Fix wrong generation for log tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When searching for log tree, we should use btrfs_super_generation + 1
other than log_root_transid.

Since log_root_transid is never touched and will be deprecated soon.

Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
---
 btrfs-find-root.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index e2d2e70c408c..376bbc4c47fa 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -73,7 +73,7 @@ static void get_root_gen_and_level(u64 objectid, struct btrfs_fs_info *fs_info,
 		break;
 	case BTRFS_TREE_LOG_OBJECTID:
 		level = btrfs_super_log_root_level(super);
-		gen = btrfs_super_log_root_transid(super);
+		gen = btrfs_super_generation(super) + 1;
 		break;
 	case BTRFS_UUID_TREE_OBJECTID:
 		gen = btrfs_super_uuid_tree_generation(super);
-- 
2.19.1




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux