@@ -774,6 +774,8 @@ xfs_inode_inherit_flags2(
/*
* Initialise a newly allocated inode and return the in-core inode to the
* caller locked exclusively.
+ *
+ * Caller is responsible for unlocking the inode manually upon return
*/
int
xfs_init_new_inode(
@@ -899,7 +901,7 @@ xfs_init_new_inode(
/*
* Log the new values stuffed into the inode.
*/
- xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
+ xfs_trans_ijoin(tp, ip, 0);
xfs_trans_log_inode(tp, ip, flags);
/* now that we have an i_mode we can setup the inode structure */
@@ -1076,6 +1078,7 @@ xfs_create(
xfs_qm_dqrele(pdqp);
*ipp = ip;
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
return 0;
out_trans_cancel:
@@ -1089,6 +1092,7 @@ xfs_create(
if (ip) {
xfs_finish_inode_setup(ip);
xfs_irele(ip);
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
}
out_release_dquots:
xfs_qm_dqrele(udqp);
@@ -1172,6 +1176,7 @@ xfs_create_tmpfile(
xfs_qm_dqrele(pdqp);
*ipp = ip;
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
return 0;
out_trans_cancel:
@@ -1185,6 +1190,7 @@ xfs_create_tmpfile(
if (ip) {
xfs_finish_inode_setup(ip);
xfs_irele(ip);
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
}
out_release_dquots:
xfs_qm_dqrele(udqp);
@@ -826,8 +826,10 @@ xfs_qm_qino_alloc(
ASSERT(xfs_is_shutdown(mp));
xfs_alert(mp, "%s failed (error %d)!", __func__, error);
}
- if (need_alloc)
+ if (need_alloc) {
xfs_finish_inode_setup(*ipp);
+ xfs_iunlock(*ipp, XFS_ILOCK_EXCL);
+ }
return error;
}
@@ -337,6 +337,7 @@ xfs_symlink(
xfs_qm_dqrele(pdqp);
*ipp = ip;
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
return 0;
out_trans_cancel:
@@ -358,6 +359,8 @@ xfs_symlink(
if (unlock_dp_on_error)
xfs_iunlock(dp, XFS_ILOCK_EXCL);
+ if (ip)
+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
return error;
}