Btrfs: fix extent_buffer leak in the metadata IO error handling
authorChris Mason <chris.mason@oracle.com>
Fri, 4 Nov 2011 02:23:13 +0000 (22:23 -0400)
committerChris Mason <chris.mason@oracle.com>
Sun, 6 Nov 2011 08:09:10 +0000 (03:09 -0500)
The scrub readahead branch brought in a new error handling hook,
but it was leaking extent_buffer references.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c

index 0eb1f09512514a229182ed6e96cc608e6f31168a..40a62b98008700a7429c93b2b8ca116eb7a3cb8d 100644 (file)
@@ -644,6 +644,7 @@ static int btree_io_failed_hook(struct bio *failed_bio,
                clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags);
                btree_readahead_hook(root, eb, eb->start, -EIO);
        }
+       free_extent_buffer(eb);
 
 out:
        return -EIO;    /* we fixed nothing */