Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function
From: Alex Lyakas <hidden>
Date: 2012-07-04 18:27:03
Hi Alex,
+ spin_lock(&left_root->root_times_lock); + ctransid = btrfs_root_ctransid(&left_root->root_item); + spin_unlock(&left_root->root_times_lock); + if (ctransid != left_start_ctransid) + left_start_ctransid = 0; + + spin_lock(&right_root->root_times_lock); + ctransid = btrfs_root_ctransid(&right_root->root_item); + spin_unlock(&right_root->root_times_lock); + if (ctransid != right_start_ctransid) + left_start_ctransid = 0;
Shouldn't it be here right_start_ctransid=0? Otherwise, right_start_ctransid is pretty useless in this function.
+
+ if (!left_start_ctransid || !right_start_ctransid) {
+ WARN(1, KERN_WARNING
+ "btrfs: btrfs_compare_tree detected "
+ "a change in one of the trees while "
+ "iterating. This is probably a "
+ "bug.\n");
+ ret = -EIO;
+ goto out;
+ }I am reading the code have more questions (and comments), but will send them all later. Alex.