From owner-p4-projects Thu Jul 11 21:27:22 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 95DF037B405; Thu, 11 Jul 2002 21:27:13 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD28837B400; Thu, 11 Jul 2002 21:27:12 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 061A343E42; Thu, 11 Jul 2002 21:27:12 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g6C4R7bM086547; Fri, 12 Jul 2002 00:27:07 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Fri, 12 Jul 2002 00:27:07 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Brian Feldman Cc: Perforce Change Reviews Subject: Re: PERFORCE change 14031 for review In-Reply-To: <200207101502.g6AF2GVj077852@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'm not sure this is a good idea -- you may have broken default labels on read-only multilabel file systems, since you've introduced a new failure mode. You've also introduced a write where previously we often did only a cached read... Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories On Wed, 10 Jul 2002, Brian Feldman wrote: > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14031 > > Change 14031 by green@green_laptop_2 on 2002/07/10 08:02:13 > > * Fix a bug where mac_update_vnode_from_externalized would _never_ > get called. (ALSO: LAZY INSTANTIATE ALL FREEBSD.MAC LABELS) > * Remove mac_create_vnode_from_exported() > > Affected files ... > > .. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#160 edit > .. //depot/projects/trustedbsd/mac/sys/sys/mac.h#109 edit > > Differences ... > > ==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#160 (text+ko) ==== > > @@ -917,10 +917,19 @@ > > case EOPNOTSUPP: > case ENOATTR: > - /* Use the label from the mountpoint. */ > + /* > + * Use the label from the mountpoint. Take this opportunity > + * to lazy-instantiate, just for correctness. > + */ > mac_update_vnode_from_mount(vp, vp->v_mount); > - return (0); > - > + error = mac_externalize(&vp->v_label, &extmac); > + if (error) > + return (error); > + error = vn_extattr_set(vp, IO_NODELOCKED, > + FREEBSD_MAC_EXTATTR_NAMESPACE, FREEBSD_MAC_EXTATTR_NAME, > + sizeof(extmac), (char *)&extmac, curthread); > + if (error == 0) > + break; > default: > /* Fail horribly. */ > return (error); > @@ -987,8 +996,7 @@ > * about doing this. > */ > mac_update_vnode_from_mount(vp, vp->v_mount); > - > - return (0); > + error = 0; > default: > return (error); > } > @@ -2216,16 +2224,6 @@ > child, &child->v_label); > } > > -void > -mac_create_vnode_from_exported(struct ucred *cred, struct vnode *vp, > - struct mac *extmac, struct label *intlabel) > -{ > - > - ASSERT_VOP_LOCKED(vp, "mac_create_vnode_from_exported"); > - > - MAC_PERFORM(create_vnode_from_exported, cred, vp, extmac, intlabel); > -} > - > int > mac_cred_check_statfs(struct ucred *cred, struct mount *mount) > { > > ==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#109 (text+ko) ==== > > @@ -326,8 +326,6 @@ > struct ucred *cred_child); > void mac_create_vnode_from_vnode(struct ucred *cred, struct vnode *parent, > struct vnode *child); > -void mac_create_vnode_from_exported(struct ucred *cred, struct vnode *vp, > - struct mac *extmac, struct label *intlabel); > void mac_set_socket_peer_from_mbuf(struct mbuf *mbuf, > struct socket *socket); > void mac_set_socket_peer_from_socket(struct socket *oldsocket, > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message