Module Name: src
Committed By: jmmv
Date: Sun Nov 22 17:09:58 UTC 2009
Modified Files:
src/sys/fs/tmpfs: tmpfs_vnops.c
Log Message:
Fix panic when trying to delete a directory entry (hi yamt!) by not
attempting to release a pnbuf that does not exist.
I.e. fixes "mkdir a ; unlink a/.". And actually, this was caught by the
automated tests.
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/fs/tmpfs/tmpfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.64 src/sys/fs/tmpfs/tmpfs_vnops.c:1.65
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.64 Sat Oct 17 22:20:56 2009
+++ src/sys/fs/tmpfs/tmpfs_vnops.c Sun Nov 22 17:09:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tmpfs_vnops.c,v 1.64 2009/10/17 22:20:56 njoly Exp $ */
+/* $NetBSD: tmpfs_vnops.c,v 1.65 2009/11/22 17:09:58 jmmv Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.64 2009/10/17 22:20:56 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.65 2009/11/22 17:09:58 jmmv Exp $");
#include <sys/param.h>
#include <sys/dirent.h>
@@ -728,7 +728,10 @@
vrele(dvp);
else
vput(dvp);
- PNBUF_PUT(cnp->cn_pnbuf);
+ if (cnp->cn_flags & HASBUF) {
+ PNBUF_PUT(cnp->cn_pnbuf);
+ cnp->cn_flags &= ~HASBUF;
+ }
return error;
}