From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 02:22:55 2011 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 49D33106566C; Sun, 1 May 2011 02:22:55 +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 1CCE58FC08; Sun, 1 May 2011 02:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p412MtwP072337; Sun, 1 May 2011 02:22:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p412MssY072335; Sun, 1 May 2011 02:22:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010222.p412MssY072335@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 02:22:54 +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: r221290 - stable/8/sys/fs/nfsclient 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, 01 May 2011 02:22:55 -0000 Author: rmacklem Date: Sun May 1 02:22:54 2011 New Revision: 221290 URL: http://svn.freebsd.org/changeset/base/221290 Log: MFC: r220735 Fix readdirplus in the experimental NFS client so that it skips over ".." to avoid a LOR race with nfs_lookup(). This fix is analagous to r138256 in the regular NFS client. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.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/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun May 1 01:49:35 2011 (r221289) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun May 1 02:22:54 2011 (r221290) @@ -2942,7 +2942,7 @@ nfsrpc_readdirplus(vnode_t vp, struct ui nfsquad_t cookie, ncookie; int error = 0, tlen, more_dirs = 1, blksiz = 0, bigenough = 1; int attrflag, tryformoredirs = 1, eof = 0, gotmnton = 0; - int unlocknewvp = 0; + int isdotdot = 0, unlocknewvp = 0; long dotfileid, dotdotfileid = 0, fileno = 0; char *cp; nfsattrbit_t attrbits, dattrbits; @@ -3192,6 +3192,11 @@ nfsrpc_readdirplus(vnode_t vp, struct ui *cp = '\0'; cp += tlen; /* points to cookie storage */ tl2 = (u_int32_t *)cp; + if (len == 2 && cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.') + isdotdot = 1; + else + isdotdot = 0; uio_iov_base_add(uiop, (tlen + NFSX_HYPER)); uio_iov_len_add(uiop, -(tlen + NFSX_HYPER)); uio_uio_resid_add(uiop, -(tlen + NFSX_HYPER)); @@ -3269,6 +3274,22 @@ nfsrpc_readdirplus(vnode_t vp, struct ui unlocknewvp = 0; FREE((caddr_t)nfhp, M_NFSFH); np = dnp; + } else if (isdotdot != 0) { + /* + * Skip doing a nfscl_nget() call for "..". + * There's a race between acquiring the nfs + * node here and lookups that look for the + * directory being read (in the parent). + * It would try to get a lock on ".." here, + * owning the lock on the directory being + * read. Lookup will hold the lock on ".." + * and try to acquire the lock on the + * directory being read. + * If the directory is unlocked/relocked, + * then there is a LOR with the buflock + * vp is relocked. + */ + free(nfhp, M_NFSFH); } else { error = nfscl_nget(vnode_mount(vp), vp, nfhp, cnp, p, &np, NULL, LK_EXCLUSIVE); From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 02:36:09 2011 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 A28EF106566B; Sun, 1 May 2011 02:36:09 +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 902C68FC17; Sun, 1 May 2011 02:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p412a9ZC072750; Sun, 1 May 2011 02:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p412a9VI072747; Sun, 1 May 2011 02:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010236.p412a9VI072747@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 02:36:09 +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: r221291 - in stable/8/sys/fs: nfs nfsclient 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, 01 May 2011 02:36:09 -0000 Author: rmacklem Date: Sun May 1 02:36:09 2011 New Revision: 221291 URL: http://svn.freebsd.org/changeset/base/221291 Log: MFC: r220739 Change some defaults in the experimental NFS client to be the same as the regular NFS client for NFSv3. The main one is making use of a reserved port# the default. Also, set the retry limit for TCP the same and fix the code so that it doesn't disable readdirplus for NFSv4. Modified: stable/8/sys/fs/nfs/nfs.h stable/8/sys/fs/nfsclient/nfs_clvfsops.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/nfs/nfs.h ============================================================================== --- stable/8/sys/fs/nfs/nfs.h Sun May 1 02:22:54 2011 (r221290) +++ stable/8/sys/fs/nfs/nfs.h Sun May 1 02:36:09 2011 (r221291) @@ -56,6 +56,7 @@ #define NFSV4_UPCALLRETRY 4 /* Number of retries before failure */ #define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ +#define NFS_RETRANS_TCP 2 /* Num of retrans for TCP soft mounts */ #define NFS_MAXGRPS 16 /* Max. size of groups list */ #define NFS_TRYLATERDEL 15 /* Maximum delay timeout (sec) */ #ifndef NFS_REMOVETIMEO Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 1 02:22:54 2011 (r221290) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 1 02:36:09 2011 (r221291) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -556,14 +557,29 @@ nfs_decode_args(struct mount *mp, struct if (argp->sotype == SOCK_STREAM) { nmp->nm_flag &= ~NFSMNT_NOCONN; nmp->nm_timeo = NFS_MAXTIMEO; + if ((argp->flags & NFSMNT_NFSV4) != 0) + nmp->nm_retry = INT_MAX; + else + nmp->nm_retry = NFS_RETRANS_TCP; } - /* Also clear RDIRPLUS if not NFSv3, it crashes some servers */ - if ((argp->flags & NFSMNT_NFSV3) == 0) + /* Also clear RDIRPLUS if NFSv2, it crashes some servers */ + if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) { + argp->flags &= ~NFSMNT_RDIRPLUS; nmp->nm_flag &= ~NFSMNT_RDIRPLUS; + } + + /* Clear NFSMNT_RESVPORT for NFSv4, since it is not required. */ + if ((argp->flags & NFSMNT_NFSV4) != 0) { + argp->flags &= ~NFSMNT_RESVPORT; + nmp->nm_flag &= ~NFSMNT_RESVPORT; + } + /* Re-bind if rsrvd port requested and wasn't on one */ + adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT) + && (argp->flags & NFSMNT_RESVPORT); /* Also re-bind if we're switching to/from a connected UDP socket */ - adjsock = ((nmp->nm_flag & NFSMNT_NOCONN) != + adjsock |= ((nmp->nm_flag & NFSMNT_NOCONN) != (argp->flags & NFSMNT_NOCONN)); /* Update flags atomically. Don't change the lock bits. */ @@ -708,7 +724,7 @@ nfs_mount(struct mount *mp) .proto = 0, .fh = NULL, .fhsize = 0, - .flags = 0, + .flags = NFSMNT_RESVPORT, .wsize = NFS_WSIZE, .rsize = NFS_RSIZE, .readdirsize = NFS_READDIRSIZE, From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 02:47:55 2011 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 67F76106564A; Sun, 1 May 2011 02:47:55 +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 0386E8FC13; Sun, 1 May 2011 02:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p412lsax073182; Sun, 1 May 2011 02:47:54 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p412ls9G073179; Sun, 1 May 2011 02:47:54 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010247.p412ls9G073179@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 02:47:54 +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: r221292 - in stable/8/sys/fs: nfs nfsclient 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, 01 May 2011 02:47:55 -0000 Author: rmacklem Date: Sun May 1 02:47:54 2011 New Revision: 221292 URL: http://svn.freebsd.org/changeset/base/221292 Log: MFC: r220751 Fix up some of the sysctls for the experimental NFS client so that they use the same names as the regular client. Also add string descriptions for them. Modified: stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/fs/nfsclient/nfs_clvnops.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/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Sun May 1 02:36:09 2011 (r221291) +++ stable/8/sys/fs/nfs/nfs_commonport.c Sun May 1 02:47:54 2011 (r221292) @@ -70,11 +70,15 @@ static int nfs_realign_test; static int nfs_realign_count; SYSCTL_NODE(_vfs, OID_AUTO, newnfs, CTLFLAG_RW, 0, "New NFS filesystem"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, newnfs_realign_test, CTLFLAG_RW, &nfs_realign_test, 0, ""); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, newnfs_realign_count, CTLFLAG_RW, &nfs_realign_count, 0, ""); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs4acl_enable, CTLFLAG_RW, &nfsrv_useacl, 0, ""); +SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, + 0, "Number of realign tests done"); +SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, + 0, "Number of mbuf realignments done"); +SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs4acl_enable, CTLFLAG_RW, &nfsrv_useacl, + 0, "Enable NFSv4 ACLs"); SYSCTL_STRING(_vfs_newnfs, OID_AUTO, callback_addr, CTLFLAG_RW, - nfsv4_callbackaddr, sizeof(nfsv4_callbackaddr), ""); + nfsv4_callbackaddr, sizeof(nfsv4_callbackaddr), + "NFSv4 callback addr for server to use"); /* * Defines for malloc Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 1 02:36:09 2011 (r221291) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 1 02:47:54 2011 (r221292) @@ -219,7 +219,7 @@ SYSCTL_INT(_vfs_newnfs, OID_AUTO, clean_ &nfs_clean_pages_on_close, 0, "NFS clean dirty pages on close"); int newnfs_directio_enable = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, directio_enable, CTLFLAG_RW, +SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, &newnfs_directio_enable, 0, "Enable NFS directio"); /* @@ -234,7 +234,7 @@ SYSCTL_INT(_vfs_newnfs, OID_AUTO, direct * meaningful. */ int newnfs_directio_allow_mmap = 1; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, directio_allow_mmap, CTLFLAG_RW, +SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); #if 0 From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 03:01:21 2011 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 7A54C1065670; Sun, 1 May 2011 03:01:21 +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 671578FC0A; Sun, 1 May 2011 03:01:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4131LSo073744; Sun, 1 May 2011 03:01:21 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4131L6W073742; Sun, 1 May 2011 03:01:21 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010301.p4131L6W073742@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 03:01:21 +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: r221293 - stable/8/sys/fs/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: Sun, 01 May 2011 03:01:21 -0000 Author: rmacklem Date: Sun May 1 03:01:21 2011 New Revision: 221293 URL: http://svn.freebsd.org/changeset/base/221293 Log: MFC: r220752 Get rid of the "nfscl: consider increasing kern.ipc.maxsockbuf" message that was generated when doing experimental NFS client mounts. I put that message in because the krpc would hang with the default size for mounts that used large rsize/wsize values. Since the bug that caused these hangs was fixed by r213756, which fixed the way the krpc used soreserve(), I think the message is no longer needed. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.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/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sun May 1 02:47:54 2011 (r221292) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sun May 1 03:01:21 2011 (r221293) @@ -143,7 +143,7 @@ newnfs_connect(struct nfsmount *nmp, str CLIENT *client; struct netconfig *nconf; struct socket *so; - int one = 1, retries, error, printsbmax = 0; + int one = 1, retries, error; struct thread *td = curthread; /* @@ -202,13 +202,8 @@ newnfs_connect(struct nfsmount *nmp, str return (error); } do { - if (error != 0 && pktscale > 2) { + if (error != 0 && pktscale > 2) pktscale--; - if (printsbmax == 0) { - printf("nfscl: consider increasing kern.ipc.maxsockbuf\n"); - printsbmax = 1; - } - } if (nrp->nr_sotype == SOCK_DGRAM) { if (nmp != NULL) { sndreserve = (NFS_MAXDGRAMDATA + NFS_MAXPKTHDR) * From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 03:16:13 2011 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 D67231065673; Sun, 1 May 2011 03:16:13 +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 C45BB8FC12; Sun, 1 May 2011 03:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p413GDCF074370; Sun, 1 May 2011 03:16:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p413GDkn074368; Sun, 1 May 2011 03:16:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010316.p413GDkn074368@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 03:16:13 +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: r221294 - stable/8/sys/fs/nfsclient 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, 01 May 2011 03:16:13 -0000 Author: rmacklem Date: Sun May 1 03:16:13 2011 New Revision: 221294 URL: http://svn.freebsd.org/changeset/base/221294 Log: MFC: r220762 Change the mutex locking for several locations in the experimental NFS client's vnode op functions to make them compatible with the regular NFS client. I'll admit I'm not sure that the mutex locks around the assignments are needed, but the regular client has them, so I added them. Also, add handling of the case of partial attributes in setattr to be compatible with the regular client. Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.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/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 1 03:01:21 2011 (r221293) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 1 03:16:13 2011 (r221294) @@ -1522,6 +1522,20 @@ again: } } else if (NFS_ISV34(dvp) && (fmode & O_EXCL)) { if (nfscl_checksattr(vap, &nfsva)) { + /* + * We are normally called with only a partially + * initialized VAP. Since the NFSv3 spec says that + * the server may use the file attributes to + * store the verifier, the spec requires us to do a + * SETATTR RPC. FreeBSD servers store the verifier in + * atime, but we can't really assume that all servers + * will so we ensure that our SETATTR sets both atime + * and mtime. + */ + if (vap->va_mtime.tv_sec == VNOVAL) + vfs_timestamp(&vap->va_mtime); + if (vap->va_atime.tv_sec == VNOVAL) + vap->va_atime = vap->va_mtime; error = nfsrpc_setattr(newvp, vap, NULL, cnp->cn_cred, cnp->cn_thread, &nfsva, &attrflag, NULL); if (error && (vap->va_uid != (uid_t)VNOVAL || @@ -1609,7 +1623,9 @@ nfs_remove(struct vop_remove_args *ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); + mtx_lock(&np->n_mtx); np->n_attrstamp = 0; + mtx_unlock(&np->n_mtx); return (error); } @@ -1697,7 +1713,7 @@ nfs_rename(struct vop_rename_args *ap) error = 0; goto out; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE))) + if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) goto out; /* @@ -1735,7 +1751,7 @@ nfs_rename(struct vop_rename_args *ap) tdvp, tvp, tcnp->cn_nameptr, tcnp->cn_namelen, tcnp->cn_cred, tcnp->cn_thread); - if (!error) { + if (error == 0 && NFS_ISV4(tdvp)) { /* * For NFSv4, check to see if it is the same name and * replace the name, if it is different. @@ -1831,18 +1847,22 @@ nfs_renamerpc(struct vnode *fdvp, struct &tattrflag, NULL, NULL); mtx_lock(&fdnp->n_mtx); fdnp->n_flag |= NMODIFIED; - mtx_unlock(&fdnp->n_mtx); - mtx_lock(&tdnp->n_mtx); - tdnp->n_flag |= NMODIFIED; - mtx_unlock(&tdnp->n_mtx); - if (fattrflag) + if (fattrflag != 0) { + mtx_unlock(&fdnp->n_mtx); (void) nfscl_loadattrcache(&fdvp, &fnfsva, NULL, NULL, 0, 1); - else + } else { fdnp->n_attrstamp = 0; - if (tattrflag) + mtx_unlock(&fdnp->n_mtx); + } + mtx_lock(&tdnp->n_mtx); + tdnp->n_flag |= NMODIFIED; + if (tattrflag != 0) { + mtx_unlock(&tdnp->n_mtx); (void) nfscl_loadattrcache(&tdvp, &tnfsva, NULL, NULL, 0, 1); - else + } else { tdnp->n_attrstamp = 0; + mtx_unlock(&tdnp->n_mtx); + } if (error && NFS_ISV4(fdvp)) error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); return (error); @@ -1857,7 +1877,7 @@ nfs_link(struct vop_link_args *ap) struct vnode *vp = ap->a_vp; struct vnode *tdvp = ap->a_tdvp; struct componentname *cnp = ap->a_cnp; - struct nfsnode *tdnp; + struct nfsnode *np, *tdnp; struct nfsvattr nfsva, dnfsva; int error = 0, attrflag, dattrflag; @@ -1878,15 +1898,21 @@ nfs_link(struct vop_link_args *ap) tdnp = VTONFS(tdvp); mtx_lock(&tdnp->n_mtx); tdnp->n_flag |= NMODIFIED; - mtx_unlock(&tdnp->n_mtx); - if (attrflag) - (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); - else - VTONFS(vp)->n_attrstamp = 0; - if (dattrflag) + if (dattrflag != 0) { + mtx_unlock(&tdnp->n_mtx); (void) nfscl_loadattrcache(&tdvp, &dnfsva, NULL, NULL, 0, 1); - else + } else { tdnp->n_attrstamp = 0; + mtx_unlock(&tdnp->n_mtx); + } + if (attrflag) + (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); + else { + np = VTONFS(vp); + mtx_lock(&np->n_mtx); + np->n_attrstamp = 0; + mtx_unlock(&np->n_mtx); + } /* * If negative lookup caching is enabled, I might as well * add an entry for this node. Not necessary for correctness, @@ -1966,11 +1992,13 @@ nfs_symlink(struct vop_symlink_args *ap) dnp = VTONFS(dvp); mtx_lock(&dnp->n_mtx); dnp->n_flag |= NMODIFIED; - mtx_unlock(&dnp->n_mtx); - if (dattrflag) + if (dattrflag != 0) { + mtx_unlock(&dnp->n_mtx); (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); - else + } else { dnp->n_attrstamp = 0; + mtx_unlock(&dnp->n_mtx); + } return (error); } @@ -1990,7 +2018,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) struct nfsvattr nfsva, dnfsva; int error = 0, attrflag, dattrflag, ret; - if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) + if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); vap->va_type = VDIR; error = nfsrpc_mkdir(dvp, cnp->cn_nameptr, cnp->cn_namelen, @@ -1999,11 +2027,13 @@ nfs_mkdir(struct vop_mkdir_args *ap) dnp = VTONFS(dvp); mtx_lock(&dnp->n_mtx); dnp->n_flag |= NMODIFIED; - mtx_unlock(&dnp->n_mtx); - if (dattrflag) + if (dattrflag != 0) { + mtx_unlock(&dnp->n_mtx); (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); - else + } else { dnp->n_attrstamp = 0; + mtx_unlock(&dnp->n_mtx); + } if (nfhp) { ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, cnp->cn_thread, &np, NULL, LK_EXCLUSIVE); @@ -2065,11 +2095,13 @@ nfs_rmdir(struct vop_rmdir_args *ap) dnp = VTONFS(dvp); mtx_lock(&dnp->n_mtx); dnp->n_flag |= NMODIFIED; - mtx_unlock(&dnp->n_mtx); - if (dattrflag) + if (dattrflag != 0) { + mtx_unlock(&dnp->n_mtx); (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); - else + } else { dnp->n_attrstamp = 0; + mtx_unlock(&dnp->n_mtx); + } cache_purge(dvp); cache_purge(vp); From owner-svn-src-stable-8@FreeBSD.ORG Sun May 1 13:55:15 2011 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 4334B1065674; Sun, 1 May 2011 13:55:15 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id DDF4B8FC08; Sun, 1 May 2011 13:55:14 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A20F445C9C; Sun, 1 May 2011 15:22:15 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 440CA4569A; Sun, 1 May 2011 15:22:10 +0200 (CEST) Date: Sun, 1 May 2011 15:21:56 +0200 From: Pawel Jakub Dawidek To: Marcel Moolenaar Message-ID: <20110501132156.GB3245@garage.freebsd.pl> References: <201104300528.p3U5StZN031259@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <201104300528.p3U5StZN031259@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r221242 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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, 01 May 2011 13:55:15 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 30, 2011 at 05:28:55AM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Sat Apr 30 05:28:54 2011 > New Revision: 221242 > URL: http://svn.freebsd.org/changeset/base/221242 >=20 > Log: > Unbreak non-x86 and in particular ia64, The default stack size > on ia64 is 32KB. Unconditionally hardcoding a 16KB stack for > reasons of increasing the stack size on i386 is just wrong. If > the size was indeed expressed in terms of pages, as the commit > log suggested, then it would happen to be just right for ia64, > though only accidentally. > =20 > Pointy hat: avg, pjd Marcel, you already know my opinion that I don't agree with this change. I don't think you are going to update the code once new architecture arrive. This change also reduces thread stack size for already existing architectures (arm and mips). I'd prefer to either commit my patch that protects against passing stack size smaller than the default on given architecture or commit what we have in HEAD. > --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat Apr= 30 02:44:15 2011 (r221241) > +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Sat Apr= 30 05:28:54 2011 (r221242) > @@ -129,6 +129,7 @@ void > txg_sync_start(dsl_pool_t *dp) > { > tx_state_t *tx =3D &dp->dp_tx; > + size_t stksize =3D 0; > =20 > mutex_enter(&tx->tx_sync_lock); > =20 > @@ -146,7 +147,10 @@ txg_sync_start(dsl_pool_t *dp) > * 32-bit x86. This is due in part to nested pools and > * scrub_visitbp() recursion. > */ > - tx->tx_sync_thread =3D thread_create(NULL, 16<<10, txg_sync_thread, > +#ifdef __i386__ > + stksize =3D 16 << 10; > +#endif > + tx->tx_sync_thread =3D thread_create(NULL, stksize, txg_sync_thread, > dp, 0, &p0, TS_RUN, minclsyspri); > =20 > mutex_exit(&tx->tx_sync_lock); --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk29XnMACgkQForvXbEpPzTpvwCg5XqB7Ws8HXbTTXGOcHNycdE5 hV0AnRF9zTitawbGVsKWXI/4Qq1R+wKP =nsBi -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z-- From owner-svn-src-stable-8@FreeBSD.ORG Mon May 2 00:49:48 2011 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 1742E1065673; Mon, 2 May 2011 00:49:48 +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 078A78FC1B; Mon, 2 May 2011 00:49:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p420nl9s014706; Mon, 2 May 2011 00:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p420nlfD014704; Mon, 2 May 2011 00:49:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105020049.p420nlfD014704@svn.freebsd.org> From: Rick Macklem Date: Mon, 2 May 2011 00:49: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: r221310 - stable/8/sys/fs/nfsclient 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, 02 May 2011 00:49:48 -0000 Author: rmacklem Date: Mon May 2 00:49:47 2011 New Revision: 221310 URL: http://svn.freebsd.org/changeset/base/221310 Log: MFC: r220763 Add vput() calls in two places in the experimental NFS client that would be needed if, in the future, nfscl_loadattrcache() were to return an error. Currently nfscl_loadattrcache() never returns an error, so these cases never currently happen. Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.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/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun May 1 23:55:56 2011 (r221309) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Mon May 2 00:49:47 2011 (r221310) @@ -1404,9 +1404,12 @@ nfs_mknodrpc(struct vnode *dvp, struct v (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); if (!error) { newvp = NFSTOV(np); - if (attrflag) + if (attrflag != 0) { error = nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); + if (error != 0) + vput(newvp); + } } if (!error) { if ((cnp->cn_flags & MAKEENTRY)) @@ -1512,7 +1515,7 @@ again: } if (error) { if (newvp != NULL) { - vrele(newvp); + vput(newvp); newvp = NULL; } if (NFS_ISV34(dvp) && (fmode & O_EXCL) && From owner-svn-src-stable-8@FreeBSD.ORG Mon May 2 01:01:03 2011 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 B4744106566C; Mon, 2 May 2011 01:01:03 +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 A08A68FC08; Mon, 2 May 2011 01:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p42113JN015082; Mon, 2 May 2011 01:01:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p42113cE015081; Mon, 2 May 2011 01:01:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105020101.p42113cE015081@svn.freebsd.org> From: Rick Macklem Date: Mon, 2 May 2011 01:01:03 +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: r221311 - stable/8/sys/fs/nfsclient 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, 02 May 2011 01:01:03 -0000 Author: rmacklem Date: Mon May 2 01:01:03 2011 New Revision: 221311 URL: http://svn.freebsd.org/changeset/base/221311 Log: MFC: r220764 Add a vput() to nfs_lookitup() in the experimental NFS client for a case that will probably never happen. It can only happen if a server were to successfully lookup a file, but not return attributes for that file. Although technically allowed by the NFSv3 RFC, I doubt any server would ever do this. However, if it did, the client would have not vput()'d the new vnode when it needed to do so. Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.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/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Mon May 2 00:49:47 2011 (r221310) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Mon May 2 01:01:03 2011 (r221311) @@ -2422,7 +2422,10 @@ printf("replace=%s\n",nnn); newvp = NFSTOV(np); } if (!attrflag && *npp == NULL) { - vrele(newvp); + if (newvp == dvp) + vrele(newvp); + else + vput(newvp); return (ENOENT); } if (attrflag) From owner-svn-src-stable-8@FreeBSD.ORG Mon May 2 13:58:41 2011 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 706C4106566C; Mon, 2 May 2011 13:58:41 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 445618FC15; Mon, 2 May 2011 13:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p42DwfWk040915; Mon, 2 May 2011 13:58:41 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p42DwfHv040911; Mon, 2 May 2011 13:58:41 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201105021358.p42DwfHv040911@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 2 May 2011 13:58: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: r221323 - stable/8/sys/fs/devfs 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, 02 May 2011 13:58:41 -0000 Author: jh Date: Mon May 2 13:58:40 2011 New Revision: 221323 URL: http://svn.freebsd.org/changeset/base/221323 Log: MFC r216461: - Assert that dm_lock is exclusively held in devfs_rules_apply() and in devfs_vmkdir() while adding the entry to de_list of the parent. - Apply devfs rules to newly created directories and symbolic links. PR: kern/125034 Modified: stable/8/sys/fs/devfs/devfs_devs.c stable/8/sys/fs/devfs/devfs_rule.c stable/8/sys/fs/devfs/devfs_vnops.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/devfs/devfs_devs.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_devs.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_devs.c Mon May 2 13:58:40 2011 (r221323) @@ -248,8 +248,10 @@ devfs_vmkdir(struct devfs_mount *dmp, ch de->de_dir = dd; } else { de->de_dir = dotdot; + sx_assert(&dmp->dm_lock, SX_XLOCKED); TAILQ_INSERT_TAIL(&dotdot->de_dlist, dd, de_list); dotdot->de_links++; + devfs_rules_apply(dmp, dd); } #ifdef MAC Modified: stable/8/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_rule.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_rule.c Mon May 2 13:58:40 2011 (r221323) @@ -139,6 +139,8 @@ devfs_rules_apply(struct devfs_mount *dm { struct devfs_ruleset *ds; + sx_assert(&dm->dm_lock, SX_XLOCKED); + if (dm->dm_ruleset == 0) return; sx_slock(&sx_rules); Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_vnops.c Mon May 2 13:58:40 2011 (r221323) @@ -1493,6 +1493,7 @@ devfs_symlink(struct vop_symlink_args *a mac_devfs_create_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); #endif TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); + devfs_rules_apply(dmp, de); return (devfs_allocv(de, ap->a_dvp->v_mount, LK_EXCLUSIVE, ap->a_vpp)); } From owner-svn-src-stable-8@FreeBSD.ORG Mon May 2 22:49:44 2011 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 17F2E106564A; Mon, 2 May 2011 22:49:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06C728FC12; Mon, 2 May 2011 22:49:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p42Mnhfl057964; Mon, 2 May 2011 22:49:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p42MnhaZ057961; Mon, 2 May 2011 22:49:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105022249.p42MnhaZ057961@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 2 May 2011 22:49: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: r221351 - stable/8/sys/dev/bge 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, 02 May 2011 22:49:44 -0000 Author: yongari Date: Mon May 2 22:49:43 2011 New Revision: 221351 URL: http://svn.freebsd.org/changeset/base/221351 Log: MFC r220368: Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780. Unlike other controllers which have more advanced jumbo support, these controllers have one send ring, one standard receive producer ring and one receive return ring. In order to receive jumbo frames on the controllers, driver now will increase Rx buffer size to 9k. Two Rx modes are supported on these controllers and I chose standard Rx BDs over extended Rx BDs. The extended Rx BD mode allows up to 4 segmentations for each Rx BDs such that kernel does not have to allocate large buffer of contiguous memory for receiving. The extended Rx BD mode is already used on controllers that have separate jumbo receive ring. However, using extended Rx BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256 entries which in turn may reduce the performance. Also UMA backed page allocator for jumbo frame returns contiguous memory so using extended Rx BD has no advantage on FreeBSD unless highly customized local allocator implemented in driver is used. To use jumbo buffers in standard receive ring, Rx buffer allocation handler was changed to allocate MJUM9BYTES sized mbuf. PR: kern/155192 Tested by: Vijay Singh gmail dot com> Submitted by: mjacob (initial version) Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.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/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon May 2 22:03:30 2011 (r221350) +++ stable/8/sys/dev/bge/if_bge.c Mon May 2 22:49:43 2011 (r221351) @@ -943,10 +943,19 @@ bge_newbuf_std(struct bge_softc *sc, int bus_dmamap_t map; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m == NULL) - return (ENOBUFS); - m->m_len = m->m_pkthdr.len = MCLBYTES; + if (sc->bge_flags & BGE_FLAG_JUMBO_STD && + (sc->bge_ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) { + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MJUM9BYTES; + } else { + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; + } if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) m_adj(m, ETHER_ALIGN); @@ -2385,7 +2394,7 @@ static int bge_dma_alloc(struct bge_softc *sc) { bus_addr_t lowaddr; - bus_size_t boundary, sbsz, txsegsz, txmaxsegsz; + bus_size_t boundary, sbsz, rxmaxsegsz, txsegsz, txmaxsegsz; int i, error; lowaddr = BUS_SPACE_MAXADDR; @@ -2513,9 +2522,13 @@ bge_dma_alloc(struct bge_softc *sc) } /* Create tag for Rx mbufs. */ + if (sc->bge_flags & BGE_FLAG_JUMBO_STD) + rxmaxsegsz = MJUM9BYTES; + else + rxmaxsegsz = MCLBYTES; error = bus_dma_tag_create(sc->bge_cdata.bge_buffer_tag, 1, 0, - BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, - MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, rxmaxsegsz, 1, + rxmaxsegsz, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); @@ -2759,7 +2772,7 @@ bge_attach(device_t dev) case BGE_ASICREV_BCM5714_A0: case BGE_ASICREV_BCM5780: case BGE_ASICREV_BCM5714: - sc->bge_flags |= BGE_FLAG_5714_FAMILY /* | BGE_FLAG_JUMBO */; + sc->bge_flags |= BGE_FLAG_5714_FAMILY | BGE_FLAG_JUMBO_STD; /* FALLTHROUGH */ case BGE_ASICREV_BCM5750: case BGE_ASICREV_BCM5752: @@ -3560,7 +3573,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); - if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + if (BGE_IS_JUMBO_CAPABLE(sc) && + ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); @@ -4689,7 +4703,8 @@ bge_init_locked(struct bge_softc *sc) } /* Init jumbo RX ring. */ - if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + if (BGE_IS_JUMBO_CAPABLE(sc) && + ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { device_printf(sc->bge_dev, @@ -4914,14 +4929,19 @@ bge_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFMTU: + if (BGE_IS_JUMBO_CAPABLE(sc) || + (sc->bge_flags & BGE_FLAG_JUMBO_STD)) { + if (ifr->ifr_mtu < ETHERMIN || + ifr->ifr_mtu > BGE_JUMBO_MTU) { + error = EINVAL; + break; + } + } else if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; + break; + } BGE_LOCK(sc); - if (ifr->ifr_mtu < ETHERMIN || - ((BGE_IS_JUMBO_CAPABLE(sc)) && - ifr->ifr_mtu > BGE_JUMBO_MTU) || - ((!BGE_IS_JUMBO_CAPABLE(sc)) && - ifr->ifr_mtu > ETHERMTU)) - error = EINVAL; - else if (ifp->if_mtu != ifr->ifr_mtu) { + if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon May 2 22:03:30 2011 (r221350) +++ stable/8/sys/dev/bge/if_bgereg.h Mon May 2 22:49:43 2011 (r221351) @@ -2748,6 +2748,7 @@ struct bge_softc { uint32_t bge_flags; #define BGE_FLAG_TBI 0x00000001 #define BGE_FLAG_JUMBO 0x00000002 +#define BGE_FLAG_JUMBO_STD 0x00000004 #define BGE_FLAG_EADDR 0x00000008 #define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_CPMU_PRESENT 0x00000020 From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 01:19:40 2011 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 1DFE51065676; Tue, 3 May 2011 01:19:40 +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 E4A818FC18; Tue, 3 May 2011 01:19:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p431Jdp4062517; Tue, 3 May 2011 01:19:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p431JdTu062515; Tue, 3 May 2011 01:19:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105030119.p431JdTu062515@svn.freebsd.org> From: Rick Macklem Date: Tue, 3 May 2011 01:19: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: r221355 - stable/8/sys/fs/nfsclient 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, 03 May 2011 01:19:40 -0000 Author: rmacklem Date: Tue May 3 01:19:39 2011 New Revision: 221355 URL: http://svn.freebsd.org/changeset/base/221355 Log: MFC: r220810 Fix up handling of the nfsmount structure in read and write within the experimental NFS client. Mostly add mutex locking and use the same rsize, wsize during the operation by keeping a local copy of it. This is another change that brings it closer to the regular NFS client. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.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/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Mon May 2 23:34:33 2011 (r221354) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Tue May 3 01:19:39 2011 (r221355) @@ -1284,16 +1284,22 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u struct nfsrv_descript nfsd; struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsrv_descript *nd = &nfsd; + int rsize; *attrflagp = 0; tsiz = uio_uio_resid(uiop); - if (uiop->uio_offset + tsiz > 0xffffffff && - !NFSHASNFSV3OR4(nmp)) + NFSLOCKMNT(nmp); + if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { + /* XXX Needs overflow/negative check for uio_offset */ + NFSUNLOCKMNT(nmp); return (EFBIG); + } + rsize = nmp->nm_rsize; + NFSUNLOCKMNT(nmp); nd->nd_mrep = NULL; while (tsiz > 0) { *attrflagp = 0; - len = (tsiz > nmp->nm_rsize) ? nmp->nm_rsize : tsiz; + len = (tsiz > rsize) ? rsize : tsiz; NFSCL_REQSTART(nd, NFSPROC_READ, vp); if (nd->nd_flag & ND_NFSV4) nfsm_stateidtom(nd, stateidp, NFSSTATEID_PUTSTATEID); @@ -1333,7 +1339,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); eof = fxdr_unsigned(int, *tl); } - NFSM_STRSIZ(retlen, nmp->nm_rsize); + NFSM_STRSIZ(retlen, rsize); error = nfsm_mbufuio(nd, uiop, retlen); if (error) goto nfsmout; @@ -1457,8 +1463,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * *attrflagp = 0; tsiz = uio_uio_resid(uiop); NFSLOCKMNT(nmp); - if (uiop->uio_offset + tsiz > 0xffffffff && - !NFSHASNFSV3OR4(nmp)) { + if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { NFSUNLOCKMNT(nmp); return (EFBIG); } @@ -1467,11 +1472,6 @@ nfsrpc_writerpc(vnode_t vp, struct uio * nd->nd_mrep = NULL; /* NFSv2 sometimes does a write with */ nd->nd_repstat = 0; /* uio_resid == 0, so the while is not done */ while (tsiz > 0) { - nmp = VFSTONFS(vnode_mount(vp)); - if (nmp == NULL) { - error = ENXIO; - goto nfsmout; - } *attrflagp = 0; len = (tsiz > wsize) ? wsize : tsiz; NFSCL_REQSTART(nd, NFSPROC_WRITE, vp); From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 01:55:27 2011 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 77D9F1065672; Tue, 3 May 2011 01:55:27 +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 64F4F8FC17; Tue, 3 May 2011 01:55:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p431tR6u063650; Tue, 3 May 2011 01:55:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p431tRmj063648; Tue, 3 May 2011 01:55:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105030155.p431tRmj063648@svn.freebsd.org> From: Rick Macklem Date: Tue, 3 May 2011 01:55:27 +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: r221357 - stable/8/usr.sbin/nfsd 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, 03 May 2011 01:55:27 -0000 Author: rmacklem Date: Tue May 3 01:55:27 2011 New Revision: 221357 URL: http://svn.freebsd.org/changeset/base/221357 Log: MFC: r220875 Add stablerestart(5) to the See Also list for nfsd.8. This is a content change. Modified: stable/8/usr.sbin/nfsd/nfsd.8 Directory Properties: stable/8/usr.sbin/nfsd/ (props changed) Modified: stable/8/usr.sbin/nfsd/nfsd.8 ============================================================================== --- stable/8/usr.sbin/nfsd/nfsd.8 Tue May 3 01:43:04 2011 (r221356) +++ stable/8/usr.sbin/nfsd/nfsd.8 Tue May 3 01:55:27 2011 (r221357) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd March 29, 1995 +.Dd April 19, 2011 .Dt NFSD 8 .Os .Sh NAME @@ -195,6 +195,7 @@ just do a .Xr nfssvc 2 , .Xr nfsv4 4 , .Xr exports 5 , +.Xr stablerestart 5 , .Xr gssd 8 , .Xr ipfw 8 , .Xr mountd 8 , From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 05:09:02 2011 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 6C49D106566B; Tue, 3 May 2011 05:09:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B0168FC16; Tue, 3 May 2011 05:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p435922w070584; Tue, 3 May 2011 05:09:02 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p435923Z070582; Tue, 3 May 2011 05:09:02 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105030509.p435923Z070582@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 3 May 2011 05:09:02 +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: r221359 - 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, 03 May 2011 05:09:02 -0000 Author: ae Date: Tue May 3 05:09:02 2011 New Revision: 221359 URL: http://svn.freebsd.org/changeset/base/221359 Log: MFC r220831: ipdn_bound_var() function is designed to bound a variable between specified minimum and maximum. In case when specified default value is out of bounds it does not work as expected and does not limit variable. Check that default value is in range and limit it if needed. Also bump max_hash_size value to 65536 to correspond with manual page. PR: kern/152887 Modified: stable/8/sys/netinet/ipfw/ip_dummynet.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_dummynet.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dummynet.c Tue May 3 04:44:50 2011 (r221358) +++ stable/8/sys/netinet/ipfw/ip_dummynet.c Tue May 3 05:09:02 2011 (r221359) @@ -108,6 +108,10 @@ ipdn_bound_var(int *v, int dflt, int lo, { int oldv = *v; const char *op = NULL; + if (dflt < lo) + dflt = lo; + if (dflt > hi) + dflt = hi; if (oldv < lo) { *v = dflt; op = "Bump"; @@ -2129,7 +2133,7 @@ ip_dn_init(void) dn_cfg.red_max_pkt_size = 1500; /* default max packet size */ /* hash tables */ - dn_cfg.max_hash_size = 1024; /* max in the hash tables */ + dn_cfg.max_hash_size = 65536; /* max in the hash tables */ dn_cfg.hash_size = 64; /* default hash size */ /* create hash tables for schedulers and flowsets. From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 05:42:50 2011 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 DEA96106564A; Tue, 3 May 2011 05:42:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD55C8FC13; Tue, 3 May 2011 05:42:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p435go5Y071617; Tue, 3 May 2011 05:42:50 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p435goQQ071615; Tue, 3 May 2011 05:42:50 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105030542.p435goQQ071615@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 3 May 2011 05:42:50 +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: r221360 - 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, 03 May 2011 05:42:51 -0000 Author: ae Date: Tue May 3 05:42:50 2011 New Revision: 221360 URL: http://svn.freebsd.org/changeset/base/221360 Log: MFC r218360 (by luigi): correct the 'output_time' of packets generated by dummynet. In the dec.2009 rewrite I introduced a bug, using for the computation the arrival time instead of the time the packet has exited from the queue. The bandwidth computation was still correct because it is computed elsewhere, but traffic was sent out in bursts. The bug is also present in RELENG_8 after dec.2009 Thanks to Daikichi Osuga for investingating, finding and fixing the bug with detailed graphs of the behaviour before and after the fix. Submitted by: Daikichi Osuga 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 May 3 05:09:02 2011 (r221359) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Tue May 3 05:42:50 2011 (r221360) @@ -461,7 +461,7 @@ serve_sched(struct mq *q, struct dn_sch_ (m->m_pkthdr.len * 8 + extra_bits(m, s)); si->credit -= len_scaled; /* Move packet in the delay line */ - dn_tag_get(m)->output_time += s->link.delay ; + dn_tag_get(m)->output_time = dn_cfg.curr_time + s->link.delay ; mq_append(&si->dline.mq, m); } /* From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 07:24:47 2011 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 C2DB9106566B; Tue, 3 May 2011 07:24:47 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78F128FC0A; Tue, 3 May 2011 07:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p437OlHb074670; Tue, 3 May 2011 07:24:47 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p437OlG4074668; Tue, 3 May 2011 07:24:47 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105030724.p437OlG4074668@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 3 May 2011 07:24: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: r221361 - stable/8/usr.sbin/mfiutil 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, 03 May 2011 07:24:47 -0000 Author: pluknet Date: Tue May 3 07:24:47 2011 New Revision: 221361 URL: http://svn.freebsd.org/changeset/base/221361 Log: MFC r221119: Fix typo in "continuously" argument used in patrol auto command. Unlike the version in head, this one preserves a misspelled version. Modified: stable/8/usr.sbin/mfiutil/mfi_patrol.c Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_patrol.c Tue May 3 05:42:50 2011 (r221360) +++ stable/8/usr.sbin/mfiutil/mfi_patrol.c Tue May 3 07:24:47 2011 (r221361) @@ -252,7 +252,8 @@ patrol_config(int ac, char **av) if (strcasecmp(av[1], "auto") == 0) { op_mode = MFI_PR_OPMODE_AUTO; if (ac > 2) { - if (strcasecmp(av[2], "continously") == 0) + if (strcasecmp(av[2], "continously") == 0 || + strcasecmp(av[2], "continuously") == 0) exec_freq = 0xffffffff; else { val = strtol(av[2], &cp, 0); From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 08:39:57 2011 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 D1376106566B; Tue, 3 May 2011 08:39:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC9BB8FC27; Tue, 3 May 2011 08:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p438dvYI077183; Tue, 3 May 2011 08:39:57 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p438dvu9077182; Tue, 3 May 2011 08:39:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201105030839.p438dvu9077182@svn.freebsd.org> From: Martin Matuska Date: Tue, 3 May 2011 08:39: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: r221368 - stable/8/contrib/gcc 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, 03 May 2011 08:39:57 -0000 Author: mm Date: Tue May 3 08:39:57 2011 New Revision: 221368 URL: http://svn.freebsd.org/changeset/base/221368 Log: MFC r221282: Add ChangeLog.gcc43 for backported changes from gcc 4.3 Added: stable/8/contrib/gcc/ChangeLog.gcc43 - copied unchanged from r221282, head/contrib/gcc/ChangeLog.gcc43 Modified: Directory Properties: stable/8/contrib/gcc/ (props changed) Copied: stable/8/contrib/gcc/ChangeLog.gcc43 (from r221282, head/contrib/gcc/ChangeLog.gcc43) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/contrib/gcc/ChangeLog.gcc43 Tue May 3 08:39:57 2011 (r221368, copy of r221282, head/contrib/gcc/ChangeLog.gcc43) @@ -0,0 +1,163 @@ +2007-05-01 Dwarakanath Rajagopal (r124339) + + * config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3 + and athlon64-sse3 as improved versions of k8, opteron and athlon64 + with SSE3 instruction set support. + * doc/invoke.texi: Likewise. + +2007-04-07 H.J. Lu (r123639) + + * config/i386/i386.c (ix86_handle_option): Handle SSSE3. + +2007-02-08 Harsha Jagasia (r121726) + + * config/i386/xmmintrin.h: Make inclusion of emmintrin.h + conditional to __SSE2__. + (Entries below should have been added to first ChangeLog + entry for amdfam10 dated 2007-02-05) + * config/i386/emmintrin.h: Generate #error if __SSE2__ is not + defined. + * config/i386/pmmintrin.h: Generate #error if __SSE3__ is not + defined. + * config/i386/tmmintrin.h: Generate #error if __SSSE3__ is not + defined. + +2007-02-07 Jakub Jelinek (r121687) + + * config/i386/i386.c (override_options): Set PTA_SSSE3 for core2. + +2007-01-17 Eric Christopher (r120846) + + * config.gcc: Support core2 processor. + +2006-12-02 H.J. Lu (r119454 - partial) + + PR target/30040 + * config/i386/driver-i386.c (bit_SSSE3): New. + +2006-11-18 Vladimir Makarov (r118973) + + * doc/invoke.texi (core2): Add item. + + * config/i386/i386.h (TARGET_CORE2, TARGET_CPU_DEFAULT_core2): New + macros. + (TARGET_CPU_CPP_BUILTINS): Add code for core2. + (TARGET_CPU_DEFAULT_generic): Change value. + (TARGET_CPU_DEFAULT_NAMES): Add core2. + (processor_type): Add new constant PROCESSOR_CORE2. + + * config/i386/i386.md (cpu): Add core2. + + * config/i386/i386.c (core2_cost): New initialized variable. + (m_CORE2): New macro. + (x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen, + x86_deep_branch, x86_partial_reg_stall, x86_use_simode_fiop, + x86_use_cltd, x86_promote_QImode, x86_sub_esp_4, x86_sub_esp_8, + x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_accumulate_outgoing_args, x86_prologue_using_move, + x86_epilogue_using_move, x86_arch_always_fancy_math_387, + x86_sse_partial_reg_dependency, x86_rep_movl_optimal, + x86_use_incdec, x86_four_jump_limit, x86_schedule, + x86_pad_returns): Add m_CORE2. + (override_options): Add entries for Core2. + (ix86_issue_rate): Add case for Core2. + +2006-10-27 Vladimir Makarov (r118090) + + * config/i386/i386.h (TARGET_GEODE): + (TARGET_CPU_CPP_BUILTINS): Add code for geode. + (TARGET_CPU_DEFAULT_geode): New macro. + (TARGET_CPU_DEFAULT_k6, TARGET_CPU_DEFAULT_k6_2, + TARGET_CPU_DEFAULT_k6_3, TARGET_CPU_DEFAULT_athlon, + TARGET_CPU_DEFAULT_athlon_sse, TARGET_CPU_DEFAULT_k8, + TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_prescott, + TARGET_CPU_DEFAULT_nocona, TARGET_CPU_DEFAULT_generic): Increase + the macro values. + (TARGET_CPU_DEFAULT_NAMES): Add geode. + (processor_type): Add PROCESSOR_GEODE. + + * config/i386/i386.md: Include geode.md. + (cpu): Add geode. + + * config/i386/i386.c (geode_cost): New initialized global + variable. + (m_GEODE, m_K6_GEODE): New macros. + (x86_use_leave, x86_push_memory, x86_deep_branch, x86_use_sahf, + x86_use_himode_fiop, x86_promote_QImode, x86_add_esp_4, + x86_add_esp_8, x86_rep_movl_optimal, x86_ext_80387_constants, + x86_schedule): Use m_K6_GEODE instead of m_K6. + (x86_movx, x86_cmove): Set up m_GEODE. + (x86_integer_DFmode_moves): Clear m_GEODE. + (processor_target_table): Add entry for geode. + (processor_alias_table): Ditto. + + * config/i386/geode.md: New file. + + * doc/invoke.texi: Add entry about geode processor. + +2006-10-22 H.J. Lu (r117958) + + * config.gcc (i[34567]86-*-*): Add tmmintrin.h to extra_headers. + (x86_64-*-*): Likewise. + + * config/i386/i386.c (pta_flags): Add PTA_SSSE3. + (override_options): Check SSSE3. + (ix86_builtins): Add IX86_BUILTIN_PHADDW, IX86_BUILTIN_PHADDD, + IX86_BUILTIN_PHADDSW, IX86_BUILTIN_PHSUBW, IX86_BUILTIN_PHSUBD, + IX86_BUILTIN_PHSUBSW, IX86_BUILTIN_PMADDUBSW, + IX86_BUILTIN_PMULHRSW, IX86_BUILTIN_PSHUFB, + IX86_BUILTIN_PSIGNB, IX86_BUILTIN_PSIGNW, IX86_BUILTIN_PSIGND, + IX86_BUILTIN_PALIGNR, IX86_BUILTIN_PABSB, IX86_BUILTIN_PABSW, + IX86_BUILTIN_PABSD, IX86_BUILTIN_PHADDW128, + IX86_BUILTIN_PHADDD128, IX86_BUILTIN_PHADDSW128, + IX86_BUILTIN_PHSUBW128, IX86_BUILTIN_PHSUBD128, + IX86_BUILTIN_PHSUBSW128, IX86_BUILTIN_PMADDUBSW128, + IX86_BUILTIN_PMULHRSW128, IX86_BUILTIN_PSHUFB128, + IX86_BUILTIN_PSIGNB128, IX86_BUILTIN_PSIGNW128, + IX86_BUILTIN_PSIGND128, IX86_BUILTIN_PALIGNR128, + IX86_BUILTIN_PABSB128, IX86_BUILTIN_PABSW128 and + IX86_BUILTIN_PABSD128. + (bdesc_2arg): Add SSSE3. + (bdesc_1arg): Likewise. + (ix86_init_mmx_sse_builtins): Support SSSE3. + (ix86_expand_builtin): Likewise. + * config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Likewise. + + * config/i386/i386.md (UNSPEC_PSHUFB): New. + (UNSPEC_PSIGN): Likewise. + (UNSPEC_PALIGNR): Likewise. + Include mmx.md before sse.md. + + * config/i386/i386.opt: Add -mssse3. + + * config/i386/sse.md (ssse3_phaddwv8hi3): New pattern for SSSE3. + (ssse3_phaddwv4hi3): Likewise. + (ssse3_phadddv4si3): Likewise. + (ssse3_phadddv2si3): Likewise. + (ssse3_phaddswv8hi3): Likewise. + (ssse3_phaddswv4hi3): Likewise. + (ssse3_phsubwv8hi3): Likewise. + (ssse3_phsubwv4hi3): Likewise. + (ssse3_phsubdv4si3): Likewise. + (ssse3_phsubdv2si3): Likewise. + (ssse3_phsubswv8hi3): Likewise. + (ssse3_phsubswv4hi3): Likewise. + (ssse3_pmaddubswv8hi3): Likewise. + (ssse3_pmaddubswv4hi3): Likewise. + (ssse3_pmulhrswv8hi3): Likewise. + (ssse3_pmulhrswv4hi3): Likewise. + (ssse3_pshufbv16qi3): Likewise. + (ssse3_pshufbv8qi3): Likewise. + (ssse3_psign3): Likewise. + (ssse3_psign3): Likewise. + (ssse3_palignrti): Likewise. + (ssse3_palignrdi): Likewise. + (abs2): Likewise. + (abs2): Likewise. + + * config/i386/tmmintrin.h: New file. + + * doc/extend.texi: Document SSSE3 built-in functions. + + * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 09:59:34 2011 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 3025C106564A; Tue, 3 May 2011 09:59:34 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE4F8FC08; Tue, 3 May 2011 09:59:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p439xYAh079574; Tue, 3 May 2011 09:59:34 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p439xYPI079572; Tue, 3 May 2011 09:59:34 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105030959.p439xYPI079572@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 3 May 2011 09:59:33 +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: r221370 - stable/8/usr.bin/xargs 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, 03 May 2011 09:59:34 -0000 Author: ru Date: Tue May 3 09:59:33 2011 New Revision: 221370 URL: http://svn.freebsd.org/changeset/base/221370 Log: MFC r219958: Discourage from using "cp -r". Modified: stable/8/usr.bin/xargs/xargs.1 Directory Properties: stable/8/usr.bin/xargs/ (props changed) Modified: stable/8/usr.bin/xargs/xargs.1 ============================================================================== --- stable/8/usr.bin/xargs/xargs.1 Tue May 3 08:40:55 2011 (r221369) +++ stable/8/usr.bin/xargs/xargs.1 Tue May 3 09:59:33 2011 (r221370) @@ -37,7 +37,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd January 26, 2008 +.Dd March 24, 2011 .Dt XARGS 1 .Os .Sh NAME @@ -167,7 +167,7 @@ directories which start with an uppercas directory to .Pa destdir : .Pp -.Dl /bin/ls -1d [A-Z]* | xargs -J % cp -rp % destdir +.Dl /bin/ls -1d [A-Z]* | xargs -J % cp -Rp % destdir .Pp .It Fl L Ar number Call From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 10:01:09 2011 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 75D801065674; Tue, 3 May 2011 10:01:09 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60E508FC24; Tue, 3 May 2011 10:01:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p43A19Va079714; Tue, 3 May 2011 10:01:09 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p43A19do079711; Tue, 3 May 2011 10:01:09 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105031001.p43A19do079711@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 3 May 2011 10:01:09 +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: r221371 - stable/8/sbin/umount 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, 03 May 2011 10:01:09 -0000 Author: ru Date: Tue May 3 10:01:08 2011 New Revision: 221371 URL: http://svn.freebsd.org/changeset/base/221371 Log: MFC r219955: It's possible to unmount multiple items at once, make it clear. Modified: stable/8/sbin/umount/umount.8 stable/8/sbin/umount/umount.c Directory Properties: stable/8/sbin/umount/ (props changed) Modified: stable/8/sbin/umount/umount.8 ============================================================================== --- stable/8/sbin/umount/umount.8 Tue May 3 09:59:33 2011 (r221370) +++ stable/8/sbin/umount/umount.8 Tue May 3 10:01:08 2011 (r221371) @@ -37,7 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl fv -.Ar special | node | fsid +.Ar special ... | node ... | fsid ... .Nm .Fl a | A .Op Fl F Ar fstab Modified: stable/8/sbin/umount/umount.c ============================================================================== --- stable/8/sbin/umount/umount.c Tue May 3 09:59:33 2011 (r221370) +++ stable/8/sbin/umount/umount.c Tue May 3 10:01:08 2011 (r221371) @@ -599,7 +599,7 @@ usage() { (void)fprintf(stderr, "%s\n%s\n", - "usage: umount [-fv] special | node | fsid", + "usage: umount [-fv] special ... | node ... | fsid ...", " umount -a | -A [-F fstab] [-fv] [-h host] [-t type]"); exit(1); } From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 11:00:32 2011 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 0606F106566C; Tue, 3 May 2011 11:00:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3F138FC08; Tue, 3 May 2011 11:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p43B0VRL090163; Tue, 3 May 2011 11:00:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p43B0VfD090159; Tue, 3 May 2011 11:00:31 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105031100.p43B0VfD090159@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 3 May 2011 11:00:31 +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: r221375 - 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, 03 May 2011 11:00:32 -0000 Author: ae Date: Tue May 3 11:00:31 2011 New Revision: 221375 URL: http://svn.freebsd.org/changeset/base/221375 Log: MFC r206428 (by luigi): This commit enables partial operation of dummynet with kernels compiled with "options VIMAGE". As it is now, there is still a single instance of the pipes, and it is only usable from vnet0 (the main instance). Trying to use a pipe from a different vimage does not crash the system as it did before, but the traffic coming out from the pipe goes to the wrong place, and i still need to figure out where. Support for per-vimage pipes is almost there (just a matter of uncommenting the VNET_* definitions for dn_cfg, plus putting into the structure the remaining static variables), however i need first to figure out how init/uninit work, and also to understand where packets are ending up on exit from a pipe. In summary: vimage support for dummynet is not complete yet, but we are getting there. MFC r206461 (by bz): Try to help with a virtualized dummynet after r206428. This adds the explicit include (so far probably included through one of the few "hidden" includes in other header files) for vnet.h and adds a cast to unbreak LINT-VIMAGE. Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c stable/8/sys/netinet/ipfw/ip_dn_private.h stable/8/sys/netinet/ipfw/ip_dummynet.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 May 3 10:18:27 2011 (r221374) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Tue May 3 11:00:31 2011 (r221375) @@ -45,8 +45,11 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include /* IFNAMSIZ, struct ifaddr, ifq head, lock.h mutex.h */ #include +#include + #include #include /* ip_len, ip_off */ #include /* ip_output(), IP_FORWARDING */ @@ -69,6 +72,7 @@ __FBSDID("$FreeBSD$"); */ struct dn_parms dn_cfg; +//VNET_DEFINE(struct dn_parms, _base_dn_cfg); static long tick_last; /* Last tick duration (usec). */ static long tick_delta; /* Last vs standard tick diff (usec). */ @@ -100,31 +104,34 @@ SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); +/* wrapper to pass dn_cfg fields to SYSCTL_* */ +//#define DC(x) (&(VNET_NAME(_base_dn_cfg).x)) +#define DC(x) (&(dn_cfg.x)) /* parameters */ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, - CTLFLAG_RW, &dn_cfg.hash_size, 0, "Default hash table size"); + CTLFLAG_RW, DC(hash_size), 0, "Default hash table size"); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, - CTLFLAG_RW, &dn_cfg.slot_limit, 0, + CTLFLAG_RW, DC(slot_limit), 0, "Upper limit in slots for pipe queue."); SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, - CTLFLAG_RW, &dn_cfg.byte_limit, 0, + CTLFLAG_RW, DC(byte_limit), 0, "Upper limit in bytes for pipe queue."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, io_fast, - CTLFLAG_RW, &dn_cfg.io_fast, 0, "Enable fast dummynet io."); + CTLFLAG_RW, DC(io_fast), 0, "Enable fast dummynet io."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, debug, - CTLFLAG_RW, &dn_cfg.debug, 0, "Dummynet debug level"); + CTLFLAG_RW, DC(debug), 0, "Dummynet debug level"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire, - CTLFLAG_RW, &dn_cfg.expire, 0, "Expire empty queues/pipes"); + CTLFLAG_RW, DC(expire), 0, "Expire empty queues/pipes"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, expire_cycle, - CTLFLAG_RD, &dn_cfg.expire_cycle, 0, "Expire cycle for queues/pipes"); + CTLFLAG_RD, DC(expire_cycle), 0, "Expire cycle for queues/pipes"); /* RED parameters */ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_lookup_depth, - CTLFLAG_RD, &dn_cfg.red_lookup_depth, 0, "Depth of RED lookup table"); + CTLFLAG_RD, DC(red_lookup_depth), 0, "Depth of RED lookup table"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_avg_pkt_size, - CTLFLAG_RD, &dn_cfg.red_avg_pkt_size, 0, "RED Medium packet size"); + CTLFLAG_RD, DC(red_avg_pkt_size), 0, "RED Medium packet size"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, red_max_pkt_size, - CTLFLAG_RD, &dn_cfg.red_max_pkt_size, 0, "RED Max packet size"); + CTLFLAG_RD, DC(red_max_pkt_size), 0, "RED Max packet size"); /* time adjustment */ SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, tick_delta, @@ -142,13 +149,13 @@ SYSCTL_LONG(_net_inet_ip_dummynet, OID_A /* statistics */ SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, schk_count, - CTLFLAG_RD, &dn_cfg.schk_count, 0, "Number of schedulers"); + CTLFLAG_RD, DC(schk_count), 0, "Number of schedulers"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, si_count, - CTLFLAG_RD, &dn_cfg.si_count, 0, "Number of scheduler instances"); + CTLFLAG_RD, DC(si_count), 0, "Number of scheduler instances"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, fsk_count, - CTLFLAG_RD, &dn_cfg.fsk_count, 0, "Number of flowsets"); + CTLFLAG_RD, DC(fsk_count), 0, "Number of flowsets"); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, queue_count, - CTLFLAG_RD, &dn_cfg.queue_count, 0, "Number of queues"); + CTLFLAG_RD, DC(queue_count), 0, "Number of queues"); SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt, CTLFLAG_RD, &io_pkt, 0, "Number of packets passed to dummynet."); @@ -158,7 +165,7 @@ SYSCTL_ULONG(_net_inet_ip_dummynet, OID_ SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_drop, CTLFLAG_RD, &io_pkt_drop, 0, "Number of packets dropped by dummynet."); - +#undef DC SYSEND #endif @@ -496,6 +503,8 @@ dummynet_task(void *context, int pending struct timeval t; struct mq q = { NULL, NULL }; /* queue to accumulate results */ + CURVNET_SET((struct vnet *)context); + DN_BH_WLOCK(); /* Update number of lost(coalesced) ticks. */ @@ -560,6 +569,7 @@ dummynet_task(void *context, int pending dn_reschedule(); if (q.head != NULL) dummynet_send(q.head); + CURVNET_RESTORE(); } /* Modified: stable/8/sys/netinet/ipfw/ip_dn_private.h ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dn_private.h Tue May 3 10:18:27 2011 (r221374) +++ stable/8/sys/netinet/ipfw/ip_dn_private.h Tue May 3 11:00:31 2011 (r221375) @@ -150,6 +150,8 @@ struct dn_parms { uint32_t expire; uint32_t expire_cycle; /* tick count */ + int init_done; + /* if the upper half is busy doing something long, * can set the busy flag and we will enqueue packets in * a queue for later processing. @@ -354,6 +356,8 @@ enum { }; extern struct dn_parms dn_cfg; +//VNET_DECLARE(struct dn_parms, _base_dn_cfg); +//#define dn_cfg VNET(_base_dn_cfg) int dummynet_io(struct mbuf **, int , struct ip_fw_args *); void dummynet_task(void *context, int pending); Modified: stable/8/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dummynet.c Tue May 3 10:18:27 2011 (r221374) +++ stable/8/sys/netinet/ipfw/ip_dummynet.c Tue May 3 11:00:31 2011 (r221375) @@ -2111,14 +2111,10 @@ ip_dn_ctl(struct sockopt *sopt) static void ip_dn_init(void) { - static int init_done = 0; - - if (init_done) + if (dn_cfg.init_done) return; - init_done = 1; - if (bootverbose) - printf("DUMMYNET with IPv6 initialized (100131)\n"); - + printf("DUMMYNET %p with IPv6 initialized (100409)\n", curvnet); + dn_cfg.init_done = 1; /* Set defaults here. MSVC does not accept initializers, * and this is also useful for vimages */ @@ -2155,10 +2151,8 @@ ip_dn_init(void) SLIST_INIT(&dn_cfg.schedlist); DN_LOCK_INIT(); - ip_dn_ctl_ptr = ip_dn_ctl; - ip_dn_io_ptr = dummynet_io; - TASK_INIT(&dn_task, 0, dummynet_task, NULL); + TASK_INIT(&dn_task, 0, dummynet_task, curvnet); dn_tq = taskqueue_create_fast("dummynet", M_NOWAIT, taskqueue_thread_enqueue, &dn_tq); taskqueue_start_threads(&dn_tq, 1, PI_NET, "dummynet"); @@ -2172,13 +2166,16 @@ ip_dn_init(void) #ifdef KLD_MODULE static void -ip_dn_destroy(void) +ip_dn_destroy(int last) { callout_drain(&dn_timeout); DN_BH_WLOCK(); - ip_dn_ctl_ptr = NULL; - ip_dn_io_ptr = NULL; + if (last) { + printf("%s removing last instance\n", __FUNCTION__); + ip_dn_ctl_ptr = NULL; + ip_dn_io_ptr = NULL; + } dummynet_flush(); DN_BH_WUNLOCK(); @@ -2203,13 +2200,15 @@ dummynet_modevent(module_t mod, int type return EEXIST ; } ip_dn_init(); + ip_dn_ctl_ptr = ip_dn_ctl; + ip_dn_io_ptr = dummynet_io; return 0; } else if (type == MOD_UNLOAD) { #if !defined(KLD_MODULE) printf("dummynet statically compiled, cannot unload\n"); return EINVAL ; #else - ip_dn_destroy(); + ip_dn_destroy(1 /* last */); return 0; #endif } else @@ -2287,8 +2286,24 @@ static moduledata_t dummynet_mod = { "dummynet", dummynet_modevent, NULL }; -DECLARE_MODULE(dummynet, dummynet_mod, - SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY-1); +#define DN_SI_SUB SI_SUB_PROTO_IFATTACHDOMAIN +#define DN_MODEV_ORD (SI_ORDER_ANY - 128) /* after ipfw */ +DECLARE_MODULE(dummynet, dummynet_mod, DN_SI_SUB, DN_MODEV_ORD); MODULE_DEPEND(dummynet, ipfw, 2, 2, 2); MODULE_VERSION(dummynet, 3); + +/* + * Starting up. Done in order after dummynet_modevent() has been called. + * VNET_SYSINIT is also called for each existing vnet and each new vnet. + */ +//VNET_SYSINIT(vnet_dn_init, DN_SI_SUB, DN_MODEV_ORD+2, ip_dn_init, NULL); + +/* + * Shutdown handlers up shop. These are done in REVERSE ORDER, but still + * after dummynet_modevent() has been called. Not called on reboot. + * VNET_SYSUNINIT is also called for each exiting vnet as it exits. + * or when the module is unloaded. + */ +//VNET_SYSUNINIT(vnet_dn_uninit, DN_SI_SUB, DN_MODEV_ORD+2, ip_dn_destroy, NULL); + /* end of file */ From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 11:07:47 2011 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 59334106564A; Tue, 3 May 2011 11:07:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A49B8FC0A; Tue, 3 May 2011 11:07:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p43B7lvr090448; Tue, 3 May 2011 11:07:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p43B7lWN090446; Tue, 3 May 2011 11:07:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105031107.p43B7lWN090446@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 3 May 2011 11:07: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: r221376 - 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, 03 May 2011 11:07:47 -0000 Author: ae Date: Tue May 3 11:07:46 2011 New Revision: 221376 URL: http://svn.freebsd.org/changeset/base/221376 Log: MFC r220832: Add sysctl handlers for net.inet.ip.dummynet.hash_size, .pipe_byte_limit and .pipe_slot_limit oids to prevent to set incorrect values. 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 May 3 11:00:31 2011 (r221375) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Tue May 3 11:07:46 2011 (r221376) @@ -108,14 +108,58 @@ SYSCTL_NODE(_net_inet_ip, OID_AUTO, dumm //#define DC(x) (&(VNET_NAME(_base_dn_cfg).x)) #define DC(x) (&(dn_cfg.x)) /* parameters */ -SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, hash_size, - CTLFLAG_RW, DC(hash_size), 0, "Default hash table size"); -SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, - CTLFLAG_RW, DC(slot_limit), 0, - "Upper limit in slots for pipe queue."); -SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, - CTLFLAG_RW, DC(byte_limit), 0, - "Upper limit in bytes for pipe queue."); + +static int +sysctl_hash_size(SYSCTL_HANDLER_ARGS) +{ + int error, value; + + value = dn_cfg.hash_size; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (value < 16 || value > 65536) + return (EINVAL); + dn_cfg.hash_size = value; + return (0); +} + +SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size, + CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size, + "I", "Default hash table size"); + +static int +sysctl_limits(SYSCTL_HANDLER_ARGS) +{ + int error; + long value; + + if (arg2 != 0) + value = dn_cfg.slot_limit; + else + value = dn_cfg.byte_limit; + error = sysctl_handle_long(oidp, &value, 0, req); + + if (error != 0 || req->newptr == NULL) + return (error); + if (arg2 != 0) { + if (value < 1) + return (EINVAL); + dn_cfg.slot_limit = value; + } else { + if (value < 1500) + return (EINVAL); + dn_cfg.byte_limit = value; + } + return (0); +} + +SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, + CTLTYPE_LONG | CTLFLAG_RW, 0, 1, sysctl_limits, + "L", "Upper limit in slots for pipe queue."); +SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, + CTLTYPE_LONG | CTLFLAG_RW, 0, 0, sysctl_limits, + "L", "Upper limit in bytes for pipe queue."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, io_fast, CTLFLAG_RW, DC(io_fast), 0, "Enable fast dummynet io."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, debug, From owner-svn-src-stable-8@FreeBSD.ORG Tue May 3 16:36:39 2011 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 6FB961065672; Tue, 3 May 2011 16:36:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CCF18FC16; Tue, 3 May 2011 16:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p43Gadxc002220; Tue, 3 May 2011 16:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p43GadGd002218; Tue, 3 May 2011 16:36:39 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201105031636.p43GadGd002218@svn.freebsd.org> From: Colin Percival Date: Tue, 3 May 2011 16:36: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: r221392 - 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: Tue, 03 May 2011 16:36:39 -0000 Author: cperciva Date: Tue May 3 16:36:39 2011 New Revision: 221392 URL: http://svn.freebsd.org/changeset/base/221392 Log: MFC r221049: Stop zeroing UFS1 superblocks if we fall off the end of the disk, in order to avoid wasting time (potentially many hours) in the event that we find a partially-overwritten UFS1 superblock. Modified: stable/8/sbin/newfs/mkfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/mkfs.c ============================================================================== --- stable/8/sbin/newfs/mkfs.c Tue May 3 16:00:36 2011 (r221391) +++ stable/8/sbin/newfs/mkfs.c Tue May 3 16:36:39 2011 (r221392) @@ -517,9 +517,12 @@ restart: fsdummy.fs_magic = 0; bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); - for (cg = 0; cg < fsdummy.fs_ncg; cg++) + for (cg = 0; cg < fsdummy.fs_ncg; cg++) { + if (fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)) > fssize) + break; bwrite(&disk, part_ofs + fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE); + } } } if (!Nflag) From owner-svn-src-stable-8@FreeBSD.ORG Wed May 4 01:24:03 2011 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 A6779106564A; Wed, 4 May 2011 01:24:03 +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 7A6AD8FC0A; Wed, 4 May 2011 01:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p441O3pJ024827; Wed, 4 May 2011 01:24:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p441O3fn024825; Wed, 4 May 2011 01:24:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105040124.p441O3fn024825@svn.freebsd.org> From: Rick Macklem Date: Wed, 4 May 2011 01:24:03 +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: r221416 - stable/8/sys/fs/nfsclient 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, 04 May 2011 01:24:03 -0000 Author: rmacklem Date: Wed May 4 01:24:03 2011 New Revision: 221416 URL: http://svn.freebsd.org/changeset/base/221416 Log: MFC: r220876 Modify the offset + size checks for read and write in the experimental NFS client to take care of overflows. Thanks go to dillon at apollo.backplane.com for providing the snippet of code that does this. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.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/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed May 4 01:07:32 2011 (r221415) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed May 4 01:24:03 2011 (r221416) @@ -1285,12 +1285,13 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u struct nfsmount *nmp = VFSTONFS(vnode_mount(vp)); struct nfsrv_descript *nd = &nfsd; int rsize; + off_t tmp_off; *attrflagp = 0; tsiz = uio_uio_resid(uiop); + tmp_off = uiop->uio_offset + tsiz; NFSLOCKMNT(nmp); - if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { - /* XXX Needs overflow/negative check for uio_offset */ + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uiop->uio_offset) { NFSUNLOCKMNT(nmp); return (EFBIG); } @@ -1458,12 +1459,14 @@ nfsrpc_writerpc(vnode_t vp, struct uio * struct nfsrv_descript nfsd; struct nfsrv_descript *nd = &nfsd; nfsattrbit_t attrbits; + off_t tmp_off; KASSERT(uiop->uio_iovcnt == 1, ("nfs: writerpc iovcnt > 1")); *attrflagp = 0; tsiz = uio_uio_resid(uiop); + tmp_off = uiop->uio_offset + tsiz; NFSLOCKMNT(nmp); - if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uiop->uio_offset) { NFSUNLOCKMNT(nmp); return (EFBIG); } From owner-svn-src-stable-8@FreeBSD.ORG Wed May 4 01:39:45 2011 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 18454106567B; Wed, 4 May 2011 01:39:45 +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 E057B8FC12; Wed, 4 May 2011 01:39:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p441difq025340; Wed, 4 May 2011 01:39:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p441diji025338; Wed, 4 May 2011 01:39:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105040139.p441diji025338@svn.freebsd.org> From: Rick Macklem Date: Wed, 4 May 2011 01:39:44 +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: r221417 - stable/8/sys/fs/nfsclient 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, 04 May 2011 01:39:45 -0000 Author: rmacklem Date: Wed May 4 01:39:44 2011 New Revision: 221417 URL: http://svn.freebsd.org/changeset/base/221417 Log: MFC: r220877 Modify the offset + size checks for read and write in the experimental NFS client to take care of overflows for the calls above the buffer cache layer in a manner similar to r220876. Thanks go to dillon at apollo.backplane.com for providing the snippet of code that does this. Modified: stable/8/sys/fs/nfsclient/nfs_clbio.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/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Wed May 4 01:24:03 2011 (r221416) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Wed May 4 01:39:44 2011 (r221417) @@ -448,6 +448,7 @@ ncl_bioread(struct vnode *vp, struct uio int bcount; int seqcount; int nra, error = 0, n = 0, on = 0; + off_t tmp_off; KASSERT(uio->uio_rw == UIO_READ, ("ncl_read mode")); if (uio->uio_resid == 0) @@ -465,11 +466,14 @@ ncl_bioread(struct vnode *vp, struct uio } if (nmp->nm_rsize == 0 || nmp->nm_readdirsize == 0) (void) newnfs_iosize(nmp); - mtx_unlock(&nmp->nm_mtx); + tmp_off = uio->uio_offset + uio->uio_resid; if (vp->v_type != VDIR && - (uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset)) { + mtx_unlock(&nmp->nm_mtx); return (EFBIG); + } + mtx_unlock(&nmp->nm_mtx); if (newnfs_directio_enable && (ioflag & IO_DIRECT) && (vp->v_type == VREG)) /* No caching/ no readaheads. Just read data into the user buffer */ @@ -871,6 +875,7 @@ ncl_write(struct vop_write_args *ap) int bcount; int n, on, error = 0; struct proc *p = td?td->td_proc:NULL; + off_t tmp_off; KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, @@ -937,8 +942,13 @@ flush_and_restart: if (uio->uio_offset < 0) return (EINVAL); - if ((uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + tmp_off = uio->uio_offset + uio->uio_resid; + mtx_lock(&nmp->nm_mtx); + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { + mtx_unlock(&nmp->nm_mtx); return (EFBIG); + } + mtx_unlock(&nmp->nm_mtx); if (uio->uio_resid == 0) return (0); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 5 12:52:06 2011 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 5FD431065673; Thu, 5 May 2011 12:52:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0988FC12; Thu, 5 May 2011 12:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45Cq6et000118; Thu, 5 May 2011 12:52:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45Cq6EE000116; Thu, 5 May 2011 12:52:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105051252.p45Cq6EE000116@svn.freebsd.org> From: Xin LI Date: Thu, 5 May 2011 12:52: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: r221493 - stable/8/sys/dev/coretemp 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, 05 May 2011 12:52:06 -0000 Author: delphij Date: Thu May 5 12:52:05 2011 New Revision: 221493 URL: http://svn.freebsd.org/changeset/base/221493 Log: MFC r221335: Correct a typo. According to Intel document 318914, the Tj(max) for Core 2 Duo Mobile CPUs should be 105. Noticed by: Mark Johnston Modified: stable/8/sys/dev/coretemp/coretemp.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/coretemp/coretemp.c ============================================================================== --- stable/8/sys/dev/coretemp/coretemp.c Thu May 5 10:17:49 2011 (r221492) +++ stable/8/sys/dev/coretemp/coretemp.c Thu May 5 12:52:05 2011 (r221493) @@ -192,7 +192,7 @@ coretemp_attach(device_t dev) } else if (cpu_model == 0x17) { switch (cpu_stepping) { case 0x6: /* Mobile Core 2 Duo */ - sc->sc_tjmax = 104; + sc->sc_tjmax = 105; break; default: /* Unknown stepping */ break; From owner-svn-src-stable-8@FreeBSD.ORG Thu May 5 14:19:38 2011 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 18CEA106566C; Thu, 5 May 2011 14:19:38 +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 032A08FC14; Thu, 5 May 2011 14:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45EJbiC003182; Thu, 5 May 2011 14:19:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45EJbFR003180; Thu, 5 May 2011 14:19:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105051419.p45EJbFR003180@svn.freebsd.org> From: Rick Macklem Date: Thu, 5 May 2011 14:19:37 +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: r221498 - stable/8/sys/fs/nfsclient 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, 05 May 2011 14:19:38 -0000 Author: rmacklem Date: Thu May 5 14:19:37 2011 New Revision: 221498 URL: http://svn.freebsd.org/changeset/base/221498 Log: MFC: r220928 Remove the nm_mtx mutex locking from the test for nm_maxfilesize. This value rarely, if ever, changes and the nm_mtx mutex is locked/unlocked earlier in the function, which should be sufficient to avoid getting a stale cached value for it. There is a discussion w.r.t. what these tests should be, but I've left them basically the same as the regular NFS client for now. Modified: stable/8/sys/fs/nfsclient/nfs_clbio.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/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Thu May 5 14:16:40 2011 (r221497) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Thu May 5 14:19:37 2011 (r221498) @@ -943,12 +943,8 @@ flush_and_restart: if (uio->uio_offset < 0) return (EINVAL); tmp_off = uio->uio_offset + uio->uio_resid; - mtx_lock(&nmp->nm_mtx); - if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { - mtx_unlock(&nmp->nm_mtx); + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) return (EFBIG); - } - mtx_unlock(&nmp->nm_mtx); if (uio->uio_resid == 0) return (0); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 5 18:50:52 2011 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 DC493106566C; Thu, 5 May 2011 18:50:52 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8A218FC0C; Thu, 5 May 2011 18:50:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45IoqQ7011610; Thu, 5 May 2011 18:50:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45Ioq2P011604; Thu, 5 May 2011 18:50:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201105051850.p45Ioq2P011604@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 5 May 2011 18:50:52 +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: r221507 - in stable/8/sbin: hastctl 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, 05 May 2011 18:50:53 -0000 Author: trociny Date: Thu May 5 18:50:52 2011 New Revision: 221507 URL: http://svn.freebsd.org/changeset/base/221507 Log: MFC r221074, r221075, r221076, r221078: r221074: Fix assert messages. r221075: For conversation between hastctl and hastd we should use HASTCTL_CMD defines. r221076: Rename HASTCTL_ defines, which are used for conversation between main hastd process and workers, remove unused one and set different range of numbers. This is done in order not to confuse them with HASTCTL_CMD defines, used for conversation between hastctl and hastd, and to avoid bugs like the one fixed in r221075. r221078: Add missing ifdef. This fixes build with NO_OPENSSL. Reported by: Pawel Tyll Approved by: pjd (mentor) Modified: stable/8/sbin/hastctl/hastctl.c stable/8/sbin/hastd/control.c stable/8/sbin/hastd/control.h stable/8/sbin/hastd/hast_proto.c stable/8/sbin/hastd/hastd.c Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Thu May 5 18:47:24 2011 (r221506) +++ stable/8/sbin/hastctl/hastctl.c Thu May 5 18:50:52 2011 (r221507) @@ -465,7 +465,7 @@ main(int argc, char *argv[]) } break; default: - assert(!"Impossible role!"); + assert(!"Impossible command!"); } /* Setup control connection... */ @@ -513,7 +513,7 @@ main(int argc, char *argv[]) error = control_status(nv); break; default: - assert(!"Impossible role!"); + assert(!"Impossible command!"); } exit(error); Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Thu May 5 18:47:24 2011 (r221506) +++ stable/8/sbin/hastd/control.c Thu May 5 18:50:52 2011 (r221507) @@ -162,7 +162,7 @@ control_status_worker(struct hast_resour * Prepare and send command to worker process. */ cnvout = nv_alloc(); - nv_add_uint8(cnvout, HASTCTL_STATUS, "cmd"); + nv_add_uint8(cnvout, CONTROL_STATUS, "cmd"); error = nv_error(cnvout); if (error != 0) { pjdlog_common(LOG_ERR, 0, error, @@ -324,7 +324,7 @@ control_handle(struct hastd_config *cfg) error = EHAST_INVALID; goto fail; } - if (cmd == HASTCTL_SET_ROLE) { + if (cmd == HASTCTL_CMD_SETROLE) { role = nv_get_uint8(nvin, "role"); switch (role) { case HAST_ROLE_INIT: @@ -345,11 +345,11 @@ control_handle(struct hastd_config *cfg) ii = 0; TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { switch (cmd) { - case HASTCTL_SET_ROLE: + case HASTCTL_CMD_SETROLE: control_set_role_common(cfg, nvout, role, res, res->hr_name, ii++); break; - case HASTCTL_STATUS: + case HASTCTL_CMD_STATUS: control_status(cfg, nvout, res, res->hr_name, ii++); break; @@ -368,11 +368,11 @@ control_handle(struct hastd_config *cfg) if (str == NULL) break; switch (cmd) { - case HASTCTL_SET_ROLE: + case HASTCTL_CMD_SETROLE: control_set_role_common(cfg, nvout, role, NULL, str, ii); break; - case HASTCTL_STATUS: + case HASTCTL_CMD_STATUS: control_status(cfg, nvout, NULL, str, ii); break; default: @@ -427,7 +427,7 @@ ctrl_thread(void *arg) } nvout = nv_alloc(); switch (cmd) { - case HASTCTL_STATUS: + case CONTROL_STATUS: if (res->hr_remotein != NULL && res->hr_remoteout != NULL) { nv_add_string(nvout, "complete", "status"); @@ -448,7 +448,7 @@ ctrl_thread(void *arg) } nv_add_int16(nvout, 0, "error"); break; - case HASTCTL_RELOAD: + case CONTROL_RELOAD: /* * When parent receives SIGHUP and discovers that * something related to us has changes, it sends reload Modified: stable/8/sbin/hastd/control.h ============================================================================== --- stable/8/sbin/hastd/control.h Thu May 5 18:47:24 2011 (r221506) +++ stable/8/sbin/hastd/control.h Thu May 5 18:50:52 2011 (r221507) @@ -32,9 +32,8 @@ #ifndef _CONTROL_H_ #define _CONTROL_H_ -#define HASTCTL_SET_ROLE 1 -#define HASTCTL_STATUS 2 -#define HASTCTL_RELOAD 3 +#define CONTROL_STATUS 10 +#define CONTROL_RELOAD 11 struct hastd_config; struct hast_resource; Modified: stable/8/sbin/hastd/hast_proto.c ============================================================================== --- stable/8/sbin/hastd/hast_proto.c Thu May 5 18:47:24 2011 (r221506) +++ stable/8/sbin/hastd/hast_proto.c Thu May 5 18:50:52 2011 (r221507) @@ -69,7 +69,9 @@ struct hast_pipe_stage { static struct hast_pipe_stage pipeline[] = { { "compression", compression_send, compression_recv }, +#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } +#endif }; /* Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Thu May 5 18:47:24 2011 (r221506) +++ stable/8/sbin/hastd/hastd.c Thu May 5 18:50:52 2011 (r221507) @@ -424,7 +424,7 @@ resource_reload(const struct hast_resour PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); nvout = nv_alloc(); - nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd"); + nv_add_uint8(nvout, CONTROL_RELOAD, "cmd"); nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr"); nv_add_string(nvout, res->hr_sourceaddr, "sourceaddr"); nv_add_int32(nvout, (int32_t)res->hr_replication, "replication"); From owner-svn-src-stable-8@FreeBSD.ORG Thu May 5 22:04:59 2011 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 B7E96106566B; Thu, 5 May 2011 22:04:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A675B8FC18; Thu, 5 May 2011 22:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45M4xpu018623; Thu, 5 May 2011 22:04:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45M4xX0018621; Thu, 5 May 2011 22:04:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105052204.p45M4xX0018621@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 5 May 2011 22:04: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: r221514 - stable/8/bin/sh 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, 05 May 2011 22:04:59 -0000 Author: jilles Date: Thu May 5 22:04:59 2011 New Revision: 221514 URL: http://svn.freebsd.org/changeset/base/221514 Log: MFC r221011: sh: Remove duplicate code resetting uid/gid for set +p/ +o privileged. Modified: stable/8/bin/sh/options.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/options.c ============================================================================== --- stable/8/bin/sh/options.c Thu May 5 20:55:55 2011 (r221513) +++ stable/8/bin/sh/options.c Thu May 5 22:04:59 2011 (r221514) @@ -195,13 +195,8 @@ options(int cmdline) minus_o(*argptr, val); if (*argptr) argptr++; - } else { - if (c == 'p' && !val && privileged) { - (void) setuid(getuid()); - (void) setgid(getgid()); - } + } else setoption(c, val); - } } } return; @@ -269,10 +264,6 @@ minus_o(char *name, int val) } else { for (i = 0; i < NOPTS; i++) if (equal(name, optlist[i].name)) { - if (!val && privileged && equal(name, "privileged")) { - (void) setuid(getuid()); - (void) setgid(getgid()); - } setoption(optlist[i].letter, val); return; } @@ -286,6 +277,10 @@ setoption(int flag, int val) { int i; + if (flag == 'p' && !val && privileged) { + (void) setuid(getuid()); + (void) setgid(getgid()); + } for (i = 0; i < NOPTS; i++) if (optlist[i].letter == flag) { optlist[i].val = val; From owner-svn-src-stable-8@FreeBSD.ORG Thu May 5 22:07:02 2011 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 6BB59106564A; Thu, 5 May 2011 22:07:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7EB8FC08; Thu, 5 May 2011 22:07:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p45M728k018876; Thu, 5 May 2011 22:07:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p45M72Lu018874; Thu, 5 May 2011 22:07:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105052207.p45M72Lu018874@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 5 May 2011 22:07:02 +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: r221515 - stable/8/bin/sh 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, 05 May 2011 22:07:02 -0000 Author: jilles Date: Thu May 5 22:07:02 2011 New Revision: 221515 URL: http://svn.freebsd.org/changeset/base/221515 Log: MFC r221012: sh: Check setuid()/setgid() return values. If the -p option is turned off, privileges from a setuid or setgid binary are dropped. Make sure to check if this succeeds. If it fails, this is an error which will cause the shell to abort except in interactive mode or if 'command' was used to make 'set' or an outer 'eval' or '.' non-special. Note that taking advantage of this feature and writing setuid shell scripts seems unwise. Modified: stable/8/bin/sh/options.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/options.c ============================================================================== --- stable/8/bin/sh/options.c Thu May 5 22:04:59 2011 (r221514) +++ stable/8/bin/sh/options.c Thu May 5 22:07:02 2011 (r221515) @@ -278,8 +278,10 @@ setoption(int flag, int val) int i; if (flag == 'p' && !val && privileged) { - (void) setuid(getuid()); - (void) setgid(getgid()); + if (setgid(getgid()) == -1) + error("setgid"); + if (setuid(getuid()) == -1) + error("setuid"); } for (i = 0; i < NOPTS; i++) if (optlist[i].letter == flag) { From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 12:49:32 2011 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 E6EE21065670; Fri, 6 May 2011 12:49:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC32C8FC1C; Fri, 6 May 2011 12:49:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46CnWOe048675; Fri, 6 May 2011 12:49:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46CnWWW048672; Fri, 6 May 2011 12:49:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105061249.p46CnWWW048672@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 May 2011 12:49: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: r221522 - in stable/8: bin/sh tools/regression/bin/sh/expansion 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, 06 May 2011 12:49:33 -0000 Author: jilles Date: Fri May 6 12:49:32 2011 New Revision: 221522 URL: http://svn.freebsd.org/changeset/base/221522 Log: MFC r220903: sh: Do not word split "${#parameter}". This is only a problem if IFS contains digits, which is unusual but valid. Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated as ${#parameter}. The underlying problem was that "${#parameter}" erroneously added CTLESC bytes before determining the length. This was properly fixed for PR bin/56147 but the incorrect fix was not backed out. Reported by: Seeker on forums.freebsd.org Added: stable/8/tools/regression/bin/sh/expansion/length6.0 - copied unchanged from r220903, head/tools/regression/bin/sh/expansion/length6.0 Modified: stable/8/bin/sh/parser.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Fri May 6 07:13:34 2011 (r221521) +++ stable/8/bin/sh/parser.c Fri May 6 12:49:32 2011 (r221522) @@ -1289,7 +1289,7 @@ parsesub: { pungetc(); } STPUTC('=', out); - if (subtype != VSLENGTH && (dblquote || arinest)) + if (dblquote || arinest) flags |= VSQUOTE; *(stackblock() + typeloc) = subtype | flags; if (subtype != VSNORMAL) Copied: stable/8/tools/regression/bin/sh/expansion/length6.0 (from r220903, head/tools/regression/bin/sh/expansion/length6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/length6.0 Fri May 6 12:49:32 2011 (r221522, copy of r220903, head/tools/regression/bin/sh/expansion/length6.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +x='!@#$%^&*()[]' +[ ${#x} = 12 ] || echo bad 1 +[ "${#x}" = 12 ] || echo bad 2 +IFS=2 +[ ${#x} = 1 ] || echo bad 3 +[ "${#x}" = 12 ] || echo bad 4 From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 13:12:45 2011 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 A381A106564A; Fri, 6 May 2011 13:12:45 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92AF58FC16; Fri, 6 May 2011 13:12:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46DCj25049444; Fri, 6 May 2011 13:12:45 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46DCj1e049441; Fri, 6 May 2011 13:12:45 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201105061312.p46DCj1e049441@svn.freebsd.org> From: Fabien Thomas Date: Fri, 6 May 2011 13:12: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: r221524 - stable/8/sys/netipsec 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, 06 May 2011 13:12:45 -0000 Author: fabient Date: Fri May 6 13:12:45 2011 New Revision: 221524 URL: http://svn.freebsd.org/changeset/base/221524 Log: MFC r220194: Fix two SA refcount: - AH does not release the SA like in ESP/IPCOMP when handling EAGAIN - ipsec_process_done incorrectly release the SA. Modified: stable/8/sys/netipsec/ipsec_output.c stable/8/sys/netipsec/xform_ah.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/netipsec/ipsec_output.c ============================================================================== --- stable/8/sys/netipsec/ipsec_output.c Fri May 6 13:11:50 2011 (r221523) +++ stable/8/sys/netipsec/ipsec_output.c Fri May 6 13:12:45 2011 (r221524) @@ -247,7 +247,6 @@ ipsec_process_done(struct mbuf *m, struc panic("ipsec_process_done"); bad: m_freem(m); - KEY_FREESAV(&sav); return (error); } Modified: stable/8/sys/netipsec/xform_ah.c ============================================================================== --- stable/8/sys/netipsec/xform_ah.c Fri May 6 13:11:50 2011 (r221523) +++ stable/8/sys/netipsec/xform_ah.c Fri May 6 13:12:45 2011 (r221524) @@ -785,6 +785,7 @@ ah_input_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { + KEY_FREESAV(&sav); error = crypto_dispatch(crp); return error; } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 13:24:10 2011 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 D0B44106564A; Fri, 6 May 2011 13:24:10 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6C628FC0A; Fri, 6 May 2011 13:24:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46DOA7S049833; Fri, 6 May 2011 13:24:10 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46DOAOK049825; Fri, 6 May 2011 13:24:10 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201105061324.p46DOAOK049825@svn.freebsd.org> From: Fabien Thomas Date: Fri, 6 May 2011 13:24: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: r221525 - stable/8/sys/netipsec 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, 06 May 2011 13:24:10 -0000 Author: fabient Date: Fri May 6 13:24:10 2011 New Revision: 221525 URL: http://svn.freebsd.org/changeset/base/221525 Log: MFC r220206: Optimisation in IPSEC(4): - Remove contention on ISR during the crypto operation by using rwlock(9). - Remove a second lookup of the SA in the callback. Modified: stable/8/sys/netipsec/ipsec.h stable/8/sys/netipsec/key.c stable/8/sys/netipsec/key.h stable/8/sys/netipsec/xform.h stable/8/sys/netipsec/xform_ah.c stable/8/sys/netipsec/xform_esp.c stable/8/sys/netipsec/xform_ipcomp.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/netipsec/ipsec.h ============================================================================== --- stable/8/sys/netipsec/ipsec.h Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/ipsec.h Fri May 6 13:24:10 2011 (r221525) @@ -123,7 +123,7 @@ struct ipsecrequest { struct secasvar *sav; /* place holder of SA for use */ struct secpolicy *sp; /* back pointer to SP */ - struct mtx lock; /* to interlock updates */ + struct rwlock lock; /* to interlock updates */ }; /* @@ -132,11 +132,15 @@ struct ipsecrequest { * hard it is to remove this... */ #define IPSECREQUEST_LOCK_INIT(_isr) \ - mtx_init(&(_isr)->lock, "ipsec request", NULL, MTX_DEF | MTX_RECURSE) -#define IPSECREQUEST_LOCK(_isr) mtx_lock(&(_isr)->lock) -#define IPSECREQUEST_UNLOCK(_isr) mtx_unlock(&(_isr)->lock) -#define IPSECREQUEST_LOCK_DESTROY(_isr) mtx_destroy(&(_isr)->lock) -#define IPSECREQUEST_LOCK_ASSERT(_isr) mtx_assert(&(_isr)->lock, MA_OWNED) + rw_init_flags(&(_isr)->lock, "ipsec request", RW_RECURSE) +#define IPSECREQUEST_LOCK(_isr) rw_rlock(&(_isr)->lock) +#define IPSECREQUEST_UNLOCK(_isr) rw_runlock(&(_isr)->lock) +#define IPSECREQUEST_WLOCK(_isr) rw_wlock(&(_isr)->lock) +#define IPSECREQUEST_WUNLOCK(_isr) rw_wunlock(&(_isr)->lock) +#define IPSECREQUEST_UPGRADE(_isr) rw_try_upgrade(&(_isr)->lock) +#define IPSECREQUEST_DOWNGRADE(_isr) rw_downgrade(&(_isr)->lock) +#define IPSECREQUEST_LOCK_DESTROY(_isr) rw_destroy(&(_isr)->lock) +#define IPSECREQUEST_LOCK_ASSERT(_isr) rw_assert(&(_isr)->lock, RA_LOCKED) /* security policy in PCB */ struct inpcbpolicy { Modified: stable/8/sys/netipsec/key.c ============================================================================== --- stable/8/sys/netipsec/key.c Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/key.c Fri May 6 13:24:10 2011 (r221525) @@ -809,6 +809,7 @@ key_checkrequest(struct ipsecrequest *is { u_int level; int error; + struct secasvar *sav; IPSEC_ASSERT(isr != NULL, ("null isr")); IPSEC_ASSERT(saidx != NULL, ("null saidx")); @@ -826,45 +827,31 @@ key_checkrequest(struct ipsecrequest *is /* get current level */ level = ipsec_get_reqlevel(isr); -#if 0 - /* - * We do allocate new SA only if the state of SA in the holder is - * SADB_SASTATE_DEAD. The SA for outbound must be the oldest. - */ - if (isr->sav != NULL) { - if (isr->sav->sah == NULL) - panic("%s: sah is null.\n", __func__); - if (isr->sav == (struct secasvar *)LIST_FIRST( - &isr->sav->sah->savtree[SADB_SASTATE_DEAD])) { - KEY_FREESAV(&isr->sav); - isr->sav = NULL; - } - } -#else + /* - * we free any SA stashed in the IPsec request because a different + * We check new SA in the IPsec request because a different * SA may be involved each time this request is checked, either * because new SAs are being configured, or this request is * associated with an unconnected datagram socket, or this request * is associated with a system default policy. * - * The operation may have negative impact to performance. We may - * want to check cached SA carefully, rather than picking new SA - * every time. - */ - if (isr->sav != NULL) { - KEY_FREESAV(&isr->sav); - isr->sav = NULL; - } -#endif - - /* - * new SA allocation if no SA found. * key_allocsa_policy should allocate the oldest SA available. * See key_do_allocsa_policy(), and draft-jenkins-ipsec-rekeying-03.txt. */ - if (isr->sav == NULL) - isr->sav = key_allocsa_policy(saidx); + sav = key_allocsa_policy(saidx); + if (sav != isr->sav) { + /* SA need to be updated. */ + if (!IPSECREQUEST_UPGRADE(isr)) { + /* Kick everyone off. */ + IPSECREQUEST_UNLOCK(isr); + IPSECREQUEST_WLOCK(isr); + } + if (isr->sav != NULL) + KEY_FREESAV(&isr->sav); + isr->sav = sav; + IPSECREQUEST_DOWNGRADE(isr); + } else if (sav != NULL) + KEY_FREESAV(&sav); /* When there is SA. */ if (isr->sav != NULL) { @@ -1239,6 +1226,16 @@ key_freesp_so(struct secpolicy **sp) KEY_FREESP(sp); } +void +key_addrefsa(struct secasvar *sav, const char* where, int tag) +{ + + IPSEC_ASSERT(sav != NULL, ("null sav")); + IPSEC_ASSERT(sav->refcnt > 0, ("refcount must exist")); + + sa_addref(sav); +} + /* * Must be called after calling key_allocsa(). * This function is called by key_freesp() to free some SA allocated Modified: stable/8/sys/netipsec/key.h ============================================================================== --- stable/8/sys/netipsec/key.h Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/key.h Fri May 6 13:24:10 2011 (r221525) @@ -76,10 +76,13 @@ extern void _key_freesp(struct secpolicy extern struct secasvar *key_allocsa(union sockaddr_union *, u_int, u_int32_t, const char*, int); +extern void key_addrefsa(struct secasvar *, const char*, int); extern void key_freesav(struct secasvar **, const char*, int); #define KEY_ALLOCSA(dst, proto, spi) \ key_allocsa(dst, proto, spi, __FILE__, __LINE__) +#define KEY_ADDREFSA(sav) \ + key_addrefsa(sav, __FILE__, __LINE__) #define KEY_FREESAV(psav) \ key_freesav(psav, __FILE__, __LINE__) Modified: stable/8/sys/netipsec/xform.h ============================================================================== --- stable/8/sys/netipsec/xform.h Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/xform.h Fri May 6 13:24:10 2011 (r221525) @@ -75,6 +75,7 @@ struct tdb_crypto { int tc_protoff; /* current protocol offset */ int tc_skip; /* data offset */ caddr_t tc_ptr; /* associated crypto data */ + struct secasvar *tc_sav; /* related SA */ }; struct secasvar; Modified: stable/8/sys/netipsec/xform_ah.c ============================================================================== --- stable/8/sys/netipsec/xform_ah.c Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/xform_ah.c Fri May 6 13:24:10 2011 (r221525) @@ -715,6 +715,8 @@ ah_input(struct mbuf *m, struct secasvar tc->tc_protoff = protoff; tc->tc_skip = skip; tc->tc_ptr = (caddr_t) mtag; /* Save the mtag we've identified. */ + KEY_ADDREFSA(sav); + tc->tc_sav = sav; if (mtag == NULL) return crypto_dispatch(crp); @@ -764,13 +766,8 @@ ah_input_cb(struct cryptop *crp) mtag = (struct m_tag *) tc->tc_ptr; m = (struct mbuf *) crp->crp_buf; - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { - V_ahstat.ahs_notdb++; - DPRINTF(("%s: SA expired while in crypto\n", __func__)); - error = ENOBUFS; /*XXX*/ - goto bad; - } + sav = tc->tc_sav; + IPSEC_ASSERT(sav != NULL, ("null SA!")); saidx = &sav->sah->saidx; IPSEC_ASSERT(saidx->dst.sa.sa_family == AF_INET || @@ -785,7 +782,6 @@ ah_input_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); error = crypto_dispatch(crp); return error; } @@ -1111,6 +1107,8 @@ ah_output( /* These are passed as-is to the callback. */ tc->tc_isr = isr; + KEY_ADDREFSA(sav); + tc->tc_sav = sav; tc->tc_spi = sav->spi; tc->tc_dst = sav->sah->saidx.dst; tc->tc_proto = sav->sah->saidx.proto; @@ -1147,14 +1145,14 @@ ah_output_cb(struct cryptop *crp) isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { + sav = tc->tc_sav; + /* With the isr lock released SA pointer can be updated. */ + if (sav != isr->sav) { V_ahstat.ahs_notdb++; DPRINTF(("%s: SA expired while in crypto\n", __func__)); error = ENOBUFS; /*XXX*/ goto bad; } - IPSEC_ASSERT(isr->sav == sav, ("SA changed\n")); /* Check for crypto errors. */ if (crp->crp_etype) { @@ -1162,7 +1160,6 @@ ah_output_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); error = crypto_dispatch(crp); return error; Modified: stable/8/sys/netipsec/xform_esp.c ============================================================================== --- stable/8/sys/netipsec/xform_esp.c Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/xform_esp.c Fri May 6 13:24:10 2011 (r221525) @@ -423,6 +423,8 @@ esp_input(struct mbuf *m, struct secasva tc->tc_proto = sav->sah->saidx.proto; tc->tc_protoff = protoff; tc->tc_skip = skip; + KEY_ADDREFSA(sav); + tc->tc_sav = sav; /* Decryption descriptor */ if (espx) { @@ -484,15 +486,8 @@ esp_input_cb(struct cryptop *crp) mtag = (struct m_tag *) tc->tc_ptr; m = (struct mbuf *) crp->crp_buf; - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { - V_espstat.esps_notdb++; - DPRINTF(("%s: SA gone during crypto (SA %s/%08lx proto %u)\n", - __func__, ipsec_address(&tc->tc_dst), - (u_long) ntohl(tc->tc_spi), tc->tc_proto)); - error = ENOBUFS; /*XXX*/ - goto bad; - } + sav = tc->tc_sav; + IPSEC_ASSERT(sav != NULL, ("null SA!")); saidx = &sav->sah->saidx; IPSEC_ASSERT(saidx->dst.sa.sa_family == AF_INET || @@ -509,7 +504,6 @@ esp_input_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); error = crypto_dispatch(crp); return error; } @@ -877,6 +871,8 @@ esp_output( /* Callback parameters */ tc->tc_isr = isr; + KEY_ADDREFSA(sav); + tc->tc_sav = sav; tc->tc_spi = sav->spi; tc->tc_dst = saidx->dst; tc->tc_proto = saidx->proto; @@ -926,8 +922,9 @@ esp_output_cb(struct cryptop *crp) isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { + sav = tc->tc_sav; + /* With the isr lock released SA pointer can be updated. */ + if (sav != isr->sav) { V_espstat.esps_notdb++; DPRINTF(("%s: SA gone during crypto (SA %s/%08lx proto %u)\n", __func__, ipsec_address(&tc->tc_dst), @@ -935,8 +932,6 @@ esp_output_cb(struct cryptop *crp) error = ENOBUFS; /*XXX*/ goto bad; } - IPSEC_ASSERT(isr->sav == sav, - ("SA changed was %p now %p\n", isr->sav, sav)); /* Check for crypto errors. */ if (crp->crp_etype) { @@ -945,7 +940,6 @@ esp_output_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); error = crypto_dispatch(crp); return error; Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Fri May 6 13:12:45 2011 (r221524) +++ stable/8/sys/netipsec/xform_ipcomp.c Fri May 6 13:24:10 2011 (r221525) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -206,6 +207,8 @@ ipcomp_input(struct mbuf *m, struct seca tc->tc_proto = sav->sah->saidx.proto; tc->tc_protoff = protoff; tc->tc_skip = skip; + KEY_ADDREFSA(sav); + tc->tc_sav = sav; return crypto_dispatch(crp); } @@ -249,13 +252,8 @@ ipcomp_input_cb(struct cryptop *crp) mtag = (struct mtag *) tc->tc_ptr; m = (struct mbuf *) crp->crp_buf; - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { - V_ipcompstat.ipcomps_notdb++; - DPRINTF(("%s: SA expired while in crypto\n", __func__)); - error = ENOBUFS; /*XXX*/ - goto bad; - } + sav = tc->tc_sav; + IPSEC_ASSERT(sav != NULL, ("null SA!")); saidx = &sav->sah->saidx; IPSEC_ASSERT(saidx->dst.sa.sa_family == AF_INET || @@ -269,7 +267,6 @@ ipcomp_input_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); return crypto_dispatch(crp); } V_ipcompstat.ipcomps_noxform++; @@ -452,6 +449,8 @@ ipcomp_output( } tc->tc_isr = isr; + KEY_ADDREFSA(sav); + tc->tc_sav = sav; tc->tc_spi = sav->spi; tc->tc_dst = sav->sah->saidx.dst; tc->tc_proto = sav->sah->saidx.proto; @@ -492,14 +491,14 @@ ipcomp_output_cb(struct cryptop *crp) isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); - sav = KEY_ALLOCSA(&tc->tc_dst, tc->tc_proto, tc->tc_spi); - if (sav == NULL) { + sav = tc->tc_sav; + /* With the isr lock released SA pointer can be updated. */ + if (sav != isr->sav) { V_ipcompstat.ipcomps_notdb++; DPRINTF(("%s: SA expired while in crypto\n", __func__)); error = ENOBUFS; /*XXX*/ goto bad; } - IPSEC_ASSERT(isr->sav == sav, ("SA changed\n")); /* Check for crypto errors */ if (crp->crp_etype) { @@ -508,7 +507,6 @@ ipcomp_output_cb(struct cryptop *crp) sav->tdb_cryptoid = crp->crp_sid; if (crp->crp_etype == EAGAIN) { - KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); return crypto_dispatch(crp); } From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 14:05:33 2011 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 6068A106564A; Fri, 6 May 2011 14:05:33 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 356E58FC0A; Fri, 6 May 2011 14:05:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46E5Xxt051240; Fri, 6 May 2011 14:05:33 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46E5XXW051237; Fri, 6 May 2011 14:05:33 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201105061405.p46E5XXW051237@svn.freebsd.org> From: Fabien Thomas Date: Fri, 6 May 2011 14:05:33 +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: r221528 - stable/8/sys/kern 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, 06 May 2011 14:05:33 -0000 Author: fabient Date: Fri May 6 14:05:32 2011 New Revision: 221528 URL: http://svn.freebsd.org/changeset/base/221528 Log: MFC r220198: Clearing the flag when preempting will let the preempted thread run too much time. This can finish in a scheduler deadlock with ping-pong between two threads. One sample of this is: - device lapic (to have a preemption point on critical_exit()) - options DEVICE_POLLING with HZ>1499 (to have lapic freq = hardclock freq) - running a cpu intensive task (that does not enter the kernel) - only one CPU on SMP or no SMP. As requested by jhb@ 4BSD have received the same type of fix instead of propagating the flag to the new thread. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.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/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Fri May 6 13:51:54 2011 (r221527) +++ stable/8/sys/kern/sched_4bsd.c Fri May 6 14:05:32 2011 (r221528) @@ -944,13 +944,9 @@ sched_switch(struct thread *td, struct t if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_rem(); - if (newtd) { - MPASS(newtd->td_lock == &sched_lock); - newtd->td_flags |= (td->td_flags & TDF_NEEDRESCHED); - } - td->td_lastcpu = td->td_oncpu; - td->td_flags &= ~TDF_NEEDRESCHED; + if (!(flags & SW_PREEMPT)) + td->td_flags &= ~TDF_NEEDRESCHED; td->td_owepreempt = 0; td->td_oncpu = NOCPU; Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Fri May 6 13:51:54 2011 (r221527) +++ stable/8/sys/kern/sched_ule.c Fri May 6 14:05:32 2011 (r221528) @@ -1795,7 +1795,8 @@ sched_switch(struct thread *td, struct t ts->ts_rltick = ticks; td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; - td->td_flags &= ~TDF_NEEDRESCHED; + if (!(flags & SW_PREEMPT)) + td->td_flags &= ~TDF_NEEDRESCHED; td->td_owepreempt = 0; tdq->tdq_switchcnt++; /* From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 18:40:52 2011 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 2D85C1065674; Fri, 6 May 2011 18:40:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA098FC08; Fri, 6 May 2011 18:40:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46IeqBo061232; Fri, 6 May 2011 18:40:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46IepxR061230; Fri, 6 May 2011 18:40:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105061840.p46IepxR061230@svn.freebsd.org> From: Xin LI Date: Fri, 6 May 2011 18:40:51 +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: r221538 - in stable: 7/lib/libc/string 8/lib/libc/string 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, 06 May 2011 18:40:52 -0000 Author: delphij Date: Fri May 6 18:40:51 2011 New Revision: 221538 URL: http://svn.freebsd.org/changeset/base/221538 Log: MFC r221401: Fix prototype for ffsll(3) and fls(3). PR: docs/156796 Submitted by: Jean-Yves Migeon Modified: stable/8/lib/libc/string/ffs.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/string/ffs.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/string/ffs.3 ============================================================================== --- stable/8/lib/libc/string/ffs.3 Fri May 6 17:51:00 2011 (r221537) +++ stable/8/lib/libc/string/ffs.3 Fri May 6 18:40:51 2011 (r221538) @@ -30,7 +30,7 @@ .\" @(#)ffs.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd October 26, 2008 +.Dd May 3, 2011 .Dt FFS 3 .Os .Sh NAME @@ -50,8 +50,8 @@ .Ft int .Fn ffsl "long value" .Ft int -.Ft int .Fn ffsll "long long value" +.Ft int .Fn fls "int value" .Ft int .Fn flsl "long value" From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 20:02:24 2011 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 3E66C1065674; Fri, 6 May 2011 20:02:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD3B8FC08; Fri, 6 May 2011 20:02:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46K2OMx063922; Fri, 6 May 2011 20:02:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46K2OP3063920; Fri, 6 May 2011 20:02:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105062002.p46K2OP3063920@svn.freebsd.org> From: Marius Strobl Date: Fri, 6 May 2011 20:02: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: r221544 - stable/8/sys/dev/bge 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, 06 May 2011 20:02:24 -0000 Author: marius Date: Fri May 6 20:02:23 2011 New Revision: 221544 URL: http://svn.freebsd.org/changeset/base/221544 Log: MFC: r221343 Fix an logic bug which caused jumbo buffers to not be synced and unloaded. Reported and tested by: Michael Moll Modified: stable/8/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Fri May 6 20:02:19 2011 (r221543) +++ stable/8/sys/dev/bge/if_bge.c Fri May 6 20:02:23 2011 (r221544) @@ -1022,7 +1022,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i return (error); } - if (sc->bge_cdata.bge_rx_jumbo_chain[i] == NULL) { + if (sc->bge_cdata.bge_rx_jumbo_chain[i] != NULL) { bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->bge_cdata.bge_mtag_jumbo, From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 20:04:48 2011 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 00ADA1065672; Fri, 6 May 2011 20:04:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA72F8FC0C; Fri, 6 May 2011 20:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46K4l83064132; Fri, 6 May 2011 20:04:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46K4lEG064129; Fri, 6 May 2011 20:04:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105062004.p46K4lEG064129@svn.freebsd.org> From: Marius Strobl Date: Fri, 6 May 2011 20:04: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: r221547 - stable/8/sys/sparc64/pci 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, 06 May 2011 20:04:48 -0000 Author: marius Date: Fri May 6 20:04:47 2011 New Revision: 221547 URL: http://svn.freebsd.org/changeset/base/221547 Log: MFC: r216962 Inherit the APB and the generic OFW PCI-PCI bridge driver from the generic PCI-PCI bridge driver in order to safe some code. Modified: stable/8/sys/sparc64/pci/apb.c stable/8/sys/sparc64/pci/ofw_pcib.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/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Fri May 6 20:04:47 2011 (r221546) +++ stable/8/sys/sparc64/pci/apb.c Fri May 6 20:04:47 2011 (r221547) @@ -81,25 +81,11 @@ static device_method_t apb_methods[] = { /* Device interface */ DEVMETHOD(device_probe, apb_probe), DEVMETHOD(device_attach, apb_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, apb_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), /* ofw_bus interface */ @@ -110,7 +96,8 @@ static device_method_t apb_methods[] = { static devclass_t pcib_devclass; -DEFINE_CLASS_0(pcib, apb_driver, apb_methods, sizeof(struct apb_softc)); +DEFINE_CLASS_1(pcib, apb_driver, apb_methods, sizeof(struct apb_softc), + pcib_driver); EARLY_DRIVER_MODULE(apb, pci, apb_driver, pcib_devclass, 0, 0, BUS_PASS_BUS); MODULE_DEPEND(apb, pci, 1, 1, 1); Modified: stable/8/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib.c Fri May 6 20:04:47 2011 (r221546) +++ stable/8/sys/sparc64/pci/ofw_pcib.c Fri May 6 20:04:47 2011 (r221547) @@ -64,31 +64,11 @@ static device_method_t ofw_pcib_methods[ /* Device interface */ DEVMETHOD(device_probe, ofw_pcib_probe), DEVMETHOD(device_attach, ofw_pcib_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), - DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), + DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_gen_get_node), @@ -98,8 +78,8 @@ static device_method_t ofw_pcib_methods[ static devclass_t pcib_devclass; -DEFINE_CLASS_0(pcib, ofw_pcib_driver, ofw_pcib_methods, - sizeof(struct ofw_pcib_gen_softc)); +DEFINE_CLASS_1(pcib, ofw_pcib_driver, ofw_pcib_methods, + sizeof(struct ofw_pcib_gen_softc), pcib_driver); EARLY_DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_driver, pcib_devclass, 0, 0, BUS_PASS_BUS); MODULE_DEPEND(ofw_pcib, pci, 1, 1, 1); From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 21:09:34 2011 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 2D7F11065672; Fri, 6 May 2011 21:09:34 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00B088FC17; Fri, 6 May 2011 21:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46L9Xmx066334; Fri, 6 May 2011 21:09:33 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46L9XAq066331; Fri, 6 May 2011 21:09:33 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201105062109.p46L9XAq066331@svn.freebsd.org> From: Nick Hibma Date: Fri, 6 May 2011 21:09:33 +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: r221553 - in stable/8/sys/dev/usb: . serial 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, 06 May 2011 21:09:34 -0000 Author: n_hibma Date: Fri May 6 21:09:33 2011 New Revision: 221553 URL: http://svn.freebsd.org/changeset/base/221553 Log: MFC r217637,218178 Add another ID for the ZTE MF190 Surf Stick New ID for the Novatel MC547 Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs 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/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Fri May 6 20:46:29 2011 (r221552) +++ stable/8/sys/dev/usb/serial/u3g.c Fri May 6 21:09:33 2011 (r221553) @@ -302,6 +302,7 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, EU740, 0), U3G_DEV(NOVATEL, EU870D, 0), U3G_DEV(NOVATEL, MC760, 0), + U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), @@ -415,6 +416,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E0078, 0), U3G_DEV(QUALCOMMINC, E0082, 0), U3G_DEV(QUALCOMMINC, E0086, 0), + U3G_DEV(QUALCOMMINC, SURFSTICK, 0), U3G_DEV(QUALCOMMINC, E2002, 0), U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Fri May 6 20:46:29 2011 (r221552) +++ stable/8/sys/dev/usb/usbdevs Fri May 6 21:09:33 2011 (r221553) @@ -2385,6 +2385,7 @@ product NOVATEL ZEROCD2 0x5030 Novatel product NOVATEL U727_2 0x5100 Merlin U727 CDMA product NOVATEL U760 0x6000 Novatel U760 product NOVATEL MC760 0x6002 Novatel MC760 +product NOVATEL MC547 0x7042 Novatel MC547 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ @@ -2693,6 +2694,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-stable-8@FreeBSD.ORG Fri May 6 22:07:32 2011 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 19647106566C; Fri, 6 May 2011 22:07:32 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0711F8FC13; Fri, 6 May 2011 22:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p46M7VSL068244; Fri, 6 May 2011 22:07:31 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p46M7VXT068241; Fri, 6 May 2011 22:07:31 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201105062207.p46M7VXT068241@svn.freebsd.org> From: Nick Hibma Date: Fri, 6 May 2011 22:07:31 +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: r221556 - in stable/8/sys/dev/usb: . quirk 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, 06 May 2011 22:07:32 -0000 Author: n_hibma Date: Fri May 6 22:07:31 2011 New Revision: 221556 URL: http://svn.freebsd.org/changeset/base/221556 Log: MFC r218422: Curitel UM150 needs a quirk to stop it from detaching straight after attach (resetting actually). Modified: stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs 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/quirk/usb_quirk.c ============================================================================== --- stable/8/sys/dev/usb/quirk/usb_quirk.c Fri May 6 22:01:46 2011 (r221555) +++ stable/8/sys/dev/usb/quirk/usb_quirk.c Fri May 6 22:07:31 2011 (r221556) @@ -136,6 +136,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(SIEMENS2, ES75, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(QUALCOMM, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(QUALCOMM2, CDMA_MSM, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), + USB_QUIRK(CURITEL, UM150, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(CURITEL, UM175, 0x0000, 0xffff, UQ_ASSUME_CM_OVER_DATA), /* USB Mass Storage Class Quirks */ Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Fri May 6 22:01:46 2011 (r221555) +++ stable/8/sys/dev/usb/usbdevs Fri May 6 22:07:31 2011 (r221556) @@ -1308,6 +1308,7 @@ product CTX EX1300 0x9999 Ex1300 hub product CURITEL HX550C 0x1101 CDMA 2000 1xRTT USB modem (HX-550C) product CURITEL HX57XB 0x2101 CDMA 2000 1xRTT USB modem (HX-570/575B/PR-600) product CURITEL PC5740 0x3701 Broadband Wireless modem +product CURITEL UM150 0x3711 EVDO modem product CURITEL UM175 0x3714 EVDO modem /* CyberPower products */ From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 02:00:36 2011 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 2F779106564A; Sat, 7 May 2011 02:00:36 +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 1EEA08FC0C; Sat, 7 May 2011 02:00:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4720ZcW075927; Sat, 7 May 2011 02:00:35 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4720ZYE075925; Sat, 7 May 2011 02:00:35 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105070200.p4720ZYE075925@svn.freebsd.org> From: Rick Macklem Date: Sat, 7 May 2011 02:00: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: r221570 - stable/8/sys/kern 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: Sat, 07 May 2011 02:00:36 -0000 Author: rmacklem Date: Sat May 7 02:00:35 2011 New Revision: 221570 URL: http://svn.freebsd.org/changeset/base/221570 Log: MFC: r220967 Fix a LOR in vfs_busy() where, after msleeping, it would lock the mutexes in the wrong order for the case where the MBF_MNTLSTLOCK is set. I believe this did have the potential for deadlock. For example, if multiple nfsd threads called vfs_busyfs(), which calls vfs_busy() with MBF_MNTLSTLOCK. Thanks go to pho for catching this during his testing. Modified: stable/8/sys/kern/vfs_subr.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/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Sat May 7 01:05:31 2011 (r221569) +++ stable/8/sys/kern/vfs_subr.c Sat May 7 02:00:35 2011 (r221570) @@ -380,9 +380,10 @@ vfs_busy(struct mount *mp, int flags) if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); mp->mnt_kern_flag |= MNTK_MWAIT; - msleep(mp, MNT_MTX(mp), PVFS, "vfs_busy", 0); + msleep(mp, MNT_MTX(mp), PVFS | PDROP, "vfs_busy", 0); if (flags & MBF_MNTLSTLOCK) mtx_lock(&mountlist_mtx); + MNT_ILOCK(mp); } if (flags & MBF_MNTLSTLOCK) mtx_unlock(&mountlist_mtx); From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 02:37:35 2011 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 802BB106566C; Sat, 7 May 2011 02:37:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4AC8FC20; Sat, 7 May 2011 02:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p472bZwM077130; Sat, 7 May 2011 02:37:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p472bZ0D077117; Sat, 7 May 2011 02:37:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201105070237.p472bZ0D077117@svn.freebsd.org> From: Glen Barber Date: Sat, 7 May 2011 02:37: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: r221572 - stable/8/share/man/man4 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: Sat, 07 May 2011 02:37:35 -0000 Author: gjb (doc committer) Date: Sat May 7 02:37:34 2011 New Revision: 221572 URL: http://svn.freebsd.org/changeset/base/221572 Log: MFC 205076 [1], 209034 [1], 211406 [2]: manlint fixes. Reported by: manlint Obtained from: uqs[1], joel[2] Modified: stable/8/share/man/man4/acpi_wmi.4 stable/8/share/man/man4/ae.4 stable/8/share/man/man4/altq.4 stable/8/share/man/man4/amdtemp.4 stable/8/share/man/man4/cxgb.4 stable/8/share/man/man4/ddb.4 stable/8/share/man/man4/enc.4 stable/8/share/man/man4/io.4 stable/8/share/man/man4/ipsec.4 stable/8/share/man/man4/iscsi_initiator.4 stable/8/share/man/man4/textdump.4 stable/8/share/man/man4/uart.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/acpi_wmi.4 ============================================================================== --- stable/8/share/man/man4/acpi_wmi.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/acpi_wmi.4 Sat May 7 02:37:34 2011 (r221572) @@ -57,7 +57,7 @@ information about GUIDs found in the sys WMI status device. .El .Sh EXAMPLES -.Bd Literal +.Bd -literal # cat /dev/wmistat GUID INST EXPE METH STR EVENT OID {5FB7F034-2C63-45E9-BE91-3D44E2C707E4} 1 NO WMAA NO NO AA Modified: stable/8/share/man/man4/ae.4 ============================================================================== --- stable/8/share/man/man4/ae.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/ae.4 Sat May 7 02:37:34 2011 (r221572) @@ -41,7 +41,7 @@ kernel configuration file: Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset -indent +.Bd -literal -offset indent if_ae_load="YES" .Ed .Sh DESCRIPTION Modified: stable/8/share/man/man4/altq.4 ============================================================================== --- stable/8/share/man/man4/altq.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/altq.4 Sat May 7 02:37:34 2011 (r221572) @@ -122,7 +122,7 @@ They have been applied to the following .Xr an 4 , .Xr ath 4 , .Xr aue 4 , -.Xt axe 4 , +.Xr axe 4 , .Xr bce 4 , .Xr bfe 4 , .Xr bge 4 , Modified: stable/8/share/man/man4/amdtemp.4 ============================================================================== --- stable/8/share/man/man4/amdtemp.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/amdtemp.4 Sat May 7 02:37:34 2011 (r221572) @@ -75,6 +75,5 @@ The driver first appeared in .Fx 7.1 . .Sh AUTHORS -.An .An Rui Paulo Aq rpaulo@FreeBSD.org .An Norikatsu Shigemura Aq nork@FreeBSD.org Modified: stable/8/share/man/man4/cxgb.4 ============================================================================== --- stable/8/share/man/man4/cxgb.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/cxgb.4 Sat May 7 02:37:34 2011 (r221572) @@ -92,8 +92,6 @@ Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . -.Bl -tag -width indent -.El .Sh DIAGNOSTICS .Bl -diag .It "cxgb%d: Unable to allocate bus resource: memory" Modified: stable/8/share/man/man4/ddb.4 ============================================================================== --- stable/8/share/man/man4/ddb.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/ddb.4 Sat May 7 02:37:34 2011 (r221572) @@ -703,7 +703,7 @@ Show information from the local APIC reg .It Ic show Cm lock Ar addr Show lock structure. The output format is as follows: -.Bl -tag -offset 0 -width "flags" +.Bl -tag -width "flags" .It Ic class: Class of the lock. Possible types include Modified: stable/8/share/man/man4/enc.4 ============================================================================== --- stable/8/share/man/man4/enc.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/enc.4 Sat May 7 02:37:34 2011 (r221572) @@ -82,10 +82,10 @@ framework can be independently controlle variables: .Bl -column net.enc.out.ipsec_filter_mask 0x00000000 0x00000000 .It Sy "Name Defaults Suggested" -.It "net.enc.out.ipsec_bpf_mask" 0x00000003 0x00000001 -.It "net.enc.out.ipsec_filter_mask" 0x00000001 0x00000001 -.It "net.enc.in.ipsec_bpf_mask" 0x00000001 0x00000002 -.It "net.enc.in.ipsec_filter_mask" 0x00000001 0x00000002 +.It "net.enc.out.ipsec_bpf_mask 0x00000003 0x00000001" +.It "net.enc.out.ipsec_filter_mask 0x00000001 0x00000001" +.It "net.enc.in.ipsec_bpf_mask 0x00000001 0x00000002" +.It "net.enc.in.ipsec_filter_mask 0x00000001 0x00000002" .El .Pp For the incoming path a value of Modified: stable/8/share/man/man4/io.4 ============================================================================== --- stable/8/share/man/man4/io.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/io.4 Sat May 7 02:37:34 2011 (r221572) @@ -40,7 +40,6 @@ .In sys/ioctl.h .In dev/io/iodev.h .In machine/iodev.h -.Pp .Bd -literal struct iodev_pio_req { u_int access; @@ -48,6 +47,7 @@ struct iodev_pio_req { u_int width; u_int val; }; +.Ed .Sh DESCRIPTION The special file .Pa /dev/io Modified: stable/8/share/man/man4/ipsec.4 ============================================================================== --- stable/8/share/man/man4/ipsec.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/ipsec.4 Sat May 7 02:37:34 2011 (r221572) @@ -90,8 +90,8 @@ To properly filter on the inner packets tunnel with firewalls, you can change the values of the following sysctls .Bl -column net.inet6.ipsec6.filtertunnel default enable .It Sy "Name Default Enable" -.It net.inet.ipsec.filtertunnel 0 1 -.It net.inet6.ipsec6.filtertunnel 0 1 +.It "net.inet.ipsec.filtertunnel 0 1" +.It "net.inet6.ipsec6.filtertunnel 0 1" .El .\" .Ss Kernel interface Modified: stable/8/share/man/man4/iscsi_initiator.4 ============================================================================== --- stable/8/share/man/man4/iscsi_initiator.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/iscsi_initiator.4 Sat May 7 02:37:34 2011 (r221572) @@ -78,7 +78,7 @@ the IP address of the target of session .Em n . .It Va net.iscsi.n.stats statistics for session -.EM n +.Em n .It Va net.iscsi.n.pid the .Em "process id" Modified: stable/8/share/man/man4/textdump.4 ============================================================================== --- stable/8/share/man/man4/textdump.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/textdump.4 Sat May 7 02:37:34 2011 (r221572) @@ -74,7 +74,7 @@ May be disabled by clearing the sysctl. .It Pa config.txt Kernel configuration, if -.Od options INCLUDE_CONFIG_FILE +.Cd options INCLUDE_CONFIG_FILE has been compiled into the kernel. May be disabled by clearing the .Dv debug.ddb.textdump.do_config Modified: stable/8/share/man/man4/uart.4 ============================================================================== --- stable/8/share/man/man4/uart.4 Sat May 7 02:19:46 2011 (r221571) +++ stable/8/share/man/man4/uart.4 Sat May 7 02:37:34 2011 (r221572) @@ -46,7 +46,6 @@ In .Cd hint.uart.0.baud="38400" .Cd hint.uart.0.port="0x3f8" .Cd hint.uart.0.flags="0x10" -.Ed .Pp With .Ar flags From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 03:09:16 2011 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 BEEC4106566B; Sat, 7 May 2011 03:09:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC808FC14; Sat, 7 May 2011 03:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4739GLM078412; Sat, 7 May 2011 03:09:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4739Gx0078410; Sat, 7 May 2011 03:09:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201105070309.p4739Gx0078410@svn.freebsd.org> From: Glen Barber Date: Sat, 7 May 2011 03:09:16 +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: r221575 - stable/8/share/man/man9 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: Sat, 07 May 2011 03:09:16 -0000 Author: gjb (doc committer) Date: Sat May 7 03:09:16 2011 New Revision: 221575 URL: http://svn.freebsd.org/changeset/base/221575 Log: MFC 205076 [1]: manlint fixes. Reported by: manlint Obtained from: uqs [1] Modified: stable/8/share/man/man9/fail.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/fail.9 ============================================================================== --- stable/8/share/man/man9/fail.9 Sat May 7 02:59:24 2011 (r221574) +++ stable/8/share/man/man9/fail.9 Sat May 7 03:09:16 2011 (r221575) @@ -84,7 +84,7 @@ below. The remaining .Fn KFAIL_POINT_* macros are wrappers around common error injection paths: -.Bl -tag -width 8 +.Bl -inset .It Fn KFAIL_POINT_RETURN parent name is the equivalent of .Sy KFAIL_POINT_CODE(..., return RETURN_VALUE) @@ -96,8 +96,7 @@ is the equivalent of .Sy KFAIL_POINT_CODE(..., error_var = RETURN_VALUE) .It Fn KFAIL_POINT_GOTO parent name error_var label is the equivalent of -.Sy KFAIL_POINT_CODE(..., - { error_var = RETURN_VALUE; goto label;}) +.Sy KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) .El .Sh SYSCTL VARIABLES The From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 03:29:23 2011 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 161D0106567A; Sat, 7 May 2011 03:29:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05D208FC13; Sat, 7 May 2011 03:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p473TMFH079201; Sat, 7 May 2011 03:29:22 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p473TMZG079198; Sat, 7 May 2011 03:29:22 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201105070329.p473TMZG079198@svn.freebsd.org> From: Glen Barber Date: Sat, 7 May 2011 03:29:22 +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: r221576 - stable/8/share/man/man4 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: Sat, 07 May 2011 03:29:23 -0000 Author: gjb (doc committer) Date: Sat May 7 03:29:22 2011 New Revision: 221576 URL: http://svn.freebsd.org/changeset/base/221576 Log: MFC 198441 [1]: manlint fixes. Reported by: manlint Obtained from: rpaulo [1] Modified: stable/8/share/man/man4/acpi_hp.4 stable/8/share/man/man4/acpi_wmi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/acpi_hp.4 ============================================================================== --- stable/8/share/man/man4/acpi_hp.4 Sat May 7 03:09:16 2011 (r221575) +++ stable/8/share/man/man4/acpi_hp.4 Sat May 7 03:29:22 2011 (r221576) @@ -256,7 +256,7 @@ sysctl dev.acpi_hp.0.cmi_detail=7 The .Nm device driver first appeared in -.Fx CURRENT . +.Fx 8.0 . .Sh AUTHORS .An -nosplit The @@ -279,7 +279,7 @@ http://www.microsoft.com/whdc/system/pnp This manual page was written by .An Michael Gmelin Aq freebsd@grem.de .Sh BUGS -This driver is experimental and has only been tested on CURRENT i386 on an +This driver is experimental and has only been tested on i386 on an HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN). Expect undefined results when operating on different hardware. .Pp Modified: stable/8/share/man/man4/acpi_wmi.4 ============================================================================== --- stable/8/share/man/man4/acpi_wmi.4 Sat May 7 03:09:16 2011 (r221575) +++ stable/8/share/man/man4/acpi_wmi.4 Sat May 7 03:29:22 2011 (r221576) @@ -79,7 +79,7 @@ GUID IN The .Nm device driver first appeared in -.Fx CURRENT . +.Fx 8.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 09:26:12 2011 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 4BC07106564A; Sat, 7 May 2011 09:26:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1098FC08; Sat, 7 May 2011 09:26:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p479QCIX090458; Sat, 7 May 2011 09:26:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p479QCGa090456; Sat, 7 May 2011 09:26:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105070926.p479QCGa090456@svn.freebsd.org> From: Andriy Gapon Date: Sat, 7 May 2011 09:26:12 +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: r221583 - stable/8/sys/dev/sound/pcm 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: Sat, 07 May 2011 09:26:12 -0000 Author: avg Date: Sat May 7 09:26:11 2011 New Revision: 221583 URL: http://svn.freebsd.org/changeset/base/221583 Log: MFC r221388: SNDCTL_DSP_GETIPTR: set pointer to sndbuf_getfreeptr() Modified: stable/8/sys/dev/sound/pcm/dsp.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/sound/pcm/dsp.c ============================================================================== --- stable/8/sys/dev/sound/pcm/dsp.c Sat May 7 06:52:04 2011 (r221582) +++ stable/8/sys/dev/sound/pcm/dsp.c Sat May 7 09:26:11 2011 (r221583) @@ -1655,7 +1655,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd /* XXX abusive DMA update: chn_rdupdate(rdch); */ a->bytes = sndbuf_gettotal(bs); a->blocks = sndbuf_getblocks(bs) - rdch->blocks; - a->ptr = sndbuf_getreadyptr(bs); + a->ptr = sndbuf_getfreeptr(bs); rdch->blocks = sndbuf_getblocks(bs); CHN_UNLOCK(rdch); } else From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:08:01 2011 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 99E60106566C; Sat, 7 May 2011 10:08:01 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8979B8FC17; Sat, 7 May 2011 10:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47A81Oq091858; Sat, 7 May 2011 10:08:01 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47A81WF091855; Sat, 7 May 2011 10:08:01 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071008.p47A81WF091855@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:08:01 +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: r221586 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:08:01 -0000 Author: kaiw Date: Sat May 7 10:08:01 2011 New Revision: 221586 URL: http://svn.freebsd.org/changeset/base/221586 Log: MFC r201166 (kientzle): ar only needs to support ar format. Modified: stable/8/usr.bin/ar/acpyacc.y stable/8/usr.bin/ar/read.c Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/acpyacc.y ============================================================================== --- stable/8/usr.bin/ar/acpyacc.y Sat May 7 10:06:43 2011 (r221585) +++ stable/8/usr.bin/ar/acpyacc.y Sat May 7 10:08:01 2011 (r221586) @@ -251,7 +251,7 @@ arscp_open(char *fname) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); archive_read_support_compression_all(a); - archive_read_support_format_all(a); + archive_read_support_format_ar(a); AC(archive_read_open_file(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); Modified: stable/8/usr.bin/ar/read.c ============================================================================== --- stable/8/usr.bin/ar/read.c Sat May 7 10:06:43 2011 (r221585) +++ stable/8/usr.bin/ar/read.c Sat May 7 10:08:01 2011 (r221586) @@ -88,7 +88,7 @@ read_archive(struct bsdar *bsdar, char m if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); archive_read_support_compression_all(a); - archive_read_support_format_all(a); + archive_read_support_format_ar(a); AC(archive_read_open_file(a, bsdar->filename, DEF_BLKSZ)); for (;;) { From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:23:07 2011 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 7FF321065670; Sat, 7 May 2011 10:23:07 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB758FC08; Sat, 7 May 2011 10:23:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47AN7eD092373; Sat, 7 May 2011 10:23:07 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47AN7ux092365; Sat, 7 May 2011 10:23:07 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071023.p47AN7ux092365@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:23: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: r221587 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:23:07 -0000 Author: kaiw Date: Sat May 7 10:23:07 2011 New Revision: 221587 URL: http://svn.freebsd.org/changeset/base/221587 Log: MFC r208189: Removed ar(1)'s support for compressed archives. This change removes ar(1)'s dependencies on compressor libraries -lz, -lbz2 and -llzma and fixes building HEAD on some versions of FreeBSD[78]. Option -j and -z is now accepted but ignored. Compressed ar(1) archives are not useful without a ld(1) that can read them. Also, the current ar(1) compression scheme prevents random access of archive members and needs to be redesigned anyway. Modified: stable/8/usr.bin/ar/Makefile stable/8/usr.bin/ar/acpyacc.y stable/8/usr.bin/ar/ar.1 stable/8/usr.bin/ar/ar.c stable/8/usr.bin/ar/ar.h stable/8/usr.bin/ar/read.c stable/8/usr.bin/ar/write.c Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/Makefile ============================================================================== --- stable/8/usr.bin/ar/Makefile Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/Makefile Sat May 7 10:23:07 2011 (r221587) @@ -5,15 +5,8 @@ SRCS= ar.c acplex.l acpyacc.y read.c uti WARNS?= 5 -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBELF} -LDADD= -larchive -lbz2 -lz -lelf - -# Do not depend on liblzma if we are building the bootstrap-tools and -# the local system doesn't include liblzma -.if !defined(BOOTSTRAPPING) || ${BOOTSTRAPPING} >= 800505 -DPADD+= ${LIBLZMA} -LDADD+= -llzma -.endif +DPADD= ${LIBARCHIVE} ${LIBELF} +LDADD= -larchive -lelf CFLAGS+=-I. -I${.CURDIR} Modified: stable/8/usr.bin/ar/acpyacc.y ============================================================================== --- stable/8/usr.bin/ar/acpyacc.y Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/acpyacc.y Sat May 7 10:23:07 2011 (r221587) @@ -250,7 +250,7 @@ arscp_open(char *fname) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_file(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:23:07 2011 (r221587) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2007 +.Dd May 17, 2010 .Dt AR 1 .Os .Sh NAME @@ -186,8 +186,7 @@ Synonymous with option Synonymous with option .Fl b . .It Fl j -Compress the resulting archive with -.Xr bzip2 1 . +This option is accepted but ignored. .It Fl m Move archive members specified by arguments .Ar files ... @@ -344,8 +343,7 @@ of extraction unless the .Fl o option was specified. .It Fl z -Compress the resulting archive with -.Xr gzip 1 . +This option is accepted but ignored. .El .Sh EXAMPLES To create a new archive Modified: stable/8/usr.bin/ar/ar.c ============================================================================== --- stable/8/usr.bin/ar/ar.c Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/ar.c Sat May 7 10:23:07 2011 (r221587) @@ -178,7 +178,7 @@ main(int argc, char **argv) bsdar->options |= AR_TR; break; case 'j': - bsdar->options |= AR_J; + /* ignored */ break; case 'l': /* ignored, for GNU ar comptibility */ @@ -223,7 +223,7 @@ main(int argc, char **argv) set_mode(bsdar, opt); break; case 'z': - bsdar->options |= AR_Z; + /* ignored */ break; case OPTION_HELP: bsdar_usage(); Modified: stable/8/usr.bin/ar/ar.h ============================================================================== --- stable/8/usr.bin/ar/ar.h Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/ar.h Sat May 7 10:23:07 2011 (r221587) @@ -81,7 +81,6 @@ struct bsdar { const char *addlib; /* target of ADDLIB. */ const char *posarg; /* position arg for modifiers -a, -b. */ char mode; /* program mode */ - char compression; /* compression mode */ int options; /* command line options */ const char *progname; /* program name */ Modified: stable/8/usr.bin/ar/read.c ============================================================================== --- stable/8/usr.bin/ar/read.c Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/read.c Sat May 7 10:23:07 2011 (r221587) @@ -87,7 +87,7 @@ read_archive(struct bsdar *bsdar, char m if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_file(a, bsdar->filename, DEF_BLKSZ)); Modified: stable/8/usr.bin/ar/write.c ============================================================================== --- stable/8/usr.bin/ar/write.c Sat May 7 10:08:01 2011 (r221586) +++ stable/8/usr.bin/ar/write.c Sat May 7 10:23:07 2011 (r221587) @@ -247,7 +247,7 @@ read_objs(struct bsdar *bsdar, const cha if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_all(a); + archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_filename(a, archive, DEF_BLKSZ)); for (;;) { @@ -264,13 +264,6 @@ read_objs(struct bsdar *bsdar, const cha continue; } - /* - * Remember the compression mode of existing archive. - * If neither -j nor -z is specified, this mode will - * be used for resulting archive. - */ - bsdar->compression = archive_compression(a); - name = archive_entry_pathname(entry); /* @@ -360,9 +353,6 @@ write_archive(struct bsdar *bsdar, char pos = NULL; memset(&sb, 0, sizeof(sb)); - /* By default, no compression is assumed. */ - bsdar->compression = ARCHIVE_COMPRESSION_NONE; - /* * Test if the specified archive exists, to figure out * whether we are creating one here. @@ -618,23 +608,7 @@ write_objs(struct bsdar *bsdar) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); - - /* The compression mode of the existing archive is used - * for the result archive or if creating a new archive, we - * do not compress archive by default. This default behavior can - * be overrided by compression mode specified explicitly - * through command line option `-j' or `-z'. - */ - if (bsdar->options & AR_J) - bsdar->compression = ARCHIVE_COMPRESSION_BZIP2; - if (bsdar->options & AR_Z) - bsdar->compression = ARCHIVE_COMPRESSION_GZIP; - if (bsdar->compression == ARCHIVE_COMPRESSION_BZIP2) - archive_write_set_compression_bzip2(a); - else if (bsdar->compression == ARCHIVE_COMPRESSION_GZIP) - archive_write_set_compression_gzip(a); - else - archive_write_set_compression_none(a); + archive_write_set_compression_none(a); AC(archive_write_open_filename(a, bsdar->filename)); From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:27:24 2011 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 19339106564A; Sat, 7 May 2011 10:27:24 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082828FC15; Sat, 7 May 2011 10:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47ARNfg092542; Sat, 7 May 2011 10:27:23 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47ARN6Z092537; Sat, 7 May 2011 10:27:23 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071027.p47ARN6Z092537@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:27:23 +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: r221588 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:27:24 -0000 Author: kaiw Date: Sat May 7 10:27:23 2011 New Revision: 221588 URL: http://svn.freebsd.org/changeset/base/221588 Log: MFC r213643 (kientzle): Add -D (deterministic) option to ar. When set, it forces all timestamps and owners to zero and modes to 0644. Useful for producing libraries that are bitwise identical across multiple build runs. Modified: stable/8/usr.bin/ar/ar.1 stable/8/usr.bin/ar/ar.c stable/8/usr.bin/ar/ar.h stable/8/usr.bin/ar/write.c Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:23:07 2011 (r221587) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:27:23 2011 (r221588) @@ -62,6 +62,7 @@ .Op Fl a Ar position-after .Op Fl b Ar position-before .Op Fl c +.Op Fl D .Op Fl i Ar position-before .Op Fl j .Op Fl s @@ -179,6 +180,16 @@ from the archive specified by argument .Ar archive . The archive's symbol table, if present, is updated to reflect the new contents of the archive. +.It Fl D +When used in combination with the +.Fl r +or +.Fl q +option, insert 0's instead of the real mtime, uid and gid values +and 0644 instead of file mode from the members named by arguments +.Ar files ... . +This ensures that checksums on the resulting archives are reproducible +when member contents are identical. .It Fl f Synonymous with option .Fl T . Modified: stable/8/usr.bin/ar/ar.c ============================================================================== --- stable/8/usr.bin/ar/ar.c Sat May 7 10:23:07 2011 (r221587) +++ stable/8/usr.bin/ar/ar.c Sat May 7 10:27:23 2011 (r221588) @@ -154,7 +154,7 @@ main(int argc, char **argv) } } - while ((opt = getopt_long(argc, argv, "abCcdfijlMmopqrSsTtuVvxz", + while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtuVvxz", longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -173,6 +173,9 @@ main(int argc, char **argv) case 'd': set_mode(bsdar, opt); break; + case 'D': + bsdar->options |= AR_D; + break; case 'f': case 'T': bsdar->options |= AR_TR; @@ -269,6 +272,8 @@ main(int argc, char **argv) only_mode(bsdar, "-c", "qr"); if (bsdar->options & AR_CC) only_mode(bsdar, "-C", "x"); + if (bsdar->options & AR_D) + only_mode(bsdar, "-D", "qr"); if (bsdar->options & AR_O) only_mode(bsdar, "-o", "x"); if (bsdar->options & AR_SS) @@ -356,9 +361,9 @@ bsdar_usage() (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); - (void)fprintf(stderr, "\tar -q [-Tcjsvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-Tcjsuvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-Tabcijsuvz] position archive file ...\n"); + (void)fprintf(stderr, "\tar -q [-TcDjsvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TcDjsuvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -s [-jz] archive\n"); (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); Modified: stable/8/usr.bin/ar/ar.h ============================================================================== --- stable/8/usr.bin/ar/ar.h Sat May 7 10:23:07 2011 (r221587) +++ stable/8/usr.bin/ar/ar.h Sat May 7 10:27:23 2011 (r221588) @@ -43,6 +43,7 @@ #define AR_U 0x0200 /* only extract or update newer members.*/ #define AR_V 0x0400 /* verbose mode */ #define AR_Z 0x0800 /* gzip compression */ +#define AR_D 0x1000 /* insert dummy mode, mtime, uid and gid */ #define DEF_BLKSZ 10240 /* default block size */ Modified: stable/8/usr.bin/ar/write.c ============================================================================== --- stable/8/usr.bin/ar/write.c Sat May 7 10:23:07 2011 (r221587) +++ stable/8/usr.bin/ar/write.c Sat May 7 10:27:23 2011 (r221588) @@ -163,11 +163,24 @@ create_obj_from_file(struct bsdar *bsdar if (mtime != 0 && bsdar->options & AR_U && sb.st_mtime <= mtime) goto giveup; - obj->uid = sb.st_uid; - obj->gid = sb.st_gid; - obj->md = sb.st_mode; + /* + * When option '-D' is specified, mtime and UID / GID from the file + * will be replaced with 0, and file mode with 644. This ensures that + * checksums will match for two archives containing the exact same + * files. + */ + if (bsdar->options & AR_D) { + obj->uid = 0; + obj->gid = 0; + obj->mtime = 0; + obj->md = S_IFREG | 0644; + } else { + obj->uid = sb.st_uid; + obj->gid = sb.st_gid; + obj->mtime = sb.st_mtime; + obj->md = sb.st_mode; + } obj->size = sb.st_size; - obj->mtime = sb.st_mtime; obj->dev = sb.st_dev; obj->ino = sb.st_ino; @@ -621,7 +634,8 @@ write_objs(struct bsdar *bsdar) bsdar->options & AR_S) { entry = archive_entry_new(); archive_entry_copy_pathname(entry, "/"); - archive_entry_set_mtime(entry, time(NULL), 0); + if ((bsdar->options & AR_D) == 0) + archive_entry_set_mtime(entry, time(NULL), 0); archive_entry_set_size(entry, (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:31:35 2011 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 06231106566B; Sat, 7 May 2011 10:31:35 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA06E8FC0A; Sat, 7 May 2011 10:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47AVYEG092718; Sat, 7 May 2011 10:31:34 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47AVYeF092715; Sat, 7 May 2011 10:31:34 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071031.p47AVYeF092715@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:31:34 +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: r221589 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:31:35 -0000 Author: kaiw Date: Sat May 7 10:31:34 2011 New Revision: 221589 URL: http://svn.freebsd.org/changeset/base/221589 Log: MFC r216014: Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generate a deterministic archive symbol table (i.e. timestamp for the symbol table member header is set to 0). Submitted by: Erik Cederstrand Modified: stable/8/usr.bin/ar/ar.1 stable/8/usr.bin/ar/ar.c Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:27:23 2011 (r221588) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:31:34 2011 (r221589) @@ -92,6 +92,7 @@ .Ar archive .Op Ar files ... .Nm ranlib +.Op Fl D .Ar archive ... .Sh DESCRIPTION The Modified: stable/8/usr.bin/ar/ar.c ============================================================================== --- stable/8/usr.bin/ar/ar.c Sat May 7 10:27:23 2011 (r221588) +++ stable/8/usr.bin/ar/ar.c Sat May 7 10:31:34 2011 (r221589) @@ -113,12 +113,15 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tV", longopts, + while ((opt = getopt_long(argc, argv, "tDV", longopts, NULL)) != -1) { switch(opt) { case 't': /* Ignored. */ break; + case 'D': + bsdar->options |= AR_D; + break; case 'V': ranlib_version(); break; From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:32:52 2011 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 703EB1065675; Sat, 7 May 2011 10:32:52 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3B68FC17; Sat, 7 May 2011 10:32:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47AWqMT092801; Sat, 7 May 2011 10:32:52 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47AWqWK092799; Sat, 7 May 2011 10:32:52 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071032.p47AWqWK092799@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:32:52 +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: r221590 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:32:52 -0000 Author: kaiw Date: Sat May 7 10:32:52 2011 New Revision: 221590 URL: http://svn.freebsd.org/changeset/base/221590 Log: MFC r216716: * Add mention of the `-f`, `-q`, `-S`, and `-V` options in the synopsis section. * Document the `-l`, `-M` and `-S` options. * Improve the text describing the behavior of the `-r` option. * Start a section on standard compliance. * Indicate in the synopsis that the `-S` and `-s` options are mutually exclusive. Modified: stable/8/usr.bin/ar/ar.1 Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:31:34 2011 (r221589) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:32:52 2011 (r221590) @@ -34,28 +34,42 @@ .Nm .Fl d .Op Fl T +.Op Fl f .Op Fl j .Op Fl v .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl m .Op Fl T .Op Fl a Ar position-after .Op Fl b Ar position-before +.Op Fl f .Op Fl i Ar position-before .Op Fl j -.Op Fl s +.Op Fl s | Fl S .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl p .Op Fl T +.Op Fl f .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar +.Nm +.Fl q +.Op Fl T +.Op Fl c +.Op Fl D +.Op Fl f +.Op Fl s | Fl S +.Op Fl v +.Op Fl z +.Ar archive +.Ar .Nm .Fl r .Op Fl T @@ -63,14 +77,15 @@ .Op Fl b Ar position-before .Op Fl c .Op Fl D +.Op Fl f .Op Fl i Ar position-before .Op Fl j -.Op Fl s +.Op Fl s | Fl S .Op Fl u .Op Fl v .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl s .Op Fl j @@ -78,19 +93,23 @@ .Ar archive .Nm .Fl t +.Op Fl f .Op Fl T .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar .Nm .Fl x .Op Fl C .Op Fl T +.Op Fl f .Op Fl o .Op Fl u .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar +.Nm +.Fl M .Nm ranlib .Op Fl D .Ar archive ... @@ -141,13 +160,13 @@ When used with option .Fl m this option specifies that the archive members specified by arguments -.Ar files ... +.Ar are moved to after the archive member named by argument .Ar member-after . When used with option .Fl r this option specifies that the files specified by arguments -.Ar files ... +.Ar are added after the archive member named by argument .Ar member-after . .It Fl b Ar member-before @@ -155,13 +174,13 @@ When used with option .Fl m this option specifies that the archive members specified by arguments -.Ar files ... +.Ar are moved to before the archive member named by argument .Ar member-before . When used with option .Fl r this option specifies that the files specified by arguments -.Ar files ... +.Ar are added before the archive member named by argument .Ar member-before . .It Fl c @@ -176,7 +195,7 @@ Prevent extracted files from replacing l in the file system. .It Fl d Delete the members named by arguments -.Ar files ... +.Ar from the archive specified by argument .Ar archive . The archive's symbol table, if present, is updated to reflect @@ -188,7 +207,7 @@ or .Fl q option, insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments -.Ar files ... . +.Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. .It Fl f @@ -199,9 +218,13 @@ Synonymous with option .Fl b . .It Fl j This option is accepted but ignored. +.It Fl l +This option is accepted for compatibility with GNU +.Xr ar 1 , +but is ignored. .It Fl m Move archive members specified by arguments -.Ar files ... +.Ar within the archive. If a position has been specified by one of the .Fl a , @@ -214,19 +237,21 @@ If no position has been specified, the s to the end of the archive. If the archive has a symbol table, it is updated to reflect the new contents of the archive. +.It Fl M +Read and execute MRI librarian commands from standard input. .It Fl o Preserve the original modification times of members when extracting them. .It Fl p Write the contents of the specified archive members named by arguments -.Ar files ... +.Ar to standard output. If no members were specified, the contents of all the files in the archive are written in the order they appear in the archive. .It Fl q Append the files specified by arguments -.Ar files ... +.Ar to the archive specified by argument .Ar archive without checking if the files already exist in the archive and @@ -241,14 +266,14 @@ option will update the archive's symbol table. .It Fl r Replace (add) the files specified by arguments -.Ar files ... +.Ar in the archive specified by argument .Ar archive , creating the archive if necessary. -Files that replace existing files do not change the order of files -within the archive. +Replacing existing members will not change the order of members within +the archive. If a file named in arguments -.Ar files ... +.Ar does not exist, existing members in the archive that match that name are not changed. New files are added to the end of the archive unless one of the @@ -271,9 +296,11 @@ with the .Fl s option alone is equivalent to invoking .Nm ranlib . +.It Fl S +Do not generate an archive symbol table. .It Fl t List the files specified by arguments -.Ar files ... +.Ar in the order in which they appear in the archive, one per line. If no files are specified, all files in the archive are listed. .It Fl T @@ -284,13 +311,13 @@ Conditionally update the archive or extr When used with the .Fl r option, files named by arguments -.Ar files ... +.Ar will be replaced in the archive if they are newer than their archived versions. When used with the .Fl x option, the members specified by arguments -.Ar files ... +.Ar will be extracted only if they are newer than the corresponding files in the file system. .It Fl v @@ -340,9 +367,11 @@ the file size in bytes, the file modific format .Dq "%b %e %H:%M %Y" , and the name of the file. +.It Fl V +Print a version string and exit. .It Fl x Extract archive members specified by arguments -.Ar files ... +.Ar into the current directory. If no members have been specified, extract all members of the archive. If the file corresponding to an extracted member does not exist it @@ -393,12 +422,27 @@ use: .Xr strftime 3 , .Xr strmode 3 , .Xr ar 5 -.\" .Sh COMPATIBILITY -.\" .Nm -.\" is expected to be compatible with GNU and SVR4 -.\" .Nm . -.\" .Sh STANDARDS -.\" Do the POSIX/SuSv3 standards have anything to say about AR(1)? +.Sh STANDARDS COMPLIANCE +The +.Nm +utility's support for the +.Fl a , +.Fl b , +.Fl c , +.Fl i , +.Fl m , +.Fl p , +.Fl q , +.Fl r , +.Fl s , +.Fl t , +.Fl u , +.Fl v , +.Fl C +and +.Fl T +options is believed to be compliant with +.St -p1003.2 . .Sh HISTORY An .Nm From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:34:00 2011 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 16A46106564A; Sat, 7 May 2011 10:34:00 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEBBC8FC19; Sat, 7 May 2011 10:33:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47AXxGw092898; Sat, 7 May 2011 10:33:59 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47AXxQh092896; Sat, 7 May 2011 10:33:59 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071033.p47AXxQh092896@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:33: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: r221591 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:34:00 -0000 Author: kaiw Date: Sat May 7 10:33:59 2011 New Revision: 221591 URL: http://svn.freebsd.org/changeset/base/221591 Log: MFC r216717: Improve the description of the `-q` option. Modified: stable/8/usr.bin/ar/ar.1 Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:32:52 2011 (r221590) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:33:59 2011 (r221591) @@ -141,10 +141,7 @@ utility can create and manage an archive .Xr ar 5 ) used to speed up link editing operations. If a symbol table is present in an archive, it will be -kept up-to-date by subsequent operations on the archive (excepting -the quick update specified by the -.Fl q -option). +kept up-to-date by subsequent operations on the archive. .Pp The .Nm ranlib @@ -254,16 +251,11 @@ Append the files specified by arguments .Ar to the archive specified by argument .Ar archive -without checking if the files already exist in the archive and -without updating the archive's symbol table. -If the archive file +without checking if the files already exist in the archive. +The archive symbol table will be updated as needed. +If the file specified by the argument .Ar archive -does not already exist, a new archive is created. -However, to be compatible with GNU -.Nm , -option -.Fl q -will update the archive's symbol table. +does not already exist, a new archive will be created. .It Fl r Replace (add) the files specified by arguments .Ar From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 10:35:43 2011 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 B3E081065672; Sat, 7 May 2011 10:35:43 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31098FC21; Sat, 7 May 2011 10:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47AZhn6092997; Sat, 7 May 2011 10:35:43 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47AZhi1092995; Sat, 7 May 2011 10:35:43 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201105071035.p47AZhi1092995@svn.freebsd.org> From: Kai Wang Date: Sat, 7 May 2011 10:35: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: r221592 - stable/8/usr.bin/ar 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: Sat, 07 May 2011 10:35:43 -0000 Author: kaiw Date: Sat May 7 10:35:43 2011 New Revision: 221592 URL: http://svn.freebsd.org/changeset/base/221592 Log: MFC r216719: Document the syntax accepted by the `-M` option. Modified: stable/8/usr.bin/ar/ar.1 Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/ar.1 ============================================================================== --- stable/8/usr.bin/ar/ar.1 Sat May 7 10:33:59 2011 (r221591) +++ stable/8/usr.bin/ar/ar.1 Sat May 7 10:35:43 2011 (r221592) @@ -236,6 +236,10 @@ If the archive has a symbol table, it is new contents of the archive. .It Fl M Read and execute MRI librarian commands from standard input. +The commands understood by the +.Nm +utility are described in the section +.Sx "MRI Librarian Commands" . .It Fl o Preserve the original modification times of members when extracting them. @@ -378,6 +382,117 @@ option was specified. .It Fl z This option is accepted but ignored. .El +.Ss "MRI Librarian Commands" +If the +.Fl M +option is specified, the +.Nm +utility will read and execute commands from its standard input. +If standard input is a terminal, the +.Nm +utility will display the prompt +.Dq Li "AR >" +before reading a line, and will continue operation even if errors are +encountered. +If standard input is not a terminal, the +.Nm +utility will not display a prompt and will terminate execution on +encountering an error. +.Pp +Each input line contains a single command. +Words in an input line are separated by whitespace characters. +The first word of the line is the command, the remaining words are +the arguments to the command. +The command word may be specified in either case. +Arguments may be separated by commas or blanks. +.Pp +Empty lines are allowed and are ignored. +Long lines are continued by ending them with the +.Dq Li + +character. +.Pp +The +.Dq Li * +and +.Dq Li "\;" +characters start a comment. +Comments extend till the end of the line. +.Pp +When executing an MRI librarian script the +.Nm +utility works on a temporary copy of an archive. +Changes to the copy are made permanent using the +.Ic save +command. +.Pp +Commands understood by the +.Nm +utility are: +.Bl -tag -width indent +.It Ic addlib Ar archive | Ic addlib Ar archive Pq Ar member Oo Li , Ar member Oc Ns ... +Add the contents of the archive named by argument +.Ar archive +to the current archive. +If specific members are named using the arguments +.Ar member , +then those members are added to the current archive. +If no members are specified, the entire contents of the archive +are added to the current archive. +.It Ic addmod Ar member Oo Li , Ar member Oc Ns ... +Add the files named by arguments +.Ar member +to the current archive. +.It Ic clear +Discard all the contents of the current archive. +.It Ic create Ar archive +Create a new archive named by the argument +.Ar archive , +and makes it the current archive. +If the named archive already exists, it will be overwritten +when the +.Ic save +command is issued. +.It Ic delete Ar module Oo Li , Ar member Oc Ns ... +Delete the modules named by the arguments +.Ar member +from the current archive. +.It Ic directory Ar archive Po Ar member Oo Li , Ar member Oc Ns ... Pc Op Ar outputfile +List each named module in the archive. +The format of the output depends on the verbosity setting set using +the +.Ic verbose +command. +Output is sent to standard output, or to the file specified by +argument +.Ar outputfile . +.It Ic end +Exit successfully from the +.Nm +utility. +Any unsaved changes to the current archive will be discarded. +.It Ic extract Ar member Oo Li , Ar member Oc Ns ... +Extract the members named by the arguments +.Ar member +from the current archive. +.It Ic list +Display the contents of the current archive in verbose style. +.It Ic open Ar archive +Open the archive named by argument +.Ar archive +and make it the current archive. +.It Ic replace Ar member Oo Li , Ar member Oc Ns ... +Replace named members in the current archive with the files specified +by arguments +.Ar member . +The files must be present in the current directory and the named +modules must already exist in the current archive. +.It Ic save +Commit all changes to the current archive. +.It Ic verbose +Toggle the verbosity of the +.Ic directory +command. +.El .Sh EXAMPLES To create a new archive .Pa ex.a @@ -405,6 +520,20 @@ To verbosely list the contents of archiv .Pa ex.a , use: .D1 "ar -tv ex.a" +.Pp +To create a new archive +.Pa ex.a +containing the files +.Pa ex1.o , +and +.Pa ex2.o , +using MRI librarian commands, use the following script: +.Bd -literal -offset indent +create ex.a * specify the output archive +addmod ex1.o ex2.o * add modules +save * save pending changes +end * exit the utility +.Ed .Sh DIAGNOSTICS .Ex -std .Sh SEE ALSO From owner-svn-src-stable-8@FreeBSD.ORG Sat May 7 22:20:02 2011 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 63E3D106566B; Sat, 7 May 2011 22:20:02 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CEA68FC0A; Sat, 7 May 2011 22:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47MK2MG017387; Sat, 7 May 2011 22:20:02 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47MK1Fo017362; Sat, 7 May 2011 22:20:02 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201105072220.p47MK1Fo017362@svn.freebsd.org> From: Nick Hibma Date: Sat, 7 May 2011 22:20:01 +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: r221612 - in stable/8/sys/dev/usb: . net serial 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: Sat, 07 May 2011 22:20:02 -0000 Author: n_hibma Date: Sat May 7 22:20:01 2011 New Revision: 221612 URL: http://svn.freebsd.org/changeset/base/221612 Log: MFC overview: - Fix busg in events provided to devd from the USB stack. - Provide more info on the u3g devices that attached. - Make the ucom device numbering more sane. MFC r214429 Add support for setting per-interface PnP information. MFC r214761 - Simplify the way unit/subunit allocation is done in ucom. - hw.usb.ucom.cons_unit is now split into hw.usb.ucom.cons_unit/...cons_subunit. Note: The tunable/sysctl hw.usb.ucom.cons_unit needs to be reviewed if a) a console was defined a USB serial devices, and a USB device with more than 1 subunit is present, and this device is attached before the device functioning as a console or b) a console was defined on a USB device with more than 1 subunit MFC r214809 Don't terminate the notification with \n. This is done in usb_device.c:devctl_notify_f(). MFC r214830 Bugfix: Move the 'at =') and hence prevent 'port=X' (and 'bus=<"on" string>) from making it into the environment for the devd action. MFC r214831 - Remove an unused entry from the softc (only used in a debugging printf). - Fix the loop count on detach (causing a panic on detaching a serial dongle). - Increase a buffer in case some driver want extra long tty device names (postfixing the purpose of the tty for example, e.g. u3g.ppp). MFC r214843 Implement ucom_set_pnpinfo_usb() providing ttyname and port number information through devd. My E220 now produces the notification (1 line): +u3g0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 \ vendor=0x12d1 product=0x1003 devclass=0x00 devsubclass=0x00 \ sernum="" release=0x0000 intclass=0xff intsubclass=0xff \ ttyname=U0 ttyports=2 on uhub0 Note: serial/ufoma and net/uhso still provide port number and tty name (uhso only) information through sysctls, which should now be removed. MFC r214919 Bugfix: Set the bit that marks a device number in use. This would cause a panic when disconnecting the second serial device. Modified: stable/8/sys/dev/usb/net/uhso.c stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/serial/uark.c stable/8/sys/dev/usb/serial/ubsa.c stable/8/sys/dev/usb/serial/ubser.c stable/8/sys/dev/usb/serial/uchcom.c stable/8/sys/dev/usb/serial/ucycom.c stable/8/sys/dev/usb/serial/ufoma.c stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/ugensa.c stable/8/sys/dev/usb/serial/uipaq.c stable/8/sys/dev/usb/serial/umct.c stable/8/sys/dev/usb/serial/umodem.c stable/8/sys/dev/usb/serial/umoscom.c stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/serial/usb_serial.c stable/8/sys/dev/usb/serial/usb_serial.h stable/8/sys/dev/usb/serial/uslcom.c stable/8/sys/dev/usb/serial/uvisor.c stable/8/sys/dev/usb/serial/uvscom.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usbdi.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/usb/net/uhso.c ============================================================================== --- stable/8/sys/dev/usb/net/uhso.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/net/uhso.c Sat May 7 22:20:01 2011 (r221612) @@ -633,11 +633,10 @@ uhso_attach(device_t self) ht->ht_name[0] = 0; if (sc->sc_ttys == 1) - snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_unit); + snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_super->sc_unit); else { snprintf(ht->ht_name, 32, "cuaU%d.%d", - ucom->sc_unit - ucom->sc_local_unit, - ucom->sc_local_unit); + ucom->sc_super->sc_unit, ucom->sc_subunit); } desc = uhso_port_type[port]; @@ -666,7 +665,7 @@ uhso_detach(device_t self) usbd_transfer_unsetup(sc->sc_xfer, 3); usbd_transfer_unsetup(sc->sc_ctrl_xfer, UHSO_CTRL_MAX); if (sc->sc_ttys > 0) { - ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_ttys); + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); for (i = 0; i < sc->sc_ttys; i++) { if (sc->sc_tty[i].ht_muxport != -1) { @@ -903,6 +902,7 @@ uhso_probe_iface(struct uhso_softc *sc, device_printf(sc->sc_dev, "ucom_attach failed\n"); return (ENXIO); } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); mtx_lock(&sc->sc_mtx); usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); @@ -921,6 +921,7 @@ uhso_probe_iface(struct uhso_softc *sc, device_printf(sc->sc_dev, "ucom_attach failed\n"); return (ENXIO); } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev); } else { UHSO_DPRINTF(0, "Unknown type %x\n", type); @@ -1448,11 +1449,11 @@ uhso_ucom_start_read(struct ucom_softc * { struct uhso_softc *sc = ucom->sc_parent; - UHSO_DPRINTF(3, "unit=%d, local_unit=%d\n", - ucom->sc_unit, ucom->sc_local_unit); + UHSO_DPRINTF(3, "unit=%d, subunit=%d\n", + ucom->sc_super->sc_unit, ucom->sc_subunit); if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - sc->sc_tty[ucom->sc_local_unit].ht_open = 1; + sc->sc_tty[ucom->sc_subunit].ht_open = 1; usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { @@ -1470,9 +1471,9 @@ uhso_ucom_stop_read(struct ucom_softc *u struct uhso_softc *sc = ucom->sc_parent; if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - sc->sc_tty[ucom->sc_local_unit].ht_open = 0; + sc->sc_tty[ucom->sc_subunit].ht_open = 0; usbd_transfer_stop( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_READ]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_READ]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { sc->sc_tty[0].ht_open = 0; @@ -1488,15 +1489,15 @@ uhso_ucom_start_write(struct ucom_softc struct uhso_softc *sc = ucom->sc_parent; if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { - UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_local_unit); + UHSO_DPRINTF(3, "local unit %d\n", ucom->sc_subunit); usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); usbd_xfer_set_priv( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE], - &sc->sc_tty[ucom->sc_local_unit]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE], + &sc->sc_tty[ucom->sc_subunit]); usbd_transfer_start( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { @@ -1511,7 +1512,7 @@ uhso_ucom_stop_write(struct ucom_softc * if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) { usbd_transfer_stop( - sc->sc_tty[ucom->sc_local_unit].ht_xfer[UHSO_CTRL_WRITE]); + sc->sc_tty[ucom->sc_subunit].ht_xfer[UHSO_CTRL_WRITE]); } else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { usbd_transfer_stop(sc->sc_xfer[UHSO_BULK_ENDPT_WRITE]); Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/u3g.c Sat May 7 22:20:01 2011 (r221612) @@ -855,8 +855,10 @@ u3g_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); device_printf(dev, "Found %u port%s.\n", sc->sc_numports, sc->sc_numports > 1 ? "s":""); + return (0); detach: @@ -868,15 +870,15 @@ static int u3g_detach(device_t dev) { struct u3g_softc *sc = device_get_softc(dev); - uint8_t m; + uint8_t subunit; DPRINTF("sc=%p\n", sc); /* NOTE: It is not dangerous to detach more ports than attached! */ - ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, U3G_MAXPORTS); + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); - for (m = 0; m != U3G_MAXPORTS; m++) - usbd_transfer_unsetup(sc->sc_xfer[m], U3G_N_TRANSFER); + for (subunit = 0; subunit != U3G_MAXPORTS; subunit++) + usbd_transfer_unsetup(sc->sc_xfer[subunit], U3G_N_TRANSFER); mtx_destroy(&sc->sc_mtx); return (0); @@ -888,7 +890,7 @@ u3g_start_read(struct ucom_softc *ucom) struct u3g_softc *sc = ucom->sc_parent; /* start read endpoint */ - usbd_transfer_start(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_RD]); + usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); return; } @@ -898,7 +900,7 @@ u3g_stop_read(struct ucom_softc *ucom) struct u3g_softc *sc = ucom->sc_parent; /* stop read endpoint */ - usbd_transfer_stop(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_RD]); + usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_RD]); return; } @@ -907,7 +909,7 @@ u3g_start_write(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; - usbd_transfer_start(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_WR]); + usbd_transfer_start(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); return; } @@ -916,7 +918,7 @@ u3g_stop_write(struct ucom_softc *ucom) { struct u3g_softc *sc = ucom->sc_parent; - usbd_transfer_stop(sc->sc_xfer[ucom->sc_local_unit][U3G_BULK_WR]); + usbd_transfer_stop(sc->sc_xfer[ucom->sc_subunit][U3G_BULK_WR]); return; } Modified: stable/8/sys/dev/usb/serial/uark.c ============================================================================== --- stable/8/sys/dev/usb/serial/uark.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uark.c Sat May 7 22:20:01 2011 (r221612) @@ -226,6 +226,8 @@ uark_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); /* success */ detach: @@ -238,7 +240,7 @@ uark_detach(device_t dev) { struct uark_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UARK_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/ubsa.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubsa.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/ubsa.c Sat May 7 22:20:01 2011 (r221612) @@ -330,6 +330,8 @@ ubsa_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -344,7 +346,7 @@ ubsa_detach(device_t dev) DPRINTF("sc=%p\n", sc); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UBSA_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubser.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/ubser.c Sat May 7 22:20:01 2011 (r221612) @@ -295,6 +295,7 @@ ubser_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]); @@ -316,7 +317,7 @@ ubser_detach(device_t dev) DPRINTF("\n"); - ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_numser); + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UBSER_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/uchcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uchcom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uchcom.c Sat May 7 22:20:01 2011 (r221612) @@ -353,6 +353,8 @@ uchcom_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -367,7 +369,7 @@ uchcom_detach(device_t dev) DPRINTFN(11, "\n"); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UCHCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/ucycom.c ============================================================================== --- stable/8/sys/dev/usb/serial/ucycom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/ucycom.c Sat May 7 22:20:01 2011 (r221612) @@ -271,13 +271,15 @@ ucycom_attach(device_t dev) } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &ucycom_callback, &sc->sc_mtx); - if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + if (urd_ptr) { free(urd_ptr, M_USBDEV); } + return (0); /* success */ detach: @@ -293,7 +295,7 @@ ucycom_detach(device_t dev) { struct ucycom_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UCYCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/8/sys/dev/usb/serial/ufoma.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/ufoma.c Sat May 7 22:20:01 2011 (r221612) @@ -449,6 +449,8 @@ ufoma_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + /*Sysctls*/ sctx = device_get_sysctl_ctx(dev); soid = device_get_sysctl_tree(dev); @@ -465,7 +467,7 @@ ufoma_attach(device_t dev) CTLFLAG_RW|CTLTYPE_STRING, sc, 0, ufoma_sysctl_open, "A", "Mode to transit when port is opened"); SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "comunit", - CTLFLAG_RD, &(sc->sc_ucom.sc_unit), 0, + CTLFLAG_RD, &(sc->sc_super_ucom.sc_unit), 0, "Unit number as USB serial"); return (0); /* success */ @@ -480,7 +482,7 @@ ufoma_detach(device_t dev) { struct ufoma_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_ctrl_xfer, UFOMA_CTRL_ENDPT_MAX); usbd_transfer_unsetup(sc->sc_bulk_xfer, UFOMA_BULK_ENDPT_MAX); Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uftdi.c Sat May 7 22:20:01 2011 (r221612) @@ -332,6 +332,8 @@ uftdi_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); /* success */ detach: @@ -344,7 +346,7 @@ uftdi_detach(device_t dev) { struct uftdi_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UFTDI_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/ugensa.c ============================================================================== --- stable/8/sys/dev/usb/serial/ugensa.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/ugensa.c Sat May 7 22:20:01 2011 (r221612) @@ -246,6 +246,8 @@ ugensa_attach(device_t dev) DPRINTF("attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); /* success */ detach: @@ -259,7 +261,7 @@ ugensa_detach(device_t dev) struct ugensa_softc *sc = device_get_softc(dev); uint8_t x; - ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_niface); + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom); for (x = 0; x < sc->sc_niface; x++) { usbd_transfer_unsetup(sc->sc_sub[x].sc_xfer, UGENSA_N_TRANSFER); Modified: stable/8/sys/dev/usb/serial/uipaq.c ============================================================================== --- stable/8/sys/dev/usb/serial/uipaq.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uipaq.c Sat May 7 22:20:01 2011 (r221612) @@ -1160,6 +1160,8 @@ uipaq_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -1172,7 +1174,7 @@ uipaq_detach(device_t dev) { struct uipaq_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UIPAQ_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/umct.c ============================================================================== --- stable/8/sys/dev/usb/serial/umct.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/umct.c Sat May 7 22:20:01 2011 (r221612) @@ -296,6 +296,8 @@ umct_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); /* success */ detach: @@ -308,7 +310,7 @@ umct_detach(device_t dev) { struct umct_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UMCT_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/umodem.c Sat May 7 22:20:01 2011 (r221612) @@ -388,6 +388,8 @@ umodem_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -815,7 +817,7 @@ umodem_detach(device_t dev) DPRINTF("sc=%p\n", sc); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UMODEM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/umoscom.c ============================================================================== --- stable/8/sys/dev/usb/serial/umoscom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/umoscom.c Sat May 7 22:20:01 2011 (r221612) @@ -337,6 +337,8 @@ umoscom_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -350,7 +352,7 @@ umoscom_detach(device_t dev) { struct umoscom_softc *sc = device_get_softc(dev); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UMOSCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uplcom.c Sat May 7 22:20:01 2011 (r221612) @@ -445,6 +445,8 @@ uplcom_attach(device_t dev) device_printf(dev, "init failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -459,7 +461,7 @@ uplcom_detach(device_t dev) DPRINTF("sc=%p\n", sc); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UPLCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/usb_serial.c Sat May 7 22:20:01 2011 (r221612) @@ -122,13 +122,16 @@ static unsigned int ucom_cons_tx_low = 0 static unsigned int ucom_cons_tx_high = 0; static int ucom_cons_unit = -1; +static int ucom_cons_subunit = 0; static int ucom_cons_baud = 9600; static struct ucom_softc *ucom_cons_softc = NULL; TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW, &ucom_cons_unit, 0, "console unit number"); - +TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit); +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW, + &ucom_cons_subunit, 0, "console subunit number"); TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW, &ucom_cons_baud, 0, "console baud rate"); @@ -140,9 +143,9 @@ static usb_proc_callback_t ucom_cfg_line static usb_proc_callback_t ucom_cfg_status_change; static usb_proc_callback_t ucom_cfg_param; -static uint8_t ucom_units_alloc(uint32_t, uint32_t *); -static void ucom_units_free(uint32_t, uint32_t); -static int ucom_attach_tty(struct ucom_softc *, uint32_t); +static int ucom_unit_alloc(void); +static void ucom_unit_free(int); +static int ucom_attach_tty(struct ucom_super_softc *, struct ucom_softc *); static void ucom_detach_tty(struct ucom_softc *); static void ucom_queue_command(struct ucom_softc *, usb_proc_callback_t *, struct termios *pt, @@ -175,84 +178,57 @@ static struct ttydevsw ucom_class = { MODULE_DEPEND(ucom, usb, 1, 1, 1); MODULE_VERSION(ucom, 1); -#define UCOM_UNIT_MAX 0x200 /* exclusive */ -#define UCOM_SUB_UNIT_MAX 0x100 /* exclusive */ +#define UCOM_UNIT_MAX 128 /* limits size of ucom_bitmap */ static uint8_t ucom_bitmap[(UCOM_UNIT_MAX + 7) / 8]; static struct mtx ucom_bitmap_mtx; MTX_SYSINIT(ucom_bitmap_mtx, &ucom_bitmap_mtx, "ucom bitmap", MTX_DEF); -static uint8_t -ucom_units_alloc(uint32_t sub_units, uint32_t *p_root_unit) +#define UCOM_TTY_PREFIX "U" + +/* + * Mark a unit number (the X in cuaUX) as in use. + * + * Note that devices using a different naming scheme (see ucom_tty_name() + * callback) still use this unit allocation. + */ +static int +ucom_unit_alloc(void) { - uint32_t n; - uint32_t o; - uint32_t x; - uint32_t max = UCOM_UNIT_MAX - (UCOM_UNIT_MAX % sub_units); - uint8_t error = 1; + int unit; mtx_lock(&ucom_bitmap_mtx); - for (n = 0; n < max; n += sub_units) { - - /* check for free consecutive bits */ - - for (o = 0; o < sub_units; o++) { - - x = n + o; - - if (ucom_bitmap[x / 8] & (1 << (x % 8))) { - goto skip; - } - } - - /* allocate */ - - for (o = 0; o < sub_units; o++) { - - x = n + o; - - ucom_bitmap[x / 8] |= (1 << (x % 8)); + for (unit = 0; unit < UCOM_UNIT_MAX; unit++) { + if ((ucom_bitmap[unit / 8] & (1 << (unit % 8))) == 0) { + ucom_bitmap[unit / 8] |= (1 << (unit % 8)); + break; } - - error = 0; - - break; - -skip: ; } mtx_unlock(&ucom_bitmap_mtx); - /* - * Always set the variable pointed to by "p_root_unit" so that - * the compiler does not think that it is used uninitialised: - */ - *p_root_unit = n; - - return (error); + if (unit == UCOM_UNIT_MAX) + return -1; + else + return unit; } +/* + * Mark the unit number as not in use. + */ static void -ucom_units_free(uint32_t root_unit, uint32_t sub_units) +ucom_unit_free(int unit) { - uint32_t x; - mtx_lock(&ucom_bitmap_mtx); - while (sub_units--) { - x = root_unit + sub_units; - ucom_bitmap[x / 8] &= ~(1 << (x % 8)); - } + ucom_bitmap[unit / 8] &= ~(1 << (unit % 8)); mtx_unlock(&ucom_bitmap_mtx); } /* - * "N" sub_units are setup at a time. All sub-units will - * be given sequential unit numbers. The number of - * sub-units can be used to differentiate among - * different types of devices. + * Setup a group of one or more serial ports. * * The mutex pointed to by "mtx" is applied before all * callbacks are called back. Also "mtx" must be applied @@ -260,47 +236,47 @@ ucom_units_free(uint32_t root_unit, uint */ int ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc, - uint32_t sub_units, void *parent, + uint32_t subunits, void *parent, const struct ucom_callback *callback, struct mtx *mtx) { - uint32_t n; - uint32_t root_unit; + uint32_t subunit; int error = 0; if ((sc == NULL) || - (sub_units == 0) || - (sub_units > UCOM_SUB_UNIT_MAX) || + (subunits == 0) || (callback == NULL)) { return (EINVAL); } - /* XXX unit management does not really belong here */ - if (ucom_units_alloc(sub_units, &root_unit)) { + ssc->sc_unit = ucom_unit_alloc(); + if (ssc->sc_unit == -1) return (ENOMEM); - } error = usb_proc_create(&ssc->sc_tq, mtx, "ucom", USB_PRI_MED); if (error) { - ucom_units_free(root_unit, sub_units); + ucom_unit_free(ssc->sc_unit); return (error); } + ssc->sc_subunits = subunits; - for (n = 0; n != sub_units; n++, sc++) { - sc->sc_unit = root_unit + n; - sc->sc_local_unit = n; - sc->sc_super = ssc; - sc->sc_mtx = mtx; - sc->sc_parent = parent; - sc->sc_callback = callback; + for (subunit = 0; subunit < ssc->sc_subunits; subunit++) { + sc[subunit].sc_subunit = subunit; + sc[subunit].sc_super = ssc; + sc[subunit].sc_mtx = mtx; + sc[subunit].sc_parent = parent; + sc[subunit].sc_callback = callback; - error = ucom_attach_tty(sc, sub_units); + error = ucom_attach_tty(ssc, &sc[subunit]); if (error) { - ucom_detach(ssc, sc - n, n); - ucom_units_free(root_unit + n, sub_units - n); + ucom_detach(ssc, &sc[0]); return (error); } - sc->sc_flag |= UCOM_FLAG_ATTACHED; + sc[subunit].sc_flag |= UCOM_FLAG_ATTACHED; } + + DPRINTF("tp = %p, unit = %d, subunits = %d\n", + sc->sc_tty, ssc->sc_unit, ssc->sc_subunits); + return (0); } @@ -309,62 +285,51 @@ ucom_attach(struct ucom_super_softc *ssc * the structure pointed to by "ssc" and "sc" is zero. */ void -ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc, - uint32_t sub_units) +ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc) { - uint32_t n; + uint32_t subunit; usb_proc_drain(&ssc->sc_tq); - for (n = 0; n != sub_units; n++, sc++) { - if (sc->sc_flag & UCOM_FLAG_ATTACHED) { - - ucom_detach_tty(sc); + for (subunit = 0; subunit < ssc->sc_subunits; subunit++) { + if (sc[subunit].sc_flag & UCOM_FLAG_ATTACHED) { - ucom_units_free(sc->sc_unit, 1); + ucom_detach_tty(&sc[subunit]); - /* avoid duplicate detach: */ - sc->sc_flag &= ~UCOM_FLAG_ATTACHED; + /* avoid duplicate detach */ + sc[subunit].sc_flag &= ~UCOM_FLAG_ATTACHED; } } + ucom_unit_free(ssc->sc_unit); usb_proc_free(&ssc->sc_tq); } static int -ucom_attach_tty(struct ucom_softc *sc, uint32_t sub_units) +ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc) { struct tty *tp; - int error = 0; char buf[32]; /* temporary TTY device name buffer */ tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx); - if (tp == NULL) { - error = ENOMEM; - goto done; - } - DPRINTF("tp = %p, unit = %d\n", tp, sc->sc_unit); - - buf[0] = 0; /* set some default value */ + if (tp == NULL) + return (ENOMEM); /* Check if the client has a custom TTY name */ + buf[0] = '\0'; if (sc->sc_callback->ucom_tty_name) { sc->sc_callback->ucom_tty_name(sc, buf, - sizeof(buf), sc->sc_local_unit); + sizeof(buf), ssc->sc_unit, sc->sc_subunit); } if (buf[0] == 0) { /* Use default TTY name */ - if (sub_units > 1) { + if (ssc->sc_subunits > 1) { /* multiple modems in one */ - if (snprintf(buf, sizeof(buf), "U%u.%u", - sc->sc_unit - sc->sc_local_unit, - sc->sc_local_unit)) { - /* ignore */ - } + snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX "%u.%u", + ssc->sc_unit, sc->sc_subunit); } else { /* single modem */ - if (snprintf(buf, sizeof(buf), "U%u", sc->sc_unit)) { - /* ignore */ - } + snprintf(buf, sizeof(buf), UCOM_TTY_PREFIX "%u", + ssc->sc_unit); } } tty_makedev(tp, NULL, "%s", buf); @@ -376,10 +341,12 @@ ucom_attach_tty(struct ucom_softc *sc, u /* Check if this device should be a console */ if ((ucom_cons_softc == NULL) && - (sc->sc_unit == ucom_cons_unit)) { - + (ssc->sc_unit == ucom_cons_unit) && + (sc->sc_subunit == ucom_cons_subunit)) { struct termios t; + DPRINTF("unit %d subunit %d is console", ssc->sc_unit, sc->sc_subunit); + ucom_cons_softc = sc; memset(&t, 0, sizeof(t)); @@ -397,8 +364,8 @@ ucom_attach_tty(struct ucom_softc *sc, u ucom_param(ucom_cons_softc->sc_tty, &t); mtx_unlock(ucom_cons_softc->sc_mtx); } -done: - return (error); + + return (0); } static void @@ -411,6 +378,7 @@ ucom_detach_tty(struct ucom_softc *sc) if (sc->sc_flag & UCOM_FLAG_CONSOLE) { mtx_lock(ucom_cons_softc->sc_mtx); ucom_close(ucom_cons_softc->sc_tty); + sc->sc_flag &= ~UCOM_FLAG_CONSOLE; mtx_unlock(ucom_cons_softc->sc_mtx); ucom_cons_softc = NULL; } @@ -446,6 +414,24 @@ ucom_detach_tty(struct ucom_softc *sc) cv_destroy(&sc->sc_cv); } +void +ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, device_t dev) +{ + char buf[64]; + uint8_t iface_index; + struct usb_attach_arg *uaa; + + snprintf(buf, sizeof(buf), "ttyname=%s%d ttyports=%d", + UCOM_TTY_PREFIX, ssc->sc_unit, ssc->sc_subunits); + + /* Store the PNP info in the first interface for the dev */ + uaa = device_get_ivars(dev); + iface_index = uaa->info.bIfaceIndex; + + if (usbd_set_pnpinfo(uaa->device, iface_index, buf) != 0) + device_printf(dev, "Could not set PNP info\n"); +} + static void ucom_queue_command(struct ucom_softc *sc, usb_proc_callback_t *fn, struct termios *pt, Modified: stable/8/sys/dev/usb/serial/usb_serial.h ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.h Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/usb_serial.h Sat May 7 22:20:01 2011 (r221612) @@ -105,7 +105,7 @@ struct ucom_callback { void (*ucom_stop_read) (struct ucom_softc *); void (*ucom_start_write) (struct ucom_softc *); void (*ucom_stop_write) (struct ucom_softc *); - void (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t local_subunit); + void (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t unit, uint16_t subunit); void (*ucom_poll) (struct ucom_softc *); }; @@ -133,6 +133,8 @@ struct ucom_param_task { struct ucom_super_softc { struct usb_process sc_tq; + uint32_t sc_unit; + uint32_t sc_subunits; }; struct ucom_softc { @@ -161,8 +163,7 @@ struct ucom_softc { struct tty *sc_tty; struct mtx *sc_mtx; void *sc_parent; - uint32_t sc_unit; - uint32_t sc_local_unit; + uint32_t sc_subunit; uint16_t sc_portno; uint16_t sc_flag; #define UCOM_FLAG_RTS_IFLOW 0x01 /* use RTS input flow control */ @@ -192,8 +193,8 @@ struct ucom_softc { int ucom_attach(struct ucom_super_softc *, struct ucom_softc *, uint32_t, void *, const struct ucom_callback *callback, struct mtx *); -void ucom_detach(struct ucom_super_softc *, - struct ucom_softc *, uint32_t); +void ucom_detach(struct ucom_super_softc *, struct ucom_softc *); +void ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t); void ucom_status_change(struct ucom_softc *); uint8_t ucom_get_data(struct ucom_softc *, struct usb_page_cache *, uint32_t, uint32_t, uint32_t *); Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uslcom.c Sat May 7 22:20:01 2011 (r221612) @@ -332,6 +332,8 @@ uslcom_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -346,7 +348,7 @@ uslcom_detach(device_t dev) DPRINTF("sc=%p\n", sc); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, USLCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/uvisor.c ============================================================================== --- stable/8/sys/dev/usb/serial/uvisor.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uvisor.c Sat May 7 22:20:01 2011 (r221612) @@ -346,6 +346,8 @@ uvisor_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + return (0); detach: @@ -360,7 +362,7 @@ uvisor_detach(device_t dev) DPRINTF("sc=%p\n", sc); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UVISOR_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/serial/uvscom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uvscom.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/serial/uvscom.c Sat May 7 22:20:01 2011 (r221612) @@ -320,6 +320,8 @@ uvscom_attach(device_t dev) if (error) { goto detach; } + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + /* start interrupt pipe */ mtx_lock(&sc->sc_mtx); usbd_transfer_start(sc->sc_xfer[UVSCOM_INTR_DT_RD]); @@ -344,7 +346,7 @@ uvscom_detach(device_t dev) if (sc->sc_xfer[UVSCOM_INTR_DT_RD]) usbd_transfer_stop(sc->sc_xfer[UVSCOM_INTR_DT_RD]); - ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1); + ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom); usbd_transfer_unsetup(sc->sc_xfer, UVSCOM_N_TRANSFER); mtx_destroy(&sc->sc_mtx); Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Sat May 7 22:05:14 2011 (r221611) +++ stable/8/sys/dev/usb/usb_device.c Sat May 7 22:20:01 2011 (r221612) @@ -87,7 +87,7 @@ static void usb_init_endpoint(struct usb struct usb_endpoint *); static void usb_unconfigure(struct usb_device *, uint8_t); static void usb_detach_device_sub(struct usb_device *, device_t *, - uint8_t); + char **, uint8_t); static uint8_t usb_probe_and_attach_sub(struct usb_device *, struct usb_attach_arg *); static void usb_init_attach_arg(struct usb_device *, @@ -1032,9 +1032,10 @@ usb_reset_iface_endpoints(struct usb_dev *------------------------------------------------------------------------*/ static void usb_detach_device_sub(struct usb_device *udev, device_t *ppdev, - uint8_t flag) + char **ppnpinfo, uint8_t flag) { device_t dev; + char *pnpinfo; int err; dev = *ppdev; @@ -1066,11 +1067,17 @@ usb_detach_device_sub(struct usb_device goto error; } } + + pnpinfo = *ppnpinfo; + if (pnpinfo != NULL) { + *ppnpinfo = NULL; + free(pnpinfo, M_USBDEV); + } return; error: /* Detach is not allowed to fail in the USB world */ - panic("A USB driver would not detach\n"); + panic("usb_detach_device_sub: A USB driver would not detach\n"); } /*------------------------------------------------------------------------* @@ -1119,7 +1126,8 @@ usb_detach_device(struct usb_device *ude /* looks like the end of the USB interfaces */ break; } - usb_detach_device_sub(udev, &iface->subdev, flag); + usb_detach_device_sub(udev, &iface->subdev, + &iface->pnpinfo, flag); } } @@ -2409,25 +2417,24 @@ usb_notify_addq_compat(const char *type, snprintf(data, buf_size, "%s" "%s " + "at port=%u " "vendor=0x%04x " "product=0x%04x " "devclass=0x%02x " "devsubclass=0x%02x " "sernum=\"%s\" " "release=0x%04x " - "at " - "port=%u " "on " "%s\n", ntype, udev->ugen_name, + udev->port_no, UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), udev->ddesc.bDeviceClass, udev->ddesc.bDeviceSubClass, usb_get_serial(udev), UGETW(udev->ddesc.bcdDevice), - udev->port_no, udev->parent_hub != NULL ? udev->parent_hub->ugen_name : device_get_nameunit(device_get_parent(udev->bus->bdev))); @@ -2459,7 +2466,7 @@ usb_notify_addq(const char *type, struct "release=0x%04x " "mode=%s " "port=%u " - "parent=%s\n", + "parent=%s", udev->ugen_name, UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), @@ -2498,7 +2505,7 @@ usb_notify_addq(const char *type, struct "endpoints=%d " "intclass=0x%02x " "intsubclass=0x%02x " - "intprotocol=0x%02x\n", + "intprotocol=0x%02x", udev->ugen_name, UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), @@ -2682,3 +2689,37 @@ usbd_enum_is_locked(struct usb_device *u { return (sx_xlocked(&udev->enum_sx)); } + +/* + * The following function is used to set the per-interface specific *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***