Btrfs: fix tree mod log for root replacements at leaf level
authorJan Schmidt <list.btrfs@jan-o-sch.net>
Thu, 21 Jun 2012 08:59:13 +0000 (10:59 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Wed, 27 Jun 2012 14:34:38 +0000 (16:34 +0200)
For the tree mod log, we don't log any operations at leaf level. If the root
is at the leaf level (i.e. the tree consists only of the root), then
__tree_mod_log_oldest_root will find a ROOT_REPLACE operation in the log
(because we always log that one no matter which level), but no other
operations.

With this patch __tree_mod_log_oldest_root exits cleanly instead of
BUGging in this situation. get_old_root checks if its really a root at leaf
level in case we don't have any operations and WARNs if this assumption
breaks.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>

No differences found