From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 13:14:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE33E106564A; Sun, 26 Dec 2010 13:14:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92DEF8FC08; Sun, 26 Dec 2010 13:14:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDEakO086823; Sun, 26 Dec 2010 13:14:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDEa2t086821; Sun, 26 Dec 2010 13:14:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261314.oBQDEa2t086821@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216704 - stable/8/sys/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 13:14:36 -0000 Author: kib Date: Sun Dec 26 13:14:36 2010 New Revision: 216704 URL: http://svn.freebsd.org/changeset/base/216704 Log: MFC r216454: VOP_ISLOCKED() should not be used to determine if the vnode is locked. Explicitely track the locked status of the vnode. Approved by: re (bz) Modified: stable/8/sys/nfsserver/nfs_serv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Sun Dec 26 13:05:43 2010 (r216703) +++ stable/8/sys/nfsserver/nfs_serv.c Sun Dec 26 13:14:36 2010 (r216704) @@ -3037,6 +3037,7 @@ nfsrv_readdirplus(struct nfsrv_descript struct vattr va, at, *vap = &va; struct nfs_fattr *fp; int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1; + int vp_locked; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ @@ -3067,10 +3068,12 @@ nfsrv_readdirplus(struct nfsrv_descript fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, &rdonly, TRUE); + vp_locked = 1; if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); vp = NULL; + vp_locked = 0; } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3090,6 +3093,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = nfsrv_access(vp, VEXEC, cred, rdonly, 0); if (error) { vput(vp); + vp_locked = 0; vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR); nfsm_srvpostop_attr(getret, &at); @@ -3097,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript goto nfsmout; } VOP_UNLOCK(vp, 0); + vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3110,6 +3115,7 @@ again: io.uio_td = NULL; eofflag = 0; vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3118,6 +3124,7 @@ again: off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); VOP_UNLOCK(vp, 0); + vp_locked = 0; if (!cookies && !error) error = NFSERR_PERM; if (!error) @@ -3238,8 +3245,10 @@ again: } else { cn.cn_flags &= ~ISDOTDOT; } - if (!VOP_ISLOCKED(vp)) + if (!vp_locked) { vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; + } if ((vp->v_vflag & VV_ROOT) != 0 && (cn.cn_flags & ISDOTDOT) != 0) { vref(vp); @@ -3342,7 +3351,7 @@ invalid: cookiep++; ncookies--; } - if (!usevget && VOP_ISLOCKED(vp)) + if (!usevget && vp_locked) vput(vp); else vrele(vp); From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 13:20:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC691065670; Sun, 26 Dec 2010 13:20:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE308FC0A; Sun, 26 Dec 2010 13:20:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDKAOr087014; Sun, 26 Dec 2010 13:20:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDKAxa087012; Sun, 26 Dec 2010 13:20:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261320.oBQDKAxa087012@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216705 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 13:20:10 -0000 Author: kib Date: Sun Dec 26 13:20:10 2010 New Revision: 216705 URL: http://svn.freebsd.org/changeset/base/216705 Log: MFC r216572: Restore the ABI of struct kinfo_proc32 after r213536. Approved by: re (bz) Modified: stable/8/sys/compat/freebsd32/freebsd32.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Sun Dec 26 13:14:36 2010 (r216704) +++ stable/8/sys/compat/freebsd32/freebsd32.h Sun Dec 26 13:20:10 2010 (r216705) @@ -323,6 +323,7 @@ struct kinfo_proc32 { uint32_t ki_pcb; uint32_t ki_kstack; uint32_t ki_udata; + uint32_t ki_tdaddr; uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */ int ki_sparelongs[KI_NSPARE_LONG]; int ki_sflag; From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 13:57:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46A5106564A; Sun, 26 Dec 2010 13:57:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3B398FC13; Sun, 26 Dec 2010 13:57:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDv5Xl087987; Sun, 26 Dec 2010 13:57:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDv5Sr087985; Sun, 26 Dec 2010 13:57:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261357.oBQDv5Sr087985@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216708 - stable/8/sbin/newfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 13:57:06 -0000 Author: kib Date: Sun Dec 26 13:57:05 2010 New Revision: 216708 URL: http://svn.freebsd.org/changeset/base/216708 Log: MFC r216453: Add the missed 'p' flag to getopt() optstring argument. Approved by: re (bz) Modified: stable/8/sbin/newfs/newfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.c ============================================================================== --- stable/8/sbin/newfs/newfs.c Sun Dec 26 13:41:53 2010 (r216707) +++ stable/8/sbin/newfs/newfs.c Sun Dec 26 13:57:05 2010 (r216708) @@ -136,7 +136,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) switch (ch) { case 'E': Eflag = 1; From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 14:09:06 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711DE1065670; Sun, 26 Dec 2010 14:09:06 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF8D8FC08; Sun, 26 Dec 2010 14:09:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQE96j5088406; Sun, 26 Dec 2010 14:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQE96n5088404; Sun, 26 Dec 2010 14:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012261409.oBQE96n5088404@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 26 Dec 2010 14:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216709 - stable/8/sys/dev/wpi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 14:09:06 -0000 Author: bschmidt Date: Sun Dec 26 14:09:06 2010 New Revision: 216709 URL: http://svn.freebsd.org/changeset/base/216709 Log: MFC r216557: Fix panic while trying to use monitor mode. The iwn_cmd() calls issued by iwn_config() want to msleep() on the mutex. PR: kern/138427 Submitted by: Henry Hu Approved by: re (kib) Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sun Dec 26 13:57:05 2010 (r216708) +++ stable/8/sys/dev/wpi/if_wpi.c Sun Dec 26 14:09:06 2010 (r216709) @@ -3561,7 +3561,9 @@ wpi_set_channel(struct ieee80211com *ic) * are already taken care of by their respective firmware commands. */ if (ic->ic_opmode == IEEE80211_M_MONITOR) { + WPI_LOCK(sc); error = wpi_config(sc); + WPI_UNLOCK(sc); if (error != 0) device_printf(sc->sc_dev, "error %d settting channel\n", error); From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 17:21:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CBB106566B; Sun, 26 Dec 2010 17:21:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F738FC0C; Sun, 26 Dec 2010 17:21:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQHLl6w093787; Sun, 26 Dec 2010 17:21:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQHLlwH093785; Sun, 26 Dec 2010 17:21:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012261721.oBQHLlwH093785@svn.freebsd.org> From: Michael Tuexen Date: Sun, 26 Dec 2010 17:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216714 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 17:21:48 -0000 Author: tuexen Date: Sun Dec 26 17:21:47 2010 New Revision: 216714 URL: http://svn.freebsd.org/changeset/base/216714 Log: MFC c216502: Fix a flightsize bug related to the processing of PKTDRP reports. Approved by: re Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Dec 26 15:15:28 2010 (r216713) +++ stable/8/sys/netinet/sctp_input.c Sun Dec 26 17:21:47 2010 (r216714) @@ -3156,7 +3156,6 @@ process_chunk_drop(struct sctp_tcb *stcb SCTP_STAT_INCR(sctps_pdrpmark); if (tp1->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - tp1->sent = SCTP_DATAGRAM_RESEND; /* * mark it as if we were doing a FR, since * we will be getting gap ack reports behind @@ -3191,6 +3190,7 @@ process_chunk_drop(struct sctp_tcb *stcb sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); } + tp1->sent = SCTP_DATAGRAM_RESEND; } { /* audit code */ unsigned int audit; From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 26 18:15:18 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D277106564A; Sun, 26 Dec 2010 18:15:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3CE8FC14; Sun, 26 Dec 2010 18:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQIFItc095388; Sun, 26 Dec 2010 18:15:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQIFI4P095386; Sun, 26 Dec 2010 18:15:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201012261815.oBQIFI4P095386@svn.freebsd.org> From: Andrew Thompson Date: Sun, 26 Dec 2010 18:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216718 - stable/8/sys/dev/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 18:15:18 -0000 Author: thompsa Date: Sun Dec 26 18:15:18 2010 New Revision: 216718 URL: http://svn.freebsd.org/changeset/base/216718 Log: MFC r216249 Re-add a status check which sneaked out during r214804. This change can fix some USB error messages showing up during bootup. Approved by: re (kib) Modified: stable/8/sys/dev/usb/usb_request.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Sun Dec 26 18:12:13 2010 (r216717) +++ stable/8/sys/dev/usb/usb_request.c Sun Dec 26 18:15:18 2010 (r216718) @@ -793,6 +793,10 @@ usbd_req_reset_port(struct usb_device *u if (err) { goto done; } + /* if the device disappeared, just give up */ + if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + goto done; + } /* check if reset is complete */ if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) { break; From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 06:59:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD921065672; Mon, 27 Dec 2010 06:59:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3D88FC0A; Mon, 27 Dec 2010 06:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBR6xxUi014145; Mon, 27 Dec 2010 06:59:59 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBR6xxYv014142; Mon, 27 Dec 2010 06:59:59 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012270659.oBR6xxYv014142@svn.freebsd.org> From: Oleg Bulyzhin Date: Mon, 27 Dec 2010 06:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216730 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 06:59:59 -0000 Author: oleg Date: Mon Dec 27 06:59:59 2010 New Revision: 216730 URL: http://svn.freebsd.org/changeset/base/216730 Log: MFC r203548: Propagate the vlan events to the underlying interfaces/members so they can do initialization of hw related features. PR: kern/141646 Modified: stable/8/sys/net/if_lagg.c stable/8/sys/net/if_lagg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Mon Dec 27 05:47:24 2010 (r216729) +++ stable/8/sys/net/if_lagg.c Mon Dec 27 06:59:59 2010 (r216730) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -204,6 +205,50 @@ static moduledata_t lagg_mod = { DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +#if __FreeBSD_version >= 800000 +/* + * This routine is run via an vlan + * config EVENT + */ +static void +lagg_register_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} + +/* + * This routine is run via an vlan + * unconfig EVENT + */ +static void +lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} +#endif + static int lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) { @@ -259,6 +304,13 @@ lagg_clone_create(struct if_clone *ifc, */ ether_ifattach(ifp, eaddr); +#if __FreeBSD_version >= 800000 + sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, + lagg_register_vlan, sc, EVENTHANDLER_PRI_FIRST); + sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, + lagg_unregister_vlan, sc, EVENTHANDLER_PRI_FIRST); +#endif + /* Insert into the global list of laggs */ mtx_lock(&lagg_list_mtx); SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); @@ -278,6 +330,11 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_stop(sc); ifp->if_flags &= ~IFF_UP; +#if __FreeBSD_version >= 800000 + EVENTHANDLER_DEREGISTER(vlan_config, sc->vlan_attach); + EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); +#endif + /* Shutdown and remove lagg ports */ while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) lagg_port_destroy(lp, 1); Modified: stable/8/sys/net/if_lagg.h ============================================================================== --- stable/8/sys/net/if_lagg.h Mon Dec 27 05:47:24 2010 (r216729) +++ stable/8/sys/net/if_lagg.h Mon Dec 27 06:59:59 2010 (r216730) @@ -198,6 +198,10 @@ struct lagg_softc { void (*sc_lladdr)(struct lagg_softc *); void (*sc_req)(struct lagg_softc *, caddr_t); void (*sc_portreq)(struct lagg_port *, caddr_t); +#if __FreeBSD_version >= 800000 + eventhandler_tag vlan_attach; + eventhandler_tag vlan_detach; +#endif }; struct lagg_port { From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 12:39:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455A4106566B; Mon, 27 Dec 2010 12:39:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304728FC0C; Mon, 27 Dec 2010 12:39:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCdP5k024531; Mon, 27 Dec 2010 12:39:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCdOZ5024516; Mon, 27 Dec 2010 12:39:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271239.oBRCdOZ5024516@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216734 - in stable/8: contrib/binutils/bfd contrib/binutils/binutils contrib/binutils/include/elf contrib/file contrib/gdb/gdb gnu/usr.bin/gdb/libgdb sys/compat/freebsd32 sys/kern sys/... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 12:39:25 -0000 Author: attilio Date: Mon Dec 27 12:39:24 2010 New Revision: 216734 URL: http://svn.freebsd.org/changeset/base/216734 Log: MFC r215679: Add the ability for GDB to printout the thread name along with other thread specific informations. In order to achieve that, for both on-line debugging and core analysis, a new member to PT_LWPINFO ptrace(2) interface is added and a new ELF note (NT_THRMISC) as well. Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/binutils/bfd/elf-bfd.h stable/8/contrib/binutils/bfd/elf.c stable/8/contrib/binutils/binutils/readelf.c stable/8/contrib/binutils/include/elf/common.h stable/8/contrib/file/readelf.h stable/8/contrib/gdb/gdb/fbsd-proc.c stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c stable/8/sys/compat/freebsd32/freebsd32.h stable/8/sys/kern/imgact_elf.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/elf_common.h stable/8/sys/sys/procfs.h stable/8/sys/sys/ptrace.h stable/8/usr.bin/gcore/elfcore.c Directory Properties: stable/8/contrib/binutils/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/contrib/binutils/bfd/elf-bfd.h ============================================================================== --- stable/8/contrib/binutils/bfd/elf-bfd.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/bfd/elf-bfd.h Mon Dec 27 12:39:24 2010 (r216734) @@ -1673,6 +1673,8 @@ extern char * elfcore_write_pstatus (bfd *, char *, int *, long, int, const void *); extern char *elfcore_write_prfpreg (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_thrmisc + (bfd *, char *, int *, const char *, int); extern char *elfcore_write_prxfpreg (bfd *, char *, int *, const void *, int); extern char *elfcore_write_lwpstatus Modified: stable/8/contrib/binutils/bfd/elf.c ============================================================================== --- stable/8/contrib/binutils/bfd/elf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/bfd/elf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -6316,6 +6316,12 @@ _bfd_elf_rel_vtable_reloc_fn #ifdef HAVE_SYS_PROCFS_H # include + +/* Define HAVE_THRMISC_T for consistency with other similar GNU-type stubs. */ +#undef HAVE_THRMISC_T +#if defined (THRMISC_VERSION) +#define HAVE_THRMISC_T 1 +#endif #endif /* FIXME: this is kinda wrong, but it's what gdb wants. */ @@ -6497,6 +6503,16 @@ elfcore_grok_prxfpreg (bfd *abfd, Elf_In return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note); } +#if defined (HAVE_THRMISC_T) + +static bfd_boolean +elfcore_grok_thrmisc (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".tname", note); +} + +#endif /* defined (HAVE_THRMISC_T) */ + #if defined (HAVE_PRPSINFO_T) typedef prpsinfo_t elfcore_psinfo_t; #if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ @@ -6863,6 +6879,12 @@ elfcore_grok_note (bfd *abfd, Elf_Intern return TRUE; } + +#if defined (HAVE_THRMISC_T) + case NT_THRMISC: + return elfcore_grok_thrmisc (abfd, note); +#endif + } } @@ -7245,6 +7267,22 @@ elfcore_write_prfpreg (bfd *abfd, } char * +elfcore_write_thrmisc (bfd *abfd, + char *buf, + int *bufsiz, + const char *tname, + int size) +{ +#if defined (HAVE_THRMISC_T) + char *note_name = "CORE"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_THRMISC, tname, size); +#else + return buf; +#endif +} + +char * elfcore_write_prxfpreg (bfd *abfd, char *buf, int *bufsiz, Modified: stable/8/contrib/binutils/binutils/readelf.c ============================================================================== --- stable/8/contrib/binutils/binutils/readelf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/binutils/readelf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -9908,6 +9908,7 @@ get_note_type (unsigned e_type) case NT_PSTATUS: return _("NT_PSTATUS (pstatus structure)"); case NT_FPREGS: return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); + case NT_THRMISC: return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: return _("NT_LWPSINFO (lwpsinfo_t structure)"); case NT_WIN32PSTATUS: return _("NT_WIN32PSTATUS (win32_pstatus structure)"); Modified: stable/8/contrib/binutils/include/elf/common.h ============================================================================== --- stable/8/contrib/binutils/include/elf/common.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/include/elf/common.h Mon Dec 27 12:39:24 2010 (r216734) @@ -366,6 +366,7 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ Modified: stable/8/contrib/file/readelf.h ============================================================================== --- stable/8/contrib/file/readelf.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/file/readelf.h Mon Dec 27 12:39:24 2010 (r216734) @@ -224,6 +224,7 @@ typedef struct { #define NT_TASKSTRUCT 4 #define NT_PLATFORM 5 #define NT_AUXV 6 +#define NT_THRMISC 7 /* Note types used in executables */ /* NetBSD executables (name = "NetBSD") */ Modified: stable/8/contrib/gdb/gdb/fbsd-proc.c ============================================================================== --- stable/8/contrib/gdb/gdb/fbsd-proc.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/gdb/gdb/fbsd-proc.c Mon Dec 27 12:39:24 2010 (r216734) @@ -124,6 +124,7 @@ fbsd_make_corefile_notes (bfd *obfd, int fpregset_t fpregs; char *note_data = NULL; Elf_Internal_Ehdr *i_ehdrp; + char fakename; /* Put a "FreeBSD" label in the ELF header. */ i_ehdrp = elf_elfheader (obfd); @@ -138,6 +139,10 @@ fbsd_make_corefile_notes (bfd *obfd, int note_data = elfcore_write_prfpreg (obfd, note_data, note_size, &fpregs, sizeof (fpregs)); + fakename = '\0'; + note_data = elfcore_write_thrmisc (obfd, note_data, note_size, + &fakename, sizeof (fakename)); + if (get_exec_file (0)) { char *fname = strrchr (get_exec_file (0), '/') + 1; Modified: stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon Dec 27 12:39:24 2010 (r216734) @@ -426,6 +426,46 @@ fbsd_thread_deactivate (void) init_thread_list (); } +static char * +fbsd_thread_get_name (lwpid_t lwpid) +{ + static char last_thr_name[MAXCOMLEN + 1]; + char section_name[32]; + struct ptrace_lwpinfo lwpinfo; + bfd_size_type size; + struct bfd_section *section; + + if (target_has_execution) + { + if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1) + goto fail; + strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1); + } + else + { + snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid); + section = bfd_get_section_by_name (core_bfd, section_name); + if (! section) + goto fail; + + /* Section size fix-up. */ + size = bfd_section_size (core_bfd, section); + if (size > sizeof (last_thr_name)) + size = sizeof (last_thr_name); + + if (! bfd_get_section_contents (core_bfd, section, last_thr_name, + (file_ptr)0, size)) + goto fail; + if (last_thr_name[0] == '\0') + goto fail; + } + last_thr_name[sizeof (last_thr_name) - 1] = '\0'; + return last_thr_name; +fail: + strcpy (last_thr_name, ""); + return last_thr_name; +} + static void fbsd_thread_new_objfile (struct objfile *objfile) { @@ -1158,7 +1198,7 @@ fbsd_thread_find_new_threads (void) static char * fbsd_thread_pid_to_str (ptid_t ptid) { - static char buf[64]; + static char buf[64 + MAXCOMLEN]; if (IS_THREAD (ptid)) { @@ -1178,8 +1218,9 @@ fbsd_thread_pid_to_str (ptid_t ptid) if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", - (unsigned long long)th.th_thread, ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)", + (unsigned long long)th.th_thread, ti.ti_lid, + fbsd_thread_get_name (ti.ti_lid)); } else { Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/compat/freebsd32/freebsd32.h Mon Dec 27 12:39:24 2010 (r216734) @@ -240,6 +240,11 @@ struct prpsinfo32 { char pr_psargs[PRARGSZ+1]; }; +struct thrmisc32 { + char pr_tname[MAXCOMLEN+1]; + u_int _pad; +}; + struct mq_attr32 { int mq_flags; int mq_maxmsg; Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/kern/imgact_elf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -1213,12 +1213,14 @@ typedef struct prpsinfo32 elf_prpsinfo_t typedef struct fpreg32 elf_prfpregset_t; typedef struct fpreg32 elf_fpregset_t; typedef struct reg32 elf_gregset_t; +typedef struct thrmisc32 elf_thrmisc_t; #else typedef prstatus_t elf_prstatus_t; typedef prpsinfo_t elf_prpsinfo_t; typedef prfpregset_t elf_prfpregset_t; typedef prfpregset_t elf_fpregset_t; typedef gregset_t elf_gregset_t; +typedef thrmisc_t elf_thrmisc_t; #endif static void @@ -1228,10 +1230,12 @@ __elfN(puthdr)(struct thread *td, void * elf_prstatus_t status; elf_prfpregset_t fpregset; elf_prpsinfo_t psinfo; + elf_thrmisc_t thrmisc; } *tempdata; elf_prstatus_t *status; elf_prfpregset_t *fpregset; elf_prpsinfo_t *psinfo; + elf_thrmisc_t *thrmisc; struct proc *p; struct thread *thr; size_t ehoff, noteoff, notesz, phoff; @@ -1254,11 +1258,13 @@ __elfN(puthdr)(struct thread *td, void * status = &tempdata->status; fpregset = &tempdata->fpregset; psinfo = &tempdata->psinfo; + thrmisc = &tempdata->thrmisc; } else { tempdata = NULL; status = NULL; fpregset = NULL; psinfo = NULL; + thrmisc = NULL; } if (dst != NULL) { @@ -1298,11 +1304,15 @@ __elfN(puthdr)(struct thread *td, void * fill_regs(thr, &status->pr_reg); fill_fpregs(thr, fpregset); #endif + memset(&thrmisc->_pad, 0, sizeof (thrmisc->_pad)); + strcpy(thrmisc->pr_tname, thr->td_name); } __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, sizeof *status); __elfN(putnote)(dst, off, "FreeBSD", NT_FPREGSET, fpregset, sizeof *fpregset); + __elfN(putnote)(dst, off, "FreeBSD", NT_THRMISC, thrmisc, + sizeof *thrmisc); /* * Allow for MD specific notes, as well as any MD * specific preparations for writing MI notes. Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/kern/sys_process.c Mon Dec 27 12:39:24 2010 (r216734) @@ -92,6 +92,7 @@ struct ptrace_lwpinfo32 { sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct siginfo32 pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ }; #endif @@ -517,6 +518,7 @@ ptrace_lwpinfo_to32(const struct ptrace_ pl32->pl_sigmask = pl->pl_sigmask; pl32->pl_siglist = pl->pl_siglist; siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); + strcpy(pl32->pl_tdname, pl->pl_tdname); } #endif /* COMPAT_FREEBSD32 */ @@ -1172,6 +1174,7 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_EXEC; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; + strcpy(pl->pl_tdname, td2->td_name); #ifdef COMPAT_FREEBSD32 if (wrap32) ptrace_lwpinfo_to32(pl, pl32); Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/elf_common.h Mon Dec 27 12:39:24 2010 (r216734) @@ -480,6 +480,7 @@ typedef struct { #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ #define NT_PRPSINFO 3 /* Process state info. */ +#define NT_THRMISC 7 /* Thread miscellaneous info. */ /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ Modified: stable/8/sys/sys/procfs.h ============================================================================== --- stable/8/sys/sys/procfs.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/procfs.h Mon Dec 27 12:39:24 2010 (r216734) @@ -80,6 +80,13 @@ typedef struct prpsinfo { char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ } prpsinfo_t; +#define THRMISC_VERSION 1 /* Current version of thrmisc_t */ + +typedef struct thrmisc { + char pr_tname[MAXCOMLEN+1]; /* Thread name, null terminated (1) */ + u_int _pad; /* Convenience pad, 0-filled (1) */ +} thrmisc_t; + typedef uint64_t psaddr_t; /* An address in the target process. */ #endif /* _SYS_PROCFS_H_ */ Modified: stable/8/sys/sys/ptrace.h ============================================================================== --- stable/8/sys/sys/ptrace.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/ptrace.h Mon Dec 27 12:39:24 2010 (r216734) @@ -34,6 +34,7 @@ #define _SYS_PTRACE_H_ #include +#include #include #define PT_TRACE_ME 0 /* child declares it's being traced */ @@ -106,6 +107,7 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name */ }; /* Argument structure for PT_VM_ENTRY. */ Modified: stable/8/usr.bin/gcore/elfcore.c ============================================================================== --- stable/8/usr.bin/gcore/elfcore.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/usr.bin/gcore/elfcore.c Mon Dec 27 12:39:24 2010 (r216734) @@ -284,10 +284,12 @@ elf_getstatus(pid_t pid, prpsinfo_t *psi static void elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct ptrace_lwpinfo lwpinfo; struct { prstatus_t status; prfpregset_t fpregset; prpsinfo_t psinfo; + thrmisc_t thrmisc; } *tempdata; size_t ehoff; size_t phoff; @@ -300,6 +302,7 @@ elf_puthdr(pid_t pid, vm_map_entry_t map prstatus_t *status; prfpregset_t *fpregset; prpsinfo_t *psinfo; + thrmisc_t *thrmisc; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -315,11 +318,13 @@ elf_puthdr(pid_t pid, vm_map_entry_t map status = &tempdata->status; fpregset = &tempdata->fpregset; psinfo = &tempdata->psinfo; + thrmisc = &tempdata->thrmisc; } else { tempdata = NULL; status = NULL; fpregset = NULL; psinfo = NULL; + thrmisc = NULL; } errno = 0; @@ -356,11 +361,17 @@ elf_puthdr(pid_t pid, vm_map_entry_t map ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + ptrace(PT_LWPINFO, tids[i], (void *)&lwpinfo, + sizeof(lwpinfo)); + memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); + strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); } elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, sizeof *status); elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, sizeof *fpregset); + elf_putnote(dst, off, "FreeBSD", NT_THRMISC, thrmisc, + sizeof *thrmisc); } notesz = *off - noteoff; From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 12:52:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE49106564A; Mon, 27 Dec 2010 12:52:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED0938FC16; Mon, 27 Dec 2010 12:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCqZlw024968; Mon, 27 Dec 2010 12:52:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCqZLG024965; Mon, 27 Dec 2010 12:52:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271252.oBRCqZLG024965@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216735 - stable/8/sys/dev/ichwd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 12:52:36 -0000 Author: attilio Date: Mon Dec 27 12:52:35 2010 New Revision: 216735 URL: http://svn.freebsd.org/changeset/base/216735 Log: MFC r215868, 215918, 216266, 216298: - Advertise when the reboot came from a watchdog-induced reset - Fix a bug where TCO_BOOT_STS was supposed to be cleared after TCO_SECOND_TO_STS - Use macros for max and min value capping when re-arming the watchdog timeout Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/ichwd/ichwd.c stable/8/sys/dev/ichwd/ichwd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.c Mon Dec 27 12:39:24 2010 (r216734) +++ stable/8/sys/dev/ichwd/ichwd.c Mon Dec 27 12:52:35 2010 (r216735) @@ -179,12 +179,12 @@ ichwd_sts_reset(struct ichwd_softc *sc) * by writing a 1, not a 0. */ ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT); - /* - * XXX The datasheet says that TCO_SECOND_TO_STS must be cleared - * before TCO_BOOT_STS, not the other way around. + /* + * According to Intel's docs, clearing SECOND_TO_STS and BOOT_STS must + * be done in two separate operations. */ - ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); + ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); } /* @@ -242,30 +242,23 @@ static __inline void ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout) { - /* - * If the datasheets are to be believed, the minimum value - * actually varies from chipset to chipset - 4 for ICH5 and 2 for - * all other chipsets. I suspect this is a bug in the ICH5 - * datasheet and that the minimum is uniformly 2, but I'd rather - * err on the side of caution. - */ - if (timeout < 4) - timeout = 4; + if (timeout < TCO_RLD_TMR_MIN) + timeout = TCO_RLD_TMR_MIN; if (sc->ich_version <= 5) { uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1); - tmr_val8 &= 0xc0; - if (timeout > 0x3f) - timeout = 0x3f; + tmr_val8 &= (~TCO_RLD1_TMR_MAX & 0xff); + if (timeout > TCO_RLD1_TMR_MAX) + timeout = TCO_RLD1_TMR_MAX; tmr_val8 |= timeout; ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8); } else { uint16_t tmr_val16 = ichwd_read_tco_2(sc, TCO_TMR2); - tmr_val16 &= 0xfc00; - if (timeout > 0x03ff) - timeout = 0x03ff; + tmr_val16 &= (~TCO_RLD2_TMR_MAX & 0xffff); + if (timeout > TCO_RLD2_TMR_MAX) + timeout = TCO_RLD2_TMR_MAX; tmr_val16 |= timeout; ichwd_write_tco_2(sc, TCO_TMR2, tmr_val16); } @@ -474,11 +467,13 @@ ichwd_attach(device_t dev) device_get_desc(dev), sc->ich_version); /* - * XXX we should check the status registers (specifically, the - * TCO_SECOND_TO_STS bit in the TCO2_STS register) to see if we - * just came back from a watchdog-induced reset, and let the user - * know. + * Determine if we are coming up after a watchdog-induced reset. Some + * BIOSes may clear this bit at bootup, preventing us from reporting + * this case on such systems. We clear this bit in ichwd_sts_reset(). */ + if ((ichwd_read_tco_2(sc, TCO2_STS) & TCO_SECOND_TO_STS) != 0) + device_printf(dev, + "resuming after hardware watchdog timeout\n"); /* reset the watchdog status registers */ ichwd_sts_reset(sc); Modified: stable/8/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.h Mon Dec 27 12:39:24 2010 (r216734) +++ stable/8/sys/dev/ichwd/ichwd.h Mon Dec 27 12:52:35 2010 (r216735) @@ -153,6 +153,17 @@ struct ichwd_softc { #define TCO_TMR_HALT 0x0800 /* clear to enable WDT */ #define TCO_CNT_PRESERVE 0x0200 /* preserve these bits */ +/* + * Masks for the TCO timer value field in TCO_RLD. + * If the datasheets are to be believed, the minimum value actually varies + * from chipset to chipset - 4 for ICH5 and 2 for all other chipsets. + * I suspect this is a bug in the ICH5 datasheet and that the minimum is + * uniformly 2, but I'd rather err on the side of caution. + */ +#define TCO_RLD_TMR_MIN 0x0004 +#define TCO_RLD1_TMR_MAX 0x003f +#define TCO_RLD2_TMR_MAX 0x03ff + /* approximate length in nanoseconds of one WDT tick (about 0.6 sec) */ #define ICHWD_TICK 600000000 From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 12:57:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FFA31065674; Mon, 27 Dec 2010 12:57:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ECAC8FC1C; Mon, 27 Dec 2010 12:57:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCvdg3025117; Mon, 27 Dec 2010 12:57:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCvdet025115; Mon, 27 Dec 2010 12:57:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271257.oBRCvdet025115@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216736 - stable/8/sys/dev/puc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 12:57:39 -0000 Author: attilio Date: Mon Dec 27 12:57:38 2010 New Revision: 216736 URL: http://svn.freebsd.org/changeset/base/216736 Log: MFC r216513: Add Exar octal PCI UART. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Mon Dec 27 12:52:35 2010 (r216735) +++ stable/8/sys/dev/puc/pucdata.c Mon Dec 27 12:57:38 2010 (r216736) @@ -554,6 +554,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_cronyx }, + { 0x13a8, 0x0258, 0xffff, 0, + "Exar XR17V258IV", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 16:01:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F59F1065693; Mon, 27 Dec 2010 16:01:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336808FC0A; Mon, 27 Dec 2010 16:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRG1enK029994; Mon, 27 Dec 2010 16:01:40 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRG1e7D029991; Mon, 27 Dec 2010 16:01:40 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201012271601.oBRG1e7D029991@svn.freebsd.org> From: Hiroki Sato Date: Mon, 27 Dec 2010 16:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216739 - in stable/8: etc sbin/route X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 16:01:40 -0000 Author: hrs Date: Mon Dec 27 16:01:39 2010 New Revision: 216739 URL: http://svn.freebsd.org/changeset/base/216739 Log: - route(8) manual page update: no longer supports RTF_CLONING and RTF_LLINFO (MFC from r196833) - Remove -cloning flag from network.subr[*] PR: conf/144842 [*] Approved by: re (bz) Modified: stable/8/etc/network.subr stable/8/sbin/route/route.8 Directory Properties: stable/8/sbin/route/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Mon Dec 27 15:57:41 2010 (r216738) +++ stable/8/etc/network.subr Mon Dec 27 16:01:39 2010 (r216739) @@ -1134,8 +1134,7 @@ network6_default_interface_setup() ;; *) laddr=`network6_getladdr ${ipv6_default_interface}` - route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \ - -cloning + route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface # Disable installing the default interface with the # case net.inet6.ip6.forwarding=0 and Modified: stable/8/sbin/route/route.8 ============================================================================== --- stable/8/sbin/route/route.8 Mon Dec 27 15:57:41 2010 (r216738) +++ stable/8/sbin/route/route.8 Mon Dec 27 16:01:39 2010 (r216739) @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd October 2, 2005 +.Dd December 17, 2010 .Dt ROUTE 8 .Os .Sh NAME @@ -279,7 +279,6 @@ when sending to destinations matched by These flags may be set (or sometimes cleared) by indicating the following corresponding modifiers: .Bd -literal --cloning RTF_CLONING - generates a new route on use -xresolve RTF_XRESOLVE - emit mesg on use (for external lookup) -iface ~RTF_GATEWAY - destination is directly reachable -static RTF_STATIC - manually added route @@ -288,7 +287,6 @@ by indicating the following correspondin -blackhole RTF_BLACKHOLE - silently discard pkts (during updates) -proto1 RTF_PROTO1 - set protocol specific routing flag #1 -proto2 RTF_PROTO2 - set protocol specific routing flag #2 --llinfo RTF_LLINFO - validly translates proto addr to link addr .Ed .Pp The optional modifiers @@ -326,25 +324,6 @@ or .Fl ifa modifiers may be used to determine the interface or interface address. .Pp -The optional -.Fl proxy -modifier specifies that the -.Dv RTF_LLINFO -routing table entry is the -.Dq published (proxy-only) -.Tn ARP -entry, as reported by -.Xr arp 8 . -.Pp -The optional -.Fl genmask -modifier specifies that a cloning mask is present. -This specifies the mask applied when determining if a child route -should be created. -It is only applicable to network routes with the -.Dv RTF_CLONING -flag set. -.Pp All symbolic names specified for a .Ar destination or From owner-svn-src-stable-8@FreeBSD.ORG Mon Dec 27 23:46:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD101065672; Mon, 27 Dec 2010 23:46:48 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD728FC18; Mon, 27 Dec 2010 23:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRNklCd040083; Mon, 27 Dec 2010 23:46:47 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRNklbL040080; Mon, 27 Dec 2010 23:46:47 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201012272346.oBRNklbL040080@svn.freebsd.org> From: Garrett Wollman Date: Mon, 27 Dec 2010 23:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216745 - stable/8/usr.bin/locate/locate X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2010 23:46:48 -0000 Author: wollman Date: Mon Dec 27 23:46:47 2010 New Revision: 216745 URL: http://svn.freebsd.org/changeset/base/216745 Log: Merge three revisions from head: r214583 | wollman | 2010-10-30 22:36:05 -0400 (Sat, 30 Oct 2010) | 6 lines Changed paths: M /head/usr.bin/locate/locate/locate.rc M /head/usr.bin/locate/locate/updatedb.sh Make it possible to exclude directories by name no matter where they are in the filesystem from the locate database. By default, exclude ".zfs" directories, as users who who have set snapdir=visible and are taking frequent snapshots most likely do not want the snapshots included in the locate database. ------------------------------------------------------------------------ r214613 | wollman | 2010-10-31 21:51:47 -0400 (Sun, 31 Oct 2010) | 7 lines Changed paths: M /head/usr.bin/locate/locate/updatedb.sh jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh made it impossible to override PRUNEDIRS to make it empty. Use the non-colon form to only set PRUNEDIRS if it is completely unset. (For parallelism, the other configuration defaults here could be done the same way, but that could be more obviously accomplished by disabling updatedb in periodic.conf, so leave them alone for now.) ------------------------------------------------------------------------ r214615 | wollman | 2010-10-31 22:20:18 -0400 (Sun, 31 Oct 2010) | 6 lines Changed paths: M /head/usr.bin/locate/locate/updatedb.sh Style cleanup: make this look more like a 21st-century shell script and not something out of the early 1980s. Make sure all error messages go to stderr, not stdout. Since there's error-handling code to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization form that allows this error to be diagnosed. (hat tip: jilles@) Modified: stable/8/usr.bin/locate/locate/locate.rc stable/8/usr.bin/locate/locate/updatedb.sh Directory Properties: stable/8/usr.bin/locate/ (props changed) Modified: stable/8/usr.bin/locate/locate/locate.rc ============================================================================== --- stable/8/usr.bin/locate/locate/locate.rc Mon Dec 27 22:52:47 2010 (r216744) +++ stable/8/usr.bin/locate/locate/locate.rc Mon Dec 27 23:46:47 2010 (r216745) @@ -15,9 +15,12 @@ # directories to be put in the database #SEARCHPATHS="/" -# directories unwanted in output +# paths unwanted in output #PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +# directories unwanted in output +#PRUNEDIRS=".zfs" + # filesystems allowed. Beware: a non-listed filesystem will be pruned # and if the SEARCHPATHS starts in such a filesystem locate will build # an empty database. Modified: stable/8/usr.bin/locate/locate/updatedb.sh ============================================================================== --- stable/8/usr.bin/locate/locate/updatedb.sh Mon Dec 27 22:52:47 2010 (r216744) +++ stable/8/usr.bin/locate/locate/updatedb.sh Mon Dec 27 23:46:47 2010 (r216745) @@ -50,17 +50,20 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database -: ${SEARCHPATHS:="/"} # directories to be put in the database -: ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories -: ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ +: ${SEARCHPATHS="/"} # directories to be put in the database +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent +: ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems : ${find:=find} -case X"$SEARCHPATHS" in - X) echo "$0: empty variable SEARCHPATHS"; exit 1;; esac -case X"$FILESYSTEMS" in - X) echo "$0: empty variable FILESYSTEMS"; exit 1;; esac +if [ -z "$SEARCHPATHS" ]; then + echo "$0: empty variable SEARCHPATHS" >&2; exit 1 +fi +if [ -z "$FILESYSTEMS" ]; then + echo "$0: empty variable FILESYSTEMS" >&2; exit 1 +fi # Make a list a paths to exclude in the locate run excludes="! (" or="" @@ -71,25 +74,29 @@ do done excludes="$excludes ) -prune" -case X"$PRUNEPATHS" in - X) ;; - *) for path in $PRUNEPATHS - do +if [ -n "$PRUNEPATHS" ]; then + for path in $PRUNEPATHS; do excludes="$excludes -or -path $path -prune" - done;; -esac + done +fi + +if [ -n "$PRUNEDIRS" ]; then + for dir in $PRUNEDIRS; do + excludes="$excludes -or -name $dir -type d -prune" + done +fi tmp=$TMPDIR/_updatedb$$ trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 # search locally -# echo $find $SEARCHPATHS $excludes -or -print && exit if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null | $mklocatedb -presort > $tmp then - case X"`$find $tmp -size -257c -print`" in - X) cat $tmp > $FCODES;; - *) echo "updatedb: locate database $tmp is empty" - exit 1 - esac + if [ -n "$($find $tmp -size -257c -print)" ]; then + echo "updatedb: locate database $tmp is empty" >&2 + exit 1 + else + cat $tmp > $FCODES # should be cp? + fi fi From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 28 02:25:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B19F1065672; Tue, 28 Dec 2010 02:25:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 899158FC12; Tue, 28 Dec 2010 02:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2PWq7043585; Tue, 28 Dec 2010 02:25:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2PWJo043583; Tue, 28 Dec 2010 02:25:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280225.oBS2PWJo043583@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216750 - stable/8/usr.bin/find X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 02:25:32 -0000 Author: kevlo Date: Tue Dec 28 02:25:32 2010 New Revision: 216750 URL: http://svn.freebsd.org/changeset/base/216750 Log: MFC r216106: Don't error out while searching for empty directories. Submitted by: Bakul Shah Modified: stable/8/usr.bin/find/function.c Modified: stable/8/usr.bin/find/function.c ============================================================================== --- stable/8/usr.bin/find/function.c Tue Dec 28 01:38:52 2010 (r216749) +++ stable/8/usr.bin/find/function.c Tue Dec 28 02:25:32 2010 (r216750) @@ -560,7 +560,7 @@ f_empty(PLAN *plan __unused, FTSENT *ent empty = 1; dir = opendir(entry->fts_accpath); if (dir == NULL) - err(1, "%s", entry->fts_accpath); + return 0; for (dp = readdir(dir); dp; dp = readdir(dir)) if (dp->d_name[0] != '.' || (dp->d_name[1] != '\0' && From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 28 02:43:29 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E586106564A; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBBA8FC13; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2hTA6044021; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2hTIg044019; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280243.oBS2hTIg044019@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216751 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 02:43:29 -0000 Author: kevlo Date: Tue Dec 28 02:43:28 2010 New Revision: 216751 URL: http://svn.freebsd.org/changeset/base/216751 Log: MFC r216431: Check return value of malloc(). Reviewed by: hselasky Modified: stable/8/lib/libusb/libusb20_compat01.c Modified: stable/8/lib/libusb/libusb20_compat01.c ============================================================================== --- stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:25:32 2010 (r216750) +++ stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:43:28 2010 (r216751) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr); From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 28 02:45:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16EF0106566C; Tue, 28 Dec 2010 02:45:25 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B278FC1B; Tue, 28 Dec 2010 02:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2jO4p044120; Tue, 28 Dec 2010 02:45:24 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2jO1O044118; Tue, 28 Dec 2010 02:45:24 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280245.oBS2jO1O044118@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216752 - stable/8/lib/libproc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 02:45:25 -0000 Author: kevlo Date: Tue Dec 28 02:45:24 2010 New Revision: 216752 URL: http://svn.freebsd.org/changeset/base/216752 Log: MFC r216432: Fix a memory leak on the error condition Reviewed by: rpaulo Modified: stable/8/lib/libproc/proc_create.c Modified: stable/8/lib/libproc/proc_create.c ============================================================================== --- stable/8/lib/libproc/proc_create.c Tue Dec 28 02:43:28 2010 (r216751) +++ stable/8/lib/libproc/proc_create.c Tue Dec 28 02:45:24 2010 (r216752) @@ -84,7 +84,7 @@ proc_attach(pid_t pid, int flags, struct else *pphdl = phdl; out: - + proc_free(phdl); return (error); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 28 11:34:59 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8BB01065672; Tue, 28 Dec 2010 11:34:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7AC68FC0C; Tue, 28 Dec 2010 11:34:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSBYxln060560; Tue, 28 Dec 2010 11:34:59 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSBYxW0060558; Tue, 28 Dec 2010 11:34:59 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012281134.oBSBYxW0060558@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 28 Dec 2010 11:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216757 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 11:34:59 -0000 Author: oleg Date: Tue Dec 28 11:34:59 2010 New Revision: 216757 URL: http://svn.freebsd.org/changeset/base/216757 Log: MFC r213265: Fix handling of initial credit for an idle pipe. This fixes the bug where setting bw > 1 MTU/tick resulted in infinite bandwidth if io_fast=1 PR: kern/147245, kern/148429 Obtained from: Riccardo Panicucci Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 10:08:50 2010 (r216756) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 11:34:59 2010 (r216757) @@ -742,8 +742,11 @@ dummynet_io(struct mbuf **m0, int dir, s } /* compute the initial allowance */ - { + if (si->idle_time < dn_cfg.curr_time) { + /* Do this only on the first packet on an idle pipe */ struct dn_link *p = &fs->sched->link; + + si->sched_time = dn_cfg.curr_time; si->credit = dn_cfg.io_fast ? p->bandwidth : 0; if (p->burst) { uint64_t burst = (dn_cfg.curr_time - si->idle_time) * p->bandwidth; From owner-svn-src-stable-8@FreeBSD.ORG Tue Dec 28 18:56:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FEB1065674; Tue, 28 Dec 2010 18:56:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12578FC0C; Tue, 28 Dec 2010 18:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSIut2I073913; Tue, 28 Dec 2010 18:56:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSIut5t073911; Tue, 28 Dec 2010 18:56:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281856.oBSIut5t073911@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 18:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216768 - stable/8/usr.bin/gcore X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 18:56:56 -0000 Author: jhb Date: Tue Dec 28 18:56:55 2010 New Revision: 216768 URL: http://svn.freebsd.org/changeset/base/216768 Log: MFC 203532: Fix gcore so that it can have the '-s' flag without hanging. Modified: stable/8/usr.bin/gcore/gcore.c Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/gcore.c ============================================================================== --- stable/8/usr.bin/gcore/gcore.c Tue Dec 28 18:37:10 2010 (r216767) +++ stable/8/usr.bin/gcore/gcore.c Tue Dec 28 18:56:55 2010 (r216768) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -75,7 +74,6 @@ __FBSDID("$FreeBSD$"); int pflags; static void killed(int); -static void restart_target(void); static void usage(void) __dead2; static pid_t pid; @@ -152,36 +150,28 @@ main(int argc, char *argv[]) fd = open(corefile, O_RDWR|O_CREAT|O_TRUNC, DEFFILEMODE); if (fd < 0) err(1, "%s", corefile); - if ((pflags & PFLAGS_RESUME) != 0) { - signal(SIGHUP, killed); - signal(SIGINT, killed); - signal(SIGTERM, killed); - if (kill(pid, SIGSTOP) == -1) - err(1, "%d: stop signal", pid); - atexit(restart_target); - } + /* + * The semantics of the 's' flag is to stop the target process. + * Previous versions of gcore would manage this by trapping SIGHUP, + * SIGINT and SIGTERM (to be passed to the target pid), and then + * signal the child to stop. + * + * However, this messes up if the selected dumper uses ptrace calls + * that leave the child already stopped. The waitpid call in elfcore + * never returns. + * + * The best thing to do here is to externalize the 's' flag and let + * each dumper dispose of what that means, if anything. For the elfcore + * dumper, the 's' flag is a no-op since the ptrace attach stops the + * process in question already. + */ + dumper->dump(efd, fd, pid); (void)close(fd); (void)close(efd); exit(0); } -static void -killed(int sig) -{ - - restart_target(); - signal(sig, SIG_DFL); - kill(getpid(), sig); -} - -static void -restart_target(void) -{ - - kill(pid, SIGCONT); -} - void usage(void) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 29 02:54:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7DE91065670; Wed, 29 Dec 2010 02:54:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F0E8FC17; Wed, 29 Dec 2010 02:54:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBT2sfbf084844; Wed, 29 Dec 2010 02:54:41 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBT2sflv084842; Wed, 29 Dec 2010 02:54:41 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012290254.oBT2sflv084842@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Dec 2010 02:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216786 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2010 02:54:41 -0000 Author: rmacklem Date: Wed Dec 29 02:54:41 2010 New Revision: 216786 URL: http://svn.freebsd.org/changeset/base/216786 Log: MFC: r216691 Since VOP_READDIR() for ZFS does not return monotonically increasing directory offset cookies, disable the UFS related loop that skips over directory entries at the beginning of the block for the experimental NFS server. This loop is required for UFS since it always returns directory entries starting at the beginning of the block that the requested directory offset is in. In discussion with pjd@ and mckusick@ it seems that this behaviour of UFS should maybe change, with this fix being an interim patch until then. This patch only fixes the experimental server, since pjd@ is working on a patch for the regular server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 02:24:43 2010 (r216785) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 02:54:41 2010 (r216786) @@ -1432,6 +1432,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1484,6 +1485,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); NFSVOPUNLOCK(vp, 0, p); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1566,10 +1568,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -1678,6 +1682,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct uio io; struct iovec iv; struct componentname cn; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1755,6 +1760,7 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1827,10 +1833,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff || + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff) || ((nd->nd_flag & ND_NFSV4) && ((dp->d_namlen == 1 && dp->d_name[0] == '.') || (dp->d_namlen==2 && dp->d_name[0]=='.' && dp->d_name[1]=='.'))))) { From owner-svn-src-stable-8@FreeBSD.ORG Wed Dec 29 12:25:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C288310656A4; Wed, 29 Dec 2010 12:25:45 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B04758FC13; Wed, 29 Dec 2010 12:25:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCPj9g000612; Wed, 29 Dec 2010 12:25:45 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCPjEF000610; Wed, 29 Dec 2010 12:25:45 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012291225.oBTCPjEF000610@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 29 Dec 2010 12:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216797 - stable/8/sbin/mount_nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2010 12:25:45 -0000 Author: simon Date: Wed Dec 29 12:25:45 2010 New Revision: 216797 URL: http://svn.freebsd.org/changeset/base/216797 Log: MFC r216725: Fix deprecated warning about -L which said -i was deprecated. Modified: stable/8/sbin/mount_nfs/mount_nfs.c Directory Properties: stable/8/sbin/mount_nfs/ (props changed) Modified: stable/8/sbin/mount_nfs/mount_nfs.c ============================================================================== --- stable/8/sbin/mount_nfs/mount_nfs.c Wed Dec 29 12:25:28 2010 (r216796) +++ stable/8/sbin/mount_nfs/mount_nfs.c Wed Dec 29 12:25:45 2010 (r216797) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "intr", NULL, 0); break; case 'L': - printf("-i deprecated, use -o nolockd\n"); + printf("-L deprecated, use -o nolockd\n"); build_iovec(&iov, &iovlen, "nolockd", NULL, 0); break; case 'l': From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 30 09:32:40 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A327106564A; Thu, 30 Dec 2010 09:32:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A8B8FC19; Thu, 30 Dec 2010 09:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9WdFG029007; Thu, 30 Dec 2010 09:32:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9WdM1029003; Thu, 30 Dec 2010 09:32:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300932.oBU9WdM1029003@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216814 - in stable/8: bin/pkill tools/regression/usr.bin/pkill X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2010 09:32:40 -0000 Author: pjd Date: Thu Dec 30 09:32:39 2010 New Revision: 216814 URL: http://svn.freebsd.org/changeset/base/216814 Log: MFC r203802: - Implement -q option for pgrep(1). - Add regression test to test -q option. Added: stable/8/tools/regression/usr.bin/pkill/pgrep-q.t - copied unchanged from r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t Modified: stable/8/bin/pkill/pkill.1 stable/8/bin/pkill/pkill.c Directory Properties: stable/8/bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) Modified: stable/8/bin/pkill/pkill.1 ============================================================================== --- stable/8/bin/pkill/pkill.1 Thu Dec 30 02:18:04 2010 (r216813) +++ stable/8/bin/pkill/pkill.1 Thu Dec 30 09:32:39 2010 (r216814) @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 16, 2009 +.Dd February 11, 2010 .Dt PKILL 1 .Os .Sh NAME @@ -44,7 +44,7 @@ .Nd find or signal processes by name .Sh SYNOPSIS .Nm pgrep -.Op Fl LSafilnovx +.Op Fl LSafilnoqvx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core @@ -177,6 +177,8 @@ display the kill command used for each p Select only the newest (most recently started) of the matching processes. .It Fl o Select only the oldest (least recently started) of the matching processes. +.It Fl q +Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated list Modified: stable/8/bin/pkill/pkill.c ============================================================================== --- stable/8/bin/pkill/pkill.c Thu Dec 30 02:18:04 2010 (r216813) +++ stable/8/bin/pkill/pkill.c Thu Dec 30 09:32:39 2010 (r216814) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -110,6 +111,7 @@ static int matchargs; static int fullmatch; static int kthreads; static int cflags = REG_EXTENDED; +static int quiet; static kvm_t *kd; static pid_t mypid; @@ -180,10 +182,11 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; + quiet = 0; execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -256,6 +259,11 @@ main(int argc, char **argv) oldest = 1; criteria = 1; break; + case 'q': + if (!pgrep) + usage(); + quiet = 1; + break; case 's': makelist(&sidlist, LT_SID, optarg); criteria = 1; @@ -555,7 +563,7 @@ usage(void) const char *ustr; if (pgrep) - ustr = "[-LSfilnovx] [-d delim]"; + ustr = "[-LSfilnoqvx] [-d delim]"; else ustr = "[-signal] [-ILfilnovx]"; @@ -573,6 +581,10 @@ show_process(const struct kinfo_proc *kp { char **argv; + if (quiet) { + assert(pgrep); + return; + } if ((longfmt || !pgrep) && matchargs && (argv = kvm_getargv(kd, kp, 0)) != NULL) { printf("%d ", (int)kp->ki_pid); @@ -629,7 +641,8 @@ grepact(const struct kinfo_proc *kp) { show_process(kp); - printf("%s", delim); + if (!quiet) + printf("%s", delim); return (1); } Copied: stable/8/tools/regression/usr.bin/pkill/pgrep-q.t (from r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/pkill/pgrep-q.t Thu Dec 30 09:32:39 2010 (r216814, copy of r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..4" + +name="pgrep -q" +sleep0=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep1=`mktemp /tmp/$base.XXXXXX` || exit 1 +ln -sf /bin/sleep $sleep0 +$sleep0 5 & +sleep 0.3 +pid=$! +out="`pgrep -q -f $sleep0 2>&1`" +if [ $? -eq 0 ]; then + echo "ok 1 - $name" +else + echo "not ok 1 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 2 - $name" +else + echo "not ok 2 - $name" +fi +out="`pgrep -q -f $sleep1 2>&1`" +if [ $? -ne 0 ]; then + echo "ok 3 - $name" +else + echo "not ok 3 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 4 - $name" +else + echo "not ok 4 - $name" +fi +kill $pid +rm -f $sleep0 $sleep1 From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 30 09:45:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B66106564A; Thu, 30 Dec 2010 09:45:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E50648FC17; Thu, 30 Dec 2010 09:45:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9jQO0029338; Thu, 30 Dec 2010 09:45:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9jQXG029334; Thu, 30 Dec 2010 09:45:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300945.oBU9jQXG029334@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216815 - stable/8/sys/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2010 09:45:27 -0000 Author: pjd Date: Thu Dec 30 09:45:26 2010 New Revision: 216815 URL: http://svn.freebsd.org/changeset/base/216815 Log: MFC r216565,r216631,r216632,r216633,r216774: r216565: Reduce lock scope a little. r216631: On error, unbusy file system and jump to the end, so we won't try to unlock NULL *vpp. Reviewed by: kib r216632: - Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() - this is the only place that is different from all the other nfsrv_fhtovp() consumers. This simplifies nfsrv_fhtovp() a bit and also eliminates one vn_lock/VOP_UNLOCK() cycle in case of NFSv3. - Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave mount point busy. Reviewed by: kib r216633: Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point busy. This fixes a race where we can pass invalid mount point to VFS_VGET() via vp->v_mount when exported file system was forcibly unmounted between nfsrv_fhtovp() and VFS_VGET(). Reviewed by: kib r216774: ZFS might not return monotonically increasing directory offset cookies, so turn off UFS-specific hack that assumes so in ZFS case. Before the change we can miss returning some directory entries to a NFS client. I believe that the hack should be moved to ufs_readdir(), but until we find somebody who will do it, turn it off for ZFS in NFS server code. Submitted by: rmacklem Discussed with: rmacklem, mckusick Modified: stable/8/sys/nfsserver/nfs.h stable/8/sys/nfsserver/nfs_serv.c stable/8/sys/nfsserver/nfs_srvsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/nfsserver/nfs.h ============================================================================== --- stable/8/sys/nfsserver/nfs.h Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs.h Thu Dec 30 09:45:26 2010 (r216815) @@ -239,6 +239,12 @@ extern int nfs_debug; #endif +/* + * The following flags can be passed to nfsrv_fhtovp() function. + */ +/* Leave file system busy on success. */ +#define NFSRV_FLAG_BUSY 0x01 + struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **, caddr_t *); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, @@ -264,7 +270,7 @@ int nfsrv_create(struct nfsrv_descript * struct mbuf **mrq); int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, int *, struct nfsrv_descript *, struct nfssvc_sock *, struct sockaddr *, - int *, int); + int *); int nfsrv_setpublicfs(struct mount *, struct netexport *, struct export_args *); int nfs_ispublicfh(fhandle_t *); Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs_serv.c Thu Dec 30 09:45:26 2010 (r216815) @@ -213,8 +213,7 @@ nfsrv3_access(struct nfsrv_descript *nfs fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_UNSIGNED); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(1, NULL); @@ -280,8 +279,7 @@ nfsrv_getattr(struct nfsrv_descript *nfs vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, - &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(0); error = 0; @@ -389,8 +387,7 @@ nfsrv_setattr(struct nfsrv_descript *nfs /* * Now that we have all the fields, lets do it. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); @@ -712,8 +709,7 @@ nfsrv_readlink(struct nfsrv_descript *nf uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; uiop->uio_td = NULL; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); if (v3) @@ -808,8 +804,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, * as well. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { vp = NULL; nfsm_reply(2 * NFSX_UNSIGNED); @@ -1109,8 +1104,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, error = 0; goto nfsmout; } - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { vp = NULL; @@ -2102,8 +2096,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, nfsm_srvmtofh(dfhp); nfsm_srvnamesiz(len); - error = nfsrv_fhtovp(fhp, TRUE, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); @@ -2744,7 +2737,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs int v3 = (nfsd->nd_flag & ND_NFSV3); u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ - int vfslocked; + int vfslocked, not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; @@ -2770,8 +2763,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); @@ -2809,6 +2801,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); /* @@ -2826,11 +2819,11 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_SHARED | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; } + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (off_t)io.uio_offset; if (!cookies && !error) @@ -2895,10 +2888,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -3044,9 +3039,12 @@ nfsrv_readdirplus(struct nfsrv_descript int v3 = (nfsd->nd_flag & ND_NFSV3); int usevget = 1, vfslocked; struct componentname cn; + struct mount *mntp = NULL; + int not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; + vp_locked = 0; if (!v3) panic("nfsrv_readdirplus: v3 proc called on a v2 connection"); fhp = &nfh.fh_generic; @@ -3066,14 +3064,17 @@ nfsrv_readdirplus(struct nfsrv_descript if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vp_locked = 1; - if (!error && vp->v_type != VDIR) { - error = ENOTDIR; - vput(vp); - vp = NULL; - vp_locked = 0; + error = nfsrv_fhtovp(fhp, NFSRV_FLAG_BUSY, &vp, &vfslocked, nfsd, slp, + nam, &rdonly); + if (!error) { + vp_locked = 1; + mntp = vp->v_mount; + if (vp->v_type != VDIR) { + error = ENOTDIR; + vput(vp); + vp = NULL; + vp_locked = 0; + } } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3100,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); @@ -3114,12 +3116,12 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_SHARED | LK_RETRY); vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; } + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); @@ -3179,10 +3181,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -3215,8 +3219,8 @@ again: * For readdir_and_lookup get the vnode using * the file number. */ - error = VFS_VGET(vp->v_mount, dp->d_fileno, - LK_SHARED, &nvp); + error = VFS_VGET(mntp, dp->d_fileno, LK_SHARED, + &nvp); if (error != 0 && error != EOPNOTSUPP) { error = 0; goto invalid; @@ -3375,6 +3379,8 @@ invalid: nfsmout: if (vp) vrele(vp); + if (mntp) + vfs_unbusy(mntp); VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3426,8 +3432,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd off = fxdr_hyper(tl); tl += 2; cnt = fxdr_unsigned(int, *tl); - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); @@ -3571,8 +3576,7 @@ nfsrv_statfs(struct nfsrv_descript *nfsd vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); if (v3) @@ -3666,8 +3670,7 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd fhp = &nfh.fh_generic; vfslocked = 0; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); @@ -3741,8 +3744,7 @@ nfsrv_pathconf(struct nfsrv_descript *nf vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); Modified: stable/8/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- stable/8/sys/nfsserver/nfs_srvsubs.c Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs_srvsubs.c Thu Dec 30 09:45:26 2010 (r216815) @@ -639,16 +639,18 @@ nfs_namei(struct nameidata *ndp, struct goto out; } + if (!pubflag && nfs_ispublicfh(fhp)) + return (ESTALE); + /* * Extract and set starting directory. */ - error = nfsrv_fhtovp(fhp, FALSE, &dp, &dvfslocked, - nfsd, slp, nam, &rdonly, pubflag); + error = nfsrv_fhtovp(fhp, 0, &dp, &dvfslocked, nfsd, slp, nam, &rdonly); if (error) goto out; vfslocked = VFS_LOCK_GIANT(dp->v_mount); if (dp->v_type != VDIR) { - vrele(dp); + vput(dp); error = ENOTDIR; goto out; } @@ -662,12 +664,12 @@ nfs_namei(struct nameidata *ndp, struct */ *retdirp = dp; if (v3) { - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY); *retdirattr_retp = VOP_GETATTR(dp, retdirattrp, ndp->ni_cnd.cn_cred); - VOP_UNLOCK(dp, 0); } + VOP_UNLOCK(dp, 0); + if (pubflag) { /* * Oh joy. For WebNFS, handle those pesky '%' escapes, @@ -1051,12 +1053,11 @@ nfsm_srvfattr(struct nfsrv_descript *nfs * - look up fsid in mount list (if not found ret error) * - get vp and export rights by calling VFS_FHTOVP() * - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon - * - if not lockflag unlock it with VOP_UNLOCK() */ int -nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, int *vfslockedp, +nfsrv_fhtovp(fhandle_t *fhp, int flags, struct vnode **vpp, int *vfslockedp, struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct sockaddr *nam, int *rdonlyp, int pubflag) + struct sockaddr *nam, int *rdonlyp) { struct mount *mp; int i; @@ -1076,7 +1077,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla *vpp = NULL; if (nfs_ispublicfh(fhp)) { - if (!pubflag || !nfs_pub.np_valid) + if (!nfs_pub.np_valid) return (ESTALE); fhp = &nfs_pub.np_handle; } @@ -1128,12 +1129,12 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla } } error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); - if (error != 0) + if (error) { /* Make sure the server replies ESTALE to the client. */ error = ESTALE; - vfs_unbusy(mp); - if (error) + vfs_unbusy(mp); goto out; + } #ifdef MNT_EXNORESPORT if (!(exflags & (MNT_EXNORESPORT|MNT_EXPUBLIC))) { saddr = (struct sockaddr_in *)nam; @@ -1144,6 +1145,8 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla vput(*vpp); *vpp = NULL; error = NFSERR_AUTHERR | AUTH_TOOWEAK; + vfs_unbusy(mp); + goto out; } } #endif @@ -1160,8 +1163,8 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla else *rdonlyp = 0; - if (!lockflag) - VOP_UNLOCK(*vpp, 0); + if (!(flags & NFSRV_FLAG_BUSY)) + vfs_unbusy(mp); out: if (credanon != NULL) crfree(credanon); From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 30 09:46:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D26106564A; Thu, 30 Dec 2010 09:46:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31B8D8FC0C; Thu, 30 Dec 2010 09:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9kk2N029414; Thu, 30 Dec 2010 09:46:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9kk2e029410; Thu, 30 Dec 2010 09:46:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300946.oBU9kk2e029410@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216816 - stable/8/sbin/hastd X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2010 09:46:46 -0000 Author: pjd Date: Thu Dec 30 09:46:45 2010 New Revision: 216816 URL: http://svn.freebsd.org/changeset/base/216816 Log: MFC r216477,r216478,r216479,r216494,r216721,r216722: r216477: Log the fact of launching and include protocol version number. r216478: Don't ignore errors from remote requests. r216479: Improve problems logging. r216494: The 'ret' variable is of type ssize_t and we use proper format for it (%zd), so no (bogus) cast is needed. r216721: When node-specific configuration is missing in resource section, provide more useful information. Instead of: hastd: remote address not configured for resource foo Print the following: No resource foo configuration for this node (acceptable node names: freefall, freefall.freebsd.org, 44333332-4c44-4e31-4a30-313920202020). r216722: Detect when resource is configured more than once. Modified: stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/parse.y stable/8/sbin/hastd/primary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/hastd.c Thu Dec 30 09:46:45 2010 (r216816) @@ -619,6 +619,9 @@ main_loop(void) PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGCHLD) == 0); + pjdlog_info("Started successfully, running protocol version %d.", + HAST_PROTO_VERSION); + for (;;) { while ((signo = sigtimedwait(&mask, NULL, &sigtimeout)) != -1) { switch (signo) { Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/parse.y Thu Dec 30 09:46:45 2010 (r216816) @@ -55,7 +55,7 @@ extern char *yytext; static struct hastd_config *lconfig; static struct hast_resource *curres; -static bool mynode; +static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; @@ -109,6 +109,44 @@ isitme(const char *name) return (0); } +static int +node_names(char **namesp) +{ + static char names[MAXHOSTNAMELEN * 3]; + char buf[MAXHOSTNAMELEN]; + char *pos; + size_t bufsize; + + if (gethostname(buf, sizeof(buf)) < 0) { + pjdlog_errno(LOG_ERR, "gethostname() failed"); + return (-1); + } + + /* First component of the host name. */ + pos = strchr(buf, '.'); + if (pos != NULL && pos != buf) { + (void)strlcpy(names, buf, MIN((size_t)(pos - buf + 1), + sizeof(names))); + (void)strlcat(names, ", ", sizeof(names)); + } + + /* Full host name. */ + (void)strlcat(names, buf, sizeof(names)); + (void)strlcat(names, ", ", sizeof(names)); + + /* Host UUID. */ + bufsize = sizeof(buf); + if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); + return (-1); + } + (void)strlcat(names, buf, sizeof(names)); + + *namesp = names; + + return (0); +} + void yyerror(const char *str) { @@ -424,6 +462,20 @@ resource_statement: RESOURCE resource_st { if (curres != NULL) { /* + * There must be section for this node, at least with + * remote address configuration. + */ + if (!hadmynode) { + char *names; + + if (node_names(&names) != 0) + return (1); + pjdlog_error("No resource %s configuration for this node (acceptable node names: %s).", + curres->hr_name, names); + return (1); + } + + /* * Let's see there are some resource-level settings * that we can use for node-level settings. */ @@ -483,12 +535,23 @@ resource_statement: RESOURCE resource_st resource_start: STR { + /* Check if there is no duplicate entry. */ + TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { + if (strcmp(curres->hr_name, $1) == 0) { + pjdlog_error("Resource %s configured more than once.", + curres->hr_name); + free($1); + return (1); + } + } + /* * Clear those, so we can tell if they were set at * resource-level or not. */ depth1_provname[0] = '\0'; depth1_localpath[0] = '\0'; + hadmynode = false; curres = calloc(1, sizeof(*curres)); if (curres == NULL) { @@ -614,7 +677,7 @@ resource_node_start: STR case 0: break; case 1: - mynode = true; + mynode = hadmynode = true; break; default: assert(!"invalid isitme() return value"); Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/primary.c Thu Dec 30 09:46:45 2010 (r216816) @@ -1133,6 +1133,15 @@ local_send_thread(void *arg) /* * If READ failed, try to read from remote node. */ + if (ret < 0) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s), trying remote node. ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd), trying remote node. ", + ret, (intmax_t)ggio->gctl_length); + } QUEUE_INSERT1(hio, send, rncomp); continue; } @@ -1141,28 +1150,43 @@ local_send_thread(void *arg) ret = pwrite(res->hr_localfd, ggio->gctl_data, ggio->gctl_length, ggio->gctl_offset + res->hr_localoff); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else if (ret != ggio->gctl_length) + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { hio->hio_errors[ncomp] = EIO; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd): ", + ret, (intmax_t)ggio->gctl_length); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_DELETE: ret = g_delete(res->hr_localfd, ggio->gctl_offset + res->hr_localoff, ggio->gctl_length); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_FLUSH: ret = g_flush(res->hr_localfd); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; } if (refcount_release(&hio->hio_countdown)) { @@ -1443,7 +1467,9 @@ remote_recv_thread(void *arg) error = nv_get_int16(nv, "error"); if (error != 0) { /* Request failed on remote side. */ - hio->hio_errors[ncomp] = 0; + hio->hio_errors[ncomp] = error; + reqlog(LOG_WARNING, 0, &hio->hio_ggio, + "Remote request failed (%s): ", strerror(error)); nv_free(nv); goto done_queue; } From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 31 12:48:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E8231065674; Fri, 31 Dec 2010 12:48:43 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE6E8FC1D; Fri, 31 Dec 2010 12:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCmhC7073192; Fri, 31 Dec 2010 12:48:43 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCmhTp073190; Fri, 31 Dec 2010 12:48:43 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311248.oBVCmhTp073190@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216837 - stable/8/sys/compat/ndis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 12:48:43 -0000 Author: bschmidt Date: Fri Dec 31 12:48:43 2010 New Revision: 216837 URL: http://svn.freebsd.org/changeset/base/216837 Log: MFC r216049: Some drivers rely on the existence of certain keys. The Atheros 9xxx driver for example requests the NetCfgInstanceId but doesn't check the returned status code and will happily access random memory instead. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/kern_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 11:55:39 2010 (r216836) +++ stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:48:43 2010 (r216837) @@ -331,6 +331,16 @@ ndis_create_sysctls(arg) ndis_add_sysctl(sc, "NdisVersion", "NDIS API Version", "0x00050001", CTLFLAG_RD); + /* + * Some miniport drivers rely on the existence of the SlotNumber, + * NetCfgInstanceId and DriverDesc keys. + */ + ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD); + ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", + "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD); + ndis_add_sysctl(sc, "DriverDesc", "Driver Description", + "NDIS Network Adapter", CTLFLAG_RD); + /* Bus type (PCI, PCMCIA, etc...) */ sprintf(buf, "%d", (int)sc->ndis_iftype); ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 31 12:53:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 955D9106566B; Fri, 31 Dec 2010 12:53:07 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69A8B8FC0C; Fri, 31 Dec 2010 12:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCr786073326; Fri, 31 Dec 2010 12:53:07 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCr7sA073324; Fri, 31 Dec 2010 12:53:07 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311253.oBVCr7sA073324@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216838 - stable/8/sys/compat/ndis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 12:53:07 -0000 Author: bschmidt Date: Fri Dec 31 12:53:07 2010 New Revision: 216838 URL: http://svn.freebsd.org/changeset/base/216838 Log: MFC r216050: Add a dummy for IoOpenDeviceRegistryKey(). With that change the Atheros 9xxx driver is actually usable and does not panic anymore. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:48:43 2010 (r216837) +++ stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:53:07 2010 (r216838) @@ -228,6 +228,8 @@ static void srand(unsigned int); static void KeQuerySystemTime(uint64_t *); static uint32_t KeTickCount(void); static uint8_t IoIsWdmVersionAvailable(uint8_t, uint8_t); +static int32_t IoOpenDeviceRegistryKey(struct device_object *, uint32_t, + uint32_t, void **); static void ntoskrnl_thrfunc(void *); static ndis_status PsCreateSystemThread(ndis_handle *, uint32_t, void *, ndis_handle, void *, void *, void *); @@ -3199,6 +3201,13 @@ IoIsWdmVersionAvailable(uint8_t major, u return (FALSE); } +static int32_t +IoOpenDeviceRegistryKey(struct device_object *devobj, uint32_t type, + uint32_t mask, void **key) +{ + return (NDIS_STATUS_INVALID_DEVICE_REQUEST); +} + static ndis_status IoGetDeviceObjectPointer(name, reqaccess, fileobj, devobj) unicode_string *name; @@ -4378,6 +4387,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapIoSpace, 2), IMPORT_SFUNC(KeInitializeSpinLock, 1), IMPORT_SFUNC(IoIsWdmVersionAvailable, 2), + IMPORT_SFUNC(IoOpenDeviceRegistryKey, 4), IMPORT_SFUNC(IoGetDeviceObjectPointer, 4), IMPORT_SFUNC(IoGetDeviceProperty, 5), IMPORT_SFUNC(IoAllocateWorkItem, 1), From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 31 12:59:17 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E32C1106566B; Fri, 31 Dec 2010 12:59:17 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D134A8FC17; Fri, 31 Dec 2010 12:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCxHdA073496; Fri, 31 Dec 2010 12:59:17 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCxHww073490; Fri, 31 Dec 2010 12:59:17 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311259.oBVCxHww073490@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216839 - stable/8/sys/compat/ndis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 12:59:18 -0000 Author: bschmidt Date: Fri Dec 31 12:59:17 2010 New Revision: 216839 URL: http://svn.freebsd.org/changeset/base/216839 Log: MFC r216242: Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in newer Ralink drivers. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/kern_ndis.c stable/8/sys/compat/ndis/ndis_var.h stable/8/sys/compat/ndis/ntoskrnl_var.h stable/8/sys/compat/ndis/subr_ndis.c stable/8/sys/compat/ndis/subr_ntoskrnl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:59:17 2010 (r216839) @@ -433,6 +433,19 @@ ndis_flush_sysctls(arg) return (0); } +void * +ndis_get_routine_address(functbl, name) + struct image_patch_table *functbl; + char *name; +{ + int i; + + for (i = 0; functbl[i].ipt_name != NULL; i++) + if (strcmp(name, functbl[i].ipt_name) == 0) + return (functbl[i].ipt_wrap); + return (NULL); +} + static void ndis_return(dobj, arg) device_object *dobj; Modified: stable/8/sys/compat/ndis/ndis_var.h ============================================================================== --- stable/8/sys/compat/ndis/ndis_var.h Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/ndis_var.h Fri Dec 31 12:59:17 2010 (r216839) @@ -1729,6 +1729,7 @@ extern int ndis_mtop(struct mbuf *, ndis extern int ndis_ptom(struct mbuf **, ndis_packet *); extern int ndis_get_info(void *, ndis_oid, void *, int *); extern int ndis_set_info(void *, ndis_oid, void *, int *); +extern void *ndis_get_routine_address(struct image_patch_table *, char *); extern int ndis_get_supported_oids(void *, ndis_oid **, int *); extern int ndis_send_packets(void *, ndis_packet **, int); extern int ndis_send_packet(void *, ndis_packet *); Modified: stable/8/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- stable/8/sys/compat/ndis/ntoskrnl_var.h Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/ntoskrnl_var.h Fri Dec 31 12:59:17 2010 (r216839) @@ -1466,6 +1466,7 @@ extern uint32_t IoConnectInterrupt(kinte kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t); extern uint8_t MmIsAddressValid(void *); +extern void *MmGetSystemRoutineAddress(unicode_string *); extern void *MmMapIoSpace(uint64_t, uint32_t, uint32_t); extern void MmUnmapIoSpace(void *, size_t); extern void MmBuildMdlForNonPagedPool(mdl *); Modified: stable/8/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ndis.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/subr_ndis.c Fri Dec 31 12:59:17 2010 (r216839) @@ -197,6 +197,7 @@ static ndis_status NdisMMapIoSpace(void ndis_physaddr, uint32_t); static void NdisMUnmapIoSpace(ndis_handle, void *, uint32_t); static uint32_t NdisGetCacheFillSize(void); +static void *NdisGetRoutineAddress(unicode_string *); static uint32_t NdisMGetDmaAlignment(ndis_handle); static ndis_status NdisMInitializeScatterGatherDma(ndis_handle, uint8_t, uint32_t); @@ -1642,6 +1643,17 @@ NdisGetCacheFillSize(void) return (128); } +static void * +NdisGetRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ndis_functbl, astr.as_buf)); +} + static uint32_t NdisMGetDmaAlignment(handle) ndis_handle handle; @@ -3246,6 +3258,7 @@ image_patch_table ndis_functbl[] = { IMPORT_SFUNC(NdisInitializeString, 2), IMPORT_SFUNC(NdisFreeString, 1), IMPORT_SFUNC(NdisGetCurrentSystemTime, 1), + IMPORT_SFUNC(NdisGetRoutineAddress, 1), IMPORT_SFUNC(NdisGetSystemUpTime, 1), IMPORT_SFUNC(NdisGetVersion, 0), IMPORT_SFUNC(NdisMSynchronizeWithInterrupt, 3), Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:59:17 2010 (r216839) @@ -2589,6 +2589,17 @@ MmGetPhysicalAddress(void *base) return (pmap_extract(kernel_map->pmap, (vm_offset_t)base)); } +void * +MmGetSystemRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ntoskrnl_functbl, astr.as_buf)); +} + uint8_t MmIsAddressValid(vaddr) void *vaddr; @@ -4382,6 +4393,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapLockedPages, 2), IMPORT_SFUNC(MmBuildMdlForNonPagedPool, 1), IMPORT_SFUNC(MmGetPhysicalAddress, 1), + IMPORT_SFUNC(MmGetSystemRoutineAddress, 1), IMPORT_SFUNC(MmIsAddressValid, 1), IMPORT_SFUNC(MmMapIoSpace, 3 + 1), IMPORT_SFUNC(MmUnmapIoSpace, 2), From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 31 14:03:57 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF4641065670; Fri, 31 Dec 2010 14:03:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B32868FC08; Fri, 31 Dec 2010 14:03:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVE3v9E074913; Fri, 31 Dec 2010 14:03:57 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVE3vMD074911; Fri, 31 Dec 2010 14:03:57 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012311403.oBVE3vMD074911@svn.freebsd.org> From: Rick Macklem Date: Fri, 31 Dec 2010 14:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216841 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 14:03:58 -0000 Author: rmacklem Date: Fri Dec 31 14:03:57 2010 New Revision: 216841 URL: http://svn.freebsd.org/changeset/base/216841 Log: MFC: r216510 Fix two vnode locking problems in nfsd_recalldelegation() in the experimental NFSv4 server. The first was a bogus use of VOP_ISLOCKED() in a KASSERT() and the second was the need to lock the vnode for the nfsrv_checkremove() call. Also, delete a "__unused" that was bogus, since the argument is used. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 31 13:07:21 2010 (r216840) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 31 14:03:57 2010 (r216841) @@ -4275,7 +4275,7 @@ nfsrv_clientconflict(struct nfsclient *c */ static int nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, - __unused vnode_t vp) + vnode_t vp) { struct nfsclient *clp = stp->ls_clp; int gotlock, error, retrycnt, zapped_clp; @@ -4568,8 +4568,6 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO int32_t starttime; int error; - KASSERT(!VOP_ISLOCKED(vp), ("vp %p is locked", vp)); - /* * First, check to see if the server is currently running and it has * been called for a regular file when issuing delegations. @@ -4578,6 +4576,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO nfsrv_issuedelegs == 0) return; + KASSERT((VOP_ISLOCKED(vp) != LK_EXCLUSIVE), ("vp %p is locked", vp)); /* * First, get a reference on the nfsv4rootfs_lock so that an * exclusive lock cannot be acquired by another thread. @@ -4593,7 +4592,12 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - error = nfsrv_checkremove(vp, 0, p); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + error = nfsrv_checkremove(vp, 0, p); + else + error = EPERM; + VOP_UNLOCK(vp, 0); if (error == NFSERR_DELAY) { NFSGETNANOTIME(&mytime); if (((u_int32_t)mytime.tv_sec - starttime) > From owner-svn-src-stable-8@FreeBSD.ORG Fri Dec 31 18:16:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29B031065670; Fri, 31 Dec 2010 18:16:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187808FC0A; Fri, 31 Dec 2010 18:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIGFcY084510; Fri, 31 Dec 2010 18:16:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIGF71084507; Fri, 31 Dec 2010 18:16:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311816.oBVIGF71084507@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216849 - in stable/8: . sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2010 18:16:16 -0000 Author: bz Date: Fri Dec 31 18:16:15 2010 New Revision: 216849 URL: http://svn.freebsd.org/changeset/base/216849 Log: MFC r216848: Happy New Year 2011. Approved by: core (kib) Modified: stable/8/COPYRIGHT (contents, props changed) stable/8/sys/sys/copyright.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/COPYRIGHT ============================================================================== --- stable/8/COPYRIGHT Fri Dec 31 18:07:16 2010 (r216848) +++ stable/8/COPYRIGHT Fri Dec 31 18:16:15 2010 (r216849) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/8/sys/sys/copyright.h ============================================================================== --- stable/8/sys/sys/copyright.h Fri Dec 31 18:07:16 2010 (r216848) +++ stable/8/sys/sys/copyright.h Fri Dec 31 18:16:15 2010 (r216849) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \