Skip to content

Commit

Permalink
[XFS] Remove a race condition where a linked inode could BUG_ON in
Browse files Browse the repository at this point in the history
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: Nathan Scott <nathans@sgi.com>
  • Loading branch information
Nathan Scott committed Jun 27, 2006
1 parent 05a3332 commit 97dfd70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,12 @@ xfs_vn_link(
tdvp = vn_from_inode(dir);
vp = vn_from_inode(ip);

VN_HOLD(vp);
error = bhv_vop_link(tdvp, vp, dentry, NULL);
if (likely(!error)) {
if (unlikely(error)) {
VN_RELE(vp);
} else {
VMODIFY(tdvp);
VN_HOLD(vp);
xfs_validate_fields(ip, &vattr);
d_instantiate(dentry, ip);
}
Expand Down

0 comments on commit 97dfd70

Please sign in to comment.