Skip to contentSkip to conversation

Btrfs: fix wrong orphan count of the fs/file tree

PATCH In review Miao Xie 1 participant 1 message Aug 29, 2012 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 5/7 Btrfs: fix wrong orphan count of the fs/file tree

If we add a new orphan item, we should increase the atomic counter, not decrease it. Fix it.

---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/inode.c +1 -1
index 7131fac..cae4c32 100644
@@ -2222,7 +2222,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)
 			insert = 1;
 #endif
 		insert = 1;
-		atomic_dec(&root->orphan_inodes);
+		atomic_inc(&root->orphan_inodes);
 	}
 
 	if (!test_and_set_bit(BTRFS_INODE_ORPHAN_META_RESERVED,
Signature · 1 line
1.7.6.5