btrfs: fix memory leak during RAID 5/6 device replacement
authorScott Talbert <scott.talbert@hgst.com>
Mon, 9 May 2016 13:14:28 +0000 (09:14 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2016 08:17:58 +0000 (10:17 +0200)
A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
freed anywhere.

Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c

index d270c70..fa35cdc 100644 (file)
@@ -2127,6 +2127,8 @@ static void scrub_missing_raid56_end_io(struct bio *bio)
        if (bio->bi_error)
                sblock->no_io_error_seen = 0;
 
+       bio_put(bio);
+
        btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
 }