Commit 97dfd70c authored by Nathan Scott's avatar Nathan Scott

[XFS] Remove a race condition where a linked inode could BUG_ON in

d_instantiate, due to fast transaction committal removing the last
remaining reference before we were all done.

SGI-PV: 953287
SGI-Modid: xfs-linux-melb:xfs-kern:26347a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 05a33328
...@@ -422,10 +422,12 @@ xfs_vn_link( ...@@ -422,10 +422,12 @@ xfs_vn_link(
tdvp = vn_from_inode(dir); tdvp = vn_from_inode(dir);
vp = vn_from_inode(ip); vp = vn_from_inode(ip);
VN_HOLD(vp);
error = bhv_vop_link(tdvp, vp, dentry, NULL); error = bhv_vop_link(tdvp, vp, dentry, NULL);
if (likely(!error)) { if (unlikely(error)) {
VN_RELE(vp);
} else {
VMODIFY(tdvp); VMODIFY(tdvp);
VN_HOLD(vp);
xfs_validate_fields(ip, &vattr); xfs_validate_fields(ip, &vattr);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment