aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/unionfs
diff options
context:
space:
mode:
authorDaichi GOTO <daichi@FreeBSD.org>2008-04-25 09:44:47 +0000
committerDaichi GOTO <daichi@FreeBSD.org>2008-04-25 09:44:47 +0000
commit5307411cbef39f06fcb08622d22f1cead840f376 (patch)
tree4d47bd25b3f575473cf154c944c39e9eb552dd6c /sys/fs/unionfs
parenta9b794ff5e24091a619493e5ccfcb4a4d7376c3d (diff)
Notes
Diffstat (limited to 'sys/fs/unionfs')
-rw-r--r--sys/fs/unionfs/union_vnops.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index d0091507c3311..73495f58b74e8 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -1165,6 +1165,9 @@ unionfs_rename(struct vop_rename_args *ap)
}
}
+ if (rfvp == rtvp)
+ goto unionfs_rename_abort;
+
if (needrelookup != 0) {
if ((error = vn_lock(fdvp, LK_EXCLUSIVE)) != 0)
goto unionfs_rename_abort;
@@ -1192,10 +1195,6 @@ unionfs_rename(struct vop_rename_args *ap)
cache_purge(fdvp);
}
- if (fdvp != rfdvp)
- vrele(fdvp);
- if (fvp != rfvp)
- vrele(fvp);
if (ltdvp != NULLVP)
VOP_UNLOCK(ltdvp, 0);
if (tdvp != rtdvp)
@@ -1208,27 +1207,31 @@ unionfs_rename(struct vop_rename_args *ap)
else
vrele(tvp);
}
+ if (fdvp != rfdvp)
+ vrele(fdvp);
+ if (fvp != rfvp)
+ vrele(fvp);
UNIONFS_INTERNAL_DEBUG("unionfs_rename: leave (%d)\n", error);
return (error);
unionfs_rename_abort:
- if (fdvp != rfdvp)
- vrele(rfdvp);
- if (fvp != rfvp)
- vrele(rfvp);
+ vput(tdvp);
if (tdvp != rtdvp)
vrele(rtdvp);
- vput(tdvp);
- if (tvp != rtvp && rtvp != NULLVP)
- vrele(rtvp);
if (tvp != NULLVP) {
if (tdvp != tvp)
vput(tvp);
else
vrele(tvp);
}
+ if (tvp != rtvp && rtvp != NULLVP)
+ vrele(rtvp);
+ if (fdvp != rfdvp)
+ vrele(rfdvp);
+ if (fvp != rfvp)
+ vrele(rfvp);
vrele(fdvp);
vrele(fvp);