btrfs-progs: fix next_leaf in restore as it improperly skips some slots
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 28 Aug 2014 02:25:54 +0000 (10:25 +0800)
committerDavid Sterba <dsterba@suse.cz>
Sun, 14 Sep 2014 12:50:54 +0000 (14:50 +0200)
When entering the next level node, the @next_leaf in restore forgets to
start at the first slot. Just reset it to the first one.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-restore.c

index bc67708..f909429 100644 (file)
@@ -191,6 +191,7 @@ again:
                        level++;
                        if (level == BTRFS_MAX_LEVEL)
                                return 1;
+                       offset = 1;
                        continue;
                }