btrfs: clear __GFP_FS flag in the space cache inode
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 31 Mar 2011 09:43:23 +0000 (09:43 +0000)
committerChris Mason <chris.mason@oracle.com>
Tue, 5 Apr 2011 05:19:43 +0000 (01:19 -0400)
the object id of the space cache inode's key is allocated from the relative
root, just like the regular file. So we can't identify space cache inode by
checking the object id of the inode's key, and we have to clear __GFP_FS flag
at the time we look up the space cache inode.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c

index 0037427d8a9d27b6a14b980898b01ca39209f51a..13575de85543762c79f51ee1708511492adb8005 100644 (file)
@@ -81,6 +81,8 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
                return ERR_PTR(-ENOENT);
        }
 
+       inode->i_mapping->flags &= ~__GFP_FS;
+
        spin_lock(&block_group->lock);
        if (!root->fs_info->closing) {
                block_group->inode = igrab(inode);
index 1ca3e68586cf39e2a8d14d6157f1913fe954d458..57a03f6eb22453f2b0655c6c720232730317ec84 100644 (file)
@@ -2535,8 +2535,6 @@ static void btrfs_read_locked_inode(struct inode *inode)
        BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item);
 
        alloc_group_block = btrfs_inode_block_group(leaf, inode_item);
-       if (location.objectid == BTRFS_FREE_SPACE_OBJECTID)
-               inode->i_mapping->flags &= ~__GFP_FS;
 
        /*
         * try to precache a NULL acl entry for files that don't have