Skip to content

Commit adae52b

Browse files
Miao Xiechrismason-xx
authored andcommitted
btrfs: clear __GFP_FS flag in the space cache inode
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>
1 parent 6e8df2a commit adae52b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/btrfs/free-space-cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ struct inode *lookup_free_space_inode(struct btrfs_root *root,
8181
return ERR_PTR(-ENOENT);
8282
}
8383

84+
inode->i_mapping->flags &= ~__GFP_FS;
85+
8486
spin_lock(&block_group->lock);
8587
if (!root->fs_info->closing) {
8688
block_group->inode = igrab(inode);

fs/btrfs/inode.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2535,8 +2535,6 @@ static void btrfs_read_locked_inode(struct inode *inode)
25352535
BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item);
25362536

25372537
alloc_group_block = btrfs_inode_block_group(leaf, inode_item);
2538-
if (location.objectid == BTRFS_FREE_SPACE_OBJECTID)
2539-
inode->i_mapping->flags &= ~__GFP_FS;
25402538

25412539
/*
25422540
* try to precache a NULL acl entry for files that don't have

0 commit comments

Comments
 (0)