summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Snitzer2010-08-03 12:54:51 +0200
committerJens Axboe2010-08-07 18:53:04 +0200
commitedca4a380584a65a16839bdee33ec82244f0f88e (patch)
treef0e24d4712cf98eb5876157ae1f49bebc6d701ef /include
parentcpqarray: check put_user() result (diff)
downloadkernel-qcow2-linux-edca4a380584a65a16839bdee33ec82244f0f88e.tar.gz
kernel-qcow2-linux-edca4a380584a65a16839bdee33ec82244f0f88e.tar.xz
kernel-qcow2-linux-edca4a380584a65a16839bdee33ec82244f0f88e.zip
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 <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a8b05fc80c6d..89c855c5655c 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);
}