aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <liubo2009@cn.fujitsu.com>2012-07-10 07:28:38 -0400
committerChris Mason <chris.mason@fusionio.com>2012-07-23 16:28:00 -0400
commit51a8cf9d2d97017d334f33f1b39067bd2f03bc49 (patch)
treea80be16062c2f5ff10d766852cf9d79a852aa0ef
parentc0901581ad077004145c9ee80e843fba71c100b8 (diff)
Btrfs: fix btrfs_is_free_space_inode to recognize btree inode
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 <liubo2009@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
-rw-r--r--fs/btrfs/btrfs_inode.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h
index 12394a90d60f..b168238bcb13 100644
--- a/fs/btrfs/btrfs_inode.h
+++ b/fs/btrfs/btrfs_inode.h
@@ -194,8 +194,10 @@ static inline void btrfs_i_size_write(struct inode *inode, u64 size)
194static inline bool btrfs_is_free_space_inode(struct btrfs_root *root, 194static inline bool btrfs_is_free_space_inode(struct btrfs_root *root,
195 struct inode *inode) 195 struct inode *inode)
196{ 196{
197 if (root == root->fs_info->tree_root || 197 if (root == root->fs_info->tree_root &&
198 BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID) 198 btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID)
199 return true;
200 if (BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID)
199 return true; 201 return true;
200 return false; 202 return false;
201} 203}