]> Git Repo - linux.git/commitdiff
Btrfs: fix btrfs_is_free_space_inode to recognize btree inode
authorLiu Bo <[email protected]>
Tue, 10 Jul 2012 11:28:38 +0000 (05:28 -0600)
committerChris Mason <[email protected]>
Mon, 23 Jul 2012 20:28:00 +0000 (16:28 -0400)
For btree inode, its root is also 'tree root', so btree inode can be
misunderstood as a free space inode.

We should add one more check for btree inode.

Signed-off-by: Liu Bo <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
fs/btrfs/btrfs_inode.h

index 12394a90d60fb7115d5b8feee0e7df701f9e743d..b168238bcb13f70a54e9b2150302d43a37ebcb31 100644 (file)
@@ -194,8 +194,10 @@ static inline void btrfs_i_size_write(struct inode *inode, u64 size)
 static inline bool btrfs_is_free_space_inode(struct btrfs_root *root,
                                       struct inode *inode)
 {
-       if (root == root->fs_info->tree_root ||
-           BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID)
+       if (root == root->fs_info->tree_root &&
+           btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID)
+               return true;
+       if (BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID)
                return true;
        return false;
 }
This page took 0.054609 seconds and 4 git commands to generate.