Simplify some leftover code and remove some old assertions.
Last year when I killed off some evil dirop-related macros, I added these assertions because if the things they asserted weren't true we'd be leaking vnodes. Well, it seems that the code at the time did leak vnodes, so certain failure cases (e.g. mkdir with disk full) would assert. Nobody apparently tripped on this in the past fourteen months, until I broke balloc so it always failed (unrelatedly) while working on some LFS64 changes. However, the vnode leak has since been removed by hannken@ as part of the vnode cache changes, so the assertions are now superfluous; instead, just make sure *vpp gets nulled on failure, and don't worry about whether or not VU_DIROP is set as it shouldn't matter any more. XXX: there's still a lot of gratuitous pointer aliasing in here that should be tidied away.
This commit is contained in:
parent
fa305bc80c
commit
6ad7a6672a
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_vnops.c,v 1.280 2015/08/02 18:12:59 dholland Exp $ */
|
||||
/* $NetBSD: lfs_vnops.c,v 1.281 2015/08/03 17:33:54 dholland Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
|
||||
@ -125,7 +125,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.280 2015/08/02 18:12:59 dholland Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.281 2015/08/03 17:33:54 dholland Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -687,13 +687,9 @@ out:
|
||||
UNMARK_VNODE(dvp);
|
||||
/* XXX: is it even possible for the symlink to get MARK'd? */
|
||||
UNMARK_VNODE(*vpp);
|
||||
if (!((*vpp)->v_uflag & VU_DIROP)) {
|
||||
KASSERT(error != 0);
|
||||
if (error) {
|
||||
*vpp = NULL;
|
||||
}
|
||||
else {
|
||||
KASSERT(error == 0);
|
||||
}
|
||||
lfs_unset_dirop(fs, dvp, "symlink");
|
||||
|
||||
vrele(dvp);
|
||||
@ -744,13 +740,6 @@ lfs_mknod(void *v)
|
||||
/* Either way we're done with the dirop at this point */
|
||||
UNMARK_VNODE(dvp);
|
||||
UNMARK_VNODE(*vpp);
|
||||
if (!((*vpp)->v_uflag & VU_DIROP)) {
|
||||
KASSERT(error != 0);
|
||||
*vpp = NULL;
|
||||
}
|
||||
else {
|
||||
KASSERT(error == 0);
|
||||
}
|
||||
lfs_unset_dirop(fs, dvp, "mknod");
|
||||
/*
|
||||
* XXX this is where this used to be (though inside some evil
|
||||
@ -843,13 +832,9 @@ out:
|
||||
|
||||
UNMARK_VNODE(dvp);
|
||||
UNMARK_VNODE(*vpp);
|
||||
if (!((*vpp)->v_uflag & VU_DIROP)) {
|
||||
KASSERT(error != 0);
|
||||
if (error) {
|
||||
*vpp = NULL;
|
||||
}
|
||||
else {
|
||||
KASSERT(error == 0);
|
||||
}
|
||||
lfs_unset_dirop(fs, dvp, "create");
|
||||
|
||||
vrele(dvp);
|
||||
@ -1018,13 +1003,9 @@ out:
|
||||
|
||||
UNMARK_VNODE(dvp);
|
||||
UNMARK_VNODE(*vpp);
|
||||
if (!((*vpp)->v_uflag & VU_DIROP)) {
|
||||
KASSERT(error != 0);
|
||||
if (error) {
|
||||
*vpp = NULL;
|
||||
}
|
||||
else {
|
||||
KASSERT(error == 0);
|
||||
}
|
||||
lfs_unset_dirop(fs, dvp, "mkdir");
|
||||
|
||||
vrele(dvp);
|
||||
|
Loading…
Reference in New Issue
Block a user