From c110b8e65e300f775fec37e865eabb495e8a03cf Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 17 Apr 2003 22:12:12 +0000 Subject: [PATCH] Add a proc lock assertion and move another assertion up to the top of the function. --- sys/fs/procfs/procfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index f6cab6a39b0..cec4df125d4 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -93,6 +93,9 @@ procfs_docurproc(PFS_FILL_ARGS) int procfs_attr(PFS_ATTR_ARGS) { + + PROC_LOCK_ASSERT(p, MA_OWNED); + /* XXX inefficient, split into separate functions */ if (p->p_flag & P_SUGID) vap->va_mode = 0; @@ -106,8 +109,6 @@ procfs_attr(PFS_ATTR_ARGS) strcmp(pn->pn_name, "fpregs") == 0) vap->va_mode = 0600; - /* p is locked by caller */ - PROC_LOCK_ASSERT(p, MA_OWNED); vap->va_uid = p->p_ucred->cr_uid; vap->va_gid = p->p_ucred->cr_gid; @@ -121,6 +122,7 @@ procfs_attr(PFS_ATTR_ARGS) int procfs_notsystem(PFS_VIS_ARGS) { + PROC_LOCK_ASSERT(p, MA_OWNED); return ((p->p_flag & P_SYSTEM) == 0); }