summaryrefslogtreecommitdiff
path: root/usr.sbin/pstat/pstat.c
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2006-03-27 14:08:15 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2006-03-27 14:08:15 +0000
commit9816d820572fc80dbd0398873da42ec03b4ce805 (patch)
tree8418a98f804711ca7398d0957aa2f77831484b58 /usr.sbin/pstat/pstat.c
parentc902506f243fb99d24b61b2abef5475bcb219d59 (diff)
Check for syncer vnodes before the file system specific routine gets
called, so that we handle NFS and ext2fs as well, okay deraadt@.
Diffstat (limited to 'usr.sbin/pstat/pstat.c')
-rw-r--r--usr.sbin/pstat/pstat.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index 8f7f4903603..98ad7306776 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pstat.c,v 1.61 2006/03/26 20:15:50 uwe Exp $ */
+/* $OpenBSD: pstat.c,v 1.62 2006/03/27 14:08:14 pedro Exp $ */
/* $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
from: static char sccsid[] = "@(#)pstat.c 8.9 (Berkeley) 2/16/94";
#else
-static char *rcsid = "$OpenBSD: pstat.c,v 1.61 2006/03/26 20:15:50 uwe Exp $";
+static char *rcsid = "$OpenBSD: pstat.c,v 1.62 2006/03/27 14:08:14 pedro Exp $";
#endif
#endif /* not lint */
@@ -260,6 +260,13 @@ vnodemode(void)
(void)printf("\n");
}
vnode_print(evp->vptr, vp);
+
+ /* Syncer vnodes have no associated fs-specific data */
+ if (vp->v_data == NULL) {
+ printf(" %6c %5c %7c\n", '-', '-', '-');
+ continue;
+ }
+
if (!strncmp(mp->mnt_stat.f_fstypename, MOUNT_FFS, MFSNAMELEN) ||
!strncmp(mp->mnt_stat.f_fstypename, MOUNT_MFS, MFSNAMELEN)) {
ufs_print(vp);
@@ -361,12 +368,6 @@ ufs_print(struct vnode *vp)
char *name;
mode_t type;
- /* Syncer vnodes have no associated inode/dinode. */
- if (VTOI(vp) == NULL) {
- printf(" %6c %5c %7c", '-', '-', '-');
- return (0);
- }
-
KGETRET(VTOI(vp), &inode, sizeof(struct inode), "vnode's inode");
KGETRET(inode.i_din1, &di1, sizeof(struct ufs1_dinode),
"vnode's dinode");