aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 5e4c0d95ce4..254da822566 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -152,12 +152,13 @@ int btrfs_add_ordered_inode(struct inode *inode)
inode->i_ino, &entry->rb_node);
BTRFS_I(inode)->ordered_trans = transid;
+ if (!node)
+ igrab(inode);
write_unlock(&tree->lock);
+
if (node)
kfree(entry);
- else
- igrab(inode);
return 0;
}