From: Mike Snitzer Date: Tue, 3 Aug 2010 10:54:51 +0000 (+0200) Subject: block: disallow FS recursion from sb_issue_discard allocation X-Git-Tag: upstream/snapshot3+hdmi~13504^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edca4a380584a65a16839bdee33ec82244f0f88e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git block: disallow FS recursion from sb_issue_discard allocation Filesystems can call sb_issue_discard on a memory reclaim path (e.g. ext4 calls sb_issue_discard during journal commit). Use GFP_NOFS in sb_issue_discard to avoid recursing back into the FS. Reported-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a8b05fc..89c855c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -933,7 +933,7 @@ static inline int sb_issue_discard(struct super_block *sb, { block <<= (sb->s_blocksize_bits - 9); nr_blocks <<= (sb->s_blocksize_bits - 9); - return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, + return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_NOFS, BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER); }