summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-27 16:13:46 +1000
committerNathan Scott <nathans@sgi.com>2006-06-27 16:13:46 +1000
commit97dfd70c8958a634157e0b35711cca01ff6f959b (patch)
treea4e47392e35a04b71ff180fa4a681731e3d03a14 /fs
parent05a3332885dd143496694bcecff223339880d7c9 (diff)
downloadlinux-3.10-97dfd70c8958a634157e0b35711cca01ff6f959b.tar.gz
linux-3.10-97dfd70c8958a634157e0b35711cca01ff6f959b.tar.bz2
linux-3.10-97dfd70c8958a634157e0b35711cca01ff6f959b.zip
[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: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index b3b46457f15..d9180020de6 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -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);
}