Skip to content

Commit 722d908

Browse files
author
Mike Snitzer
committed
dm thin: fix issue_discard to pass GFP_NOIO to __blkdev_issue_discard
issue_discard() passes GFP_NOWAIT to __blkdev_issue_discard() despite its code assuming bio_alloc() always succeeds. Commit 3dba53a ("dm thin: use __blkdev_issue_discard for async discard support") clearly shows where things went bad: Before commit 3dba53a, dm-thin.c's open-coded __blkdev_issue_discard_async() properly handled using GFP_NOWAIT. Unfortunately __blkdev_issue_discard() doesn't and it was missed during review. Cc: [email protected] Signed-off-by: Mike Snitzer <[email protected]>
1 parent cb65b28 commit 722d908

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/dm-thin.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ static int issue_discard(struct discard_op *op, dm_block_t data_b, dm_block_t da
401401
sector_t s = block_to_sectors(tc->pool, data_b);
402402
sector_t len = block_to_sectors(tc->pool, data_e - data_b);
403403

404-
return __blkdev_issue_discard(tc->pool_dev->bdev, s, len, GFP_NOWAIT,
405-
&op->bio);
404+
return __blkdev_issue_discard(tc->pool_dev->bdev, s, len, GFP_NOIO, &op->bio);
406405
}
407406

408407
static void end_discard(struct discard_op *op, int r)

0 commit comments

Comments
 (0)