From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 10:17:40 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B7AB6EE; Sun, 31 Mar 2013 10:17:40 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D65460B; Sun, 31 Mar 2013 10:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VAHeHm099434; Sun, 31 Mar 2013 10:17:40 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VAHdAh099431; Sun, 31 Mar 2013 10:17:39 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303311017.r2VAHdAh099431@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 31 Mar 2013 10:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248942 - stable/8/sys/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 10:17:40 -0000 Author: melifaro Date: Sun Mar 31 10:17:39 2013 New Revision: 248942 URL: http://svnweb.freebsd.org/changeset/base/248942 Log: Merge r248070. Fix long-standing issue with interface routes being unprotected: Use RTM_PINNED flag to mark route as immutable. Forbid deleting immutable routes without special rtrequest1_fib() flag. Adding interface address with prefix already in route table is handled by atomically deleting old prefix and adding interface one. Modified: stable/8/sys/net/if.c stable/8/sys/net/route.c stable/8/sys/net/route.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Sun Mar 31 08:54:04 2013 (r248941) +++ stable/8/sys/net/if.c Sun Mar 31 10:17:39 2013 (r248942) @@ -1412,7 +1412,8 @@ if_rtdel(struct radix_node *rn, void *ar return (0); err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway, - rt_mask(rt), rt->rt_flags|RTF_RNH_LOCKED, + rt_mask(rt), + rt->rt_flags|RTF_RNH_LOCKED|RTF_PINNED, (struct rtentry **) NULL, rt->rt_fibnum); if (err) { log(LOG_WARNING, "if_rtdel: error %d\n", err); Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Sun Mar 31 08:54:04 2013 (r248941) +++ stable/8/sys/net/route.c Sun Mar 31 10:17:39 2013 (r248942) @@ -1112,6 +1112,14 @@ rtrequest1_fib(int req, struct rt_addrin error = 0; } #endif + if ((flags & RTF_PINNED) == 0) { + /* Check if target route can be deleted */ + rt = (struct rtentry *)rnh->rnh_lookup(dst, + netmask, rnh); + if ((rt != NULL) && (rt->rt_flags & RTF_PINNED)) + senderr(EADDRINUSE); + } + /* * Remove the item from the tree and return it. * Complain if it is not there and do no more processing. @@ -1439,6 +1447,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int int didwork = 0; int a_failure = 0; static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + struct radix_node_head *rnh; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1497,7 +1506,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ for ( fibnum = startfib; fibnum <= endfib; fibnum++) { if (cmd == RTM_DELETE) { - struct radix_node_head *rnh; struct radix_node *rn; /* * Look up an rtentry that is in the routing tree and @@ -1547,7 +1555,8 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ bzero((caddr_t)&info, sizeof(info)); info.rti_ifa = ifa; - info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); + info.rti_flags = flags | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; info.rti_info[RTAX_DST] = dst; /* * doing this for compatibility reasons @@ -1559,6 +1568,33 @@ rtinit1(struct ifaddr *ifa, int cmd, int info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; error = rtrequest1_fib(cmd, &info, &rt, fibnum); + + if ((error == EEXIST) && (cmd == RTM_ADD)) { + /* + * Interface route addition failed. + * Atomically delete current prefix generating + * RTM_DELETE message, and retry adding + * interface prefix. + */ + rnh = rt_tables_get_rnh(fibnum, dst->sa_family); + RADIX_NODE_HEAD_LOCK(rnh); + + /* Delete old prefix */ + info.rti_ifa = NULL; + info.rti_flags = RTF_RNH_LOCKED; + + error = rtrequest1_fib(RTM_DELETE, &info, &rt, fibnum); + if (error == 0) { + info.rti_ifa = ifa; + info.rti_flags = flags | RTF_RNH_LOCKED | + (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; + error = rtrequest1_fib(cmd, &info, &rt, fibnum); + } + + RADIX_NODE_HEAD_UNLOCK(rnh); + } + + if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Sun Mar 31 08:54:04 2013 (r248941) +++ stable/8/sys/net/route.h Sun Mar 31 10:17:39 2013 (r248942) @@ -171,7 +171,7 @@ struct ortentry { /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ -#define RTF_PINNED 0x100000 /* future use */ +#define RTF_PINNED 0x100000 /* route is immutable */ #define RTF_LOCAL 0x200000 /* route represents a local address */ #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 10:20:29 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A527D8C5; Sun, 31 Mar 2013 10:20:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97D0A61E; Sun, 31 Mar 2013 10:20:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VAKTgV001371; Sun, 31 Mar 2013 10:20:29 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VAKTuU001370; Sun, 31 Mar 2013 10:20:29 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201303311020.r2VAKTuU001370@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 31 Mar 2013 10:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248943 - stable/8/sys/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 10:20:29 -0000 Author: melifaro Date: Sun Mar 31 10:20:29 2013 New Revision: 248943 URL: http://svnweb.freebsd.org/changeset/base/248943 Log: MFC r247842. Write lock is not required for find&compare operation. Modified: stable/8/sys/net/route.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Sun Mar 31 10:17:39 2013 (r248942) +++ stable/8/sys/net/route.c Sun Mar 31 10:20:29 2013 (r248943) @@ -1515,7 +1515,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int if (rnh == NULL) /* this table doesn't exist but others might */ continue; - RADIX_NODE_HEAD_LOCK(rnh); + RADIX_NODE_HEAD_RLOCK(rnh); #ifdef RADIX_MPATH if (rn_mpath_capable(rnh)) { @@ -1544,7 +1544,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int (rn->rn_flags & RNF_ROOT) || RNTORT(rn)->rt_ifa != ifa || !sa_equal((struct sockaddr *)rn->rn_key, dst)); - RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); if (error) { /* this is only an error if bad on ALL tables */ continue; From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 13:56:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34CC15F0; Sun, 31 Mar 2013 13:56:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1842CDE3; Sun, 31 Mar 2013 13:56:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VDuDeF063455; Sun, 31 Mar 2013 13:56:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VDuDr2063454; Sun, 31 Mar 2013 13:56:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311356.r2VDuDr2063454@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 13:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248946 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 13:56:14 -0000 Author: avg Date: Sun Mar 31 13:56:13 2013 New Revision: 248946 URL: http://svnweb.freebsd.org/changeset/base/248946 Log: MFC r246293: zfs: fix, improve and re-organize page_lookup and page_unlock Please note that because of the significant VM API differences between HEAD and stable/8 this commit has some additional changes. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 13:54:44 2013 (r248945) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 13:56:13 2013 (r248946) @@ -323,7 +323,7 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt } static vm_page_t -page_lookup(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) +page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) { vm_object_t obj; vm_page_t pp; @@ -333,19 +333,23 @@ page_lookup(vnode_t *vp, int64_t start, for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && - vm_page_is_valid(pp, (vm_offset_t)off, nbytes)) { + pp->valid) { if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb")) continue; - vm_page_busy(pp); + } else { + pp = vm_page_alloc(obj, OFF_TO_IDX(start), + VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | + VM_ALLOC_NOBUSY); + } + + if (pp != NULL) { + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_object_pip_add(obj, 1); + vm_page_io_start(pp); vm_page_lock_queues(); - vm_page_undirty(pp); + pmap_remove_write(pp); + vm_page_clear_dirty(pp, off, nbytes); vm_page_unlock_queues(); - } else { - if (__predict_false(obj->cache != NULL)) { - vm_page_cache_free(obj, OFF_TO_IDX(start), - OFF_TO_IDX(start) + 1); - } - pp = NULL; } break; } @@ -353,10 +357,46 @@ page_lookup(vnode_t *vp, int64_t start, } static void -page_unlock(vm_page_t pp) +page_unbusy(vm_page_t pp) { - vm_page_wakeup(pp); + vm_page_io_finish(pp); + vm_object_pip_subtract(pp->object, 1); +} + +static vm_page_t +page_hold(vnode_t *vp, int64_t start) +{ + vm_object_t obj; + vm_page_t pp; + + obj = vp->v_object; + VM_OBJECT_LOCK_ASSERT(obj, MA_OWNED); + + for (;;) { + if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && + pp->valid) { + if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb")) + continue; + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_page_lock_queues(); + vm_page_hold(pp); + vm_page_unlock_queues(); + + } else + pp = NULL; + break; + } + return (pp); +} + +static void +page_unhold(vm_page_t pp) +{ + + vm_page_lock_queues(); + vm_page_unhold(pp); + vm_page_unlock_queues(); } static caddr_t @@ -387,6 +427,7 @@ update_pages(vnode_t *vp, int64_t start, { vm_object_t obj; struct sf_buf *sf; + caddr_t va; int off; ASSERT(vp->v_mount != NULL); @@ -397,27 +438,44 @@ update_pages(vnode_t *vp, int64_t start, VM_OBJECT_LOCK(obj); for (start &= PAGEMASK; len > 0; start += PAGESIZE) { vm_page_t pp; - int nbytes = MIN(PAGESIZE - off, len); + int nbytes = imin(PAGESIZE - off, len); - if ((pp = page_lookup(vp, start, off, nbytes)) != NULL) { - caddr_t va; + if (segflg == UIO_NOCOPY) { + pp = vm_page_lookup(obj, OFF_TO_IDX(start)); + KASSERT(pp != NULL, + ("zfs update_pages: NULL page in putpages case")); + KASSERT(off == 0, + ("zfs update_pages: unaligned data in putpages case")); + KASSERT(pp->valid == VM_PAGE_BITS_ALL, + ("zfs update_pages: invalid page in putpages case")); + KASSERT(pp->busy > 0, + ("zfs update_pages: unbusy page in putpages case")); + KASSERT(!pmap_page_is_write_mapped(pp), + ("zfs update_pages: writable page in putpages case")); + VM_OBJECT_UNLOCK(obj); + + va = zfs_map_page(pp, &sf); + (void) dmu_write(os, oid, start, nbytes, va, tx); + zfs_unmap_page(sf); + VM_OBJECT_LOCK(obj); + vm_page_undirty(pp); + } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) { VM_OBJECT_UNLOCK(obj); + va = zfs_map_page(pp, &sf); - if (segflg == UIO_NOCOPY) { - (void) dmu_write(os, oid, start+off, nbytes, - va+off, tx); - } else { - (void) dmu_read(os, oid, start+off, nbytes, - va+off, DMU_READ_PREFETCH); - } + (void) dmu_read(os, oid, start+off, nbytes, + va+off, DMU_READ_PREFETCH);; zfs_unmap_page(sf); + VM_OBJECT_LOCK(obj); - page_unlock(pp); + page_unbusy(pp); } len -= nbytes; off = 0; } + if (segflg != UIO_NOCOPY) + vm_object_pip_wakeupn(obj, 0); VM_OBJECT_UNLOCK(obj); } @@ -532,7 +590,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ vm_page_t pp; uint64_t bytes = MIN(PAGESIZE - off, len); - if (pp = page_lookup(vp, start, off, bytes)) { + if (pp = page_hold(vp, start)) { struct sf_buf *sf; caddr_t va; VM_OBJECT_UNLOCK(obj); @@ -540,7 +598,7 @@ mappedread(vnode_t *vp, int nbytes, uio_ error = uiomove(va + off, bytes, UIO_READ, uio); zfs_unmap_page(sf); VM_OBJECT_LOCK(obj); - page_unlock(pp); + page_unhold(pp); } else { VM_OBJECT_UNLOCK(obj); error = dmu_read_uio(os, zp->z_id, uio, bytes); From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 14:02:43 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D52FA97A; Sun, 31 Mar 2013 14:02:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7E6AE13; Sun, 31 Mar 2013 14:02:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VE2h4t066062; Sun, 31 Mar 2013 14:02:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VE2hM8066061; Sun, 31 Mar 2013 14:02:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311402.r2VE2hM8066061@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 14:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248948 - stable/8/sys/cddl/dev/fbt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 14:02:43 -0000 Author: avg Date: Sun Mar 31 14:02:43 2013 New Revision: 248948 URL: http://svnweb.freebsd.org/changeset/base/248948 Log: MFC r248640: fbt_typoff_init: fix an off by one in determining required memory size Modified: stable/8/sys/cddl/dev/fbt/fbt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/8/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:02:28 2013 (r248947) +++ stable/8/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:02:43 2013 (r248948) @@ -777,6 +777,8 @@ fbt_typoff_init(linker_ctf_t *lc) pop[kind]++; } + /* account for a sentinel value below */ + ctf_typemax++; *lc->typlenp = ctf_typemax; if ((xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, M_ZERO | M_WAITOK)) == NULL) From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 14:10:50 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F793DBB; Sun, 31 Mar 2013 14:10:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 31E3FE4C; Sun, 31 Mar 2013 14:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VEAo7u068792; Sun, 31 Mar 2013 14:10:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VEAoHr068791; Sun, 31 Mar 2013 14:10:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311410.r2VEAoHr068791@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 14:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248950 - stable/8/sys/cddl/dev/fbt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 14:10:50 -0000 Author: avg Date: Sun Mar 31 14:10:49 2013 New Revision: 248950 URL: http://svnweb.freebsd.org/changeset/base/248950 Log: MFC r248642: fbt_getargdesc: correctly handle types for return probes Modified: stable/8/sys/cddl/dev/fbt/fbt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/8/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:10:19 2013 (r248949) +++ stable/8/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:10:49 2013 (r248950) @@ -1260,6 +1260,11 @@ fbt_getargdesc(void *arg __unused, dtrac uint32_t offset; ushort_t info, kind, n; + if (fbt->fbtp_roffset != 0 && desc->dtargd_ndx == 0) { + (void) strcpy(desc->dtargd_native, "int"); + return; + } + desc->dtargd_ndx = DTRACE_ARGNONE; /* Get a pointer to the CTF data and it's length. */ @@ -1310,12 +1315,19 @@ fbt_getargdesc(void *arg __unused, dtrac return; } - /* Check if the requested argument doesn't exist. */ - if (ndx >= n) - return; + if (fbt->fbtp_roffset != 0) { + /* Only return type is available for args[1] in return probe. */ + if (ndx > 1) + return; + ASSERT(ndx == 1); + } else { + /* Check if the requested argument doesn't exist. */ + if (ndx >= n) + return; - /* Skip the return type and arguments up to the one requested. */ - dp += ndx + 1; + /* Skip the return type and arguments up to the one requested. */ + dp += ndx + 1; + } if (fbt_type_name(&lc, *dp, desc->dtargd_native, sizeof(desc->dtargd_native)) > 0) desc->dtargd_ndx = ndx; From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 18:31:59 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE3A2209; Sun, 31 Mar 2013 18:31:59 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F00A9A6; Sun, 31 Mar 2013 18:31:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VIVxPq045163; Sun, 31 Mar 2013 18:31:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VIVxKq045160; Sun, 31 Mar 2013 18:31:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303311831.r2VIVxKq045160@svn.freebsd.org> From: Martin Matuska Date: Sun, 31 Mar 2013 18:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248954 - in stable/8: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 18:31:59 -0000 Author: mm Date: Sun Mar 31 18:31:58 2013 New Revision: 248954 URL: http://svnweb.freebsd.org/changeset/base/248954 Log: MFC r247852: Import ZFS bpobj bugfix from vendor. Illumos ZFS issues: 3603 panic from bpobj_enqueue_subobj() 3604 zdb should print bpobjs more verbosely Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 31 18:27:46 2013 (r248953) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 31 18:31:58 2013 (r248954) @@ -1189,7 +1189,7 @@ dump_bpobj_cb(void *arg, const blkptr_t } static void -dump_bpobj(bpobj_t *bpo, char *name) +dump_bpobj(bpobj_t *bpo, char *name, int indent) { char bytes[32]; char comp[32]; @@ -1199,31 +1199,56 @@ dump_bpobj(bpobj_t *bpo, char *name) return; zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes); - if (bpo->bpo_havesubobj) { + if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) { zdb_nicenum(bpo->bpo_phys->bpo_comp, comp); zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp); - (void) printf("\n %s: %llu local blkptrs, %llu subobjs, " - "%s (%s/%s comp)\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + (void) printf(" %*s: object %llu, %llu local blkptrs, " + "%llu subobjs, %s (%s/%s comp)\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs, bytes, comp, uncomp); + + for (uint64_t i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) { + uint64_t subobj; + bpobj_t subbpo; + int error; + VERIFY0(dmu_read(bpo->bpo_os, + bpo->bpo_phys->bpo_subobjs, + i * sizeof (subobj), sizeof (subobj), &subobj, 0)); + error = bpobj_open(&subbpo, bpo->bpo_os, subobj); + if (error != 0) { + (void) printf("ERROR %u while trying to open " + "subobj id %llu\n", + error, (u_longlong_t)subobj); + continue; + } + dump_bpobj(&subbpo, "subobj", indent + 1); + } } else { - (void) printf("\n %s: %llu blkptrs, %s\n", - name, (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, bytes); + (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", + indent * 8, name, + (u_longlong_t)bpo->bpo_object, + (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs, + bytes); } if (dump_opt['d'] < 5) return; - (void) printf("\n"); - (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + if (indent == 0) { + (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL); + (void) printf("\n"); + } } static void dump_deadlist(dsl_deadlist_t *dl) { dsl_deadlist_entry_t *dle; + uint64_t unused; char bytes[32]; char comp[32]; char uncomp[32]; @@ -1242,14 +1267,24 @@ dump_deadlist(dsl_deadlist_t *dl) (void) printf("\n"); + /* force the tree to be loaded */ + dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); + for (dle = avl_first(&dl->dl_tree); dle; dle = AVL_NEXT(&dl->dl_tree, dle)) { - (void) printf(" mintxg %llu -> obj %llu\n", - (longlong_t)dle->dle_mintxg, - (longlong_t)dle->dle_bpobj.bpo_object); + if (dump_opt['d'] >= 5) { + char buf[128]; + (void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); - if (dump_opt['d'] >= 5) - dump_bpobj(&dle->dle_bpobj, ""); + dump_bpobj(&dle->dle_bpobj, buf, 0); + } else { + (void) printf("mintxg %llu -> obj %llu\n", + (longlong_t)dle->dle_mintxg, + (longlong_t)dle->dle_bpobj.bpo_object); + + } } } @@ -1272,7 +1307,7 @@ fuid_table_destroy() * print uid or gid information. * For normal POSIX id just the id is printed in decimal format. * For CIFS files with FUID the fuid is printed in hex followed by - * the doman-rid string. + * the domain-rid string. */ static void print_idstr(uint64_t id, const char *id_type) @@ -2529,10 +2564,11 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { - dump_bpobj(&spa->spa_deferred_bpobj, "Deferred frees"); + dump_bpobj(&spa->spa_deferred_bpobj, + "Deferred frees", 0); if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { dump_bpobj(&spa->spa_dsl_pool->dp_free_bpobj, - "Pool snapshot frees"); + "Pool snapshot frees", 0); } if (spa_feature_is_active(spa, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sun Mar 31 18:27:46 2013 (r248953) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c Sun Mar 31 18:31:58 2013 (r248954) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -414,6 +414,12 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 VERIFY3U(0, ==, dmu_buf_hold(bpo->bpo_os, subsubobjs, 0, FTAG, &subdb, 0)); + /* + * Make sure that we are not asking dmu_write() + * to write more data than we have in our buffer. + */ + VERIFY3U(subdb->db_size, >=, + numsubsub * sizeof (subobj)); dmu_write(bpo->bpo_os, bpo->bpo_phys->bpo_subobjs, bpo->bpo_phys->bpo_num_subobjs * sizeof (subobj), numsubsub * sizeof (subobj), subdb->db_data, tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Mar 31 18:27:46 2013 (r248953) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sun Mar 31 18:31:58 2013 (r248954) @@ -1712,7 +1712,7 @@ dmu_object_info_from_dnode(dnode_t *dn, doi->doi_checksum = dn->dn_checksum; doi->doi_compress = dn->dn_compress; doi->doi_physical_blocks_512 = (DN_USED_BYTES(dnp) + 256) >> 9; - doi->doi_max_offset = (dnp->dn_maxblkid + 1) * dn->dn_datablksz; + doi->doi_max_offset = (dn->dn_maxblkid + 1) * dn->dn_datablksz; doi->doi_fill_count = 0; for (int i = 0; i < dnp->dn_nblkptr; i++) doi->doi_fill_count += dnp->dn_blkptr[i].blk_fill; From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 18:39:12 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39B4951C; Sun, 31 Mar 2013 18:39:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C65A9D5; Sun, 31 Mar 2013 18:39:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VIdCRv046259; Sun, 31 Mar 2013 18:39:12 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VIdBbL046255; Sun, 31 Mar 2013 18:39:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303311839.r2VIdBbL046255@svn.freebsd.org> From: Martin Matuska Date: Sun, 31 Mar 2013 18:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248956 - in stable/8/cddl/contrib/opensolaris/cmd: zdb zpool X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 18:39:12 -0000 Author: mm Date: Sun Mar 31 18:39:11 2013 New Revision: 248956 URL: http://svnweb.freebsd.org/changeset/base/248956 Log: MFC r248267: Import minor ZFS changes from vendor Illumos ZFS issues: 3604 zdb should print bpobjs more verbosely (fix zdb hang) 3606 zpool status -x shouldn't warn about old on-disk format Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 31 18:35:02 2013 (r248955) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Mar 31 18:39:11 2013 (r248956) @@ -1225,6 +1225,7 @@ dump_bpobj(bpobj_t *bpo, char *name, int continue; } dump_bpobj(&subbpo, "subobj", indent + 1); + bpobj_close(&subbpo); } } else { (void) printf(" %*s: object %llu, %llu blkptrs, %s\n", Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Mar 31 18:35:02 2013 (r248955) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Mar 31 18:39:11 2013 (r248956) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2012 +.Dd March 14, 2013 .Dt ZPOOL 8 .Os .Sh NAME @@ -1608,14 +1608,15 @@ is specified, the command exits after .Ar count reports are printed. .Pp -If a scrub or resilver is in progress, this command reports the percentage done -and the estimated time to completion. Both of these are only approximate, +If a scrub or resilver is in progress, this command reports the percentage +done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. +Warnings about pools not using the latest on-disk format will not be included. .It Fl v Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub. Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Mar 31 18:35:02 2013 (r248955) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Mar 31 18:39:11 2013 (r248956) @@ -4030,7 +4030,10 @@ status_callback(zpool_handle_t *zhp, voi * If we were given 'zpool status -x', only report those pools with * problems. */ - if (reason == ZPOOL_STATUS_OK && cbp->cb_explain) { + if (cbp->cb_explain && + (reason == ZPOOL_STATUS_OK || + reason == ZPOOL_STATUS_VERSION_OLDER || + reason == ZPOOL_STATUS_FEAT_DISABLED)) { if (!cbp->cb_allpools) { (void) printf(gettext("pool '%s' is healthy\n"), zpool_get_name(zhp)); From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 18:56:01 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 481CB8EE; Sun, 31 Mar 2013 18:56:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3885EA2B; Sun, 31 Mar 2013 18:56:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VIu1M1051761; Sun, 31 Mar 2013 18:56:01 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VIu1sd051760; Sun, 31 Mar 2013 18:56:01 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303311856.r2VIu1sd051760@svn.freebsd.org> From: Martin Matuska Date: Sun, 31 Mar 2013 18:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248958 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 18:56:01 -0000 Author: mm Date: Sun Mar 31 18:56:00 2013 New Revision: 248958 URL: http://svnweb.freebsd.org/changeset/base/248958 Log: MFC r247592 (delphij): Import a fix tighten assertion on SPA versions from vendor (Illumos). Illumos ZFS issue: 3543 Feature flags causes assertion in spa.c to miss certain cases Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 31 18:51:34 2013 (r248957) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 31 18:56:00 2013 (r248958) @@ -5995,7 +5995,7 @@ spa_sync_version(void *arg1, void *arg2, */ ASSERT(tx->tx_txg != TXG_INITIAL); - ASSERT(version <= SPA_VERSION); + ASSERT(SPA_VERSION_IS_SUPPORTED(version)); ASSERT(version >= spa_version(spa)); spa->spa_uberblock.ub_version = version; @@ -6517,7 +6517,7 @@ spa_upgrade(spa_t *spa, uint64_t version * future version would result in an unopenable pool, this shouldn't be * possible. */ - ASSERT(spa->spa_uberblock.ub_version <= SPA_VERSION); + ASSERT(SPA_VERSION_IS_SUPPORTED(spa->spa_uberblock.ub_version)); ASSERT(version >= spa->spa_uberblock.ub_version); spa->spa_uberblock.ub_version = version; From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 19:03:26 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D224B87; Sun, 31 Mar 2013 19:03:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D30BA83; Sun, 31 Mar 2013 19:03:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VJ3QFB054454; Sun, 31 Mar 2013 19:03:26 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VJ3PiC054450; Sun, 31 Mar 2013 19:03:25 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201303311903.r2VJ3PiC054450@svn.freebsd.org> From: Martin Matuska Date: Sun, 31 Mar 2013 19:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248959 - in stable/8: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 19:03:26 -0000 Author: mm Date: Sun Mar 31 19:03:25 2013 New Revision: 248959 URL: http://svnweb.freebsd.org/changeset/base/248959 Log: MFC r242845 (delphij): Illumos r13840:97fd5cdf328a: 3145 single-copy arc 3212 ztest: race condition between vdev_online() and spa_vdev_remove() Illumos r13849:3468a95b27cd: 3258 ztest's use of file descriptors is unstable Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Mar 31 18:56:00 2013 (r248958) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Sun Mar 31 19:03:25 2013 (r248959) @@ -121,8 +121,8 @@ #include #include -#define ZTEST_FD_DATA 3 -#define ZTEST_FD_RAND 4 +static int ztest_fd_data = -1; +static int ztest_fd_rand = -1; typedef struct ztest_shared_hdr { uint64_t zh_hdr_size; @@ -713,14 +713,17 @@ process_options(int argc, char **argv) UINT64_MAX >> 2); if (strlen(altdir) > 0) { - char cmd[MAXNAMELEN]; - char realaltdir[MAXNAMELEN]; + char *cmd; + char *realaltdir; char *bin; char *ztest; char *isa; int isalen; - (void) realpath(getexecname(), cmd); + cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + + VERIFY(NULL != realpath(getexecname(), cmd)); if (0 != access(altdir, F_OK)) { ztest_dump_core = B_FALSE; fatal(B_TRUE, "invalid alternate ztest path: %s", @@ -751,6 +754,9 @@ process_options(int argc, char **argv) fatal(B_TRUE, "invalid alternate lib directory %s", zo->zo_alt_libpath); } + + umem_free(cmd, MAXPATHLEN); + umem_free(realaltdir, MAXPATHLEN); } } @@ -767,10 +773,12 @@ ztest_random(uint64_t range) { uint64_t r; + ASSERT3S(ztest_fd_rand, >=, 0); + if (range == 0) return (0); - if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r)) + if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r)) fatal(1, "short read from /dev/urandom"); return (r % range); @@ -4836,7 +4844,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 if (islog) (void) rw_unlock(&ztest_name_lock); } else { + /* + * Ideally we would like to be able to randomly + * call vdev_[on|off]line without holding locks + * to force unpredictable failures but the side + * effects of vdev_[on|off]line prevent us from + * doing so. We grab the ztest_vdev_lock here to + * prevent a race between injection testing and + * aux_vdev removal. + */ + VERIFY(mutex_lock(&ztest_vdev_lock) == 0); (void) vdev_online(spa, guid0, 0, NULL); + VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); } } @@ -5795,29 +5814,16 @@ ztest_init(ztest_shared_t *zs) } static void -setup_fds(void) +setup_data_fd(void) { - int fd; -#ifdef illumos - - char *tmp = tempnam(NULL, NULL); - fd = open(tmp, O_RDWR | O_CREAT, 0700); - ASSERT3U(fd, ==, ZTEST_FD_DATA); - (void) unlink(tmp); - free(tmp); -#else - char tmp[MAXPATHLEN]; - - strlcpy(tmp, ztest_opts.zo_dir, MAXPATHLEN); - strlcat(tmp, "/ztest.XXXXXX", MAXPATHLEN); - fd = mkstemp(tmp); - ASSERT3U(fd, ==, ZTEST_FD_DATA); -#endif + static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX"; - fd = open("/dev/urandom", O_RDONLY); - ASSERT3U(fd, ==, ZTEST_FD_RAND); + ztest_fd_data = mkstemp(ztest_name_data); + ASSERT3S(ztest_fd_data, >=, 0); + (void) unlink(ztest_name_data); } + static int shared_data_size(ztest_shared_hdr_t *hdr) { @@ -5838,15 +5844,11 @@ setup_hdr(void) int size; ztest_shared_hdr_t *hdr; -#ifndef illumos - pwrite(ZTEST_FD_DATA, "", 1, 0); -#endif - hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t))); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t))); hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t); hdr->zh_opts_size = sizeof (ztest_shared_opts_t); @@ -5857,7 +5859,7 @@ setup_hdr(void) hdr->zh_ds_count = ztest_opts.zo_datasets; size = shared_data_size(hdr); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size)); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, size)); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); } @@ -5870,14 +5872,14 @@ setup_data(void) uint8_t *buf; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); size = shared_data_size(hdr); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); buf = (uint8_t *)hdr; @@ -5896,12 +5898,13 @@ exec_child(char *cmd, char *libpath, boo { pid_t pid; int status; - char cmdbuf[MAXPATHLEN]; + char *cmdbuf = NULL; pid = fork(); if (cmd == NULL) { - (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf)); + cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN); cmd = cmdbuf; } @@ -5910,9 +5913,16 @@ exec_child(char *cmd, char *libpath, boo if (pid == 0) { /* child */ char *emptyargv[2] = { cmd, NULL }; + char fd_data_str[12]; struct rlimit rl = { 1024, 1024 }; (void) setrlimit(RLIMIT_NOFILE, &rl); + + (void) close(ztest_fd_rand); + VERIFY3U(11, >=, + snprintf(fd_data_str, 12, "%d", ztest_fd_data)); + VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1)); + (void) enable_extended_FILE_stdio(-1, -1); if (libpath != NULL) VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1)); @@ -5925,6 +5935,11 @@ exec_child(char *cmd, char *libpath, boo fatal(B_TRUE, "exec failed: %s", cmd); } + if (cmdbuf != NULL) { + umem_free(cmdbuf, MAXPATHLEN); + cmd = NULL; + } + while (waitpid(pid, &status, 0) != pid) continue; if (statusp != NULL) @@ -5989,39 +6004,41 @@ main(int argc, char **argv) char timebuf[100]; char numbuf[6]; spa_t *spa; - char cmd[MAXNAMELEN]; + char *cmd; boolean_t hasalt; - - boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR)); - ASSERT(ischild || errno == EBADF); + char *fd_data_str = getenv("ZTEST_FD_DATA"); (void) setvbuf(stdout, NULL, _IOLBF, 0); dprintf_setup(&argc, argv); - if (!ischild) { + ztest_fd_rand = open("/dev/urandom", O_RDONLY); + ASSERT3S(ztest_fd_rand, >=, 0); + + if (!fd_data_str) { process_options(argc, argv); - setup_fds(); + setup_data_fd(); setup_hdr(); setup_data(); bcopy(&ztest_opts, ztest_shared_opts, sizeof (*ztest_shared_opts)); } else { + ztest_fd_data = atoi(fd_data_str); setup_data(); bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts)); } ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count); /* Override location of zpool.cache */ - (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", - ztest_opts.zo_dir); + VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache", + ztest_opts.zo_dir), !=, -1); ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t), UMEM_NOFAIL); zs = ztest_shared; - if (ischild) { + if (fd_data_str) { metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang; metaslab_df_alloc_threshold = zs->zs_metaslab_df_alloc_threshold; @@ -6044,7 +6061,8 @@ main(int argc, char **argv) (u_longlong_t)ztest_opts.zo_time); } - (void) strlcpy(cmd, getexecname(), sizeof (cmd)); + cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL); + (void) strlcpy(cmd, getexecname(), MAXNAMELEN); zs->zs_do_init = B_TRUE; if (strlen(ztest_opts.zo_alt_ztest) != 0) { @@ -6185,5 +6203,7 @@ main(int argc, char **argv) kills, iters - kills, (100.0 * kills) / MAX(1, iters)); } + umem_free(cmd, MAXNAMELEN); + return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Mar 31 18:56:00 2013 (r248958) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Mar 31 19:03:25 2013 (r248959) @@ -191,6 +191,7 @@ uint64_t zfs_arc_meta_limit = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; +int zfs_disable_dup_eviction = 0; TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max); TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); @@ -321,7 +322,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_io_error; kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_memory_throttle_count; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -334,6 +334,10 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_write_buffer_bytes_scanned; kstat_named_t arcstat_l2_write_buffer_list_iter; kstat_named_t arcstat_l2_write_buffer_list_null_iter; + kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_duplicate_buffers; + kstat_named_t arcstat_duplicate_buffers_size; + kstat_named_t arcstat_duplicate_reads; } arc_stats_t; static arc_stats_t arc_stats = { @@ -391,7 +395,6 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, @@ -403,7 +406,11 @@ static arc_stats_t arc_stats = { { "l2_write_pios", KSTAT_DATA_UINT64 }, { "l2_write_buffer_bytes_scanned", KSTAT_DATA_UINT64 }, { "l2_write_buffer_list_iter", KSTAT_DATA_UINT64 }, - { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 } + { "l2_write_buffer_list_null_iter", KSTAT_DATA_UINT64 }, + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "duplicate_buffers", KSTAT_DATA_UINT64 }, + { "duplicate_buffers_size", KSTAT_DATA_UINT64 }, + { "duplicate_reads", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -1516,6 +1523,17 @@ arc_buf_clone(arc_buf_t *from) hdr->b_buf = buf; arc_get_data_buf(buf); bcopy(from->b_data, buf->b_data, size); + + /* + * This buffer already exists in the arc so create a duplicate + * copy for the caller. If the buffer is associated with user data + * then track the size and number of duplicates. These stats will be + * updated as duplicate buffers are created and destroyed. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMP(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, size); + } hdr->b_datacnt += 1; return (buf); } @@ -1616,6 +1634,16 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ ASSERT3U(state->arcs_size, >=, size); atomic_add_64(&state->arcs_size, -size); buf->b_data = NULL; + + /* + * If we're destroying a duplicate buffer make sure + * that the appropriate statistics are updated. + */ + if (buf->b_hdr->b_datacnt > 1 && + buf->b_hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, -size); + } ASSERT(buf->b_hdr->b_datacnt > 0); buf->b_hdr->b_datacnt -= 1; } @@ -1800,6 +1828,48 @@ arc_buf_size(arc_buf_t *buf) } /* + * Called from the DMU to determine if the current buffer should be + * evicted. In order to ensure proper locking, the eviction must be initiated + * from the DMU. Return true if the buffer is associated with user data and + * duplicate buffers still exist. + */ +boolean_t +arc_buf_eviction_needed(arc_buf_t *buf) +{ + arc_buf_hdr_t *hdr; + boolean_t evict_needed = B_FALSE; + + if (zfs_disable_dup_eviction) + return (B_FALSE); + + mutex_enter(&buf->b_evict_lock); + hdr = buf->b_hdr; + if (hdr == NULL) { + /* + * We are in arc_do_user_evicts(); let that function + * perform the eviction. + */ + ASSERT(buf->b_data == NULL); + mutex_exit(&buf->b_evict_lock); + return (B_FALSE); + } else if (buf->b_data == NULL) { + /* + * We have already been added to the arc eviction list; + * recommend eviction. + */ + ASSERT3P(hdr, ==, &arc_eviction_hdr); + mutex_exit(&buf->b_evict_lock); + return (B_TRUE); + } + + if (hdr->b_datacnt > 1 && hdr->b_type == ARC_BUFC_DATA) + evict_needed = B_TRUE; + + mutex_exit(&buf->b_evict_lock); + return (evict_needed); +} + +/* * Evict buffers from list until we've removed the specified number of * bytes. Move the removed buffers to the appropriate evict state. * If the recycle flag is set, then attempt to "recycle" a buffer: @@ -2885,8 +2955,10 @@ arc_read_done(zio_t *zio) abuf = buf; for (acb = callback_list; acb; acb = acb->acb_next) { if (acb->acb_done) { - if (abuf == NULL) + if (abuf == NULL) { + ARCSTAT_BUMP(arcstat_duplicate_reads); abuf = arc_buf_clone(buf); + } acb->acb_buf = abuf; abuf = NULL; } @@ -3401,6 +3473,16 @@ arc_release(arc_buf_t *buf, void *tag) ASSERT3U(*size, >=, hdr->b_size); atomic_add_64(size, -hdr->b_size); } + + /* + * We're releasing a duplicate user data buffer, update + * our statistics accordingly. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, + -hdr->b_size); + } hdr->b_datacnt -= 1; arc_cksum_verify(buf); #ifdef illumos Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Mar 31 18:56:00 2013 (r248958) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sun Mar 31 19:03:25 2013 (r248959) @@ -2071,7 +2071,24 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, dbuf_evict(db); } else { VERIFY(arc_buf_remove_ref(db->db_buf, db) == 0); - if (!DBUF_IS_CACHEABLE(db)) + + /* + * A dbuf will be eligible for eviction if either the + * 'primarycache' property is set or a duplicate + * copy of this buffer is already cached in the arc. + * + * In the case of the 'primarycache' a buffer + * is considered for eviction if it matches the + * criteria set in the property. + * + * To decide if our buffer is considered a + * duplicate, we must call into the arc to determine + * if multiple buffers are referencing the same + * block on-disk. If so, then we simply evict + * ourselves. + */ + if (!DBUF_IS_CACHEABLE(db) || + arc_buf_eviction_needed(db->db_buf)) dbuf_clear(db); else mutex_exit(&db->db_mtx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Mar 31 18:56:00 2013 (r248958) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sun Mar 31 19:03:25 2013 (r248959) @@ -96,6 +96,7 @@ int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); +boolean_t arc_buf_eviction_needed(arc_buf_t *buf); #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf); #endif From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 31 20:40:06 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6803C36; Sun, 31 Mar 2013 20:40:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7856E4B; Sun, 31 Mar 2013 20:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VKe6do081814; Sun, 31 Mar 2013 20:40:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VKe6Am081813; Sun, 31 Mar 2013 20:40:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303312040.r2VKe6Am081813@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 20:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r248960 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 31 Mar 2013 20:40:06 -0000 Author: avg Date: Sun Mar 31 20:40:06 2013 New Revision: 248960 URL: http://svnweb.freebsd.org/changeset/base/248960 Log: fix r248946: there is no pmap_page_is_write_mapped in stable/8 This is a direct commit. Pointyhat to: avg Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 19:03:25 2013 (r248959) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 20:40:06 2013 (r248960) @@ -450,7 +450,7 @@ update_pages(vnode_t *vp, int64_t start, ("zfs update_pages: invalid page in putpages case")); KASSERT(pp->busy > 0, ("zfs update_pages: unbusy page in putpages case")); - KASSERT(!pmap_page_is_write_mapped(pp), + KASSERT((pp->flags & PG_WRITEABLE) == 0, ("zfs update_pages: writable page in putpages case")); VM_OBJECT_UNLOCK(obj); From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 1 08:50:49 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D3E31C9; Mon, 1 Apr 2013 08:50:49 +0000 (UTC) Date: Mon, 1 Apr 2013 08:50:49 +0000 From: Alexey Dokuchaev To: Alexander Motin Subject: Re: svn commit: r236750 - in stable/8: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda Message-ID: <20130401085049.GA84064@FreeBSD.org> References: <201206081235.q58CZiiK059149@svn.freebsd.org> <20130321162521.GA82532@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130321162521.GA82532@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Apr 2013 08:50:49 -0000 On Thu, Mar 21, 2013 at 04:25:21PM +0000, Alexey Dokuchaev wrote: > On Fri, Jun 08, 2012 at 12:35:44PM +0000, Alexander Motin wrote: > > New Revision: 236750 > > URL: http://svn.freebsd.org/changeset/base/236750 > > > > Log: > > MFC r230130: > > Major snd_hda driver rewrite: > > - Huge old hdac driver was split into three independent pieces: HDA > > controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function > > driver (hdaa). [...] > > Unfortunately, this commit apparently had broken the sound for me on my > laptop. [...] While trying to debug this problem, I've noticed that though I can recompile snd_hda(4), I cannot load it: # kldload ./snd_hda.ko kldload: can't load ./snd_hda.ko: No such file or directory The message is clearly bogus, but in /var/log/messages I see this line: link_elf: symbol snd_verbose undefined Is this known behavior? How to remedy it? ./danfe From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 1 11:52:00 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62D309D; Mon, 1 Apr 2013 11:52:00 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ea0-x231.google.com (mail-ea0-x231.google.com [IPv6:2a00:1450:4013:c01::231]) by mx1.freebsd.org (Postfix) with ESMTP id 4D87790F; Mon, 1 Apr 2013 11:51:59 +0000 (UTC) Received: by mail-ea0-f177.google.com with SMTP id q14so976129eaj.8 for ; Mon, 01 Apr 2013 04:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=HSRqgN0GMhnQRlzxzroynlyTaN78VwWB3n0w6j4Puic=; b=0n4GPckZMRbu+p5ouO89X/sf47SIjjoviQb1TL+9N0+DQQQxHw7inyswuVS7Qx4gjB +eUPR2tZdjDxR8R0NSLV/P/TQEbCGVtOaicdvNb1A7K1cT2Mno1mlHGGkomIvpKWeNWR ZiU7S5k/EJG/T+KVD195pnCio/rNEvc2ceSe6q2N6uy+8ek5J+q/9Q7PIC5pr5nlfJfm ArxNngkJ56md9heQkQyUQnxcV1mOF75WtZEL6qobv8uCp8qhhJ6EsIz1SxprN5yKGbrJ pceIVoqBucuSPbYe6gCZ88uMXiW7gp7YJMJmsy7hFdTx4d29T830+wb1wVGE7FEZt7NA AiHg== X-Received: by 10.15.61.8 with SMTP id h8mr36217056eex.33.1364817118372; Mon, 01 Apr 2013 04:51:58 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id u44sm20703992eel.7.2013.04.01.04.51.56 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Apr 2013 04:51:57 -0700 (PDT) Sender: Alexander Motin Message-ID: <515966CC.2000108@FreeBSD.org> Date: Mon, 01 Apr 2013 13:51:56 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130326 Thunderbird/17.0.4 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r236750 - in stable/8: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda References: <201206081235.q58CZiiK059149@svn.freebsd.org> <20130321162521.GA82532@FreeBSD.org> <20130401085049.GA84064@FreeBSD.org> In-Reply-To: <20130401085049.GA84064@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Apr 2013 11:52:00 -0000 On 01.04.2013 11:50, Alexey Dokuchaev wrote: > On Thu, Mar 21, 2013 at 04:25:21PM +0000, Alexey Dokuchaev wrote: >> On Fri, Jun 08, 2012 at 12:35:44PM +0000, Alexander Motin wrote: >>> New Revision: 236750 >>> URL: http://svn.freebsd.org/changeset/base/236750 >>> >>> Log: >>> MFC r230130: >>> Major snd_hda driver rewrite: >>> - Huge old hdac driver was split into three independent pieces: HDA >>> controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function >>> driver (hdaa). [...] >> >> Unfortunately, this commit apparently had broken the sound for me on my >> laptop. [...] > > While trying to debug this problem, I've noticed that though I can recompile > snd_hda(4), I cannot load it: > > # kldload ./snd_hda.ko > kldload: can't load ./snd_hda.ko: No such file or directory > > The message is clearly bogus, but in /var/log/messages I see this line: > > link_elf: symbol snd_verbose undefined > > Is this known behavior? How to remedy it? I guess it is result of some mismatch between sources used for building and the running kernel. I haven't tested it last time, but previously snd_hda perfectly worked as module. -- Alexander Motin From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 1 15:12:40 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 47FB3DA8; Mon, 1 Apr 2013 15:12:40 +0000 (UTC) Date: Mon, 1 Apr 2013 15:12:40 +0000 From: Alexey Dokuchaev To: Alexander Motin Subject: Re: svn commit: r236750 - in stable/8: share/man/man4 sys/conf sys/dev/sound/pci/hda sys/modules/sound/driver/hda Message-ID: <20130401151240.GA75193@FreeBSD.org> References: <201206081235.q58CZiiK059149@svn.freebsd.org> <20130321162521.GA82532@FreeBSD.org> <20130401085049.GA84064@FreeBSD.org> <515966CC.2000108@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <515966CC.2000108@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Apr 2013 15:12:40 -0000 On Mon, Apr 01, 2013 at 01:51:56PM +0300, Alexander Motin wrote: > On 01.04.2013 11:50, Alexey Dokuchaev wrote: > >While trying to debug this problem, I've noticed that though I can > >recompile snd_hda(4), I cannot load it: > > > > # kldload ./snd_hda.ko > > kldload: can't load ./snd_hda.ko: No such file or directory > > > >The message is clearly bogus, but in /var/log/messages I see this line: > > > > link_elf: symbol snd_verbose undefined > > > >Is this known behavior? How to remedy it? > > I guess it is result of some mismatch between sources used for > building and the running kernel. I haven't tested it last time, but > previously snd_hda perfectly worked as module. It works perfectly as a module, indeed: if I do full "make kernel". I use modules whenever it's possible in fact. The problem is that once I rebuild (in exactly the same source base) just snd_hda(4), that is "cd /sys/modules /sound/driver/hda && make", I cannot load newly built ./snd_hda.ko anymore, while "kldload /boot/kernel/snd_hda.ko" works fine. On the same running kernel, against the very same sources. I needed sound to work very soon this time (upcoming Skype conference call), so I just rolled back your changes and did "make kernel", but honestly I find it very annoying having to rebuild entire kernel when just snd_hda(4) rebuild should suffice. BTW, any ideas why my nid patches from pre-r236750 no longer apply? ./danfe From owner-svn-src-stable-8@FreeBSD.ORG Tue Apr 2 14:10:23 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 520E8BD1; Tue, 2 Apr 2013 14:10:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44BB66B1; Tue, 2 Apr 2013 14:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r32EANoj016766; Tue, 2 Apr 2013 14:10:23 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r32EANZf016765; Tue, 2 Apr 2013 14:10:23 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201304021410.r32EANZf016765@svn.freebsd.org> From: Devin Teske Date: Tue, 2 Apr 2013 14:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249023 - stable/8/usr.sbin/sysinstall X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Apr 2013 14:10:23 -0000 Author: dteske Date: Tue Apr 2 14:10:22 2013 New Revision: 249023 URL: http://svnweb.freebsd.org/changeset/base/249023 Log: Oops, r240972 (Add DEBUG kernel distribution) forgot to make said distribution optional (such as the long-standing "local" distribution; also optional). This fixes a regression in the install process when the user selects "All" as the distribution-set. This is a direct commit to stable/8. PR: bin/177309 Reviewed by: eadler Modified: stable/8/usr.sbin/sysinstall/dist.c Modified: stable/8/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/8/usr.sbin/sysinstall/dist.c Tue Apr 2 13:52:09 2013 (r249022) +++ stable/8/usr.sbin/sysinstall/dist.c Tue Apr 2 14:10:22 2013 (r249023) @@ -756,7 +756,9 @@ distExtract(char *parent, Distribution * &me[i] == BASE_DIST); if (!status) { dialog_clear_norefresh(); - if (me[i].my_bit != DIST_LOCAL) { + if (me[i].my_bit != DIST_LOCAL && + me[i].my_bit != DIST_KERNEL_DEBUG) + { status = msgYesNo("Unable to transfer the %s distribution from\n%s.\n\n" "Do you want to try to retrieve it again?", me[i].my_name, mediaDevice->name); @@ -767,7 +769,7 @@ distExtract(char *parent, Distribution * status = FALSE; } else { - // ignore any failures with DIST_LOCAL + // ignore any failures with DIST_LOCAL/_KERNEL_DEBUG status = TRUE; } } @@ -906,8 +908,8 @@ distExtractAll(dialogMenuItem *self) if ((old_dists & DIST_KERNEL) && !(Dists & DIST_KERNEL)) status |= installFixupKernel(self, old_kernel); - /* Clear any local dist flags now */ - Dists &= ~DIST_LOCAL; + /* Clear any optional dist flags now */ + Dists &= ~(DIST_LOCAL|DIST_KERNEL_DEBUG); if (Dists) { int col = 0; From owner-svn-src-stable-8@FreeBSD.ORG Wed Apr 3 15:57:18 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C2A3D4A; Wed, 3 Apr 2013 15:57:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6F1C10; Wed, 3 Apr 2013 15:57:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33FvI76084689; Wed, 3 Apr 2013 15:57:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33FvIbw084688; Wed, 3 Apr 2013 15:57:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304031557.r33FvIbw084688@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Apr 2013 15:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249055 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Apr 2013 15:57:18 -0000 Author: kib Date: Wed Apr 3 15:57:18 2013 New Revision: 249055 URL: http://svnweb.freebsd.org/changeset/base/249055 Log: MFC r248562: Move the vn_start_write() call in the dounmount() before setting the MNTK_UNMOUNT flag. Modified: stable/8/sys/kern/vfs_mount.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/vfs_mount.c ============================================================================== --- stable/8/sys/kern/vfs_mount.c Wed Apr 3 15:38:44 2013 (r249054) +++ stable/8/sys/kern/vfs_mount.c Wed Apr 3 15:57:18 2013 (r249055) @@ -1247,11 +1247,13 @@ dounmount(mp, flags, td) return (error); } + vn_start_write(NULL, &mp, V_WAIT); MNT_ILOCK(mp); if (mp->mnt_kern_flag & MNTK_UNMOUNT) { MNT_IUNLOCK(mp); if (coveredvp) VOP_UNLOCK(coveredvp, 0); + vn_finished_write(mp); return (EBUSY); } mp->mnt_kern_flag |= MNTK_UNMOUNT | MNTK_NOINSMNTQ; @@ -1271,7 +1273,6 @@ dounmount(mp, flags, td) KASSERT(error == 0, ("%s: invalid return value for msleep in the drain path @ %s:%d", __func__, __FILE__, __LINE__)); - vn_start_write(NULL, &mp, V_WAIT); if (mp->mnt_flag & MNT_EXPUBLIC) vfs_setpublicfs(NULL, NULL, NULL); From owner-svn-src-stable-8@FreeBSD.ORG Wed Apr 3 16:02:02 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53DC41CD; Wed, 3 Apr 2013 16:02:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46180CD5; Wed, 3 Apr 2013 16:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33G22m5087042; Wed, 3 Apr 2013 16:02:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33G22Hj087041; Wed, 3 Apr 2013 16:02:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304031602.r33G22Hj087041@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Apr 2013 16:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249056 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Apr 2013 16:02:02 -0000 Author: kib Date: Wed Apr 3 16:02:01 2013 New Revision: 249056 URL: http://svnweb.freebsd.org/changeset/base/249056 Log: MFC r248563: Increment the write ref counter for the buffer object before calling bundirty(). Modified: stable/8/sys/kern/vfs_bio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Wed Apr 3 15:57:18 2013 (r249055) +++ stable/8/sys/kern/vfs_bio.c Wed Apr 3 16:02:01 2013 (r249056) @@ -892,7 +892,13 @@ bufwrite(struct buf *bp) else vp_md = 0; - /* Mark the buffer clean */ + /* + * Mark the buffer clean. Increment the bufobj write count + * before bundirty() call, to prevent other thread from seeing + * empty dirty list and zero counter for writes in progress, + * falsely indicating that the bufobj is clean. + */ + bufobj_wref(bp->b_bufobj); bundirty(bp); bp->b_flags &= ~B_DONE; @@ -900,7 +906,6 @@ bufwrite(struct buf *bp) bp->b_flags |= B_CACHE; bp->b_iocmd = BIO_WRITE; - bufobj_wref(bp->b_bufobj); vfs_busy_pages(bp, 1); /* From owner-svn-src-stable-8@FreeBSD.ORG Wed Apr 3 16:26:59 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D56FDF5; Wed, 3 Apr 2013 16:26:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16A36E5C; Wed, 3 Apr 2013 16:26:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33GQwPF093619; Wed, 3 Apr 2013 16:26:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33GQwL7093617; Wed, 3 Apr 2013 16:26:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304031626.r33GQwL7093617@svn.freebsd.org> From: Dimitry Andric Date: Wed, 3 Apr 2013 16:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249058 - in stable/8/contrib/binutils: bfd binutils X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Apr 2013 16:26:59 -0000 Author: dim Date: Wed Apr 3 16:26:58 2013 New Revision: 249058 URL: http://svnweb.freebsd.org/changeset/base/249058 Log: MFC r248802: Similar to r239870 and r239872, teach the other binutils tools about the DW_FORM_flag_present dwarf attribute, so they do not print errors or warnings on files that contain it. (This attribute can be emitted by newer versions of clang and gcc.) Modified: stable/8/contrib/binutils/bfd/dwarf2.c stable/8/contrib/binutils/binutils/readelf.c Directory Properties: stable/8/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/bfd/dwarf2.c ============================================================================== --- stable/8/contrib/binutils/bfd/dwarf2.c Wed Apr 3 16:20:21 2013 (r249057) +++ stable/8/contrib/binutils/bfd/dwarf2.c Wed Apr 3 16:26:58 2013 (r249058) @@ -617,6 +617,9 @@ read_attribute_value (struct attribute * attr->u.val = read_1_byte (abfd, info_ptr); info_ptr += 1; break; + case DW_FORM_flag_present: + attr->u.val = 1; + break; case DW_FORM_sdata: attr->u.sval = read_signed_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; Modified: stable/8/contrib/binutils/binutils/readelf.c ============================================================================== --- stable/8/contrib/binutils/binutils/readelf.c Wed Apr 3 16:20:21 2013 (r249057) +++ stable/8/contrib/binutils/binutils/readelf.c Wed Apr 3 16:26:58 2013 (r249058) @@ -6997,6 +6997,7 @@ get_FORM_name (unsigned long form) case DW_FORM_ref8: return "DW_FORM_ref8"; case DW_FORM_ref_udata: return "DW_FORM_ref_udata"; case DW_FORM_indirect: return "DW_FORM_indirect"; + case DW_FORM_flag_present: return "DW_FORM_flag_present"; default: { static char buffer[100]; @@ -7888,6 +7889,10 @@ read_and_display_attr_value (unsigned lo data += offset_size; break; + case DW_FORM_flag_present: + uvalue = 1; + break; + case DW_FORM_ref1: case DW_FORM_flag: case DW_FORM_data1: @@ -7943,6 +7948,7 @@ read_and_display_attr_value (unsigned lo printf (" %#lx", uvalue); break; + case DW_FORM_flag_present: case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_data2: From owner-svn-src-stable-8@FreeBSD.ORG Wed Apr 3 21:15:22 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 89D313A2; Wed, 3 Apr 2013 21:15:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A43CF45; Wed, 3 Apr 2013 21:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33LFMgk079823; Wed, 3 Apr 2013 21:15:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33LFMDl079822; Wed, 3 Apr 2013 21:15:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304032115.r33LFMDl079822@svn.freebsd.org> From: Xin LI Date: Wed, 3 Apr 2013 21:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249068 - stable/8/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Apr 2013 21:15:22 -0000 Author: delphij Date: Wed Apr 3 21:15:21 2013 New Revision: 249068 URL: http://svnweb.freebsd.org/changeset/base/249068 Log: The current ZFS version in 8-STABLE supports feature flags, which enables many new features but makes it impossible to import pools created on earlier released FreeBSD 9.x releases, including 9.0 and 9.1-RELEASE, where the feature flags are not yet supported because they predates the merge (r243674), and 9.2-RELEASE will not be released before 8.4-RELEASE. To avoid surprises when users "upgrade" to 9.1-RELEASE, limit the creation version to 28 by default on stable/8. The user will still be able to upgrade the pool by using "zpool upgrade" or at create time by explicitly specifying "zpool create -o version=5000". This is a direct commit to stable/8 because it's not applicable to -HEAD, and can be reverted once 9.2-RELEASE is released. Requested by: re (jpaetzel, hrs) Reviewed by: mm Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Apr 3 20:52:17 2013 (r249067) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Apr 3 21:15:21 2013 (r249068) @@ -856,6 +856,19 @@ zpool_do_create(int argc, char **argv) } } +#ifdef __FreeBSD__ + /* Compatiblity with FreeBSD 9.0 and 9.1: Use version 28 if unspecified */ + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_VERSION), + &propval) != 0) { + if (add_prop_list(zpool_prop_to_name( + ZPOOL_PROP_VERSION), "28", &props, B_TRUE)) + goto errout; + enable_all_pool_feat = B_FALSE; + } else if (enable_all_pool_feat) + nvlist_remove_all(props, zpool_prop_to_name(ZPOOL_PROP_VERSION)); +#endif /* __FreeBSD__ */ + argc -= optind; argv += optind; From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 4 05:16:14 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D29AAC0D; Thu, 4 Apr 2013 05:16:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C35616AE; Thu, 4 Apr 2013 05:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345GEa0021344; Thu, 4 Apr 2013 05:16:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345GEOv021342; Thu, 4 Apr 2013 05:16:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040516.r345GEOv021342@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249076 - in stable/8/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 04 Apr 2013 05:16:14 -0000 Author: kib Date: Thu Apr 4 05:16:14 2013 New Revision: 249076 URL: http://svnweb.freebsd.org/changeset/base/249076 Log: MFC r248968: Record the correct error in the trace. Modified: stable/8/sys/amd64/amd64/busdma_machdep.c stable/8/sys/i386/i386/busdma_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/x86/ (props changed) Modified: stable/8/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/busdma_machdep.c Thu Apr 4 05:04:48 2013 (r249075) +++ stable/8/sys/amd64/amd64/busdma_machdep.c Thu Apr 4 05:16:14 2013 (r249076) @@ -235,7 +235,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, M_ZERO | M_NOWAIT); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, 0, error); + __func__, newtag, 0, ENOMEM); return (ENOMEM); } Modified: stable/8/sys/i386/i386/busdma_machdep.c ============================================================================== --- stable/8/sys/i386/i386/busdma_machdep.c Thu Apr 4 05:04:48 2013 (r249075) +++ stable/8/sys/i386/i386/busdma_machdep.c Thu Apr 4 05:16:14 2013 (r249076) @@ -247,7 +247,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, M_ZERO | M_NOWAIT); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", - __func__, newtag, 0, error); + __func__, newtag, 0, ENOMEM); return (ENOMEM); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 4 17:10:37 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1D3A54DA; Thu, 4 Apr 2013 17:10:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E0D01C2; Thu, 4 Apr 2013 17:10:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r34HAahg031183; Thu, 4 Apr 2013 17:10:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r34HAa9w031182; Thu, 4 Apr 2013 17:10:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304041710.r34HAa9w031182@svn.freebsd.org> From: Xin LI Date: Thu, 4 Apr 2013 17:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249100 - stable/8/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 04 Apr 2013 17:10:37 -0000 Author: delphij Date: Thu Apr 4 17:10:36 2013 New Revision: 249100 URL: http://svnweb.freebsd.org/changeset/base/249100 Log: Per Matthew Ahrens, version 5000 should not be exposed to user and there is a problem with my first revision, namely, specifying -d -o feature@...=enable will still bail out with: 'feature@' and 'version' properties cannot be specified together. Because zpool create -o version=5000 will not likely be supported by other ZFS implementations (including ours on -CURRENT and 9-STABLE), remove the hack that make that work. Users who want feature flags support can still do an explicit 'zpool upgrade' after creating a pool. Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 4 17:08:49 2013 (r249099) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 4 17:10:36 2013 (r249100) @@ -865,8 +865,7 @@ zpool_do_create(int argc, char **argv) ZPOOL_PROP_VERSION), "28", &props, B_TRUE)) goto errout; enable_all_pool_feat = B_FALSE; - } else if (enable_all_pool_feat) - nvlist_remove_all(props, zpool_prop_to_name(ZPOOL_PROP_VERSION)); + } #endif /* __FreeBSD__ */ argc -= optind; From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 4 19:31:20 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1A1066D8; Thu, 4 Apr 2013 19:31:20 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E717297B; Thu, 4 Apr 2013 19:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r34JVJoC074065; Thu, 4 Apr 2013 19:31:19 GMT (envelope-from rakuco@svn.freebsd.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r34JVJVV074063; Thu, 4 Apr 2013 19:31:19 GMT (envelope-from rakuco@svn.freebsd.org) Message-Id: <201304041931.r34JVJVV074063@svn.freebsd.org> From: Raphael Kubo da Costa Date: Thu, 4 Apr 2013 19:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249107 - in stable/8: share/man/man4 sys/netgraph/bluetooth/drivers/ubt X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 04 Apr 2013 19:31:20 -0000 Author: rakuco (ports committer) Date: Thu Apr 4 19:31:19 2013 New Revision: 249107 URL: http://svnweb.freebsd.org/changeset/base/249107 Log: MFC r244704, r244714 and r244715: Add vendor IDs for Broadcom USB dongles (BCM20702). PR: kern/174707 Approved by: glebius Modified: stable/8/share/man/man4/ng_ubt.4 stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/netgraph/ (props changed) Modified: stable/8/share/man/man4/ng_ubt.4 ============================================================================== --- stable/8/share/man/man4/ng_ubt.4 Thu Apr 4 19:07:37 2013 (r249106) +++ stable/8/share/man/man4/ng_ubt.4 Thu Apr 4 19:31:19 2013 (r249107) @@ -25,7 +25,7 @@ .\" $Id: ng_ubt.4,v 1.3 2003/05/21 19:37:35 max Exp $ .\" $FreeBSD$ .\" -.Dd September 13, 2004 +.Dd December 26, 2012 .Dt NG_UBT 4 .Os .Sh NAME @@ -73,6 +73,8 @@ Mitsumi Bluetooth USB adapter MSI MS-6967 .It TDK Bluetooth USB adapter +.It +Broadcom Bluetooth USB adapter .El .Sh HOOKS This node type supports the following hooks: Modified: stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Thu Apr 4 19:07:37 2013 (r249106) +++ stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Thu Apr 4 19:31:19 2013 (r249107) @@ -398,6 +398,12 @@ static const STRUCT_USB_HOST_ID ubt_devs /* AVM USB Bluetooth-Adapter BlueFritz! v2.0 */ { USB_VPI(USB_VENDOR_AVM, 0x3800, 0) }, + + /* Broadcom USB dongles, mostly BCM20702 and BCM20702A0 */ + { USB_VENDOR(USB_VENDOR_BROADCOM), + USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(UDSUBCLASS_RF), + USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) }, }; /* @@ -1748,7 +1754,7 @@ static device_method_t ubt_methods[] = DEVMETHOD(device_probe, ubt_probe), DEVMETHOD(device_attach, ubt_attach), DEVMETHOD(device_detach, ubt_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ubt_driver = From owner-svn-src-stable-8@FreeBSD.ORG Thu Apr 4 23:14:15 2013 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 236E8979; Thu, 4 Apr 2013 23:14:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14F36264; Thu, 4 Apr 2013 23:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r34NEEsZ039604; Thu, 4 Apr 2013 23:14:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r34NEE6M039603; Thu, 4 Apr 2013 23:14:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304042314.r34NEE6M039603@svn.freebsd.org> From: Xin LI Date: Thu, 4 Apr 2013 23:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249114 - stable/8/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 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, 04 Apr 2013 23:14:15 -0000 Author: delphij Date: Thu Apr 4 23:14:14 2013 New Revision: 249114 URL: http://svnweb.freebsd.org/changeset/base/249114 Log: Further improve previous revision: - enable_all_pool_feat will be unset if version is specified. Use it as a flag instead of testing the props nvlist; - Allow user to use -d -o feature@...=enable to create a v5000 pool when desired. Without this, the implicit -o version=28 would make the utility to complain about feature@ and version being conflict, which is confusing. Reviewed by: Matthew Ahrens Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 4 23:11:56 2013 (r249113) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Apr 4 23:14:14 2013 (r249114) @@ -858,9 +858,7 @@ zpool_do_create(int argc, char **argv) #ifdef __FreeBSD__ /* Compatiblity with FreeBSD 9.0 and 9.1: Use version 28 if unspecified */ - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_VERSION), - &propval) != 0) { + if (enable_all_pool_feat && !prop_list_contains_feature(props)) { if (add_prop_list(zpool_prop_to_name( ZPOOL_PROP_VERSION), "28", &props, B_TRUE)) goto errout;