diff mbox

[V2] btrfs: fix possible deadlock by clearing __GFP_FS flag

Message ID 4D8F2D32.3000601@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Miao Xie March 27, 2011, 12:27 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 3e1ea3e..cf55fa0 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1632,6 +1632,8 @@  struct btrfs_root *open_ctree(struct super_block *sb,
 		goto fail_bdi;
 	}
 
+	fs_info->btree_inode->i_mapping->flags &= ~__GFP_FS;
+
 	INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_ATOMIC);
 	INIT_LIST_HEAD(&fs_info->trans_list);
 	INIT_LIST_HEAD(&fs_info->dead_roots);
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index a039065..57df380 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -88,6 +88,8 @@  struct inode *lookup_free_space_inode(struct btrfs_root *root,
 	}
 	spin_unlock(&block_group->lock);
 
+	inode->i_mapping->flags &= ~__GFP_FS;
+
 	return inode;
 }