From 095a7dd3b6dc97d27ba10169ab995ce6ed5eef78 Mon Sep 17 00:00:00 2001 From: pooka Date: Thu, 2 Apr 2009 11:33:04 +0000 Subject: [PATCH] Release tdvp in an appropriate VOP_RENAME error branch to avoid panic described in PR kern/40948. As usual, all the error branches in rename live based on an unholy amalgamation of prayer and the blood of cute, furry and tasty quadrupeds, so I won't even attempt to audit the rest. And this wapbl rename really really needs to be merged with the standard rename. That should be a fun PhD thesis topic .... --- sys/ufs/ufs/ufs_wapbl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ufs/ufs_wapbl.c b/sys/ufs/ufs/ufs_wapbl.c index 1616d6a5ccab..c2610c522bde 100644 --- a/sys/ufs/ufs/ufs_wapbl.c +++ b/sys/ufs/ufs/ufs_wapbl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_wapbl.c,v 1.5 2009/02/22 20:28:07 ad Exp $ */ +/* $NetBSD: ufs_wapbl.c,v 1.6 2009/04/02 11:33:04 pooka Exp $ */ /*- * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.5 2009/02/22 20:28:07 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.6 2009/04/02 11:33:04 pooka Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -357,6 +357,8 @@ wapbl_ufs_rename(void *v) } else { error = VOP_LOOKUP(fdvp, &fvp, fcnp); if (error && (error != EJUSTRETURN)) { + vput(ITOV(tdp)); + tdp = NULL; vrele(ap->a_fvp); goto out2; }