diff options
authorQu Wenruo <>2018-10-04 14:02:13 +0800
committerDavid Sterba <>2018-10-31 18:24:13 +0100
commitd59e19ca0786be2b415ca342b0fab5f222ecb702 (patch)
parentbf60039cbed6228b94341e2faba326608d4b2093 (diff)
btrfs-progs: image: Warn about log tree generation mismatch when restoring
At restore time, btrfs-image will try to fixup dev extents, this will trigger a transaction. It's normally OK to start a new transaction, but for an image with log tree, a new transaction will increment generation, and log tree generation will not match super block generation + 1. There is no good way to solve it yet. Just output a warning for now. Signed-off-by: Qu Wenruo <> [ update error message ] Signed-off-by: David Sterba <>
1 files changed, 4 insertions, 0 deletions
diff --git a/image/main.c b/image/main.c
index 351c5a25..5b0050a0 100644
--- a/image/main.c
+++ b/image/main.c
@@ -2093,6 +2093,10 @@ static int fixup_devices(struct btrfs_fs_info *fs_info,
u64 devid, cur_devid;
int ret;
+ if (btrfs_super_log_root(fs_info->super_copy)) {
+ warning(
+ "log tree detected, its generation will not match superblock");
+ }
trans = btrfs_start_transaction(fs_info->tree_root, 1);
if (IS_ERR(trans)) {
error("cannot starting transaction %ld", PTR_ERR(trans));