Skip to content

Commit ea7bd56

Browse files
jankaradjwong
authored andcommitted
xfs: Fix leak of discard bio
The bio describing discard operation is allocated by __blkdev_issue_discard() which returns us a reference to it. That reference is never released and thus we leak this bio. Drop the bio reference once it completes in xlog_discard_endio(). CC: stable@vger.kernel.org Fixes: 4560e78 Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent 5b094d6 commit ea7bd56

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/xfs/xfs_log_cil.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ xlog_discard_endio(
539539

540540
INIT_WORK(&ctx->discard_endio_work, xlog_discard_endio_work);
541541
queue_work(xfs_discard_wq, &ctx->discard_endio_work);
542+
bio_put(bio);
542543
}
543544

544545
static void

0 commit comments

Comments
 (0)