Skip to contentSkip to conversation

Btrfs: use join_transaction in btrfs_evict_inode()

PATCH In review Li Zefan 2 participants 2 messages Jun 8, 2011 Btrfs file system

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 Btrfs: use join_transaction in btrfs_evict_inode()

The WARN_ON() in start_transaction() was triggered while balancing.

The cause is btrfs_relocate_chunk() started a transaction and then called iput() on the inode that stores free space cache, and iput() called btrfs_start_transaction() again.

---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/inode.c +1 -1
index 02ff4a1..4e9aa28 100644
@@ -3646,7 +3646,7 @@ void btrfs_evict_inode(struct inode *inode)
 	btrfs_i_size_write(inode, 0);
 
 	while (1) {
-		trans = btrfs_start_transaction(root, 0);
+		trans = btrfs_join_transaction(root);
 		BUG_ON(IS_ERR(trans));
 		trans->block_rsv = root->orphan_block_rsv;
 

-- 1.7.3.1