Btrfs: use join_transaction in btrfs_evict_inode()
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 8 Jun 2011 03:56:44 +0000 (03:56 +0000)
committerChris Mason <chris.mason@oracle.com>
Sat, 11 Jun 2011 12:31:55 +0000 (08:31 -0400)
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.

Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Reviewed-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c

index 113913ae36e0dd5f3adcd6cab7917ba51f3ea092..c15636b17874bb1f1e181dabe5e344e2a19b45b4 100644 (file)
@@ -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;