From c64485544baa9ffc5fbedd5661a05bdee1b37598 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 1 Oct 2013 09:00:19 -0400 Subject: Btrfs-progs: keep track of transid failures and fix them if possible A user was reporting an issue with bad transid errors on his blocks. The thing is that btrfs-progs will ignore transid failures for things like restore and fsck so we can do a best effort to fix a users file system. So fsck can put together a coherent view of the file system with stale blocks. So if everything else is ok in the mind of fsck then we can recow these blocks to fix the generation and the user can get their file system back. Thanks, Signed-off-by: Josef Bacik Signed-off-by: David Sterba Signed-off-by: Chris Mason --- extent_io.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'extent_io.c') diff --git a/extent_io.c b/extent_io.c index 1c481d5d..ad07b9cd 100644 --- a/extent_io.c +++ b/extent_io.c @@ -587,6 +587,7 @@ static struct extent_buffer *__alloc_extent_buffer(struct extent_io_tree *tree, eb->dev_bytenr = (u64)-1; eb->cache_node.start = bytenr; eb->cache_node.size = blocksize; + INIT_LIST_HEAD(&eb->recow); free_some_buffers(tree); ret = insert_cache_extent(&tree->cache, &eb->cache_node); @@ -610,6 +611,7 @@ void free_extent_buffer(struct extent_buffer *eb) struct extent_io_tree *tree = eb->tree; BUG_ON(eb->flags & EXTENT_DIRTY); list_del_init(&eb->lru); + list_del_init(&eb->recow); remove_cache_extent(&tree->cache, &eb->cache_node); BUG_ON(tree->cache_size < eb->len); tree->cache_size -= eb->len; -- cgit v1.2.3