linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 1/2] btrfs: use GFP_NOFS instead of GFP_KERNEL
@ 2011-03-24 11:41 Miao Xie
  2011-03-24 23:07 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Miao Xie @ 2011-03-24 11:41 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux Btrfs, Itaru Kitayama, Ito, David Sterba

In the filesystem context, we must allocate memory by GFP_NOFS,
or we may start another filesystem operation and make kswap thread hang up.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/extent-tree.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index f1db57d..42061d2 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -471,7 +471,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
 	if (load_cache_only)
 		return 0;
 
-	caching_ctl = kzalloc(sizeof(*caching_ctl), GFP_KERNEL);
+	caching_ctl = kzalloc(sizeof(*caching_ctl), GFP_NOFS);
 	BUG_ON(!caching_ctl);
 
 	INIT_LIST_HEAD(&caching_ctl->list);
@@ -1743,7 +1743,7 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans,
 static void btrfs_issue_discard(struct block_device *bdev,
 				u64 start, u64 len)
 {
-	blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL,
+	blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_NOFS,
 			BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
 }
 
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-25  1:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 11:41 [PATCH V5 1/2] btrfs: use GFP_NOFS instead of GFP_KERNEL Miao Xie
2011-03-24 23:07 ` David Sterba
2011-03-25  1:56   ` Miao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).