Date: Wed, 12 Nov 2003 14:28:22 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 42174 for review Message-ID: <200311122228.hACMSMSI026991@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=42174 Change 42174 by rwatson@rwatson_tislabs on 2003/11/12 14:28:05 Slide Giant a little more, whitespace synchronization to the version committed to the main FreeBSD source tree. Affected files ... .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#433 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#433 (text+ko) ==== @@ -553,6 +553,9 @@ return (0); } +/* + * MPSAFE + */ int __mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { @@ -751,7 +754,6 @@ case DTYPE_FIFO: case DTYPE_VNODE: vp = fp->f_vnode; - intlabel = mac_vnode_label_alloc(); mtx_lock(&Giant); /* VFS */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); @@ -762,9 +764,9 @@ buffer, mac.m_buflen); mac_vnode_label_free(intlabel); break; + case DTYPE_PIPE: pipe = fp->f_data; - intlabel = mac_pipe_label_alloc(); PIPE_LOCK(pipe); mac_copy_pipe_label(pipe->pipe_label, intlabel); @@ -773,12 +775,14 @@ buffer, mac.m_buflen); mac_pipe_label_free(intlabel); break; + default: error = EINVAL; } fdrop(fp, td); if (error == 0) error = copyout(buffer, mac.m_string, strlen(buffer)+1); + out: free(buffer, M_MACTEMP); free(elements, M_MACTEMP); @@ -937,16 +941,14 @@ mac_vnode_label_free(intlabel); break; } - vp = fp->f_vnode; mtx_lock(&Giant); /* VFS */ error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) { + mtx_unlock(&Giant); /* VFS */ mac_vnode_label_free(intlabel); - mtx_unlock(&Giant); /* VFS */ break; } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); error = vn_setlabel(vp, intlabel, td->td_ucred); VOP_UNLOCK(vp, 0, td);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311122228.hACMSMSI026991>