summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_extattr.c7
-rw-r--r--sys/kern/vfs_syscalls.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index f89e8b9..1db5510 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -1765,6 +1765,10 @@ open(td, uap)
return 0;
}
+ /* assert that vn_open created a backing object if one is needed */
+ KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
+ ("open: vmio vnode has no backing object after vn_open"));
+
fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
@@ -1800,9 +1804,6 @@ open(td, uap)
if (error)
goto bad;
}
- /* assert that vn_open created a backing object if one is needed */
- KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
- ("open: vmio vnode has no backing object after vn_open"));
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index f89e8b9..1db5510 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1765,6 +1765,10 @@ open(td, uap)
return 0;
}
+ /* assert that vn_open created a backing object if one is needed */
+ KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
+ ("open: vmio vnode has no backing object after vn_open"));
+
fp->f_data = (caddr_t)vp;
fp->f_flag = flags & FMASK;
fp->f_ops = &vnops;
@@ -1800,9 +1804,6 @@ open(td, uap)
if (error)
goto bad;
}
- /* assert that vn_open created a backing object if one is needed */
- KASSERT(!vn_canvmio(vp) || VOP_GETVOBJECT(vp, NULL) == 0,
- ("open: vmio vnode has no backing object after vn_open"));
/*
* Release our private reference, leaving the one associated with
* the descriptor table intact.
OpenPOWER on IntegriCloud