From patchwork Tue Jul 6 16:11:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: disallow FS recursion from sb_issue_discard allocation Date: Tue, 06 Jul 2010 06:11:56 -0000 From: Mike Snitzer X-Patchwork-Id: 58046 Message-Id: <20100706161155.GA24461@redhat.com> To: Jens Axboe Cc: Mikulas Patocka , dm-devel@redhat.com, Alasdair G Kergon , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org 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 --- include/linux/blkdev.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index baf5258..dbb510c 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); }