Module Name: src
Committed By: pooka
Date: Wed Mar 31 01:27:05 UTC 2010
Modified Files:
src/sys/miscfs/kernfs: kernfs_vnops.c
Log Message:
If msgbuf is not enabled, do not report the node in readdir. That
way ls -l won't report funny errors because getattr for a readdir
result fails.
XXX: lookup for msgbuf still succeeds even if not enabled
To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/sys/miscfs/kernfs/kernfs_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/miscfs/kernfs/kernfs_vnops.c
diff -u src/sys/miscfs/kernfs/kernfs_vnops.c:1.140 src/sys/miscfs/kernfs/kernfs_vnops.c:1.141
--- src/sys/miscfs/kernfs/kernfs_vnops.c:1.140 Fri Jan 22 22:46:00 2010
+++ src/sys/miscfs/kernfs/kernfs_vnops.c Wed Mar 31 01:27:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: kernfs_vnops.c,v 1.140 2010/01/22 22:46:00 njoly Exp $ */
+/* $NetBSD: kernfs_vnops.c,v 1.141 2010/03/31 01:27:05 pooka Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.140 2010/01/22 22:46:00 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.141 2010/03/31 01:27:05 pooka Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -1169,6 +1169,12 @@
!vfinddev(*dp, kt->kt_vtype, &fvp))
continue;
}
+ if (kt->kt_tag == KFSmsgbuf) {
+ if (!msgbufenabled
+ || msgbufp->msg_magic != MSG_MAGIC) {
+ continue;
+ }
+ }
d.d_namlen = kt->kt_namlen;
if ((error = kernfs_setdirentfileno(&d, i, kfs,
&kern_targets[0], kt, ap)) != 0)