All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Jens Axboe <jaxboe@fusionio.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
	dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: [PATCH] disallow FS recursion from sb_issue_discard allocation
Date: Tue, 6 Jul 2010 12:11:56 -0400	[thread overview]
Message-ID: <20100706161155.GA24461@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1007021605410.13662@hs20-bc2-1.build.redhat.com>

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>
---
 include/linux/blkdev.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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);
 }
 

  reply	other threads:[~2010-07-06 16:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 15:12 [PATCH 0/4] discard updates Mikulas Patocka
2010-07-02 15:17 ` [PATCH 1/4] Check that the target supports discard Mikulas Patocka
2010-07-02 15:18   ` [PATCH 2/4] Clear the discard flag if the device loses discard capability Mikulas Patocka
2010-07-02 15:19     ` [PATCH 3/4] Support discard for multiple devices Mikulas Patocka
2010-07-02 15:19       ` [PATCH 4/4] Support discard if at least one underlying device supports it Mikulas Patocka
2010-07-02 18:14         ` Mike Snitzer
2010-07-02 19:49           ` Mikulas Patocka
2010-07-02 20:00             ` Mikulas Patocka
2010-07-02 20:08               ` GFP_KERNEL in ext4 (was: [PATCH 4/4] Support discard if at least one underlying device supports it) Mikulas Patocka
2010-07-06 16:11                 ` Mike Snitzer [this message]
2010-07-27 13:44                   ` [PATCH] disallow FS recursion from sb_issue_discard allocation Ted Ts'o
2010-07-27 15:33                     ` Mike Snitzer
2010-07-28 18:12                       ` Jens Axboe
2010-07-28 23:15                         ` Ted Ts'o
2010-07-02 20:47               ` [PATCH 4/4] Support discard if at least one underlying device supports it Mike Snitzer
2010-07-02 20:54                 ` Alasdair G Kergon
2010-07-05  7:03                 ` Dmitry Monakhov
2010-07-05 11:32                 ` Mikulas Patocka
2010-07-02 20:29             ` Mike Snitzer
2010-07-08  0:07         ` Alasdair G Kergon
2010-07-02 17:50       ` [PATCH 3/4] Support discard for multiple devices Mike Snitzer
2010-07-07 23:23       ` Alasdair G Kergon
2010-07-02 17:51     ` [PATCH 2/4] Clear the discard flag if the device loses discard capability Mike Snitzer
2010-07-07 23:18     ` Alasdair G Kergon
2010-07-02 18:05   ` [PATCH 1/4] Check that the target supports discard Mike Snitzer
2010-07-07 23:14   ` Alasdair G Kergon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100706161155.GA24461@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jaxboe@fusionio.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.