summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-12-23 17:23:52 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-12-23 17:23:52 +0000
commit068bc87f058ec1a37c96bbc5b95537da924485f5 (patch)
treef14f568eee364c10fc4de89deac629bb6f190266
parentd39b448c7306185013a87110ea36ffa2716f823e (diff)
Move KASSERT a bit further down because it can apparently be triggered by
trying to hardlink a directory. While this is not allowed on tmpfs, this allows us to reach the code that checks for this such that we can return the appropriate error. Cluestick from Pedro Martelletto. ok espie@
-rw-r--r--sys/tmpfs/tmpfs_vnops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c
index ac93be1cf55..467b3f2b159 100644
--- a/sys/tmpfs/tmpfs_vnops.c
+++ b/sys/tmpfs/tmpfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmpfs_vnops.c,v 1.10 2013/12/14 18:01:52 espie Exp $ */
+/* $OpenBSD: tmpfs_vnops.c,v 1.11 2013/12/23 17:23:51 kettenis Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */
/*
@@ -765,7 +765,6 @@ tmpfs_link(void *v)
tmpfs_dirent_t *de;
int error;
- KASSERT(dvp != vp);
KASSERT(VOP_ISLOCKED(dvp));
if (vp->v_type == VDIR) {
@@ -774,6 +773,8 @@ tmpfs_link(void *v)
return EPERM;
}
+ KASSERT(dvp != vp);
+
if (dvp->v_mount != vp->v_mount) {
VOP_ABORTOP(dvp, cnp);
vput(dvp);