]> git.hungrycats.org Git - linux/commitdiff
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)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Wed, 17 Aug 2016 02:40:27 +0000 (22:40 -0400)
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>
(cherry picked from commit 4673272f43ae790ab9ec04e38a7542f82bb8f020)

fs/btrfs/scrub.c

index 4c46ff69b4278c3281798e30525ddf23f7c5feb0..f02f38265535e5de995f1bb6357461c2f1d3fc8b 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);
 }