btrfs-progs: repair: remove recowed entry from the to-recow list
authorAlexandre Oliva <oliva@gnu.org>
Tue, 23 Sep 2014 15:49:58 +0000 (17:49 +0200)
committerDavid Sterba <dsterba@suse.cz>
Fri, 10 Oct 2014 16:11:32 +0000 (18:11 +0200)
If we attempt to repair a filesystem with metadata blocks that need
recowing, we'll get into an infinite loop repeatedly recowing the
first entry in the list, without ever removing it from the list.
Oops.  Fixed.

Signed-off-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-check.c

index c0a9870..7a86077 100644 (file)
@@ -7034,6 +7034,7 @@ int cmd_check(int argc, char **argv)
 
                eb = list_first_entry(&root->fs_info->recow_ebs,
                                      struct extent_buffer, recow);
+               list_del_init(&eb->recow);
                ret = recow_extent_buffer(root, eb);
                if (ret)
                        break;