提交 edca4a38 编写于 作者: M Mike Snitzer 提交者: Jens Axboe

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: NMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 f6c4c8e1
...@@ -933,7 +933,7 @@ static inline int sb_issue_discard(struct super_block *sb, ...@@ -933,7 +933,7 @@ static inline int sb_issue_discard(struct super_block *sb,
{ {
block <<= (sb->s_blocksize_bits - 9); block <<= (sb->s_blocksize_bits - 9);
nr_blocks <<= (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); BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册