|
@@ -6658,8 +6658,9 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
|
|
* 2 items for inode and inode ref
|
|
|
* 2 items for dir items
|
|
|
* 1 item for parent inode
|
|
|
+ * 1 item for orphan item deletion if O_TMPFILE
|
|
|
*/
|
|
|
- trans = btrfs_start_transaction(root, 5);
|
|
|
+ trans = btrfs_start_transaction(root, inode->i_nlink ? 5 : 6);
|
|
|
if (IS_ERR(trans)) {
|
|
|
err = PTR_ERR(trans);
|
|
|
trans = NULL;
|