From owner-svn-src-stable@FreeBSD.ORG Sun Mar 31 04:10:39 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E51D481B; Sun, 31 Mar 2013 04:10:38 +0000 (UTC) (envelope-from jamie@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 D19938CC; Sun, 31 Mar 2013 04:10:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2V4Ac5X093735; Sun, 31 Mar 2013 04:10:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2V4Ac5r093732; Sun, 31 Mar 2013 04:10:38 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201303310410.r2V4Ac5r093732@svn.freebsd.org> From: Jamie Gritton Date: Sun, 31 Mar 2013 04:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248939 - stable/9/usr.sbin/jail X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2013 04:10:39 -0000 Author: jamie Date: Sun Mar 31 04:10:37 2013 New Revision: 248939 URL: http://svnweb.freebsd.org/changeset/base/248939 Log: MFC r248854: Reverse the order of some implicit commands (FS mounts and ifconfigs) when stopping jails. This matters particularly for nested filesystem mounts. PR: kern/177325 Submitted by: Harald Schmalzbauer Modified: stable/9/usr.sbin/jail/command.c stable/9/usr.sbin/jail/config.c stable/9/usr.sbin/jail/jailp.h Directory Properties: stable/9/usr.sbin/jail/ (props changed) Modified: stable/9/usr.sbin/jail/command.c ============================================================================== --- stable/9/usr.sbin/jail/command.c Sun Mar 31 03:56:48 2013 (r248938) +++ stable/9/usr.sbin/jail/command.c Sun Mar 31 04:10:37 2013 (r248939) @@ -88,13 +88,14 @@ int next_command(struct cfjail *j) { enum intparam comparam; - int create_failed; + int create_failed, stopping; if (paralimit == 0) { requeue(j, &runnable); return 1; } create_failed = (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED; + stopping = (j->flags & JF_STOP) != 0; comparam = *j->comparam; for (;;) { if (j->comstring == NULL) { @@ -113,14 +114,16 @@ next_command(struct cfjail *j) default: if (j->intparams[comparam] == NULL) continue; - j->comstring = create_failed + j->comstring = create_failed || (stopping && + (j->intparams[comparam]->flags & PF_REV)) ? TAILQ_LAST(&j->intparams[comparam]->val, cfstrings) : TAILQ_FIRST(&j->intparams[comparam]->val); } } else { j->comstring = j->comstring == &dummystring ? NULL : - create_failed + create_failed || (stopping && + (j->intparams[comparam]->flags & PF_REV)) ? TAILQ_PREV(j->comstring, cfstrings, tq) : TAILQ_NEXT(j->comstring, tq); } Modified: stable/9/usr.sbin/jail/config.c ============================================================================== --- stable/9/usr.sbin/jail/config.c Sun Mar 31 03:56:48 2013 (r248938) +++ stable/9/usr.sbin/jail/config.c Sun Mar 31 04:10:37 2013 (r248939) @@ -79,18 +79,18 @@ static const struct ipspec intparams[] = [IP_INTERFACE] = {"interface", PF_INTERNAL}, [IP_IP_HOSTNAME] = {"ip_hostname", PF_INTERNAL | PF_BOOL}, #endif - [IP_MOUNT] = {"mount", PF_INTERNAL}, + [IP_MOUNT] = {"mount", PF_INTERNAL | PF_REV}, [IP_MOUNT_DEVFS] = {"mount.devfs", PF_INTERNAL | PF_BOOL}, [IP_MOUNT_FSTAB] = {"mount.fstab", PF_INTERNAL}, [IP_STOP_TIMEOUT] = {"stop.timeout", PF_INTERNAL | PF_INT}, [IP_VNET_INTERFACE] = {"vnet.interface", PF_INTERNAL}, #ifdef INET - [IP__IP4_IFADDR] = {"ip4.addr", PF_INTERNAL | PF_CONV}, + [IP__IP4_IFADDR] = {"ip4.addr", PF_INTERNAL | PF_CONV | PF_REV}, #endif #ifdef INET6 - [IP__IP6_IFADDR] = {"ip6.addr", PF_INTERNAL | PF_CONV}, + [IP__IP6_IFADDR] = {"ip6.addr", PF_INTERNAL | PF_CONV | PF_REV}, #endif - [IP__MOUNT_FROM_FSTAB] = {"mount.fstab", PF_INTERNAL | PF_CONV}, + [IP__MOUNT_FROM_FSTAB] = {"mount.fstab", PF_INTERNAL | PF_CONV | PF_REV}, [IP__OP] = {NULL, PF_CONV}, [KP_ALLOW_CHFLAGS] = {"allow.chflags", 0}, [KP_ALLOW_MOUNT] = {"allow.mount", 0}, Modified: stable/9/usr.sbin/jail/jailp.h ============================================================================== --- stable/9/usr.sbin/jail/jailp.h Sun Mar 31 03:56:48 2013 (r248938) +++ stable/9/usr.sbin/jail/jailp.h Sun Mar 31 04:10:37 2013 (r248939) @@ -50,6 +50,7 @@ #define PF_BOOL 0x10 /* Boolean parameter */ #define PF_INT 0x20 /* Integer parameter */ #define PF_CONV 0x40 /* Parameter duplicated in converted form */ +#define PF_REV 0x80 /* Run commands in reverse order on stopping */ #define JF_START 0x0001 /* -c */ #define JF_SET 0x0002 /* -m */ From owner-svn-src-stable@FreeBSD.ORG Sun Mar 31 10:17:40 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 10:20:29 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 13:54:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4E58473; Sun, 31 Mar 2013 13:54:44 +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 A6CA2DD3; Sun, 31 Mar 2013 13:54:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VDsi1Z063158; Sun, 31 Mar 2013 13:54:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VDsifr063157; Sun, 31 Mar 2013 13:54:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311354.r2VDsifr063157@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 13:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248945 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2013 13:54:44 -0000 Author: avg Date: Sun Mar 31 13:54:44 2013 New Revision: 248945 URL: http://svnweb.freebsd.org/changeset/base/248945 Log: MFC r246293: zfs: fix, improve and re-organize page_lookup and page_unlock Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 12:51:56 2013 (r248944) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Mar 31 13:54:44 2013 (r248945) @@ -322,7 +322,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; @@ -332,7 +332,7 @@ 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 ((pp->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and @@ -343,25 +343,74 @@ page_lookup(vnode_t *vp, int64_t start, vm_page_sleep(pp, "zfsmwb"); continue; } - vm_page_busy(pp); - vm_page_undirty(pp); } else { - if (__predict_false(obj->cache != NULL)) { - vm_page_cache_free(obj, OFF_TO_IDX(start), - OFF_TO_IDX(start) + 1); + 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); + pmap_remove_write(pp); + vm_page_clear_dirty(pp, off, nbytes); + } + break; + } + return (pp); +} + +static void +page_unbusy(vm_page_t 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 ((pp->oflags & VPO_BUSY) != 0) { + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_reference(pp); + vm_page_sleep(pp, "zfsmwb"); + continue; } + + ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); + vm_page_lock(pp); + vm_page_hold(pp); + vm_page_unlock(pp); + + } else pp = NULL; - } break; } return (pp); } static void -page_unlock(vm_page_t pp) +page_unhold(vm_page_t pp) { - vm_page_wakeup(pp); + vm_page_lock(pp); + vm_page_unhold(pp); + vm_page_unlock(pp); } static caddr_t @@ -392,6 +441,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); @@ -402,27 +452,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); } @@ -524,7 +591,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; @@ -533,7 +600,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@FreeBSD.ORG Sun Mar 31 13:56:14 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 14:02:28 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8D1B81E; Sun, 31 Mar 2013 14:02:28 +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 C9C56E10; Sun, 31 Mar 2013 14:02:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VE2SMw065992; Sun, 31 Mar 2013 14:02:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VE2SSc065991; Sun, 31 Mar 2013 14:02:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311402.r2VE2SSc065991@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 14:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248947 - stable/9/sys/cddl/dev/fbt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2013 14:02:28 -0000 Author: avg Date: Sun Mar 31 14:02:28 2013 New Revision: 248947 URL: http://svnweb.freebsd.org/changeset/base/248947 Log: MFC r248640: fbt_typoff_init: fix an off by one in determining required memory size Modified: stable/9/sys/cddl/dev/fbt/fbt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/9/sys/cddl/dev/fbt/fbt.c Sun Mar 31 13:56:13 2013 (r248946) +++ stable/9/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:02:28 2013 (r248947) @@ -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@FreeBSD.ORG Sun Mar 31 14:02:43 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 14:10:20 2013 Return-Path: Delivered-To: svn-src-stable@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 9264EBC2; Sun, 31 Mar 2013 14:10:20 +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 851DCE40; Sun, 31 Mar 2013 14:10:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2VEAKis068557; Sun, 31 Mar 2013 14:10:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2VEAKXj068556; Sun, 31 Mar 2013 14:10:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201303311410.r2VEAKXj068556@svn.freebsd.org> From: Andriy Gapon Date: Sun, 31 Mar 2013 14:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r248949 - stable/9/sys/cddl/dev/fbt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Mar 2013 14:10:20 -0000 Author: avg Date: Sun Mar 31 14:10:19 2013 New Revision: 248949 URL: http://svnweb.freebsd.org/changeset/base/248949 Log: MFC r248642: fbt_getargdesc: correctly handle types for return probes Modified: stable/9/sys/cddl/dev/fbt/fbt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/9/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:02:43 2013 (r248948) +++ stable/9/sys/cddl/dev/fbt/fbt.c Sun Mar 31 14:10:19 2013 (r248949) @@ -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@FreeBSD.ORG Sun Mar 31 14:10:50 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 18:31:59 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 18:39:12 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 18:56:01 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 19:03:26 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Sun Mar 31 20:40:06 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Mon Apr 1 08:50:49 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Mon Apr 1 11:52:00 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Mon Apr 1 15:12:40 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Tue Apr 2 06:49:44 2013 Return-Path: Delivered-To: svn-src-stable@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 C2A41B71; Tue, 2 Apr 2013 06:49:44 +0000 (UTC) (envelope-from ae@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 B432FB47; Tue, 2 Apr 2013 06:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r326niLu084208; Tue, 2 Apr 2013 06:49:44 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r326niVe084207; Tue, 2 Apr 2013 06:49:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304020649.r326niVe084207@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 2 Apr 2013 06:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249002 - stable/9/sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 06:49:44 -0000 Author: ae Date: Tue Apr 2 06:49:44 2013 New Revision: 249002 URL: http://svnweb.freebsd.org/changeset/base/249002 Log: MFC r248697: When we are removing a specific set, call ipfw_expire_dyn_rules only once. Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Apr 2 06:48:29 2013 (r249001) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Tue Apr 2 06:49:44 2013 (r249002) @@ -377,14 +377,15 @@ del_entry(struct ip_fw_chain *chain, uin /* 4. swap the maps (under BH_LOCK) */ map = swap_map(chain, map, chain->n_rules - n); /* 5. now remove the rules deleted from the old map */ + if (cmd == 1) + ipfw_expire_dyn_rules(chain, NULL, new_set); for (i = start; i < end; i++) { - int l; rule = map[i]; if (keep_rule(rule, cmd, new_set, num)) continue; - l = RULESIZE(rule); - chain->static_len -= l; - ipfw_expire_dyn_rules(chain, rule, RESVD_SET); + chain->static_len -= RULESIZE(rule); + if (cmd != 1) + ipfw_expire_dyn_rules(chain, rule, RESVD_SET); rule->x_next = chain->reap; chain->reap = rule; } From owner-svn-src-stable@FreeBSD.ORG Tue Apr 2 14:10:23 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Tue Apr 2 17:59:01 2013 Return-Path: Delivered-To: svn-src-stable@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 13A95FEB; Tue, 2 Apr 2013 17:59:01 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id AAE263F5; Tue, 2 Apr 2013 17:58:59 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r32Hx3Aw085456; Tue, 2 Apr 2013 12:59:03 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r32Hx3w7085455; Tue, 2 Apr 2013 12:59:03 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Apr 2013 12:59:03 -0500 From: Brooks Davis To: John Baldwin Subject: Re: svn commit: r248352 - in stable/9: etc share/mk Message-ID: <20130402175903.GA85393@lor.one-eyed-alien.net> References: <201303152132.r2FLWfwx076672@svn.freebsd.org> <20130319200631.GC80942@lor.one-eyed-alien.net> <201303200918.08803.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <201303200918.08803.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-stable-9@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 17:59:01 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2013 at 09:18:08AM -0400, John Baldwin wrote: > On Tuesday, March 19, 2013 4:06:31 pm Brooks Davis wrote: > > On Tue, Mar 19, 2013 at 09:49:47PM +0400, Dmitry Morozovsky wrote: > > > On Tue, 19 Mar 2013, Brooks Davis wrote: > > >=20 > > > > > > Replace all known uses of ln in the build process with approp= riate > > > > > > install -l invocations via new INSTALL_LINK and INSTALL_SYMLI= NK > > > > > > variables. > > > > >=20 > > > > > It seems this merge breaks ``make distribution'' and hence mergem= aster if your=20 > > > > > base system is not updated yet (for example, while updating jail): > > > >=20 > > > > Sorry for the delay in responding. I missed this yesterday. > > > >=20 > > > > It works for me on a older 9.0-STABLE system where the base install > > > > doesn't support -l. Did you build world or run "make toolchain" in= that > > > > source tree to build the bootstrap copy of install? > > >=20 > > > Yes, this is after full ``make buildworld buildkernel'' process. > >=20 > > I've found the problem thanks to misc/177055. It is that mergemaster > > (and etcupdate) set MAKEOBJDIRPREFIX to something in their > > temporary directory and thus deprive themselves of bootstrap tools. > > Unfortunately, I don't see a trivial fix so I've backed this out for > > now and will work on this in HEAD. >=20 > Hummmm. In the case of etcupdate you can use 'etcupdate -B'. That is ac= tually safe > to do in the common case where you've just updated /usr/src and built the= corresponding > world in /usr/obj. It should possibly even by the default for etcupdate = if a DESTDIR > is not specified. Finally getting back to this... etcupdate -B would correct the immediate problem for etcupdate. I do think that making it the default if the tree exists makes sense. It won't be more broken than a cross installworld is. I did a quick test when I first found this issue and it would be easy to reuse the existing MAKEOBJDIRPREFIX in mergemaster as well. I think we'll want to update UPDATING to recommend that the mergemaster -p stage (and the equivalent for etcupdate) be run using the version in the source tree, not the installed one. I do wonder if it would make sense for them to attempt to find and invoke that version so simplify bootstrapping. -- Brooks --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRWxxmXY6L6fI4GtQRAtcmAJ97CIgMrktZlbUNZiz8nISGM3XLqgCg2P7m nJnWURO7LGk5i+JRCS1nxhY= =R+vd -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2-- From owner-svn-src-stable@FreeBSD.ORG Tue Apr 2 21:08:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09615E7D; Tue, 2 Apr 2013 21:08:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id D928FAB8; Tue, 2 Apr 2013 21:08:05 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2CEBAB943; Tue, 2 Apr 2013 17:08:05 -0400 (EDT) From: John Baldwin To: Brooks Davis Subject: Re: svn commit: r248352 - in stable/9: etc share/mk Date: Tue, 2 Apr 2013 15:50:43 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201303152132.r2FLWfwx076672@svn.freebsd.org> <201303200918.08803.jhb@freebsd.org> <20130402175903.GA85393@lor.one-eyed-alien.net> In-Reply-To: <20130402175903.GA85393@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201304021550.43701.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 02 Apr 2013 17:08:05 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 21:08:06 -0000 On Tuesday, April 02, 2013 1:59:03 pm Brooks Davis wrote: > On Wed, Mar 20, 2013 at 09:18:08AM -0400, John Baldwin wrote: > > On Tuesday, March 19, 2013 4:06:31 pm Brooks Davis wrote: > > > On Tue, Mar 19, 2013 at 09:49:47PM +0400, Dmitry Morozovsky wrote: > > > > On Tue, 19 Mar 2013, Brooks Davis wrote: > > > > > > > > > > > Replace all known uses of ln in the build process with appropriate > > > > > > > install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK > > > > > > > variables. > > > > > > > > > > > > It seems this merge breaks ``make distribution'' and hence mergemaster if your > > > > > > base system is not updated yet (for example, while updating jail): > > > > > > > > > > Sorry for the delay in responding. I missed this yesterday. > > > > > > > > > > It works for me on a older 9.0-STABLE system where the base install > > > > > doesn't support -l. Did you build world or run "make toolchain" in that > > > > > source tree to build the bootstrap copy of install? > > > > > > > > Yes, this is after full ``make buildworld buildkernel'' process. > > > > > > I've found the problem thanks to misc/177055. It is that mergemaster > > > (and etcupdate) set MAKEOBJDIRPREFIX to something in their > > > temporary directory and thus deprive themselves of bootstrap tools. > > > Unfortunately, I don't see a trivial fix so I've backed this out for > > > now and will work on this in HEAD. > > > > Hummmm. In the case of etcupdate you can use 'etcupdate -B'. That is actually safe > > to do in the common case where you've just updated /usr/src and built the corresponding > > world in /usr/obj. It should possibly even by the default for etcupdate if a DESTDIR > > is not specified. > > Finally getting back to this... > > etcupdate -B would correct the immediate problem for etcupdate. I do > think that making it the default if the tree exists makes sense. It > won't be more broken than a cross installworld is. Hmmm, checking for the obj tree is a bit hackish. I'd rather it were more deterministic. I think I'd like to make it just default to -B and require a new -b flag to build a new tree, but perhaps have it check for a tree and error out if it doesn't exist and you don't give it -b? > I did a quick test when I first found this issue and it would be easy to > reuse the existing MAKEOBJDIRPREFIX in mergemaster as well. > > I think we'll want to update UPDATING to recommend that the > mergemaster -p stage (and the equivalent for etcupdate) be run using the > version in the source tree, not the installed one. I do wonder if it > would make sense for them to attempt to find and invoke that version so > simplify bootstrapping. Currently etcupdate doesn't implement something like -p. I need to add that as I would prefer to use its conflict resolution for adding users. (That would also let it serve as a full replacement for mergemaster for those who prefer it.) -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Tue Apr 2 21:35:31 2013 Return-Path: Delivered-To: svn-src-stable@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 EC6DEA33; Tue, 2 Apr 2013 21:35:30 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7FFD0C; Tue, 2 Apr 2013 21:35:30 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r32LZYw8086446; Tue, 2 Apr 2013 16:35:34 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r32LZYiG086445; Tue, 2 Apr 2013 16:35:34 -0500 (CDT) (envelope-from brooks) Date: Tue, 2 Apr 2013 16:35:34 -0500 From: Brooks Davis To: John Baldwin Subject: Re: svn commit: r248352 - in stable/9: etc share/mk Message-ID: <20130402213534.GA86221@lor.one-eyed-alien.net> References: <201303152132.r2FLWfwx076672@svn.freebsd.org> <201303200918.08803.jhb@freebsd.org> <20130402175903.GA85393@lor.one-eyed-alien.net> <201304021550.43701.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <201304021550.43701.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Brooks Davis , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-stable-9@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Apr 2013 21:35:31 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 02, 2013 at 03:50:43PM -0400, John Baldwin wrote: > On Tuesday, April 02, 2013 1:59:03 pm Brooks Davis wrote: > > On Wed, Mar 20, 2013 at 09:18:08AM -0400, John Baldwin wrote: > > > On Tuesday, March 19, 2013 4:06:31 pm Brooks Davis wrote: > > > > On Tue, Mar 19, 2013 at 09:49:47PM +0400, Dmitry Morozovsky wrote: > > > > > On Tue, 19 Mar 2013, Brooks Davis wrote: > > > > >=20 > > > > > > > > Replace all known uses of ln in the build process with ap= propriate > > > > > > > > install -l invocations via new INSTALL_LINK and INSTALL_S= YMLINK > > > > > > > > variables. > > > > > > >=20 > > > > > > > It seems this merge breaks ``make distribution'' and hence me= rgemaster if your=20 > > > > > > > base system is not updated yet (for example, while updating j= ail): > > > > > >=20 > > > > > > Sorry for the delay in responding. I missed this yesterday. > > > > > >=20 > > > > > > It works for me on a older 9.0-STABLE system where the base ins= tall > > > > > > doesn't support -l. Did you build world or run "make toolchain= " in that > > > > > > source tree to build the bootstrap copy of install? > > > > >=20 > > > > > Yes, this is after full ``make buildworld buildkernel'' process. > > > >=20 > > > > I've found the problem thanks to misc/177055. It is that mergemast= er > > > > (and etcupdate) set MAKEOBJDIRPREFIX to something in their > > > > temporary directory and thus deprive themselves of bootstrap tools. > > > > Unfortunately, I don't see a trivial fix so I've backed this out for > > > > now and will work on this in HEAD. > > >=20 > > > Hummmm. In the case of etcupdate you can use 'etcupdate -B'. That i= s actually safe > > > to do in the common case where you've just updated /usr/src and built= the corresponding > > > world in /usr/obj. It should possibly even by the default for etcupd= ate if a DESTDIR > > > is not specified. > >=20 > > Finally getting back to this... > >=20 > > etcupdate -B would correct the immediate problem for etcupdate. I do > > think that making it the default if the tree exists makes sense. It > > won't be more broken than a cross installworld is. >=20 > Hmmm, checking for the obj tree is a bit hackish. I'd rather it were more > deterministic. I think I'd like to make it just default to -B and require > a new -b flag to build a new tree, but perhaps have it check for a tree > and error out if it doesn't exist and you don't give it -b? Just switching the default seems fine in practice. I guess it would probably be useful to keep an option to enable the old behavior. > > I did a quick test when I first found this issue and it would be easy to > > reuse the existing MAKEOBJDIRPREFIX in mergemaster as well. > >=20 > > I think we'll want to update UPDATING to recommend that the > > mergemaster -p stage (and the equivalent for etcupdate) be run using the > > version in the source tree, not the installed one. I do wonder if it > > would make sense for them to attempt to find and invoke that version so > > simplify bootstrapping. >=20 > Currently etcupdate doesn't implement something like -p. I need to add t= hat as > I would prefer to use its conflict resolution for adding users. (That wo= uld > also let it serve as a full replacement for mergemaster for those who pre= fer it.) OK, I'll look at switching the default behavior in mergemaster and adding an option to revert to the old behavior. I'll also change UPDATING to suggest using the mergemaster.sh from the source tree for mergemaster -p. - Brooks --0F1p//8PRICkK4MW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRW08mXY6L6fI4GtQRAmQfAKDRXZ2X1pp5dxfAVJxbfrhAwH4hswCg6BsR LoUgP+mDyC1z82yjgm7U+ls= =Hcx7 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-svn-src-stable@FreeBSD.ORG Wed Apr 3 06:48:47 2013 Return-Path: Delivered-To: svn-src-stable@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 E1BDDC0A; Wed, 3 Apr 2013 06:48:47 +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 BA21284F; Wed, 3 Apr 2013 06:48:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r336mlOK022331; Wed, 3 Apr 2013 06:48:47 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r336mlT5022329; Wed, 3 Apr 2013 06:48:47 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304030648.r336mlT5022329@svn.freebsd.org> From: Dimitry Andric Date: Wed, 3 Apr 2013 06:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249040 - in stable/9/contrib/binutils: bfd binutils X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 06:48:48 -0000 Author: dim Date: Wed Apr 3 06:48:47 2013 New Revision: 249040 URL: http://svnweb.freebsd.org/changeset/base/249040 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/9/contrib/binutils/bfd/dwarf2.c stable/9/contrib/binutils/binutils/dwarf.c Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/bfd/dwarf2.c ============================================================================== --- stable/9/contrib/binutils/bfd/dwarf2.c Wed Apr 3 06:45:21 2013 (r249039) +++ stable/9/contrib/binutils/bfd/dwarf2.c Wed Apr 3 06:48:47 2013 (r249040) @@ -633,6 +633,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/9/contrib/binutils/binutils/dwarf.c ============================================================================== --- stable/9/contrib/binutils/binutils/dwarf.c Wed Apr 3 06:45:21 2013 (r249039) +++ stable/9/contrib/binutils/binutils/dwarf.c Wed Apr 3 06:48:47 2013 (r249040) @@ -557,6 +557,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]; @@ -969,6 +970,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: @@ -1030,6 +1035,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@FreeBSD.ORG Wed Apr 3 11:00:50 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E27EE4F5; Wed, 3 Apr 2013 11:00:50 +0000 (UTC) (envelope-from des@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 D3A93670; Wed, 3 Apr 2013 11:00: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 r33B0omJ098138; Wed, 3 Apr 2013 11:00:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33B0oQQ098137; Wed, 3 Apr 2013 11:00:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304031100.r33B0oQQ098137@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 3 Apr 2013 11:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249046 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 11:00:51 -0000 Author: des Date: Wed Apr 3 11:00:50 2013 New Revision: 249046 URL: http://svnweb.freebsd.org/changeset/base/249046 Log: MFH (r246358): load pfsync.ko if necessary. Modified: stable/9/etc/rc.d/pfsync Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/pfsync ============================================================================== --- stable/9/etc/rc.d/pfsync Wed Apr 3 10:49:05 2013 (r249045) +++ stable/9/etc/rc.d/pfsync Wed Apr 3 11:00:50 2013 (r249046) @@ -35,6 +35,7 @@ pfsync_start() if [ -n "${pfsync_syncpeer}" ]; then _syncpeer="syncpeer ${pfsync_syncpeer}" fi + load_kld pfsync ifconfig pfsync0 $_syncpeer syncdev $pfsync_syncdev $pfsync_ifconfig up } From owner-svn-src-stable@FreeBSD.ORG Wed Apr 3 11:51:12 2013 Return-Path: Delivered-To: svn-src-stable@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 C1D2FDB9; Wed, 3 Apr 2013 11:51:12 +0000 (UTC) (envelope-from des@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 B3BD88F8; Wed, 3 Apr 2013 11:51: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 r33BpCxt013440; Wed, 3 Apr 2013 11:51:12 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33BpCcD013437; Wed, 3 Apr 2013 11:51:12 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304031151.r33BpCcD013437@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 3 Apr 2013 11:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249049 - in stable/9: etc/rc.d usr.sbin/rtadvd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 11:51:12 -0000 Author: des Date: Wed Apr 3 11:51:11 2013 New Revision: 249049 URL: http://svnweb.freebsd.org/changeset/base/249049 Log: MFH (r247270, r247271): allow starting rtadvd without any interfaces. Modified: stable/9/etc/rc.d/rtadvd stable/9/usr.sbin/rtadvd/rtadvd.8 stable/9/usr.sbin/rtadvd/rtadvd.c Directory Properties: stable/9/etc/ (props changed) stable/9/usr.sbin/rtadvd/ (props changed) Modified: stable/9/etc/rc.d/rtadvd ============================================================================== --- stable/9/etc/rc.d/rtadvd Wed Apr 3 11:30:18 2013 (r249048) +++ stable/9/etc/rc.d/rtadvd Wed Apr 3 11:51:11 2013 (r249049) @@ -45,6 +45,9 @@ rtadvd_precmd() fi done ;; + [Nn][Oo][Nn][Ee]) + rtadvd_interfaces="" + ;; esac command_args="${rtadvd_interfaces}" Modified: stable/9/usr.sbin/rtadvd/rtadvd.8 ============================================================================== --- stable/9/usr.sbin/rtadvd/rtadvd.8 Wed Apr 3 11:30:18 2013 (r249048) +++ stable/9/usr.sbin/rtadvd/rtadvd.8 Wed Apr 3 11:51:11 2013 (r249049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2011 +.Dd February 25, 2013 .Dt RTADVD 8 .Os .Sh NAME @@ -39,13 +39,19 @@ .Nm .Op Fl dDfRs .Op Fl c Ar configfile +.Op Fl C Ar ctlsock .Op Fl M Ar ifname .Op Fl p Ar pidfile -.Ar interface ... +.Op Ar interface ... .Sh DESCRIPTION .Nm sends router advertisement packets to the specified .Ar interfaces . +If no interfaces are specified, +.Nm +will still run, but will not advertise any routes until interfaces are +added using +.Xr rtadvctl 8 . .Pp The program will daemonize itself on invocation. It will then send router advertisement packets periodically, as well @@ -121,6 +127,11 @@ for the configuration file. By default, .Pa /etc/rtadvd.conf is used. +.It Fl C +Specify an alternate location for the control socket used by +.Xr rtadvctl 8 . +The default is +.Pa /var/run/rtadvd.sock . .It Fl d Print debugging information. .It Fl D @@ -185,6 +196,7 @@ The default process ID file. .Ex -std .Sh SEE ALSO .Xr rtadvd.conf 5 , +.Xr rtadvctl 8 , .Xr rtsol 8 .Rs .%A Thomas Narten Modified: stable/9/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- stable/9/usr.sbin/rtadvd/rtadvd.c Wed Apr 3 11:30:18 2013 (r249048) +++ stable/9/usr.sbin/rtadvd/rtadvd.c Wed Apr 3 11:51:11 2013 (r249049) @@ -166,6 +166,15 @@ static void rtmsg_input(struct sockinfo static void set_short_delay(struct ifinfo *); static int check_accept_rtadv(int); +static void +usage(void) +{ + + fprintf(stderr, "usage: rtadvd [-dDfRs] " + "[-c configfile] [-C ctlsock] [-M ifname] [-p pidfile]\n"); + exit(1); +} + int main(int argc, char *argv[]) { @@ -177,7 +186,7 @@ main(int argc, char *argv[]) pid_t pid, otherpid; /* get command line options and arguments */ - while ((ch = getopt(argc, argv, "c:C:dDfM:p:Rs")) != -1) { + while ((ch = getopt(argc, argv, "c:C:dDfhM:p:Rs")) != -1) { switch (ch) { case 'c': conffile = optarg; @@ -209,17 +218,12 @@ main(int argc, char *argv[]) case 'p': pidfilename = optarg; break; + default: + usage(); } } argc -= optind; argv += optind; - if (argc == 0) { - fprintf(stderr, - "usage: rtadvd [-dDfRs] [-c conffile] " - "[-C ctrlsockname] [-M ifname] " - "[-p pidfile] interfaces...\n"); - exit(1); - } logopt = LOG_NDELAY | LOG_PID; if (fflag) From owner-svn-src-stable@FreeBSD.ORG Wed Apr 3 12:17:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E952D7F5; Wed, 3 Apr 2013 12:17:36 +0000 (UTC) (envelope-from des@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 CCD7BABC; Wed, 3 Apr 2013 12:17:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33CHann020322; Wed, 3 Apr 2013 12:17:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33CHaDm020319; Wed, 3 Apr 2013 12:17:36 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304031217.r33CHaDm020319@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 3 Apr 2013 12:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249050 - in stable/9/contrib/openpam: doc/man lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 12:17:37 -0000 Author: des Date: Wed Apr 3 12:17:35 2013 New Revision: 249050 URL: http://svnweb.freebsd.org/changeset/base/249050 Log: MFH (r247810): correctly parse mixed quoted / unquoted text. Modified: stable/9/contrib/openpam/doc/man/openpam_straddch.3 stable/9/contrib/openpam/lib/openpam_readline.c stable/9/contrib/openpam/lib/openpam_readword.c Directory Properties: stable/9/contrib/openpam/ (props changed) Modified: stable/9/contrib/openpam/doc/man/openpam_straddch.3 ============================================================================== --- stable/9/contrib/openpam/doc/man/openpam_straddch.3 Wed Apr 3 11:51:11 2013 (r249049) +++ stable/9/contrib/openpam/doc/man/openpam_straddch.3 Wed Apr 3 12:17:35 2013 (r249050) @@ -34,7 +34,7 @@ .\" .\" $Id$ .\" -.Dd May 26, 2012 +.Dd March 3, 2013 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME @@ -73,6 +73,21 @@ and argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. .Pp +The final argument, +.Fa ch , +is the character that should be appended to +the string. If +.Fa ch +is 0, nothing is appended, but a new buffer is +still allocated if +.Fa str +is NULL. This can be used to +.Do +bootstrap +.Dc +the +string. +.Pp If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, .Fa str @@ -91,7 +106,9 @@ If the function is successful, it increments the integer variable pointed to by .Fa len -and returns 0. +(unless +.Fa ch +was 0) and returns 0. Otherwise, it leaves the variables pointed to by .Fa str , .Fa size Modified: stable/9/contrib/openpam/lib/openpam_readline.c ============================================================================== --- stable/9/contrib/openpam/lib/openpam_readline.c Wed Apr 3 11:51:11 2013 (r249049) +++ stable/9/contrib/openpam/lib/openpam_readline.c Wed Apr 3 12:17:35 2013 (r249050) @@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, s size_t len, size; int ch; - if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); + line = NULL; + if (openpam_straddch(&line, &size, &len, 0) != 0) return (NULL); - } - len = 0; for (;;) { ch = fgetc(f); /* strip comment */ Modified: stable/9/contrib/openpam/lib/openpam_readword.c ============================================================================== --- stable/9/contrib/openpam/lib/openpam_readword.c Wed Apr 3 11:51:11 2013 (r249049) +++ stable/9/contrib/openpam/lib/openpam_readword.c Wed Apr 3 12:17:35 2013 (r249050) @@ -86,13 +86,8 @@ openpam_readword(FILE *f, int *lineno, s /* begin quote */ quote = ch; /* edge case: empty quoted string */ - if (word == NULL && (word = malloc(1)) == NULL) { - openpam_log(PAM_LOG_ERROR, "malloc(): %m"); - errno = ENOMEM; + if (openpam_straddch(&word, &size, &len, 0) != 0) return (NULL); - } - *word = '\0'; - size = 1; } else if (ch == quote && !escape) { /* end quote */ quote = 0; From owner-svn-src-stable@FreeBSD.ORG Wed Apr 3 12:20:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CCB6996; Wed, 3 Apr 2013 12:20:09 +0000 (UTC) (envelope-from des@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 37A51AD0; Wed, 3 Apr 2013 12:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33CK9H8020728; Wed, 3 Apr 2013 12:20:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33CK9oT020727; Wed, 3 Apr 2013 12:20:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304031220.r33CK9oT020727@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 3 Apr 2013 12:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249051 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 12:20:09 -0000 Author: des Date: Wed Apr 3 12:20:08 2013 New Revision: 249051 URL: http://svnweb.freebsd.org/changeset/base/249051 Log: MFH (r247285): always bootstrap liby along with yacc. Modified: stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Wed Apr 3 12:17:35 2013 (r249050) +++ stable/9/Makefile.inc1 Wed Apr 3 12:20:08 2013 (r249051) @@ -1083,7 +1083,8 @@ _lex= usr.bin/lex .endif .if ${BOOTSTRAPPING} < 900006 || ${BOOTSTRAPPING} >= 1000013 -_yacc= usr.bin/yacc +_yacc= lib/liby \ + usr.bin/yacc .endif .if ${BOOTSTRAPPING} < 1000026 From owner-svn-src-stable@FreeBSD.ORG Wed Apr 3 15:34:25 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C11DEF73; Wed, 3 Apr 2013 15:34:25 +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 B29B7A33; Wed, 3 Apr 2013 15:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33FYPA6078292; Wed, 3 Apr 2013 15:34:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33FYPQR078291; Wed, 3 Apr 2013 15:34:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304031534.r33FYPQR078291@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Apr 2013 15:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249053 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 15:34:25 -0000 Author: kib Date: Wed Apr 3 15:34:25 2013 New Revision: 249053 URL: http://svnweb.freebsd.org/changeset/base/249053 Log: MFC r248562: Move the vn_start_write() call in the dounmount() before setting the MNTK_UNMOUNT flag. Modified: stable/9/sys/kern/vfs_mount.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mount.c ============================================================================== --- stable/9/sys/kern/vfs_mount.c Wed Apr 3 14:10:37 2013 (r249052) +++ stable/9/sys/kern/vfs_mount.c Wed Apr 3 15:34:25 2013 (r249053) @@ -1260,12 +1260,14 @@ dounmount(mp, flags, td) return (error); } + vn_start_write(NULL, &mp, V_WAIT); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || !TAILQ_EMPTY(&mp->mnt_uppers)) { MNT_IUNLOCK(mp); if (coveredvp) VOP_UNLOCK(coveredvp, 0); + vn_finished_write(mp); return (EBUSY); } mp->mnt_kern_flag |= MNTK_UNMOUNT | MNTK_NOINSMNTQ; @@ -1285,7 +1287,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@FreeBSD.ORG Wed Apr 3 15:38:45 2013 Return-Path: Delivered-To: svn-src-stable@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 297972E3; Wed, 3 Apr 2013 15:38:45 +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 1A1BAA8D; Wed, 3 Apr 2013 15:38:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33FciOS078905; Wed, 3 Apr 2013 15:38:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33FciW4078904; Wed, 3 Apr 2013 15:38:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304031538.r33FciW4078904@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Apr 2013 15:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249054 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 15:38:45 -0000 Author: kib Date: Wed Apr 3 15:38:44 2013 New Revision: 249054 URL: http://svnweb.freebsd.org/changeset/base/249054 Log: MFC r248563: Increment the write ref counter for the buffer object before calling bundirty(). Modified: stable/9/sys/kern/vfs_bio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Wed Apr 3 15:34:25 2013 (r249053) +++ stable/9/sys/kern/vfs_bio.c Wed Apr 3 15:38:44 2013 (r249054) @@ -936,7 +936,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; @@ -944,7 +950,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@FreeBSD.ORG Wed Apr 3 15:57:18 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Wed Apr 3 16:02:02 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Wed Apr 3 16:26:59 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Wed Apr 3 16:31:31 2013 Return-Path: Delivered-To: svn-src-stable@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 56995FCD; Wed, 3 Apr 2013 16:31:31 +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 304D7E9E; Wed, 3 Apr 2013 16:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r33GVVN0095853; Wed, 3 Apr 2013 16:31:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33GVUQc095851; Wed, 3 Apr 2013 16:31:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304031631.r33GVUQc095851@svn.freebsd.org> From: Dimitry Andric Date: Wed, 3 Apr 2013 16:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r249059 - in stable/7/contrib/binutils: bfd binutils X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 16:31:31 -0000 Author: dim Date: Wed Apr 3 16:31:30 2013 New Revision: 249059 URL: http://svnweb.freebsd.org/changeset/base/249059 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/7/contrib/binutils/bfd/dwarf2.c stable/7/contrib/binutils/binutils/readelf.c Directory Properties: stable/7/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/bfd/dwarf2.c ============================================================================== --- stable/7/contrib/binutils/bfd/dwarf2.c Wed Apr 3 16:26:58 2013 (r249058) +++ stable/7/contrib/binutils/bfd/dwarf2.c Wed Apr 3 16:31:30 2013 (r249059) @@ -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/7/contrib/binutils/binutils/readelf.c ============================================================================== --- stable/7/contrib/binutils/binutils/readelf.c Wed Apr 3 16:26:58 2013 (r249058) +++ stable/7/contrib/binutils/binutils/readelf.c Wed Apr 3 16:31:30 2013 (r249059) @@ -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@FreeBSD.ORG Wed Apr 3 21:15:22 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Wed Apr 3 23:11:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03290E18; Wed, 3 Apr 2013 23:11:16 +0000 (UTC) (envelope-from sbruno@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 E8DC1717; Wed, 3 Apr 2013 23:11: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 r33NBFvq014495; Wed, 3 Apr 2013 23:11:15 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r33NBFLu014493; Wed, 3 Apr 2013 23:11:15 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304032311.r33NBFLu014493@svn.freebsd.org> From: Sean Bruno Date: Wed, 3 Apr 2013 23:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r249073 - stable/7/sys/contrib/dev/acpica X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2013 23:11:16 -0000 Author: sbruno Date: Wed Apr 3 23:11:15 2013 New Revision: 249073 URL: http://svnweb.freebsd.org/changeset/base/249073 Log: Resolve kernel panic that occurs on callback from sysctl when setting hw.ciss.expose_hidden_physical=1 on a HP ProLiant DL360 G6 (and possibly others) due to mishandling of error value in acpica on stable/7 Note that this is a direct commit as this code has been fixed in stable/8 (8.4 included) and higher release for quite some time. PR: kern/152250 Submitted by: Loic Pefferkorn Reviewed by: avg@ Modified: stable/7/sys/contrib/dev/acpica/nsxfname.c Modified: stable/7/sys/contrib/dev/acpica/nsxfname.c ============================================================================== --- stable/7/sys/contrib/dev/acpica/nsxfname.c Wed Apr 3 22:37:40 2013 (r249072) +++ stable/7/sys/contrib/dev/acpica/nsxfname.c Wed Apr 3 23:11:15 2013 (r249073) @@ -361,6 +361,7 @@ AcpiGetObjectInfo ( if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + Status = AE_BAD_PARAMETER; goto Cleanup; } From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:04:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E3079BA; Thu, 4 Apr 2013 05:04:49 +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 60B92678; Thu, 4 Apr 2013 05:04:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3454m9c018096; Thu, 4 Apr 2013 05:04:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3454mXj018095; Thu, 4 Apr 2013 05:04:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040504.r3454mXj018095@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249075 - stable/9/sys/x86/x86 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:04:49 -0000 Author: kib Date: Thu Apr 4 05:04:48 2013 New Revision: 249075 URL: http://svnweb.freebsd.org/changeset/base/249075 Log: MFC r248968: Record the correct error in the trace. Modified: stable/9/sys/x86/x86/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/x86/x86/busdma_machdep.c ============================================================================== --- stable/9/sys/x86/x86/busdma_machdep.c Wed Apr 3 23:39:54 2013 (r249074) +++ stable/9/sys/x86/x86/busdma_machdep.c Thu Apr 4 05:04:48 2013 (r249075) @@ -252,7 +252,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@FreeBSD.ORG Thu Apr 4 05:16:14 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Thu Apr 4 05:20:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8204D8F; Thu, 4 Apr 2013 05:20:52 +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 AC6A36C3; Thu, 4 Apr 2013 05:20:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345Kqes023559; Thu, 4 Apr 2013 05:20:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345Kqut023558; Thu, 4 Apr 2013 05:20:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040520.r345Kqut023558@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249077 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:20:52 -0000 Author: kib Date: Thu Apr 4 05:20:52 2013 New Revision: 249077 URL: http://svnweb.freebsd.org/changeset/base/249077 Log: MFC r248967: Strip the unnneeded spaces, mostly at the end of lines. Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Thu Apr 4 05:16:14 2013 (r249076) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Thu Apr 4 05:20:52 2013 (r249077) @@ -73,7 +73,7 @@ int ncl_pbuf_freecnt = -1; /* start out static struct buf *nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td); -static int nfs_directio_write(struct vnode *vp, struct uio *uiop, +static int nfs_directio_write(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag); /* @@ -120,7 +120,7 @@ ncl_getpages(struct vop_getpages_args *a mtx_lock(&nmp->nm_mtx); if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && - (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { + (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { mtx_unlock(&nmp->nm_mtx); /* We'll never get here for v4, because we always have fsinfo */ (void)ncl_fsinfo(nmp, vp, cred, td); @@ -269,7 +269,7 @@ ncl_putpages(struct vop_putpages_args *a rtvals = ap->a_rtvals; npages = btoc(count); offset = IDX_TO_OFF(pages[0]->pindex); - + mtx_lock(&nmp->nm_mtx); if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { @@ -279,9 +279,9 @@ ncl_putpages(struct vop_putpages_args *a mtx_unlock(&nmp->nm_mtx); mtx_lock(&np->n_mtx); - if (newnfs_directio_enable && !newnfs_directio_allow_mmap && + if (newnfs_directio_enable && !newnfs_directio_allow_mmap && (np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + mtx_unlock(&np->n_mtx); ncl_printf("ncl_putpages: called on noncache-able vnode??\n"); mtx_lock(&np->n_mtx); } @@ -362,7 +362,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct vattr vattr; struct nfsnode *np = VTONFS(vp); int old_lock; - + /* * Grab the exclusive lock before checking whether the cache is * consistent. @@ -414,7 +414,7 @@ nfs_bioread_check_cons(struct vnode *vp, } mtx_unlock(&np->n_mtx); } -out: +out: ncl_downgrade_vnlock(vp, old_lock); return error; } @@ -456,10 +456,10 @@ ncl_bioread(struct vnode *vp, struct uio tmp_off = uio->uio_offset + uio->uio_resid; if (vp->v_type != VDIR && (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset)) { - mtx_unlock(&nmp->nm_mtx); + mtx_unlock(&nmp->nm_mtx); return (EFBIG); } - mtx_unlock(&nmp->nm_mtx); + 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 */ @@ -467,17 +467,17 @@ ncl_bioread(struct vnode *vp, struct uio biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); - + error = nfs_bioread_check_cons(vp, td, cred); if (error) return error; do { u_quad_t nsize; - + mtx_lock(&np->n_mtx); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + mtx_unlock(&np->n_mtx); switch (vp->v_type) { case VREG: @@ -710,13 +710,13 @@ ncl_bioread(struct vnode *vp, struct uio } /* - * The NFS write path cannot handle iovecs with len > 1. So we need to + * The NFS write path cannot handle iovecs with len > 1. So we need to * break up iovecs accordingly (restricting them to wsize). - * For the SYNC case, we can do this with 1 copy (user buffer -> mbuf). - * For the ASYNC case, 2 copies are needed. The first a copy from the + * For the SYNC case, we can do this with 1 copy (user buffer -> mbuf). + * For the ASYNC case, 2 copies are needed. The first a copy from the * user buffer to a staging buffer and then a second copy from the staging * buffer to mbufs. This can be optimized by copying from the user buffer - * directly into mbufs and passing the chain down, but that requires a + * directly into mbufs and passing the chain down, but that requires a * fair amount of re-working of the relevant codepaths (and can be done * later). */ @@ -732,7 +732,7 @@ nfs_directio_write(vp, uiop, cred, iofla struct thread *td = uiop->uio_td; int size; int wsize; - + mtx_lock(&nmp->nm_mtx); wsize = nmp->nm_wsize; mtx_unlock(&nmp->nm_mtx); @@ -756,7 +756,7 @@ do_sync: iomode = NFSWRITE_FILESYNC; error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit, 0); - KASSERT((must_commit == 0), + KASSERT((must_commit == 0), ("ncl_directio_write: Did not commit write")); if (error) return (error); @@ -766,7 +766,7 @@ do_sync: uiop->uio_iovcnt--; uiop->uio_iov++; } else { - uiop->uio_iov->iov_base = + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + size; uiop->uio_iov->iov_len -= size; } @@ -775,14 +775,14 @@ do_sync: struct uio *t_uio; struct iovec *t_iov; struct buf *bp; - + /* * Break up the write into blocksize chunks and hand these * over to nfsiod's for write back. - * Unfortunately, this incurs a copy of the data. Since - * the user could modify the buffer before the write is + * Unfortunately, this incurs a copy of the data. Since + * the user could modify the buffer before the write is * initiated. - * + * * The obvious optimization here is that one of the 2 copies * in the async write path can be eliminated by copying the * data here directly into mbufs and passing the mbuf chain @@ -825,8 +825,8 @@ do_sync: if (cred != NOCRED) { crhold(cred); bp->b_wcred = cred; - } else - bp->b_wcred = NOCRED; + } else + bp->b_wcred = NOCRED; bp->b_caller1 = (void *)t_uio; bp->b_vp = vp; error = ncl_asyncio(nmp, bp, NOCRED, td); @@ -847,7 +847,7 @@ err_free: uiop->uio_iovcnt--; uiop->uio_iov++; } else { - uiop->uio_iov->iov_base = + uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + size; uiop->uio_iov->iov_len -= size; } @@ -980,7 +980,7 @@ flush_and_restart: mtx_lock(&np->n_mtx); nflag = np->n_flag; - mtx_unlock(&np->n_mtx); + mtx_unlock(&np->n_mtx); int needrestart = 0; if (nmp->nm_wcommitsize < uio->uio_resid) { /* @@ -1293,11 +1293,11 @@ nfs_getcacheblk(struct vnode *vp, daddr_ nmp = VFSTONFS(mp); if (nmp->nm_flag & NFSMNT_INT) { - sigset_t oldset; + sigset_t oldset; - newnfs_set_sigmask(td, &oldset); + newnfs_set_sigmask(td, &oldset); bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0); - newnfs_restore_sigmask(td, &oldset); + newnfs_restore_sigmask(td, &oldset); while (bp == NULL) { if (newnfs_sigintr(nmp, td)) return (NULL); @@ -1322,7 +1322,7 @@ ncl_vinvalbuf(struct vnode *vp, int flag struct nfsnode *np = VTONFS(vp); struct nfsmount *nmp = VFSTONFS(vp->v_mount); int error = 0, slpflag, slptimeo; - int old_lock = 0; + int old_lock = 0; ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); @@ -1358,7 +1358,7 @@ ncl_vinvalbuf(struct vnode *vp, int flag VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object); /* * If the page clean was interrupted, fail the invalidation. - * Not doing so, we run the risk of losing dirty pages in the + * Not doing so, we run the risk of losing dirty pages in the * vinvalbuf() call below. */ if (intrflg && (error = newnfs_sigintr(nmp, td))) @@ -1466,13 +1466,13 @@ again: NFS_DPF(ASYNCIO, ("ncl_asyncio: waiting for mount %p queue to drain\n", nmp)); nmp->nm_bufqwant = TRUE; - error = newnfs_msleep(td, &nmp->nm_bufq, + error = newnfs_msleep(td, &nmp->nm_bufq, &ncl_iod_mutex, slpflag | PRIBIO, "nfsaio", - slptimeo); + slptimeo); if (error) { error2 = newnfs_sigintr(nmp, td); if (error2) { - mtx_unlock(&ncl_iod_mutex); + mtx_unlock(&ncl_iod_mutex); return (error2); } if (slpflag == NFS_PCATCH) { @@ -1508,7 +1508,7 @@ again: TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - mtx_lock(&(VTONFS(bp->b_vp))->n_mtx); + mtx_lock(&(VTONFS(bp->b_vp))->n_mtx); VTONFS(bp->b_vp)->n_flag |= NMODIFIED; VTONFS(bp->b_vp)->n_directio_asyncwr++; mtx_unlock(&(VTONFS(bp->b_vp))->n_mtx); @@ -1533,7 +1533,7 @@ ncl_doio_directwrite(struct buf *bp) int iomode, must_commit; struct uio *uiop = (struct uio *)bp->b_caller1; char *iov_base = uiop->uio_iov->iov_base; - + iomode = NFSWRITE_FILESYNC; uiop->uio_td = NULL; /* NULL since we're in nfsiod */ ncl_writerpc(bp->b_vp, uiop, bp->b_wcred, &iomode, &must_commit, 0); @@ -1574,7 +1574,7 @@ ncl_doio(struct vnode *vp, struct buf *b struct iovec io; struct proc *p = td ? td->td_proc : NULL; uint8_t iocmd; - + np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount); uiop = &uio; @@ -1758,20 +1758,20 @@ ncl_doio(struct vnode *vp, struct buf *b * bp in this case is not an NFS cache block so we should * be safe. XXX * - * The logic below breaks up errors into recoverable and + * The logic below breaks up errors into recoverable and * unrecoverable. For the former, we clear B_INVAL|B_NOCACHE * and keep the buffer around for potential write retries. * For the latter (eg ESTALE), we toss the buffer away (B_INVAL) - * and save the error in the nfsnode. This is less than ideal + * and save the error in the nfsnode. This is less than ideal * but necessary. Keeping such buffers around could potentially * cause buffer exhaustion eventually (they can never be written * out, so will get constantly be re-dirtied). It also causes - * all sorts of vfs panics. For non-recoverable write errors, + * all sorts of vfs panics. For non-recoverable write errors, * also invalidate the attrcache, so we'll be forced to go over * the wire for this object, returning an error to user on next * call (most of the time). */ - if (error == EINTR || error == EIO || error == ETIMEDOUT + if (error == EINTR || error == EIO || error == ETIMEDOUT || (!error && (bp->b_flags & B_NEEDCOMMIT))) { int s; @@ -1785,7 +1785,7 @@ ncl_doio(struct vnode *vp, struct buf *b (bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; splx(s); - } else { + } else { if (error) { bp->b_ioflags |= BIO_ERROR; bp->b_flags |= B_INVAL; @@ -1838,7 +1838,7 @@ ncl_meta_setsize(struct vnode *vp, struc int bufsize; /* - * vtruncbuf() doesn't get the buffer overlapping the + * vtruncbuf() doesn't get the buffer overlapping the * truncation point. We may have a B_DELWRI and/or B_CACHE * buffer that now needs to be truncated. */ @@ -1846,8 +1846,8 @@ ncl_meta_setsize(struct vnode *vp, struc lbn = nsize / biosize; bufsize = nsize & (biosize - 1); bp = nfs_getcacheblk(vp, lbn, bufsize, td); - if (!bp) - return EINTR; + if (!bp) + return EINTR; if (bp->b_dirtyoff > bp->b_bcount) bp->b_dirtyoff = bp->b_bcount; if (bp->b_dirtyend > bp->b_bcount) From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:26:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3B3EE174; Thu, 4 Apr 2013 05:26:23 +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 1527D6F0; Thu, 4 Apr 2013 05:26: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 r345QMlI024397; Thu, 4 Apr 2013 05:26:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345QMPB024396; Thu, 4 Apr 2013 05:26:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040526.r345QMPB024396@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249078 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:26:23 -0000 Author: kib Date: Thu Apr 4 05:26:22 2013 New Revision: 249078 URL: http://svnweb.freebsd.org/changeset/base/249078 Log: MFC r248567: Do not call vnode_pager_setsize() while a NFS node mutex is locked. vnode_pager_setsize() might sleep waiting for the page after EOF be unbusied. Call vnode_pager_setsize() both for the regular and directory vnodes. MFC r248581: Initialize the variable to avoid (false) compiler warning about use of an uninitialized local. Modified: stable/9/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Thu Apr 4 05:20:52 2013 (r249077) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Thu Apr 4 05:26:22 2013 (r249078) @@ -367,6 +367,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsnode *np; struct nfsmount *nmp; struct timespec mtime_save; + u_quad_t nsize; + int setnsize; /* * If v_type == VNON it is a new node, so fill in the v_type, @@ -424,6 +426,8 @@ nfscl_loadattrcache(struct vnode **vpp, } else vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; np->n_attrstamp = time_second; + setnsize = 0; + nsize = 0; if (vap->va_size != np->n_size) { if (vap->va_type == VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -450,10 +454,13 @@ nfscl_loadattrcache(struct vnode **vpp, np->n_size = vap->va_size; np->n_flag |= NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); } else { np->n_size = vap->va_size; } + if (vap->va_type == VREG || vap->va_type == VDIR) { + setnsize = 1; + nsize = vap->va_size; + } } /* * The following checks are added to prevent a race between (say) @@ -486,6 +493,8 @@ nfscl_loadattrcache(struct vnode **vpp, KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); #endif NFSUNLOCKNODE(np); + if (setnsize) + vnode_pager_setsize(vp, nsize); return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:29:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3C72A304; Thu, 4 Apr 2013 05:29:38 +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 2ED84708; Thu, 4 Apr 2013 05:29:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345Tch6024859; Thu, 4 Apr 2013 05:29:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345Tcfo024858; Thu, 4 Apr 2013 05:29:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040529.r345Tcfo024858@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249079 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:29:38 -0000 Author: kib Date: Thu Apr 4 05:29:37 2013 New Revision: 249079 URL: http://svnweb.freebsd.org/changeset/base/249079 Log: MFC r248815: Release the v_writecount reference on the vnode in case of error, before the vnode is vput() in vm_mmap_vnode(). Modified: stable/9/sys/vm/vm_mmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_mmap.c ============================================================================== --- stable/9/sys/vm/vm_mmap.c Thu Apr 4 05:26:22 2013 (r249078) +++ stable/9/sys/vm/vm_mmap.c Thu Apr 4 05:29:37 2013 (r249079) @@ -1352,6 +1352,10 @@ mark_atime: vfs_mark_atime(vp, cred); done: + if (error != 0 && *writecounted) { + *writecounted = FALSE; + vnode_pager_update_writecount(obj, objsize, 0); + } vput(vp); VFS_UNLOCK_GIANT(vfslocked); return (error); From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:36:11 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9BE4E4AA; Thu, 4 Apr 2013 05:36:11 +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 8D9B872D; Thu, 4 Apr 2013 05:36:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345aBSx027419; Thu, 4 Apr 2013 05:36:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345aBqr027418; Thu, 4 Apr 2013 05:36:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040536.r345aBqr027418@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249080 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:36:11 -0000 Author: kib Date: Thu Apr 4 05:36:11 2013 New Revision: 249080 URL: http://svnweb.freebsd.org/changeset/base/249080 Log: MFC r247832: Import the likely() compat macro. MFC r247838: Correct the r247832. Modified: stable/9/sys/dev/drm2/drmP.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drmP.h ============================================================================== --- stable/9/sys/dev/drm2/drmP.h Thu Apr 4 05:29:37 2013 (r249079) +++ stable/9/sys/dev/drm2/drmP.h Thu Apr 4 05:36:11 2013 (r249080) @@ -228,6 +228,7 @@ typedef void irqreturn_t; #define IRQ_NONE /* nothing */ #define unlikely(x) __builtin_expect(!!(x), 0) +#define likely(x) __builtin_expect(!!(x), 1) #define container_of(ptr, type, member) ({ \ __typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:39:38 2013 Return-Path: Delivered-To: svn-src-stable@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 DAED0630; Thu, 4 Apr 2013 05:39:38 +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 B056D741; Thu, 4 Apr 2013 05:39:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345dcMd027930; Thu, 4 Apr 2013 05:39:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345dcY8027925; Thu, 4 Apr 2013 05:39:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040539.r345dcY8027925@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249081 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:39:38 -0000 Author: kib Date: Thu Apr 4 05:39:37 2013 New Revision: 249081 URL: http://svnweb.freebsd.org/changeset/base/249081 Log: MFC r247833: Import the drm_mm_debug_table() function. Modified: stable/9/sys/dev/drm2/drm_mm.c stable/9/sys/dev/drm2/drm_mm.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_mm.c ============================================================================== --- stable/9/sys/dev/drm2/drm_mm.c Thu Apr 4 05:36:11 2013 (r249080) +++ stable/9/sys/dev/drm2/drm_mm.c Thu Apr 4 05:39:37 2013 (r249081) @@ -561,3 +561,40 @@ void drm_mm_takedown(struct drm_mm * mm) KASSERT(mm->num_unused == 0, ("num_unused != 0")); } + +void drm_mm_debug_table(struct drm_mm *mm, const char *prefix) +{ + struct drm_mm_node *entry; + unsigned long total_used = 0, total_free = 0, total = 0; + unsigned long hole_start, hole_end, hole_size; + + hole_start = drm_mm_hole_node_start(&mm->head_node); + hole_end = drm_mm_hole_node_end(&mm->head_node); + hole_size = hole_end - hole_start; + if (hole_size) + printf("%s 0x%08lx-0x%08lx: %8lu: free\n", + prefix, hole_start, hole_end, + hole_size); + total_free += hole_size; + + drm_mm_for_each_node(entry, mm) { + printf("%s 0x%08lx-0x%08lx: %8lu: used\n", + prefix, entry->start, entry->start + entry->size, + entry->size); + total_used += entry->size; + + if (entry->hole_follows) { + hole_start = drm_mm_hole_node_start(entry); + hole_end = drm_mm_hole_node_end(entry); + hole_size = hole_end - hole_start; + printf("%s 0x%08lx-0x%08lx: %8lu: free\n", + prefix, hole_start, hole_end, + hole_size); + total_free += hole_size; + } + } + total = total_free + total_used; + + printf("%s total: %lu, used %lu free %lu\n", prefix, total, + total_used, total_free); +} Modified: stable/9/sys/dev/drm2/drm_mm.h ============================================================================== --- stable/9/sys/dev/drm2/drm_mm.h Thu Apr 4 05:36:11 2013 (r249080) +++ stable/9/sys/dev/drm2/drm_mm.h Thu Apr 4 05:39:37 2013 (r249081) @@ -182,4 +182,6 @@ void drm_mm_init_scan_with_range(struct int drm_mm_scan_add_block(struct drm_mm_node *node); int drm_mm_scan_remove_block(struct drm_mm_node *node); +void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); + #endif From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 05:47:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4229B7E0; Thu, 4 Apr 2013 05:47:51 +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 32C1976C; Thu, 4 Apr 2013 05:47:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r345lp8L030714; Thu, 4 Apr 2013 05:47:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r345loBc030711; Thu, 4 Apr 2013 05:47:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304040547.r345loBc030711@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 4 Apr 2013 05:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249082 - in stable/9/sys: dev/drm2 modules/drm2/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2013 05:47:51 -0000 Author: kib Date: Thu Apr 4 05:47:50 2013 New Revision: 249082 URL: http://svnweb.freebsd.org/changeset/base/249082 Log: MFC r247834: Import the drm_global references helpers. MFC r247839 (by dumbbell): Destroy sx in drm_global_release(). Added: stable/9/sys/dev/drm2/drm_global.c - copied, changed from r247834, head/sys/dev/drm2/drm_global.c stable/9/sys/dev/drm2/drm_global.h - copied unchanged from r247834, head/sys/dev/drm2/drm_global.h Modified: stable/9/sys/modules/drm2/drm2/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Copied and modified: stable/9/sys/dev/drm2/drm_global.c (from r247834, head/sys/dev/drm2/drm_global.c) ============================================================================== --- head/sys/dev/drm2/drm_global.c Tue Mar 5 09:27:21 2013 (r247834, copy source) +++ stable/9/sys/dev/drm2/drm_global.c Thu Apr 4 05:47:50 2013 (r249082) @@ -63,6 +63,7 @@ void drm_global_release(void) struct drm_global_item *item = &glob[i]; MPASS(item->object == NULL); MPASS(item->refcount == 0); + sx_destroy(&item->mutex); } } Copied: stable/9/sys/dev/drm2/drm_global.h (from r247834, head/sys/dev/drm2/drm_global.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/drm2/drm_global.h Thu Apr 4 05:47:50 2013 (r249082, copy of r247834, head/sys/dev/drm2/drm_global.h) @@ -0,0 +1,56 @@ +/************************************************************************** + * + * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ +/* + * Authors: Thomas Hellstrom + */ +/* $FreeBSD$ */ + +#ifndef _DRM_GLOBAL_H_ +#define _DRM_GLOBAL_H_ +enum drm_global_types { + DRM_GLOBAL_TTM_MEM = 0, + DRM_GLOBAL_TTM_BO, + DRM_GLOBAL_TTM_OBJECT, + DRM_GLOBAL_NUM +}; + +struct drm_global_reference { + enum drm_global_types global_type; + size_t size; + void *object; + int (*init) (struct drm_global_reference *); + void (*release) (struct drm_global_reference *); +}; + +extern void drm_global_init(void); +extern void drm_global_release(void); +extern int drm_global_item_ref(struct drm_global_reference *ref); +extern void drm_global_item_unref(struct drm_global_reference *ref); + +MALLOC_DECLARE(M_DRM_GLOBAL); + +#endif Modified: stable/9/sys/modules/drm2/drm2/Makefile ============================================================================== --- stable/9/sys/modules/drm2/drm2/Makefile Thu Apr 4 05:39:37 2013 (r249081) +++ stable/9/sys/modules/drm2/drm2/Makefile Thu Apr 4 05:47:50 2013 (r249082) @@ -18,6 +18,7 @@ SRCS = \ drm_fops.c \ drm_gem.c \ drm_gem_names.c \ + drm_global.c \ drm_hashtab.c \ drm_ioctl.c \ drm_irq.c \ From owner-svn-src-stable@FreeBSD.ORG Thu Apr 4 17:10:37 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Thu Apr 4 19:31:20 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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@FreeBSD.ORG Thu Apr 4 23:14:15 2013 Return-Path: Delivered-To: svn-src-stable@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@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the 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; From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 05:58:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9B90C3E for ; Fri, 5 Apr 2013 05:58:35 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:32]) by mx1.freebsd.org (Postfix) with ESMTP id BDB2922E for ; Fri, 5 Apr 2013 05:58:35 +0000 (UTC) Received: from omta19.emeryville.ca.mail.comcast.net ([76.96.30.76]) by qmta03.emeryville.ca.mail.comcast.net with comcast id L5yb1l00C1eYJf8A35yb10; Fri, 05 Apr 2013 05:58:35 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta19.emeryville.ca.mail.comcast.net with comcast id L5ya1l0031t3BNj015yaJL; Fri, 05 Apr 2013 05:58:34 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 298B073A1C; Thu, 4 Apr 2013 22:58:34 -0700 (PDT) Date: Thu, 4 Apr 2013 22:58:34 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r248352 - in stable/9: etc share/mk Message-ID: <20130405055834.GA97433@icarus.home.lan> References: <201303152132.r2FLWfwx076672@svn.freebsd.org> <201303200918.08803.jhb@freebsd.org> <20130402175903.GA85393@lor.one-eyed-alien.net> <201304021550.43701.jhb@freebsd.org> <20130402213534.GA86221@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130402213534.GA86221@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1365141515; bh=AL11v+gbgrPsGKyi3+FKRi1dFBm762FM6DSGLen99V8=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=DkxP+iwx/9fTlebCEIhXshg5aWudng0HZhRzx5muXfJhNVqo/BU53+KjE82/R5fi2 bakultbYEMprp4xN+KwN0OWAUzcTZVtLUCdm4JkCZFHBemePcJaED0pA1CW51oZ2tt q8ycb3/N9pteSsSJxErDLcOehhd5Qu5meOsl1bx//i92JR8d4jSCaElzOlWaTPaCh7 g8VPzfdkIRBjIsNru6ZJNBJ4evwHEBg0XUJcKHZ4KA/3VMI961rHM1bA0Cxv9oZGLb /wqsJ14KJULTkljkkn6mBtuNxgZrbjnBxbOKQnwH4PhwB41i3KX/JrTfT6gzreYWb0 SwRQnKcA2AfIw== Cc: src-committers@freebsd.org, John Baldwin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 05:58:35 -0000 On Tue, Apr 02, 2013 at 04:35:34PM -0500, Brooks Davis wrote: > On Tue, Apr 02, 2013 at 03:50:43PM -0400, John Baldwin wrote: > > On Tuesday, April 02, 2013 1:59:03 pm Brooks Davis wrote: > > > On Wed, Mar 20, 2013 at 09:18:08AM -0400, John Baldwin wrote: > > > > On Tuesday, March 19, 2013 4:06:31 pm Brooks Davis wrote: > > > > > On Tue, Mar 19, 2013 at 09:49:47PM +0400, Dmitry Morozovsky wrote: > > > > > > On Tue, 19 Mar 2013, Brooks Davis wrote: > > > > > > > > > > > > > > > Replace all known uses of ln in the build process with appropriate > > > > > > > > > install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK > > > > > > > > > variables. > > > > > > > > > > > > > > > > It seems this merge breaks ``make distribution'' and hence mergemaster if your > > > > > > > > base system is not updated yet (for example, while updating jail): > > > > > > > > > > > > > > Sorry for the delay in responding. I missed this yesterday. > > > > > > > > > > > > > > It works for me on a older 9.0-STABLE system where the base install > > > > > > > doesn't support -l. Did you build world or run "make toolchain" in that > > > > > > > source tree to build the bootstrap copy of install? > > > > > > > > > > > > Yes, this is after full ``make buildworld buildkernel'' process. > > > > > > > > > > I've found the problem thanks to misc/177055. It is that mergemaster > > > > > (and etcupdate) set MAKEOBJDIRPREFIX to something in their > > > > > temporary directory and thus deprive themselves of bootstrap tools. > > > > > Unfortunately, I don't see a trivial fix so I've backed this out for > > > > > now and will work on this in HEAD. > > > > > > > > Hummmm. In the case of etcupdate you can use 'etcupdate -B'. That is actually safe > > > > to do in the common case where you've just updated /usr/src and built the corresponding > > > > world in /usr/obj. It should possibly even by the default for etcupdate if a DESTDIR > > > > is not specified. > > > > > > Finally getting back to this... > > > > > > etcupdate -B would correct the immediate problem for etcupdate. I do > > > think that making it the default if the tree exists makes sense. It > > > won't be more broken than a cross installworld is. > > > > Hmmm, checking for the obj tree is a bit hackish. I'd rather it were more > > deterministic. I think I'd like to make it just default to -B and require > > a new -b flag to build a new tree, but perhaps have it check for a tree > > and error out if it doesn't exist and you don't give it -b? > > Just switching the default seems fine in practice. I guess it would > probably be useful to keep an option to enable the old behavior. > > > > I did a quick test when I first found this issue and it would be easy to > > > reuse the existing MAKEOBJDIRPREFIX in mergemaster as well. > > > > > > I think we'll want to update UPDATING to recommend that the > > > mergemaster -p stage (and the equivalent for etcupdate) be run using the > > > version in the source tree, not the installed one. I do wonder if it > > > would make sense for them to attempt to find and invoke that version so > > > simplify bootstrapping. > > > > Currently etcupdate doesn't implement something like -p. I need to add that as > > I would prefer to use its conflict resolution for adding users. (That would > > also let it serve as a full replacement for mergemaster for those who prefer it.) > > OK, I'll look at switching the default behavior in mergemaster and > adding an option to revert to the old behavior. > > I'll also change UPDATING to suggest using the mergemaster.sh from the > source tree for mergemaster -p. Please be sure to update the relevant comments in src/Makefile too (see roughly lines 59 onward). -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 08:22:30 2013 Return-Path: Delivered-To: svn-src-stable@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 138B6FAE; Fri, 5 Apr 2013 08:22:30 +0000 (UTC) (envelope-from mav@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 012F6826; Fri, 5 Apr 2013 08:22:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r358MTaX001864; Fri, 5 Apr 2013 08:22:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r358MBon001743; Fri, 5 Apr 2013 08:22:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304050822.r358MBon001743@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249132 - in stable/9/sys: arm/arm arm/xscale/pxa cam cam/ata cam/scsi cddl/dev/cyclic cddl/dev/fbt dev/aac dev/acpi_support dev/acpica dev/acpica/Osd dev/ahci dev/amr dev/ath dev/ciss ... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 08:22:30 -0000 Author: mav Date: Fri Apr 5 08:22:11 2013 New Revision: 249132 URL: http://svnweb.freebsd.org/changeset/base/249132 Log: MFC r227293 (by ed): Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. This means that their use is restricted to a single C file. Modified: stable/9/sys/arm/arm/vm_machdep.c stable/9/sys/arm/xscale/pxa/pxa_smi.c stable/9/sys/arm/xscale/pxa/pxa_space.c stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_pmp.c stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_queue.c stable/9/sys/cam/cam_sim.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_ch.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_low.c stable/9/sys/cam/scsi/scsi_sa.c stable/9/sys/cam/scsi/scsi_targ_bh.c stable/9/sys/cddl/dev/cyclic/cyclic.c stable/9/sys/cddl/dev/fbt/fbt.c stable/9/sys/dev/aac/aac.c stable/9/sys/dev/aac/aac_cam.c stable/9/sys/dev/acpi_support/acpi_wmi.c stable/9/sys/dev/acpica/Osd/OsdInterrupt.c stable/9/sys/dev/acpica/Osd/OsdMemory.c stable/9/sys/dev/acpica/Osd/OsdSchedule.c stable/9/sys/dev/acpica/Osd/OsdSynch.c stable/9/sys/dev/acpica/acpi.c stable/9/sys/dev/acpica/acpi_cmbat.c stable/9/sys/dev/acpica/acpi_pci_link.c stable/9/sys/dev/acpica/acpi_perf.c stable/9/sys/dev/acpica/acpi_powerres.c stable/9/sys/dev/acpica/acpi_video.c stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/amr/amr.c stable/9/sys/dev/amr/amr_cam.c stable/9/sys/dev/ath/ah_osdep.c stable/9/sys/dev/ath/if_ath.c stable/9/sys/dev/ciss/ciss.c stable/9/sys/dev/firewire/fwmem.c stable/9/sys/dev/firewire/if_fwe.c stable/9/sys/dev/firewire/if_fwip.c stable/9/sys/dev/firewire/sbp.c stable/9/sys/dev/firewire/sbp_targ.c stable/9/sys/dev/iicbus/ad7417.c stable/9/sys/dev/iicbus/max6690.c stable/9/sys/dev/iir/iir.c stable/9/sys/dev/ipmi/ipmi.c stable/9/sys/dev/iscsi/initiator/isc_subr.c stable/9/sys/dev/iscsi/initiator/iscsi.c stable/9/sys/dev/malo/if_malo.c stable/9/sys/dev/mvs/mvs.c stable/9/sys/dev/mwl/if_mwl.c stable/9/sys/dev/nmdm/nmdm.c stable/9/sys/dev/puc/puc.c stable/9/sys/dev/quicc/quicc_core.c stable/9/sys/dev/scc/scc_core.c stable/9/sys/dev/siis/siis.c stable/9/sys/dev/sound/pci/envy24.c stable/9/sys/dev/sound/pci/envy24ht.c stable/9/sys/dev/sound/pci/spicds.c stable/9/sys/dev/sound/pcm/ac97.c stable/9/sys/dev/sound/pcm/feeder.c stable/9/sys/dev/sound/pcm/mixer.c stable/9/sys/dev/tdfx/tdfx_pci.c stable/9/sys/dev/twa/tw_osl_freebsd.c stable/9/sys/dev/twe/twe_freebsd.c stable/9/sys/dev/uart/uart_core.c stable/9/sys/dev/xen/balloon/balloon.c stable/9/sys/dev/xen/blkback/blkback.c stable/9/sys/dev/xen/blkfront/blkfront.c stable/9/sys/fs/ntfs/ntfs_subr.c stable/9/sys/fs/smbfs/smbfs_node.c stable/9/sys/fs/udf/udf_vnops.c stable/9/sys/geom/uzip/g_uzip.c stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c stable/9/sys/ia64/ia64/mca.c stable/9/sys/ia64/ia64/sapic.c stable/9/sys/ia64/ia64/sscdisk.c stable/9/sys/ia64/ia64/unwind.c stable/9/sys/kern/kern_dtrace.c stable/9/sys/kern/kern_fail.c stable/9/sys/kern/kern_jail.c stable/9/sys/kern/kern_lockf.c stable/9/sys/kern/kern_rctl.c stable/9/sys/kern/kern_timeout.c stable/9/sys/kern/subr_pcpu.c stable/9/sys/kern/subr_witness.c stable/9/sys/libkern/iconv.c stable/9/sys/net/if.c stable/9/sys/net/if_arcsubr.c stable/9/sys/net/if_atmsubr.c stable/9/sys/net/if_ethersubr.c stable/9/sys/net/if_fwsubr.c stable/9/sys/net/if_iso88025subr.c stable/9/sys/net/if_spppsubr.c stable/9/sys/net/vnet.c stable/9/sys/net80211/ieee80211_acl.c stable/9/sys/net80211/ieee80211_dfs.c stable/9/sys/net80211/ieee80211_freebsd.c stable/9/sys/net80211/ieee80211_power.c stable/9/sys/netgraph/atm/ngatmbase.c stable/9/sys/netgraph/atm/uni/ng_uni.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c stable/9/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c stable/9/sys/netgraph/ng_async.c stable/9/sys/netgraph/ng_base.c stable/9/sys/netgraph/ng_bpf.c stable/9/sys/netgraph/ng_bridge.c stable/9/sys/netgraph/ng_deflate.c stable/9/sys/netgraph/ng_gif_demux.c stable/9/sys/netgraph/ng_hub.c stable/9/sys/netgraph/ng_iface.c stable/9/sys/netgraph/ng_ksocket.c stable/9/sys/netgraph/ng_l2tp.c stable/9/sys/netgraph/ng_mppc.c stable/9/sys/netgraph/ng_parse.c stable/9/sys/netgraph/ng_ppp.c stable/9/sys/netgraph/ng_pppoe.c stable/9/sys/netgraph/ng_pred1.c stable/9/sys/netgraph/ng_sample.c stable/9/sys/netgraph/ng_socket.c stable/9/sys/netgraph/ng_sppp.c stable/9/sys/netgraph/ng_tag.c stable/9/sys/netinet/igmp.c stable/9/sys/netinet/libalias/alias_sctp.c stable/9/sys/netinet6/mld6.c stable/9/sys/netinet6/send.c stable/9/sys/netipx/spx_reass.c stable/9/sys/netsmb/smb_conn.c stable/9/sys/netsmb/smb_rq.c stable/9/sys/netsmb/smb_subr.c stable/9/sys/nfs/nfs_lock.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c stable/9/sys/ofed/include/linux/linux_idr.c stable/9/sys/ofed/include/linux/linux_radix.c stable/9/sys/powerpc/ofw/ofw_real.c stable/9/sys/powerpc/ofw/rtas.c stable/9/sys/powerpc/powermac/dbdma.c stable/9/sys/powerpc/powermac/fcu.c stable/9/sys/powerpc/powermac/powermac_thermal.c stable/9/sys/powerpc/powermac/smusat.c stable/9/sys/powerpc/powerpc/intr_machdep.c stable/9/sys/security/mac_bsdextended/mac_bsdextended.c stable/9/sys/security/mac_lomac/mac_lomac.c stable/9/sys/security/mac_portacl/mac_portacl.c stable/9/sys/sparc64/sparc64/iommu.c stable/9/sys/x86/acpica/acpi_apm.c stable/9/sys/x86/acpica/madt.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/9/sys/arm/arm/vm_machdep.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/arm/arm/vm_machdep.c Fri Apr 5 08:22:11 2013 (r249132) @@ -526,7 +526,7 @@ extern uma_zone_t l2zone; struct mtx smallalloc_mtx; -MALLOC_DEFINE(M_VMSMALLALLOC, "vm_small_alloc", "VM Small alloc data"); +static MALLOC_DEFINE(M_VMSMALLALLOC, "vm_small_alloc", "VM Small alloc data"); vm_offset_t alloc_firstaddr; Modified: stable/9/sys/arm/xscale/pxa/pxa_smi.c ============================================================================== --- stable/9/sys/arm/xscale/pxa/pxa_smi.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/arm/xscale/pxa/pxa_smi.c Fri Apr 5 08:22:11 2013 (r249132) @@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PXASMI, "PXA SMI", "Data for static memory interface devices."); +static MALLOC_DEFINE(M_PXASMI, "PXA SMI", + "Data for static memory interface devices."); struct pxa_smi_softc { struct resource *ps_res[1]; Modified: stable/9/sys/arm/xscale/pxa/pxa_space.c ============================================================================== --- stable/9/sys/arm/xscale/pxa/pxa_space.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/arm/xscale/pxa/pxa_space.c Fri Apr 5 08:22:11 2013 (r249132) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PXATAG, "PXA bus_space tags", "Bus_space tags for PXA"); +static MALLOC_DEFINE(M_PXATAG, "PXA bus_space tags", "Bus_space tags for PXA"); /* Prototypes for all the bus_space structure functions */ bs_protos(generic); Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/ata/ata_da.c Fri Apr 5 08:22:11 2013 (r249132) @@ -518,7 +518,7 @@ static struct periph_driver adadriver = PERIPHDRIVER_DECLARE(ada, adadriver); -MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); +static MALLOC_DEFINE(M_ATADA, "ata_da", "ata_da buffers"); static int adaopen(struct disk *dp) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/ata/ata_pmp.c Fri Apr 5 08:22:11 2013 (r249132) @@ -155,7 +155,7 @@ static struct periph_driver pmpdriver = PERIPHDRIVER_DECLARE(pmp, pmpdriver); -MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); +static MALLOC_DEFINE(M_ATPMP, "ata_pmp", "ata_pmp buffers"); static void pmpinit(void) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/cam_periph.c Fri Apr 5 08:22:11 2013 (r249132) @@ -91,7 +91,7 @@ static int nperiph_drivers; static int initialized = 0; struct periph_driver **periph_drivers; -MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers"); +static MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers"); static int periph_selto_delay = 1000; TUNABLE_INT("kern.cam.periph_selto_delay", &periph_selto_delay); Modified: stable/9/sys/cam/cam_queue.c ============================================================================== --- stable/9/sys/cam/cam_queue.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/cam_queue.c Fri Apr 5 08:22:11 2013 (r249132) @@ -40,9 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_CAMQ, "CAM queue", "CAM queue buffers"); -MALLOC_DEFINE(M_CAMDEVQ, "CAM dev queue", "CAM dev queue buffers"); -MALLOC_DEFINE(M_CAMCCBQ, "CAM ccb queue", "CAM ccb queue buffers"); +static MALLOC_DEFINE(M_CAMQ, "CAM queue", "CAM queue buffers"); +static MALLOC_DEFINE(M_CAMDEVQ, "CAM dev queue", "CAM dev queue buffers"); +static MALLOC_DEFINE(M_CAMCCBQ, "CAM ccb queue", "CAM ccb queue buffers"); static __inline int queue_cmp(cam_pinfo **queue_array, int i, int j); Modified: stable/9/sys/cam/cam_sim.c ============================================================================== --- stable/9/sys/cam/cam_sim.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/cam_sim.c Fri Apr 5 08:22:11 2013 (r249132) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #define CAM_PATH_ANY (u_int32_t)-1 -MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers"); +static MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers"); struct cam_devq * cam_simq_alloc(u_int32_t max_sim_transactions) Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 08:22:11 2013 (r249132) @@ -335,7 +335,7 @@ static struct mtx changerq_mtx; static STAILQ_HEAD(changerlist, cdchanger) changerq; static int num_changers; -MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); +static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); static void cdinit(void) Modified: stable/9/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_ch.c Fri Apr 5 08:22:11 2013 (r249132) @@ -218,7 +218,7 @@ static struct cdevsw ch_cdevsw = { .d_name = "ch", }; -MALLOC_DEFINE(M_SCSICH, "scsi_ch", "scsi_ch buffers"); +static MALLOC_DEFINE(M_SCSICH, "scsi_ch", "scsi_ch buffers"); static void chinit(void) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 08:22:11 2013 (r249132) @@ -928,7 +928,7 @@ static struct periph_driver dadriver = PERIPHDRIVER_DECLARE(da, dadriver); -MALLOC_DEFINE(M_SCSIDA, "scsi_da", "scsi_da buffers"); +static MALLOC_DEFINE(M_SCSIDA, "scsi_da", "scsi_da buffers"); static int daopen(struct disk *dp) Modified: stable/9/sys/cam/scsi/scsi_low.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_low.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_low.c Fri Apr 5 08:22:11 2013 (r249132) @@ -145,7 +145,7 @@ __FBSDID("$FreeBSD$"); #define SCSI_LOW_DISK_LFLAGS 0x0000ffff #define SCSI_LOW_DISK_TFLAGS 0xffff0000 -MALLOC_DEFINE(M_SCSILOW, "SCSI low", "SCSI low buffers"); +static MALLOC_DEFINE(M_SCSILOW, "SCSI low", "SCSI low buffers"); /************************************************************** * Declarations Modified: stable/9/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_sa.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_sa.c Fri Apr 5 08:22:11 2013 (r249132) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); * Driver states */ -MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers"); +static MALLOC_DEFINE(M_SCSISA, "SCSI sa", "SCSI sequential access buffers"); typedef enum { SA_STATE_NORMAL, SA_STATE_ABNORMAL Modified: stable/9/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_targ_bh.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cam/scsi/scsi_targ_bh.c Fri Apr 5 08:22:11 2013 (r249132) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_SCSIBH, "SCSI bh", "SCSI blackhole buffers"); +static MALLOC_DEFINE(M_SCSIBH, "SCSI bh", "SCSI blackhole buffers"); typedef enum { TARGBH_STATE_NORMAL, Modified: stable/9/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- stable/9/sys/cddl/dev/cyclic/cyclic.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cddl/dev/cyclic/cyclic.c Fri Apr 5 08:22:11 2013 (r249132) @@ -339,7 +339,7 @@ static kmem_cache_t *cyclic_id_cache; static cyc_id_t *cyclic_id_head; static cyc_backend_t cyclic_backend; -MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); +static MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); static __inline hrtime_t cyc_gethrtime(void) Modified: stable/9/sys/cddl/dev/fbt/fbt.c ============================================================================== --- stable/9/sys/cddl/dev/fbt/fbt.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/cddl/dev/fbt/fbt.c Fri Apr 5 08:22:11 2013 (r249132) @@ -61,7 +61,7 @@ #include #include -MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); +static MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); #define FBT_PUSHL_EBP 0x55 #define FBT_MOVL_ESP_EBP0_V0 0x8b Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/aac/aac.c Fri Apr 5 08:22:11 2013 (r249132) @@ -219,7 +219,7 @@ static struct cdevsw aac_cdevsw = { .d_name = "aac", }; -MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); +static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); Modified: stable/9/sys/dev/aac/aac_cam.c ============================================================================== --- stable/9/sys/dev/aac/aac_cam.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/aac/aac_cam.c Fri Apr 5 08:22:11 2013 (r249132) @@ -104,7 +104,7 @@ static driver_t aac_pass_driver = { DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, 0, 0); MODULE_DEPEND(aacp, cam, 1, 1, 1); -MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); +static MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); static void aac_cam_rescan(struct aac_softc *sc, uint32_t channel, uint32_t target_id) Modified: stable/9/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_wmi.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpi_support/acpi_wmi.c Fri Apr 5 08:22:11 2013 (r249132) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_wmi_if.h" -MALLOC_DEFINE(M_ACPIWMI, "acpiwmi", "ACPI-WMI mapping"); +static MALLOC_DEFINE(M_ACPIWMI, "acpiwmi", "ACPI-WMI mapping"); #define _COMPONENT ACPI_OEM ACPI_MODULE_NAME("ACPI_WMI"); Modified: stable/9/sys/dev/acpica/Osd/OsdInterrupt.c ============================================================================== --- stable/9/sys/dev/acpica/Osd/OsdInterrupt.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/Osd/OsdInterrupt.c Fri Apr 5 08:22:11 2013 (r249132) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("INTERRUPT") -MALLOC_DEFINE(M_ACPIINTR, "acpiintr", "ACPI interrupt"); +static MALLOC_DEFINE(M_ACPIINTR, "acpiintr", "ACPI interrupt"); struct acpi_intr { SLIST_ENTRY(acpi_intr) ai_link; Modified: stable/9/sys/dev/acpica/Osd/OsdMemory.c ============================================================================== --- stable/9/sys/dev/acpica/Osd/OsdMemory.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/Osd/OsdMemory.c Fri Apr 5 08:22:11 2013 (r249132) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool"); +static MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool"); void * AcpiOsAllocate(ACPI_SIZE Size) Modified: stable/9/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- stable/9/sys/dev/acpica/Osd/OsdSchedule.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/Osd/OsdSchedule.c Fri Apr 5 08:22:11 2013 (r249132) @@ -65,7 +65,7 @@ TUNABLE_INT("debug.acpi.max_tasks", &acp static int acpi_max_threads = ACPI_MAX_THREADS; TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads); -MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); +static MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); struct acpi_task_ctx { struct task at_task; Modified: stable/9/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- stable/9/sys/dev/acpica/Osd/OsdSynch.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/Osd/OsdSynch.c Fri Apr 5 08:22:11 2013 (r249132) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("SYNCH") -MALLOC_DEFINE(M_ACPISEM, "acpisem", "ACPI semaphore"); +static MALLOC_DEFINE(M_ACPISEM, "acpisem", "ACPI semaphore"); /* * Convert milliseconds to ticks. Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi.c Fri Apr 5 08:22:11 2013 (r249132) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); +static MALLOC_DEFINE(M_ACPIDEV, "acpidev", "ACPI devices"); /* Hooks for the ACPI CA debugging infrastructure */ #define _COMPONENT ACPI_BUS Modified: stable/9/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_cmbat.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi_cmbat.c Fri Apr 5 08:22:11 2013 (r249132) @@ -46,7 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ACPICMBAT, "acpicmbat", "ACPI control method battery data"); +static MALLOC_DEFINE(M_ACPICMBAT, "acpicmbat", + "ACPI control method battery data"); /* Number of times to retry initialization before giving up. */ #define ACPI_CMBAT_RETRY_MAX 6 Modified: stable/9/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_pci_link.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi_pci_link.c Fri Apr 5 08:22:11 2013 (r249132) @@ -120,7 +120,7 @@ struct link_res_request { int link_index; }; -MALLOC_DEFINE(M_PCI_LINK, "pci_link", "ACPI PCI Link structures"); +static MALLOC_DEFINE(M_PCI_LINK, "pci_link", "ACPI PCI Link structures"); static int pci_link_interrupt_weights[NUM_ACPI_INTERRUPTS]; static int pci_link_bios_isa_irqs; Modified: stable/9/sys/dev/acpica/acpi_perf.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_perf.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi_perf.c Fri Apr 5 08:22:11 2013 (r249132) @@ -135,7 +135,7 @@ static devclass_t acpi_perf_devclass; DRIVER_MODULE(acpi_perf, cpu, acpi_perf_driver, acpi_perf_devclass, 0, 0); MODULE_DEPEND(acpi_perf, acpi, 1, 1, 1); -MALLOC_DEFINE(M_ACPIPERF, "acpi_perf", "ACPI Performance states"); +static MALLOC_DEFINE(M_ACPIPERF, "acpi_perf", "ACPI Performance states"); static void acpi_perf_identify(driver_t *driver, device_t parent) Modified: stable/9/sys/dev/acpica/acpi_powerres.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_powerres.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi_powerres.c Fri Apr 5 08:22:11 2013 (r249132) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * on, turned off, etc. */ -MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources"); +static MALLOC_DEFINE(M_ACPIPWR, "acpipwr", "ACPI power resources"); /* Hooks for the ACPI CA debugging infrastructure */ #define _COMPONENT ACPI_POWERRES Modified: stable/9/sys/dev/acpica/acpi_video.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_video.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/acpica/acpi_video.c Fri Apr 5 08:22:11 2013 (r249132) @@ -185,7 +185,7 @@ static struct acpi_video_output_queue cr */ ACPI_SERIAL_DECL(video, "ACPI video"); ACPI_SERIAL_DECL(video_output, "ACPI video output"); -MALLOC_DEFINE(M_ACPIVIDEO, "acpivideo", "ACPI video extension"); +static MALLOC_DEFINE(M_ACPIVIDEO, "acpivideo", "ACPI video extension"); static int acpi_video_modevent(struct module *mod __unused, int evt, void *cookie __unused) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/ahci/ahci.c Fri Apr 5 08:22:11 2013 (r249132) @@ -101,7 +101,7 @@ static void ahci_process_request_sense(d static void ahciaction(struct cam_sim *sim, union ccb *ccb); static void ahcipoll(struct cam_sim *sim); -MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); +static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driver data buffers"); static struct { uint32_t id; Modified: stable/9/sys/dev/amr/amr.c ============================================================================== --- stable/9/sys/dev/amr/amr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/amr/amr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -175,7 +175,7 @@ static void amr_init_sysctl(struct amr_s static int amr_linux_ioctl_int(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td); -MALLOC_DEFINE(M_AMR, "amr", "AMR memory"); +static MALLOC_DEFINE(M_AMR, "amr", "AMR memory"); /******************************************************************************** ******************************************************************************** Modified: stable/9/sys/dev/amr/amr_cam.c ============================================================================== --- stable/9/sys/dev/amr/amr_cam.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/amr/amr_cam.c Fri Apr 5 08:22:11 2013 (r249132) @@ -109,7 +109,7 @@ static driver_t amr_pass_driver = { DRIVER_MODULE(amrp, amr, amr_pass_driver, amr_pass_devclass, 0, 0); MODULE_DEPEND(amrp, cam, 1, 1, 1); -MALLOC_DEFINE(M_AMRCAM, "amrcam", "AMR CAM memory"); +static MALLOC_DEFINE(M_AMRCAM, "amrcam", "AMR CAM memory"); /*********************************************************************** * Enqueue/dequeue functions Modified: stable/9/sys/dev/ath/ah_osdep.c ============================================================================== --- stable/9/sys/dev/ath/ah_osdep.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/ath/ah_osdep.c Fri Apr 5 08:22:11 2013 (r249132) @@ -86,7 +86,7 @@ SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); #endif /* AH_DEBUG */ -MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); +static MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); void* ath_hal_malloc(size_t size) Modified: stable/9/sys/dev/ath/if_ath.c ============================================================================== --- stable/9/sys/dev/ath/if_ath.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/ath/if_ath.c Fri Apr 5 08:22:11 2013 (r249132) @@ -258,7 +258,7 @@ static int ath_bstuck_threshold = 4; /* SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); -MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); +static MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/ciss/ciss.c Fri Apr 5 08:22:11 2013 (r249132) @@ -105,7 +105,8 @@ #include #include -MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", "ciss internal data buffers"); +static MALLOC_DEFINE(CISS_MALLOC_CLASS, "ciss_data", + "ciss internal data buffers"); /* pci interface */ static int ciss_lookup(device_t dev); Modified: stable/9/sys/dev/firewire/fwmem.c ============================================================================== --- stable/9/sys/dev/firewire/fwmem.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/firewire/fwmem.c Fri Apr 5 08:22:11 2013 (r249132) @@ -84,7 +84,7 @@ SYSCTL_INT(_hw_firewire_fwmem, OID_AUTO, SYSCTL_INT(_debug, OID_AUTO, fwmem_debug, CTLFLAG_RW, &fwmem_debug, 0, "Fwmem driver debug flag"); -MALLOC_DEFINE(M_FWMEM, "fwmem", "fwmem/FireWire"); +static MALLOC_DEFINE(M_FWMEM, "fwmem", "fwmem/FireWire"); #define MAXLEN (512 << fwmem_speed) Modified: stable/9/sys/dev/firewire/if_fwe.c ============================================================================== --- stable/9/sys/dev/firewire/if_fwe.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/firewire/if_fwe.c Fri Apr 5 08:22:11 2013 (r249132) @@ -86,7 +86,7 @@ static int stream_ch = 1; static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; -MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); +static MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, Modified: stable/9/sys/dev/firewire/if_fwip.c ============================================================================== --- stable/9/sys/dev/firewire/if_fwip.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/firewire/if_fwip.c Fri Apr 5 08:22:11 2013 (r249132) @@ -99,7 +99,7 @@ static int broadcast_channel = 0xc0 | 0x static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; -MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); +static MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, Modified: stable/9/sys/dev/firewire/sbp.c ============================================================================== --- stable/9/sys/dev/firewire/sbp.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/firewire/sbp.c Fri Apr 5 08:22:11 2013 (r249132) @@ -277,7 +277,7 @@ static void sbp_mgm_timeout (void *arg); static void sbp_timeout (void *arg); static void sbp_mgm_orb (struct sbp_dev *, int, struct sbp_ocb *); -MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire"); +static MALLOC_DEFINE(M_SBP, "sbp", "SBP-II/FireWire"); /* cam related functions */ static void sbp_action(struct cam_sim *sim, union ccb *ccb); Modified: stable/9/sys/dev/firewire/sbp_targ.c ============================================================================== --- stable/9/sys/dev/firewire/sbp_targ.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/firewire/sbp_targ.c Fri Apr 5 08:22:11 2013 (r249132) @@ -95,7 +95,7 @@ #define F_HOLD (1 << 3) #define F_FREEZED (1 << 4) -MALLOC_DEFINE(M_SBP_TARG, "sbp_targ", "SBP-II/FireWire target mode"); +static MALLOC_DEFINE(M_SBP_TARG, "sbp_targ", "SBP-II/FireWire target mode"); static int debug = 0; Modified: stable/9/sys/dev/iicbus/ad7417.c ============================================================================== --- stable/9/sys/dev/iicbus/ad7417.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/iicbus/ad7417.c Fri Apr 5 08:22:11 2013 (r249132) @@ -121,7 +121,7 @@ static driver_t ad7417_driver = { static devclass_t ad7417_devclass; DRIVER_MODULE(ad7417, iicbus, ad7417_driver, ad7417_devclass, 0, 0); -MALLOC_DEFINE(M_AD7417, "ad7417", "Supply-Monitor AD7417"); +static MALLOC_DEFINE(M_AD7417, "ad7417", "Supply-Monitor AD7417"); static int Modified: stable/9/sys/dev/iicbus/max6690.c ============================================================================== --- stable/9/sys/dev/iicbus/max6690.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/iicbus/max6690.c Fri Apr 5 08:22:11 2013 (r249132) @@ -101,7 +101,7 @@ static driver_t max6690_driver = { static devclass_t max6690_devclass; DRIVER_MODULE(max6690, iicbus, max6690_driver, max6690_devclass, 0, 0); -MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); +static MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); static int max6690_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) Modified: stable/9/sys/dev/iir/iir.c ============================================================================== --- stable/9/sys/dev/iir/iir.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/iir/iir.c Fri Apr 5 08:22:11 2013 (r249132) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); +static MALLOC_DEFINE(M_GDTBUF, "iirbuf", "iir driver buffer"); struct gdt_softc *gdt_wait_gdt; int gdt_wait_index; Modified: stable/9/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/9/sys/dev/ipmi/ipmi.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/ipmi/ipmi.c Fri Apr 5 08:22:11 2013 (r249132) @@ -76,7 +76,7 @@ static struct cdevsw ipmi_cdevsw = { .d_name = "ipmi", }; -MALLOC_DEFINE(M_IPMI, "ipmi", "ipmi"); +static MALLOC_DEFINE(M_IPMI, "ipmi", "ipmi"); static int ipmi_open(struct cdev *cdev, int flags, int fmt, struct thread *td) Modified: stable/9/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/isc_subr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/iscsi/initiator/isc_subr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_ISC, "iSC", "iSCSI driver options"); +static MALLOC_DEFINE(M_ISC, "iSC", "iSCSI driver options"); static char * i_strdupin(char *s, size_t maxlen) Modified: stable/9/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/iscsi/initiator/iscsi.c Fri Apr 5 08:22:11 2013 (r249132) @@ -66,7 +66,7 @@ static struct isc_softc *isc; MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI driver"); MALLOC_DEFINE(M_ISCSIBUF, "iSCbuf", "iSCSI buffers"); -MALLOC_DEFINE(M_TMP, "iSCtmp", "iSCSI tmp"); +static MALLOC_DEFINE(M_TMP, "iSCtmp", "iSCSI tmp"); #ifdef ISCSI_INITIATOR_DEBUG int iscsi_debug = ISCSI_INITIATOR_DEBUG; Modified: stable/9/sys/dev/malo/if_malo.c ============================================================================== --- stable/9/sys/dev/malo/if_malo.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/malo/if_malo.c Fri Apr 5 08:22:11 2013 (r249132) @@ -123,7 +123,7 @@ enum { } while (0) #endif -MALLOC_DEFINE(M_MALODEV, "malodev", "malo driver dma buffers"); +static MALLOC_DEFINE(M_MALODEV, "malodev", "malo driver dma buffers"); static struct ieee80211vap *malo_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, Modified: stable/9/sys/dev/mvs/mvs.c ============================================================================== --- stable/9/sys/dev/mvs/mvs.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/mvs/mvs.c Fri Apr 5 08:22:11 2013 (r249132) @@ -94,7 +94,7 @@ static void mvs_process_request_sense(de static void mvsaction(struct cam_sim *sim, union ccb *ccb); static void mvspoll(struct cam_sim *sim); -MALLOC_DEFINE(M_MVS, "MVS driver", "MVS driver data buffers"); +static MALLOC_DEFINE(M_MVS, "MVS driver", "MVS driver data buffers"); #define recovery_type spriv_field0 #define RECOVERY_NONE 0 Modified: stable/9/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/9/sys/dev/mwl/if_mwl.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/mwl/if_mwl.c Fri Apr 5 08:22:11 2013 (r249132) @@ -262,7 +262,7 @@ static void mwl_printtxbuf(const struct } while (0) #endif -MALLOC_DEFINE(M_MWLDEV, "mwldev", "mwl driver dma buffers"); +static MALLOC_DEFINE(M_MWLDEV, "mwldev", "mwl driver dma buffers"); /* * Each packet has fixed front matter: a 2-byte length Modified: stable/9/sys/dev/nmdm/nmdm.c ============================================================================== --- stable/9/sys/dev/nmdm/nmdm.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/nmdm/nmdm.c Fri Apr 5 08:22:11 2013 (r249132) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures"); +static MALLOC_DEFINE(M_NMDM, "nullmodem", "nullmodem data structures"); static tsw_inwakeup_t nmdm_outwakeup; static tsw_outwakeup_t nmdm_inwakeup; Modified: stable/9/sys/dev/puc/puc.c ============================================================================== --- stable/9/sys/dev/puc/puc.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/puc/puc.c Fri Apr 5 08:22:11 2013 (r249132) @@ -68,7 +68,7 @@ struct puc_port { devclass_t puc_devclass; const char puc_driver_name[] = "puc"; -MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); +static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); struct puc_bar * puc_get_bar(struct puc_softc *sc, int rid) Modified: stable/9/sys/dev/quicc/quicc_core.c ============================================================================== --- stable/9/sys/dev/quicc/quicc_core.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/quicc/quicc_core.c Fri Apr 5 08:22:11 2013 (r249132) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); devclass_t quicc_devclass; char quicc_driver_name[] = "quicc"; -MALLOC_DEFINE(M_QUICC, "QUICC", "QUICC driver"); +static MALLOC_DEFINE(M_QUICC, "QUICC", "QUICC driver"); struct quicc_device { struct rman *qd_rman; Modified: stable/9/sys/dev/scc/scc_core.c ============================================================================== --- stable/9/sys/dev/scc/scc_core.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/scc/scc_core.c Fri Apr 5 08:22:11 2013 (r249132) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); devclass_t scc_devclass; char scc_driver_name[] = "scc"; -MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); +static MALLOC_DEFINE(M_SCC, "SCC", "SCC driver"); static int scc_bfe_intr(void *arg) Modified: stable/9/sys/dev/siis/siis.c ============================================================================== --- stable/9/sys/dev/siis/siis.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/siis/siis.c Fri Apr 5 08:22:11 2013 (r249132) @@ -91,7 +91,7 @@ static void siis_process_request_sense(d static void siisaction(struct cam_sim *sim, union ccb *ccb); static void siispoll(struct cam_sim *sim); -MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers"); +static MALLOC_DEFINE(M_SIIS, "SIIS driver", "SIIS driver data buffers"); static struct { uint32_t id; Modified: stable/9/sys/dev/sound/pci/envy24.c ============================================================================== --- stable/9/sys/dev/sound/pci/envy24.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pci/envy24.c Fri Apr 5 08:22:11 2013 (r249132) @@ -41,7 +41,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio"); +static MALLOC_DEFINE(M_ENVY24, "envy24", "envy24 audio"); /* -------------------------------------------------------------------- */ Modified: stable/9/sys/dev/sound/pci/envy24ht.c ============================================================================== --- stable/9/sys/dev/sound/pci/envy24ht.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pci/envy24ht.c Fri Apr 5 08:22:11 2013 (r249132) @@ -53,7 +53,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_ENVY24HT, "envy24ht", "envy24ht audio"); +static MALLOC_DEFINE(M_ENVY24HT, "envy24ht", "envy24ht audio"); /* -------------------------------------------------------------------- */ Modified: stable/9/sys/dev/sound/pci/spicds.c ============================================================================== --- stable/9/sys/dev/sound/pci/spicds.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pci/spicds.c Fri Apr 5 08:22:11 2013 (r249132) @@ -35,7 +35,7 @@ #include -MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec"); +static MALLOC_DEFINE(M_SPICDS, "spicds", "SPI codec"); #define SPICDS_NAMELEN 16 struct spicds_info { Modified: stable/9/sys/dev/sound/pcm/ac97.c ============================================================================== --- stable/9/sys/dev/sound/pcm/ac97.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pcm/ac97.c Fri Apr 5 08:22:11 2013 (r249132) @@ -38,7 +38,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); +static MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); struct ac97mixtable_entry { int reg; /* register index */ Modified: stable/9/sys/dev/sound/pcm/feeder.c ============================================================================== --- stable/9/sys/dev/sound/pcm/feeder.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pcm/feeder.c Fri Apr 5 08:22:11 2013 (r249132) @@ -35,7 +35,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); +static MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); #define MAXFEEDERS 256 #undef FEEDER_DEBUG Modified: stable/9/sys/dev/sound/pcm/mixer.c ============================================================================== --- stable/9/sys/dev/sound/pcm/mixer.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/sound/pcm/mixer.c Fri Apr 5 08:22:11 2013 (r249132) @@ -37,7 +37,7 @@ SND_DECLARE_FILE("$FreeBSD$"); -MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); +static MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); static int mixer_bypass = 1; TUNABLE_INT("hw.snd.vpc_mixer_bypass", &mixer_bypass); Modified: stable/9/sys/dev/tdfx/tdfx_pci.c ============================================================================== --- stable/9/sys/dev/tdfx/tdfx_pci.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/tdfx/tdfx_pci.c Fri Apr 5 08:22:11 2013 (r249132) @@ -89,7 +89,7 @@ static device_method_t tdfx_methods[] = { 0, 0 } }; -MALLOC_DEFINE(M_TDFX,"tdfx_driver","3DFX Graphics[/2D]/3D Accelerator(s)"); +static MALLOC_DEFINE(M_TDFX,"tdfx_driver","3DFX Graphics[/2D]/3D Accelerators"); /* Char. Dev. file operations structure */ static struct cdevsw tdfx_cdev = { Modified: stable/9/sys/dev/twa/tw_osl_freebsd.c ============================================================================== --- stable/9/sys/dev/twa/tw_osl_freebsd.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/twa/tw_osl_freebsd.c Fri Apr 5 08:22:11 2013 (r249132) @@ -55,7 +55,7 @@ TW_INT32 TW_DEBUG_LEVEL_FOR_OSL = TW_OSL TW_INT32 TW_OSL_DEBUG_LEVEL_FOR_CL = TW_OSL_DEBUG; #endif /* TW_OSL_DEBUG */ -MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands"); +static MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands"); static d_open_t twa_open; Modified: stable/9/sys/dev/twe/twe_freebsd.c ============================================================================== --- stable/9/sys/dev/twe/twe_freebsd.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/twe/twe_freebsd.c Fri Apr 5 08:22:11 2013 (r249132) @@ -879,7 +879,7 @@ twed_detach(device_t dev) /******************************************************************************** * Allocate a command buffer */ -MALLOC_DEFINE(TWE_MALLOC_CLASS, "twe_commands", "twe commands"); +static MALLOC_DEFINE(TWE_MALLOC_CLASS, "twe_commands", "twe commands"); struct twe_request * twe_allocate_request(struct twe_softc *sc, int tag) Modified: stable/9/sys/dev/uart/uart_core.c ============================================================================== --- stable/9/sys/dev/uart/uart_core.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/uart/uart_core.c Fri Apr 5 08:22:11 2013 (r249132) @@ -56,7 +56,7 @@ char uart_driver_name[] = "uart"; SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs = SLIST_HEAD_INITIALIZER(uart_sysdevs); -MALLOC_DEFINE(M_UART, "UART", "UART driver"); +static MALLOC_DEFINE(M_UART, "UART", "UART driver"); void uart_add_sysdev(struct uart_devinfo *di) Modified: stable/9/sys/dev/xen/balloon/balloon.c ============================================================================== --- stable/9/sys/dev/xen/balloon/balloon.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/xen/balloon/balloon.c Fri Apr 5 08:22:11 2013 (r249132) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_BALLOON, "Balloon", "Xen Balloon Driver"); +static MALLOC_DEFINE(M_BALLOON, "Balloon", "Xen Balloon Driver"); struct mtx balloon_mutex; Modified: stable/9/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/9/sys/dev/xen/blkback/blkback.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/xen/blkback/blkback.c Fri Apr 5 08:22:11 2013 (r249132) @@ -124,7 +124,7 @@ __FBSDID("$FreeBSD$"); /** * Custom malloc type for all driver allocations. */ -MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data"); +static MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data"); #ifdef XBB_DEBUG #define DPRINTF(fmt, args...) \ Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Fri Apr 5 08:22:11 2013 (r249132) @@ -82,7 +82,7 @@ static int blkif_completion(struct xb_co static void blkif_free(struct xb_softc *); static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); -MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); +static MALLOC_DEFINE(M_XENBLOCKFRONT, "xbd", "Xen Block Front driver data"); #define GRANT_INVALID_REF 0 Modified: stable/9/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- stable/9/sys/fs/ntfs/ntfs_subr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/fs/ntfs/ntfs_subr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -51,10 +51,12 @@ #include #include -MALLOC_DEFINE(M_NTFSNTVATTR, "ntfs_vattr", "NTFS file attribute information"); -MALLOC_DEFINE(M_NTFSRDATA, "ntfsd_resdata", "NTFS resident data"); -MALLOC_DEFINE(M_NTFSRUN, "ntfs_vrun", "NTFS vrun storage"); -MALLOC_DEFINE(M_NTFSDECOMP, "ntfs_decomp", "NTFS decompression temporary"); +static MALLOC_DEFINE(M_NTFSNTVATTR, "ntfs_vattr", + "NTFS file attribute information"); +static MALLOC_DEFINE(M_NTFSRDATA, "ntfsd_resdata", "NTFS resident data"); +static MALLOC_DEFINE(M_NTFSRUN, "ntfs_vrun", "NTFS vrun storage"); +static MALLOC_DEFINE(M_NTFSDECOMP, "ntfs_decomp", + "NTFS decompression temporary"); static int ntfs_ntlookupattr(struct ntfsmount *, const char *, int, int *, char **); static int ntfs_findvattr(struct ntfsmount *, struct ntnode *, struct ntvattr **, struct ntvattr **, u_int32_t, const char *, size_t, cn_t); Modified: stable/9/sys/fs/smbfs/smbfs_node.c ============================================================================== --- stable/9/sys/fs/smbfs/smbfs_node.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/fs/smbfs/smbfs_node.c Fri Apr 5 08:22:11 2013 (r249132) @@ -58,7 +58,7 @@ extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */ -MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); +static MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); static MALLOC_DEFINE(M_SMBNODENAME, "smbufs_nname", "SMBFS node name"); int smbfs_hashprint(struct mount *mp); Modified: stable/9/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/9/sys/fs/udf/udf_vnops.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/fs/udf/udf_vnops.c Fri Apr 5 08:22:11 2013 (r249132) @@ -107,8 +107,8 @@ struct vop_vector udf_fifoops = { .vop_vptofh = udf_vptofh, }; -MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); -MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); +static MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); +static MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); #define UDF_INVALID_BMAP -1 Modified: stable/9/sys/geom/uzip/g_uzip.c ============================================================================== --- stable/9/sys/geom/uzip/g_uzip.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/geom/uzip/g_uzip.c Fri Apr 5 08:22:11 2013 (r249132) @@ -50,7 +50,7 @@ FEATURE(geom_uzip, "GEOM uzip read-only #define DPRINTF(a) #endif -MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); +static MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); #define UZIP_CLASS_NAME "UZIP" Modified: stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c ============================================================================== --- stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c Fri Apr 5 08:22:11 2013 (r249132) @@ -71,7 +71,7 @@ #include -MALLOC_DEFINE(M_XFSNODE, "XFS node", "XFS vnode private part"); +static MALLOC_DEFINE(M_XFSNODE, "XFS node", "XFS vnode private part"); static vfs_mount_t _xfs_mount; static vfs_unmount_t _xfs_unmount; Modified: stable/9/sys/ia64/ia64/mca.c ============================================================================== --- stable/9/sys/ia64/ia64/mca.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/ia64/ia64/mca.c Fri Apr 5 08:22:11 2013 (r249132) @@ -43,7 +43,7 @@ #include #include -MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); +static MALLOC_DEFINE(M_MCA, "MCA", "Machine Check Architecture"); struct mca_info { STAILQ_ENTRY(mca_info) mi_link; Modified: stable/9/sys/ia64/ia64/sapic.c ============================================================================== --- stable/9/sys/ia64/ia64/sapic.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/ia64/ia64/sapic.c Fri Apr 5 08:22:11 2013 (r249132) @@ -99,7 +99,7 @@ struct sapic_rte { uint64_t rte_destination_id :8; }; -MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); +static MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); struct sapic *ia64_sapics[16]; /* XXX make this resizable */ int ia64_sapic_count; Modified: stable/9/sys/ia64/ia64/sscdisk.c ============================================================================== --- stable/9/sys/ia64/ia64/sscdisk.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/ia64/ia64/sscdisk.c Fri Apr 5 08:22:11 2013 (r249132) @@ -72,7 +72,7 @@ ssc(u_int64_t in0, u_int64_t in1, u_int6 #define SSC_NSECT 409600 #endif -MALLOC_DEFINE(M_SSC, "ssc_disk", "Simulator Disk"); +static MALLOC_DEFINE(M_SSC, "ssc_disk", "Simulator Disk"); static d_strategy_t sscstrategy; Modified: stable/9/sys/ia64/ia64/unwind.c ============================================================================== --- stable/9/sys/ia64/ia64/unwind.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/ia64/ia64/unwind.c Fri Apr 5 08:22:11 2013 (r249132) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_UNWIND, "Unwind", "Unwind information"); +static MALLOC_DEFINE(M_UNWIND, "Unwind", "Unwind information"); struct unw_entry { uint64_t ue_start; /* procedure start */ Modified: stable/9/sys/kern/kern_dtrace.c ============================================================================== --- stable/9/sys/kern/kern_dtrace.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_dtrace.c Fri Apr 5 08:22:11 2013 (r249132) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); FEATURE(kdtrace_hooks, "Kernel DTrace hooks which are required to load DTrace kernel modules"); -MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); +static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); /* Return the DTrace process data size compiled in the kernel hooks. */ size_t Modified: stable/9/sys/kern/kern_fail.c ============================================================================== --- stable/9/sys/kern/kern_fail.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_fail.c Fri Apr 5 08:22:11 2013 (r249132) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); ILOG_DEFINE_FOR_FILE(L_ISI_FAIL_POINT, L_ILOG, fail_point); #endif -MALLOC_DEFINE(M_FAIL_POINT, "Fail Points", "fail points system"); +static MALLOC_DEFINE(M_FAIL_POINT, "Fail Points", "fail points system"); #define fp_free(ptr) free(ptr, M_FAIL_POINT) #define fp_malloc(size, flags) malloc((size), M_FAIL_POINT, (flags)) Modified: stable/9/sys/kern/kern_jail.c ============================================================================== --- stable/9/sys/kern/kern_jail.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_jail.c Fri Apr 5 08:22:11 2013 (r249132) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_HOSTUUID "00000000-0000-0000-0000-000000000000" MALLOC_DEFINE(M_PRISON, "prison", "Prison structures"); -MALLOC_DEFINE(M_PRISON_RACCT, "prison_racct", "Prison racct structures"); +static MALLOC_DEFINE(M_PRISON_RACCT, "prison_racct", "Prison racct structures"); /* Keep struct prison prison0 and some code in kern_jail_set() readable. */ #ifdef INET Modified: stable/9/sys/kern/kern_lockf.c ============================================================================== --- stable/9/sys/kern/kern_lockf.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_lockf.c Fri Apr 5 08:22:11 2013 (r249132) @@ -90,7 +90,7 @@ static int lockf_debug = 0; /* control d SYSCTL_INT(_debug, OID_AUTO, lockf_debug, CTLFLAG_RW, &lockf_debug, 0, ""); #endif -MALLOC_DEFINE(M_LOCKF, "lockf", "Byte-range locking structures"); +static MALLOC_DEFINE(M_LOCKF, "lockf", "Byte-range locking structures"); struct owner_edge; struct owner_vertex; Modified: stable/9/sys/kern/kern_rctl.c ============================================================================== --- stable/9/sys/kern/kern_rctl.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_rctl.c Fri Apr 5 08:22:11 2013 (r249132) @@ -170,7 +170,7 @@ RW_SYSINIT(rctl_lock, &rctl_lock, "RCTL static int rctl_rule_fully_specified(const struct rctl_rule *rule); static void rctl_rule_to_sbuf(struct sbuf *sb, const struct rctl_rule *rule); -MALLOC_DEFINE(M_RCTL, "rctl", "Resource Limits"); +static MALLOC_DEFINE(M_RCTL, "rctl", "Resource Limits"); static const char * rctl_subject_type_name(int subject) Modified: stable/9/sys/kern/kern_timeout.c ============================================================================== --- stable/9/sys/kern/kern_timeout.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/kern_timeout.c Fri Apr 5 08:22:11 2013 (r249132) @@ -156,7 +156,7 @@ struct callout_cpu cc_cpu; static int timeout_cpu; void (*callout_new_inserted)(int cpu, int ticks) = NULL; -MALLOC_DEFINE(M_CALLOUT, "callout", "Callout datastructures"); +static MALLOC_DEFINE(M_CALLOUT, "callout", "Callout datastructures"); /** * Locked by cc_lock: Modified: stable/9/sys/kern/subr_pcpu.c ============================================================================== --- stable/9/sys/kern/subr_pcpu.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/subr_pcpu.c Fri Apr 5 08:22:11 2013 (r249132) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting."); +static MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting."); struct dpcpu_free { uintptr_t df_start; Modified: stable/9/sys/kern/subr_witness.c ============================================================================== --- stable/9/sys/kern/subr_witness.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/kern/subr_witness.c Fri Apr 5 08:22:11 2013 (r249132) @@ -184,7 +184,7 @@ __FBSDID("$FreeBSD$"); #define WITNESS_INDEX_ASSERT(i) \ MPASS((i) > 0 && (i) <= w_max_used_index && (i) < WITNESS_COUNT) -MALLOC_DEFINE(M_WITNESS, "Witness", "Witness"); +static MALLOC_DEFINE(M_WITNESS, "Witness", "Witness"); /* * Lock instances. A lock instance is the data associated with a lock while Modified: stable/9/sys/libkern/iconv.c ============================================================================== --- stable/9/sys/libkern/iconv.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/libkern/iconv.c Fri Apr 5 08:22:11 2013 (r249132) @@ -43,7 +43,7 @@ SYSCTL_DECL(_kern_iconv); SYSCTL_NODE(_kern, OID_AUTO, iconv, CTLFLAG_RW, NULL, "kernel iconv interface"); MALLOC_DEFINE(M_ICONV, "iconv", "ICONV structures"); -MALLOC_DEFINE(M_ICONVDATA, "iconv_data", "ICONV data"); +static MALLOC_DEFINE(M_ICONVDATA, "iconv_data", "ICONV data"); MODULE_VERSION(libiconv, 2); Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/net/if.c Fri Apr 5 08:22:11 2013 (r249132) @@ -118,7 +118,7 @@ SYSCTL_UINT(_net, OID_AUTO, ifdescr_maxl &ifdescr_maxlen, 0, "administrative maximum length for interface description"); -MALLOC_DEFINE(M_IFDESCR, "ifdescr", "ifnet descriptions"); +static MALLOC_DEFINE(M_IFDESCR, "ifdescr", "ifnet descriptions"); /* global sx for non-critical path ifdescr */ static struct sx ifdescr_sx; @@ -215,7 +215,7 @@ struct sx ifnet_sxlock; static if_com_alloc_t *if_com_alloc[256]; static if_com_free_t *if_com_free[256]; -MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals"); +static MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals"); MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); Modified: stable/9/sys/net/if_arcsubr.c ============================================================================== --- stable/9/sys/net/if_arcsubr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/net/if_arcsubr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -837,7 +837,7 @@ arc_resolvemulti(struct ifnet *ifp, stru } } -MALLOC_DEFINE(M_ARCCOM, "arccom", "ARCNET interface internals"); +static MALLOC_DEFINE(M_ARCCOM, "arccom", "ARCNET interface internals"); static void* arc_alloc(u_char type, struct ifnet *ifp) Modified: stable/9/sys/net/if_atmsubr.c ============================================================================== --- stable/9/sys/net/if_atmsubr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/net/if_atmsubr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -98,7 +98,7 @@ void (*atm_harp_event_p)(struct ifnet *, SYSCTL_NODE(_hw, OID_AUTO, atm, CTLFLAG_RW, 0, "ATM hardware"); -MALLOC_DEFINE(M_IFATM, "ifatm", "atm interface internals"); +static MALLOC_DEFINE(M_IFATM, "ifatm", "atm interface internals"); #ifndef ETHERTYPE_IPV6 #define ETHERTYPE_IPV6 0x86dd Modified: stable/9/sys/net/if_ethersubr.c ============================================================================== --- stable/9/sys/net/if_ethersubr.c Fri Apr 5 07:41:47 2013 (r249131) +++ stable/9/sys/net/if_ethersubr.c Fri Apr 5 08:22:11 2013 (r249132) @@ -134,7 +134,7 @@ static void ether_reassign(struct ifnet #endif /* XXX: should be in an arp support file, not here */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 08:46:21 2013 Return-Path: Delivered-To: svn-src-stable@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 A2903577; Fri, 5 Apr 2013 08:46:21 +0000 (UTC) (envelope-from mav@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 860C68F8; Fri, 5 Apr 2013 08:46:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r358kLR1008430; Fri, 5 Apr 2013 08:46:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r358kLPd008429; Fri, 5 Apr 2013 08:46:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304050846.r358kLPd008429@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 08:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249133 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 08:46:21 -0000 Author: mav Date: Fri Apr 5 08:46:20 2013 New Revision: 249133 URL: http://svnweb.freebsd.org/changeset/base/249133 Log: MFC r234177, r234374 (by trasz): Refactor da(4) to remove one of two code paths used to query capacity data. Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 08:22:11 2013 (r249132) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 08:46:20 2013 (r249133) @@ -82,7 +82,8 @@ typedef enum { DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, - DA_FLAG_CAN_RC16 = 0x400 + DA_FLAG_CAN_RC16 = 0x400, + DA_FLAG_PROBED = 0x800 } da_flags; typedef enum { @@ -867,7 +868,7 @@ static void dadone(struct cam_periph *p static int daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); static void daprevent(struct cam_periph *periph, int action); -static int dagetcapacity(struct cam_periph *periph); +static void dareprobe(struct cam_periph *periph); static void dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, struct scsi_read_capacity_data_long *rcaplong, @@ -966,36 +967,31 @@ daopen(struct disk *dp) softc->flags &= ~DA_FLAG_PACK_INVALID; } - error = dagetcapacity(periph); + dareprobe(periph); - if (error == 0) { - - softc->disk->d_sectorsize = softc->params.secsize; - softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; - softc->disk->d_stripesize = softc->params.stripesize; - softc->disk->d_stripeoffset = softc->params.stripeoffset; - /* XXX: these are not actually "firmware" values, so they may be wrong */ - softc->disk->d_fwsectors = softc->params.secs_per_track; - softc->disk->d_fwheads = softc->params.heads; - softc->disk->d_devstat->block_size = softc->params.secsize; - softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; - if (softc->delete_method > DA_DELETE_DISABLE) - softc->disk->d_flags |= DISKFLAG_CANDELETE; - else - softc->disk->d_flags &= ~DISKFLAG_CANDELETE; - - if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && - (softc->quirks & DA_Q_NO_PREVENT) == 0) - daprevent(periph, PR_PREVENT); - } else - softc->flags &= ~DA_FLAG_OPEN; + /* Wait for the disk size update. */ + error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO, + "dareprobe", 0); + if (error != 0) + xpt_print(periph->path, "unable to retrieve capacity data"); + + if (periph->flags & CAM_PERIPH_INVALID || + softc->disk->d_sectorsize == 0 || + softc->disk->d_mediasize == 0) + error = ENXIO; + + if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && + (softc->quirks & DA_Q_NO_PREVENT) == 0) + daprevent(periph, PR_PREVENT); cam_periph_unhold(periph); cam_periph_unlock(periph); if (error != 0) { + softc->flags &= ~DA_FLAG_OPEN; cam_periph_release(periph); } + return (error); } @@ -2400,7 +2396,7 @@ dadone(struct cam_periph *periph, union } } free(csio->data_ptr, M_SCSIDA); - if (announce_buf[0] != '\0') { + if (announce_buf[0] != '\0' && ((softc->flags & DA_FLAG_PROBED) == 0)) { /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -2414,9 +2410,7 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); } - } - softc->state = DA_STATE_NORMAL; /* * Since our peripheral may be invalidated by an error * above or an external event, we must release our CCB @@ -2426,7 +2420,13 @@ dadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - cam_periph_unhold(periph); + softc->state = DA_STATE_NORMAL; + wakeup(&softc->disk->d_mediasize); + if ((softc->flags & DA_FLAG_PROBED) == 0) { + softc->flags |= DA_FLAG_PROBED; + cam_periph_unhold(periph); + } else + cam_periph_release_locked(periph); return; } case DA_CCB_WAITING: @@ -2444,6 +2444,30 @@ dadone(struct cam_periph *periph, union xpt_release_ccb(done_ccb); } +static void +dareprobe(struct cam_periph *periph) +{ + struct da_softc *softc; + cam_status status; + + softc = (struct da_softc *)periph->softc; + + /* Probe in progress; don't interfere. */ + if ((softc->flags & DA_FLAG_PROBED) == 0) + return; + + status = cam_periph_acquire(periph); + KASSERT(status == CAM_REQ_CMP, + ("dareprobe: cam_periph_acquire failed")); + + if (softc->flags & DA_FLAG_CAN_RC16) + softc->state = DA_STATE_PROBE2; + else + softc->state = DA_STATE_PROBE; + + xpt_schedule(periph, CAM_PRIORITY_DEV); +} + static int daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) { @@ -2473,6 +2497,16 @@ daerror(union ccb *ccb, u_int32_t cam_fl &error_code, &sense_key, &asc, &ascq); if (sense_key == SSD_KEY_ILLEGAL_REQUEST) error = cmd6workaround(ccb); + /* + * If the target replied with CAPACITY DATA HAS CHANGED UA, + * query the capacity and notify upper layers. + */ + else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x2A && ascq == 0x09) { + xpt_print(periph->path, "capacity data has changed\n"); + dareprobe(periph); + sense_flags |= SF_NO_PRINT; + } } if (error == ERESTART) return (ERESTART); @@ -2526,162 +2560,6 @@ daprevent(struct cam_periph *periph, int xpt_release_ccb(ccb); } -static int -dagetcapacity(struct cam_periph *periph) -{ - struct da_softc *softc; - union ccb *ccb; - struct scsi_read_capacity_data *rcap; - struct scsi_read_capacity_data_long *rcaplong; - uint32_t block_len; - uint64_t maxsector; - int error, rc16failed; - u_int32_t sense_flags; - u_int lbppbe; /* Logical blocks per physical block exponent. */ - u_int lalba; /* Lowest aligned LBA. */ - - softc = (struct da_softc *)periph->softc; - block_len = 0; - maxsector = 0; - lbppbe = 0; - lalba = 0; - error = 0; - rc16failed = 0; - rcaplong = NULL; - sense_flags = SF_RETRY_UA; - if (softc->flags & DA_FLAG_PACK_REMOVABLE) - sense_flags |= SF_NO_PRINT; - - /* Do a read capacity */ - rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong), - M_SCSIDA, - M_NOWAIT | M_ZERO); - if (rcap == NULL) - return (ENOMEM); - rcaplong = (struct scsi_read_capacity_data_long *)rcap; - - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); - - /* Try READ CAPACITY(16) first if we think it should work. */ - if (softc->flags & DA_FLAG_CAN_RC16) { - scsi_read_capacity_16(&ccb->csio, - /*retries*/ 4, - /*cbfcnp*/ dadone, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*lba*/ 0, - /*reladr*/ 0, - /*pmi*/ 0, - /*rcap_buf*/ rcaplong, - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, softc->disk->d_devstat); - if (error == 0) - goto rc16ok; - - /* If we got ILLEGAL REQUEST, do not prefer RC16 any more. */ - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { - softc->flags &= ~DA_FLAG_CAN_RC16; - } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) - && ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) - && ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { - int sense_key, error_code, asc, ascq; - - scsi_extract_sense_len(&ccb->csio.sense_data, - ccb->csio.sense_len - - ccb->csio.sense_resid, - &error_code, &sense_key, - &asc, &ascq, /*show_errors*/1); - /* - * If we don't have enough sense to get the sense - * key, or if it's illegal request, turn off - * READ CAPACITY (16). - */ - if ((sense_key == -1) - || (sense_key == SSD_KEY_ILLEGAL_REQUEST)) - softc->flags &= ~DA_FLAG_CAN_RC16; - } - rc16failed = 1; - } - - /* Do READ CAPACITY(10). */ - scsi_read_capacity(&ccb->csio, - /*retries*/4, - /*cbfncp*/dadone, - MSG_SIMPLE_Q_TAG, - rcap, - SSD_FULL_SIZE, - /*timeout*/60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, - softc->disk->d_devstat); - if (error == 0) { - block_len = scsi_4btoul(rcap->length); - maxsector = scsi_4btoul(rcap->addr); - - if (maxsector != 0xffffffff || rc16failed) - goto done; - } else - goto done; - - /* If READ CAPACITY(10) returned overflow, use READ CAPACITY(16) */ - scsi_read_capacity_16(&ccb->csio, - /*retries*/ 4, - /*cbfcnp*/ dadone, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*lba*/ 0, - /*reladr*/ 0, - /*pmi*/ 0, - rcaplong, - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, - softc->disk->d_devstat); - if (error == 0) { -rc16ok: - block_len = scsi_4btoul(rcaplong->length); - maxsector = scsi_8btou64(rcaplong->addr); - lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; - lalba = scsi_2btoul(rcaplong->lalba_lbp); - } - -done: - - if (error == 0) { - if (block_len >= MAXPHYS || block_len == 0) { - xpt_print(periph->path, - "unsupportable block size %ju\n", - (uintmax_t) block_len); - error = EINVAL; - } else { - dasetgeom(periph, block_len, maxsector, - rcaplong, sizeof(*rcaplong)); - if ((lalba & SRC16_LBPME) - && softc->delete_method == DA_DELETE_NONE) - softc->delete_method = DA_DELETE_UNMAP; - } - } - - xpt_release_ccb(ccb); - - free(rcap, M_SCSIDA); - - return (error); -} - static void dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, struct scsi_read_capacity_data_long *rcaplong, size_t rcap_len) @@ -2781,6 +2659,20 @@ dasetgeom(struct cam_periph *periph, uin min(sizeof(softc->rcaplong), rcap_len)); } } + + softc->disk->d_sectorsize = softc->params.secsize; + softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; + softc->disk->d_stripesize = softc->params.stripesize; + softc->disk->d_stripeoffset = softc->params.stripeoffset; + /* XXX: these are not actually "firmware" values, so they may be wrong */ + softc->disk->d_fwsectors = softc->params.secs_per_track; + softc->disk->d_fwheads = softc->params.heads; + softc->disk->d_devstat->block_size = softc->params.secsize; + softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } static void From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 08:51:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B7E7F7DB; Fri, 5 Apr 2013 08:51:06 +0000 (UTC) (envelope-from mav@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 A92D3927; Fri, 5 Apr 2013 08:51: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 r358p6b8010686; Fri, 5 Apr 2013 08:51:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r358p5dg010681; Fri, 5 Apr 2013 08:51:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304050851.r358p5dg010681@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 08:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249134 - in stable/9/sys/cam: . scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 08:51:06 -0000 Author: mav Date: Fri Apr 5 08:51:05 2013 New Revision: 249134 URL: http://svnweb.freebsd.org/changeset/base/249134 Log: MFC r237478: Add scsi_extract_sense_ccb() -- wrapper around scsi_extract_sense_len(). It allows to remove number of duplicate checks from several places. Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/scsi/scsi_all.c stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Fri Apr 5 08:46:20 2013 (r249133) +++ stable/9/sys/cam/cam_periph.c Fri Apr 5 08:51:05 2013 (r249134) @@ -1155,22 +1155,15 @@ camperiphdone(struct cam_periph *periph, union ccb *saved_ccb; cam_status status; struct scsi_start_stop_unit *scsi_cmd; + int error_code, sense_key, asc, ascq; scsi_cmd = (struct scsi_start_stop_unit *) &done_ccb->csio.cdb_io.cdb_bytes; status = done_ccb->ccb_h.status; if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if ((status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR && - (status & CAM_AUTOSNS_VALID)) { - struct scsi_sense_data *sense; - int error_code, sense_key, asc, ascq, sense_len; - - sense = &done_ccb->csio.sense_data; - sense_len = done_ccb->csio.sense_len - - done_ccb->csio.sense_resid; - scsi_extract_sense_len(sense, sense_len, &error_code, - &sense_key, &asc, &ascq, /*show_errors*/ 1); + if (scsi_extract_sense_ccb(done_ccb, + &error_code, &sense_key, &asc, &ascq)) { /* * If the error is "invalid field in CDB", * and the load/eject flag is set, turn the @@ -1432,12 +1425,8 @@ camperiphscsisenseerror(union ccb *ccb, cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0) - err_action = scsi_error_action(&ccb->csio, - &cgd.inq_data, - sense_flags); - else - err_action = SS_RETRY|SSQ_DECREMENT_COUNT|EIO; + err_action = scsi_error_action(&ccb->csio, &cgd.inq_data, + sense_flags); error = err_action & SS_ERRMASK; /* Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Fri Apr 5 08:46:20 2013 (r249133) +++ stable/9/sys/cam/scsi/scsi_all.c Fri Apr 5 08:51:05 2013 (r249134) @@ -3005,11 +3005,10 @@ scsi_error_action(struct ccb_scsiio *csi int error_code, sense_key, asc, ascq; scsi_sense_action action; - scsi_extract_sense_len(&csio->sense_data, csio->sense_len - - csio->sense_resid, &error_code, - &sense_key, &asc, &ascq, /*show_errors*/ 1); - - if ((error_code == SSD_DEFERRED_ERROR) + if (!scsi_extract_sense_ccb((union ccb *)csio, + &error_code, &sense_key, &asc, &ascq)) { + action = SS_RETRY | SSQ_DECREMENT_COUNT | SSQ_PRINT_SENSE | EIO; + } else if ((error_code == SSD_DEFERRED_ERROR) || (error_code == SSD_DESC_DEFERRED_ERROR)) { /* * XXX dufault@FreeBSD.org @@ -4793,6 +4792,36 @@ scsi_extract_sense(struct scsi_sense_dat } /* + * Extract basic sense information from SCSI I/O CCB structure. + */ +int +scsi_extract_sense_ccb(union ccb *ccb, + int *error_code, int *sense_key, int *asc, int *ascq) +{ + struct scsi_sense_data *sense_data; + + /* Make sure there are some sense data we can access. */ + if (ccb->ccb_h.func_code != XPT_SCSI_IO || + (ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_SCSI_STATUS_ERROR || + (ccb->csio.scsi_status != SCSI_STATUS_CHECK_COND) || + (ccb->ccb_h.status & CAM_AUTOSNS_VALID) == 0 || + (ccb->ccb_h.flags & CAM_SENSE_PHYS)) + return (0); + + if (ccb->ccb_h.flags & CAM_SENSE_PTR) + bcopy(&ccb->csio.sense_data, &sense_data, + sizeof(struct scsi_sense_data *)); + else + sense_data = &ccb->csio.sense_data; + scsi_extract_sense_len(sense_data, + ccb->csio.sense_len - ccb->csio.sense_resid, + error_code, sense_key, asc, ascq, 1); + if (*error_code == -1) + return (0); + return (1); +} + +/* * Extract basic sense information. If show_errors is set, sense values * will be set to -1 if they are not present. */ Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Fri Apr 5 08:46:20 2013 (r249133) +++ stable/9/sys/cam/scsi/scsi_all.h Fri Apr 5 08:51:05 2013 (r249134) @@ -2389,6 +2389,8 @@ int scsi_devid_match(uint8_t *rhs, size void scsi_extract_sense(struct scsi_sense_data *sense, int *error_code, int *sense_key, int *asc, int *ascq); +int scsi_extract_sense_ccb(union ccb *ccb, int *error_code, int *sense_key, + int *asc, int *ascq); void scsi_extract_sense_len(struct scsi_sense_data *sense, u_int sense_len, int *error_code, int *sense_key, int *asc, int *ascq, int show_errors); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 08:46:20 2013 (r249133) +++ stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 08:51:05 2013 (r249134) @@ -1691,7 +1691,6 @@ cddone(struct cam_periph *periph, union */ return; } else { - struct scsi_sense_data *sense; int asc, ascq; int sense_key, error_code; int have_sense; @@ -1714,20 +1713,12 @@ cddone(struct cam_periph *periph, union cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if (((csio->ccb_h.flags & CAM_SENSE_PHYS) != 0) - || ((csio->ccb_h.flags & CAM_SENSE_PTR) != 0) - || ((status & CAM_AUTOSNS_VALID) == 0)) - have_sense = FALSE; - else + if (scsi_extract_sense_ccb(done_ccb, + &error_code, &sense_key, &asc, &ascq)) have_sense = TRUE; + else + have_sense = FALSE; - if (have_sense) { - sense = &csio->sense_data; - scsi_extract_sense_len(sense, - csio->sense_len - csio->sense_resid, - &error_code, &sense_key, &asc, - &ascq, /*show_errors*/ 1); - } /* * Attach to anything that claims to be a * CDROM or WORM device, as long as it @@ -3154,7 +3145,7 @@ cderror(union ccb *ccb, u_int32_t cam_fl { struct cd_softc *softc; struct cam_periph *periph; - int error; + int error, error_code, sense_key, asc, ascq; periph = xpt_path_periph(ccb->ccb_h.path); softc = (struct cd_softc *)periph->softc; @@ -3168,19 +3159,10 @@ cderror(union ccb *ccb, u_int32_t cam_fl */ if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { error = cd6byteworkaround(ccb); - } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) - && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) - && ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) - && ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { - int sense_key, error_code, asc, ascq; - - scsi_extract_sense_len(&ccb->csio.sense_data, - ccb->csio.sense_len - ccb->csio.sense_resid, &error_code, - &sense_key, &asc, &ascq, /*show_errors*/ 1); + } else if (scsi_extract_sense_ccb(ccb, + &error_code, &sense_key, &asc, &ascq)) { if (sense_key == SSD_KEY_ILLEGAL_REQUEST) - error = cd6byteworkaround(ccb); + error = cd6byteworkaround(ccb); } if (error == ERESTART) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 08:46:20 2013 (r249133) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 08:51:05 2013 (r249134) @@ -2299,7 +2299,6 @@ dadone(struct cam_periph *periph, union */ return; } else if (error != 0) { - struct scsi_sense_data *sense; int asc, ascq; int sense_key, error_code; int have_sense; @@ -2322,20 +2321,12 @@ dadone(struct cam_periph *periph, union cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if (((csio->ccb_h.flags & CAM_SENSE_PHYS) != 0) - || ((csio->ccb_h.flags & CAM_SENSE_PTR) != 0) - || ((status & CAM_AUTOSNS_VALID) == 0)) - have_sense = FALSE; - else + if (scsi_extract_sense_ccb(done_ccb, + &error_code, &sense_key, &asc, &ascq)) have_sense = TRUE; + else + have_sense = FALSE; - if (have_sense) { - sense = &csio->sense_data; - scsi_extract_sense_len(sense, - csio->sense_len - csio->sense_resid, - &error_code, &sense_key, &asc, - &ascq, /*show_errors*/ 1); - } /* * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). @@ -2473,7 +2464,7 @@ daerror(union ccb *ccb, u_int32_t cam_fl { struct da_softc *softc; struct cam_periph *periph; - int error; + int error, error_code, sense_key, asc, ascq; periph = xpt_path_periph(ccb->ccb_h.path); softc = (struct da_softc *)periph->softc; @@ -2485,16 +2476,8 @@ daerror(union ccb *ccb, u_int32_t cam_fl error = 0; if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { error = cmd6workaround(ccb); - } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) - && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) - && ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) - && ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { - int sense_key, error_code, asc, ascq; - - scsi_extract_sense(&ccb->csio.sense_data, - &error_code, &sense_key, &asc, &ascq); + } else if (scsi_extract_sense_ccb(ccb, + &error_code, &sense_key, &asc, &ascq)) { if (sense_key == SSD_KEY_ILLEGAL_REQUEST) error = cmd6workaround(ccb); /* From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 09:02:05 2013 Return-Path: Delivered-To: svn-src-stable@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 39803B34; Fri, 5 Apr 2013 09:02:05 +0000 (UTC) (envelope-from mav@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 129BF9AA; Fri, 5 Apr 2013 09:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35924eZ013953; Fri, 5 Apr 2013 09:02:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3592457013952; Fri, 5 Apr 2013 09:02:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304050902.r3592457013952@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 09:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249135 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 09:02:05 -0000 Author: mav Date: Fri Apr 5 09:02:04 2013 New Revision: 249135 URL: http://svnweb.freebsd.org/changeset/base/249135 Log: MFC r237689 (by imp): Add a sysctl to set the cdrom timeout. Data recovery operations from a CD or DVD drive with a damaged disc often benefit from a shorter timeout. Also, when retries are set to 0, an application is expecting errors and recovering them so do not print the error into the log. The number of expected errors can literally be in the hundreds of thousands which significantly slows data recovery. Modified: stable/9/sys/cam/scsi/scsi_cd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 08:51:05 2013 (r249134) +++ stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 09:02:04 2013 (r249135) @@ -293,6 +293,9 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #ifndef CD_DEFAULT_RETRY #define CD_DEFAULT_RETRY 4 #endif +#ifndef CD_DEFAULT_TIMEOUT +#define CD_DEFAULT_TIMEOUT 30000 +#endif #ifndef CHANGER_MIN_BUSY_SECONDS #define CHANGER_MIN_BUSY_SECONDS 5 #endif @@ -301,6 +304,7 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #endif static int cd_retry_count = CD_DEFAULT_RETRY; +static int cd_timeout = CD_DEFAULT_TIMEOUT; static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; @@ -310,6 +314,9 @@ static SYSCTL_NODE(_kern_cam_cd, OID_AUT SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, &cd_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); +SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, + &cd_timeout, 0, "Timeout, in us, for read operations"); +TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW, &changer_min_busy_seconds, 0, "Minimum changer scheduling quantum"); TUNABLE_INT("kern.cam.cd.changer.min_busy_seconds", &changer_min_busy_seconds); @@ -1505,8 +1512,9 @@ cdstart(struct cam_periph *periph, union bp->bio_bcount / softc->params.blksize, /* data_ptr */ bp->bio_data, /* dxfer_len */ bp->bio_bcount, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ 30000); + /* sense_len */ cd_retry_count ? + SSD_FULL_SIZE : SF_NO_PRINT, + /* timeout */ cd_timeout); /* Use READ CD command for audio tracks. */ if (softc->params.blksize == 2352) { start_ccb->csio.cdb_io.cdb_bytes[0] = READ_CD; From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:10:40 2013 Return-Path: Delivered-To: svn-src-stable@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 44B5318E; Fri, 5 Apr 2013 10:10:40 +0000 (UTC) (envelope-from mav@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 36EA7CDB; Fri, 5 Apr 2013 10:10: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 r35AAeHr035022; Fri, 5 Apr 2013 10:10:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AAeak035021; Fri, 5 Apr 2013 10:10:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051010.r35AAeak035021@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249142 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:10:40 -0000 Author: mav Date: Fri Apr 5 10:10:39 2013 New Revision: 249142 URL: http://svnweb.freebsd.org/changeset/base/249142 Log: MFC r226735 (by pjd): Simplify disk_alloc(). Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Fri Apr 5 09:51:31 2013 (r249141) +++ stable/9/sys/geom/geom_disk.c Fri Apr 5 10:10:39 2013 (r249142) @@ -574,12 +574,10 @@ g_disk_ident_adjust(char *ident, size_t } struct disk * -disk_alloc() +disk_alloc(void) { - struct disk *dp; - dp = g_malloc(sizeof *dp, M_WAITOK | M_ZERO); - return (dp); + return (g_malloc(sizeof(struct disk), M_WAITOK | M_ZERO)); } void From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:13:44 2013 Return-Path: Delivered-To: svn-src-stable@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 DF51F3C5; Fri, 5 Apr 2013 10:13:44 +0000 (UTC) (envelope-from mav@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 B92D2D0A; Fri, 5 Apr 2013 10:13:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35ADike035543; Fri, 5 Apr 2013 10:13:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35ADiIO035542; Fri, 5 Apr 2013 10:13:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051013.r35ADiIO035542@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249143 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:13:45 -0000 Author: mav Date: Fri Apr 5 10:13:44 2013 New Revision: 249143 URL: http://svnweb.freebsd.org/changeset/base/249143 Log: MFC r226736: Improve style a bit. Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Fri Apr 5 10:10:39 2013 (r249142) +++ stable/9/sys/geom/geom_disk.c Fri Apr 5 10:13:44 2013 (r249143) @@ -112,6 +112,7 @@ DECLARE_GEOM_CLASS(g_disk_class, g_disk) static void __inline g_disk_lock_giant(struct disk *dp) { + if (dp->d_flags & DISKFLAG_NEEDSGIANT) mtx_lock(&Giant); } @@ -119,6 +120,7 @@ g_disk_lock_giant(struct disk *dp) static void __inline g_disk_unlock_giant(struct disk *dp) { + if (dp->d_flags & DISKFLAG_NEEDSGIANT) mtx_unlock(&Giant); } @@ -254,9 +256,9 @@ g_disk_done(struct bio *bp) if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) && - (sc = bp2->bio_to->geom->softc) && - (dp = sc->dp)) { + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0 && + (sc = bp2->bio_to->geom->softc) != NULL && + (dp = sc->dp) != NULL) { devstat_end_transaction_bio(dp->d_devstat, bp); } g_destroy_bio(bp); @@ -285,7 +287,7 @@ g_disk_ioctl(struct g_provider *pp, u_lo g_disk_lock_giant(dp); error = dp->d_ioctl(dp, cmd, data, fflag, td); g_disk_unlock_giant(dp); - return(error); + return (error); } static void @@ -583,6 +585,7 @@ disk_alloc(void) void disk_create(struct disk *dp, int version) { + if (version != DISK_VERSION_02 && version != DISK_VERSION_01) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, @@ -674,4 +677,3 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_disks, "A", "names of available disks"); - From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:22:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 943DF63F; Fri, 5 Apr 2013 10:22:23 +0000 (UTC) (envelope-from mav@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 86C44D6E; Fri, 5 Apr 2013 10:22: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 r35AMNdN038355; Fri, 5 Apr 2013 10:22:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AMNlP038354; Fri, 5 Apr 2013 10:22:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051022.r35AMNlP038354@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249144 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:22:23 -0000 Author: mav Date: Fri Apr 5 10:22:22 2013 New Revision: 249144 URL: http://svnweb.freebsd.org/changeset/base/249144 Log: MFC r226737 (by pjd): Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not supported by returning EOPNOTSUPP instead of 0 or ENODEV. Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Fri Apr 5 10:13:44 2013 (r249143) +++ stable/9/sys/geom/geom_disk.c Fri Apr 5 10:22:22 2013 (r249144) @@ -308,7 +308,7 @@ g_disk_start(struct bio *bp) switch(bp->bio_cmd) { case BIO_DELETE: if (!(dp->d_flags & DISKFLAG_CANDELETE)) { - error = 0; + error = EOPNOTSUPP; break; } /* fall-through */ @@ -397,8 +397,8 @@ g_disk_start(struct bio *bp) g_trace(G_T_BIO, "g_disk_flushcache(%s)", bp->bio_to->name); if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) { - g_io_deliver(bp, ENODEV); - return; + error = EOPNOTSUPP; + break; } bp2 = g_clone_bio(bp); if (bp2 == NULL) { From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:27:07 2013 Return-Path: Delivered-To: svn-src-stable@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 2E7458DE; Fri, 5 Apr 2013 10:27:07 +0000 (UTC) (envelope-from mav@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 1F63FDA2; Fri, 5 Apr 2013 10:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35AR6EI039055; Fri, 5 Apr 2013 10:27:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AR6wb039051; Fri, 5 Apr 2013 10:27:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051027.r35AR6wb039051@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249145 - in stable/9/sys/geom: concat stripe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:27:07 -0000 Author: mav Date: Fri Apr 5 10:27:05 2013 New Revision: 249145 URL: http://svnweb.freebsd.org/changeset/base/249145 Log: MFC r226998, r227004: Refactor disk disconnection and geom destruction handling sequences. Do not close/destroy opened consumer directly in case of disconnect. Instead keep it existing until it will be closed in regular way in response to upstream provider destruction. Delay geom destruction in the same way. Previous implementation could destroy consumers still having active requests and worked only because of global workaround made on GEOM level. Modified: stable/9/sys/geom/concat/g_concat.c stable/9/sys/geom/concat/g_concat.h stable/9/sys/geom/stripe/g_stripe.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/concat/g_concat.c ============================================================================== --- stable/9/sys/geom/concat/g_concat.c Fri Apr 5 10:22:22 2013 (r249144) +++ stable/9/sys/geom/concat/g_concat.c Fri Apr 5 10:27:05 2013 (r249145) @@ -118,25 +118,33 @@ g_concat_remove_disk(struct g_concat_dis struct g_consumer *cp; struct g_concat_softc *sc; + g_topology_assert(); KASSERT(disk->d_consumer != NULL, ("Non-valid disk in %s.", __func__)); sc = disk->d_softc; cp = disk->d_consumer; - G_CONCAT_DEBUG(0, "Disk %s removed from %s.", cp->provider->name, - sc->sc_name); + if (!disk->d_removed) { + G_CONCAT_DEBUG(0, "Disk %s removed from %s.", + cp->provider->name, sc->sc_name); + disk->d_removed = 1; + } - disk->d_consumer = NULL; if (sc->sc_provider != NULL) { sc->sc_provider->flags |= G_PF_WITHER; + G_CONCAT_DEBUG(0, "Device %s deactivated.", + sc->sc_provider->name); g_orphan_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; - G_CONCAT_DEBUG(0, "Device %s removed.", sc->sc_name); } if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) - g_access(cp, -cp->acr, -cp->acw, -cp->ace); + return; + disk->d_consumer = NULL; g_detach(cp); g_destroy_consumer(cp); + /* If there are no valid disks anymore, remove device. */ + if (LIST_EMPTY(&sc->sc_geom->consumer)) + g_concat_destroy(sc, 1); } static void @@ -156,37 +164,18 @@ g_concat_orphan(struct g_consumer *cp) if (disk == NULL) /* Possible? */ return; g_concat_remove_disk(disk); - - /* If there are no valid disks anymore, remove device. */ - if (g_concat_nvalid(sc) == 0) - g_concat_destroy(sc, 1); } static int g_concat_access(struct g_provider *pp, int dr, int dw, int de) { - struct g_consumer *cp1, *cp2; - struct g_concat_softc *sc; + struct g_consumer *cp1, *cp2, *tmp; + struct g_concat_disk *disk; struct g_geom *gp; int error; + g_topology_assert(); gp = pp->geom; - sc = gp->softc; - - if (sc == NULL) { - /* - * It looks like geom is being withered. - * In that case we allow only negative requests. - */ - KASSERT(dr <= 0 && dw <= 0 && de <= 0, - ("Positive access request (device=%s).", pp->name)); - if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && - (pp->ace + de) == 0) { - G_CONCAT_DEBUG(0, "Device %s definitely destroyed.", - gp->name); - } - return (0); - } /* On first open, grab an extra "exclusive" bit */ if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) @@ -195,22 +184,24 @@ g_concat_access(struct g_provider *pp, i if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0) de--; - error = ENXIO; - LIST_FOREACH(cp1, &gp->consumer, consumer) { + LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) { error = g_access(cp1, dr, dw, de); - if (error == 0) - continue; - /* - * If we fail here, backout all previous changes. - */ - LIST_FOREACH(cp2, &gp->consumer, consumer) { - if (cp1 == cp2) - return (error); - g_access(cp2, -dr, -dw, -de); + if (error != 0) + goto fail; + disk = cp1->private; + if (cp1->acr == 0 && cp1->acw == 0 && cp1->ace == 0 && + disk->d_removed) { + g_concat_remove_disk(disk); /* May destroy geom. */ } - /* NOTREACHED */ } + return (0); +fail: + LIST_FOREACH(cp2, &gp->consumer, consumer) { + if (cp1 == cp2) + break; + g_access(cp2, -dr, -dw, -de); + } return (error); } @@ -392,6 +383,7 @@ g_concat_check_and_run(struct g_concat_s u_int no, sectorsize = 0; off_t start; + g_topology_assert(); if (g_concat_nvalid(sc) != sc->sc_ndisks) return; @@ -420,7 +412,7 @@ g_concat_check_and_run(struct g_concat_s sc->sc_provider = pp; g_error_provider(pp, 0); - G_CONCAT_DEBUG(0, "Device %s activated.", sc->sc_name); + G_CONCAT_DEBUG(0, "Device %s activated.", sc->sc_provider->name); } static int @@ -462,6 +454,7 @@ g_concat_add_disk(struct g_concat_softc struct g_geom *gp; int error; + g_topology_assert(); /* Metadata corrupted? */ if (no >= sc->sc_ndisks) return (EINVAL); @@ -510,6 +503,7 @@ g_concat_add_disk(struct g_concat_softc disk->d_softc = sc; disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ + disk->d_removed = 0; G_CONCAT_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name); @@ -577,8 +571,8 @@ static int g_concat_destroy(struct g_concat_softc *sc, boolean_t force) { struct g_provider *pp; + struct g_consumer *cp, *cp1; struct g_geom *gp; - u_int no; g_topology_assert(); @@ -598,24 +592,23 @@ g_concat_destroy(struct g_concat_softc * } } - for (no = 0; no < sc->sc_ndisks; no++) { - if (sc->sc_disks[no].d_consumer != NULL) - g_concat_remove_disk(&sc->sc_disks[no]); + gp = sc->sc_geom; + LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { + g_concat_remove_disk(cp->private); + if (cp1 == NULL) + return (0); /* Recursion happened. */ } + if (!LIST_EMPTY(&gp->consumer)) + return (EINPROGRESS); - gp = sc->sc_geom; gp->softc = NULL; KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)", gp->name)); free(sc->sc_disks, M_CONCAT); free(sc, M_CONCAT); - pp = LIST_FIRST(&gp->provider); - if (pp == NULL || (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)) - G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name); - + G_CONCAT_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); - return (0); } Modified: stable/9/sys/geom/concat/g_concat.h ============================================================================== --- stable/9/sys/geom/concat/g_concat.h Fri Apr 5 10:22:22 2013 (r249144) +++ stable/9/sys/geom/concat/g_concat.h Fri Apr 5 10:27:05 2013 (r249145) @@ -72,6 +72,7 @@ struct g_concat_disk { struct g_concat_softc *d_softc; off_t d_start; off_t d_end; + int d_removed; }; struct g_concat_softc { Modified: stable/9/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/9/sys/geom/stripe/g_stripe.c Fri Apr 5 10:22:22 2013 (r249144) +++ stable/9/sys/geom/stripe/g_stripe.c Fri Apr 5 10:27:05 2013 (r249145) @@ -161,28 +161,35 @@ static void g_stripe_remove_disk(struct g_consumer *cp) { struct g_stripe_softc *sc; - u_int no; + g_topology_assert(); KASSERT(cp != NULL, ("Non-valid disk in %s.", __func__)); - sc = (struct g_stripe_softc *)cp->private; + sc = (struct g_stripe_softc *)cp->geom->softc; KASSERT(sc != NULL, ("NULL sc in %s.", __func__)); - no = cp->index; - G_STRIPE_DEBUG(0, "Disk %s removed from %s.", cp->provider->name, - sc->sc_name); + if (cp->private == NULL) { + G_STRIPE_DEBUG(0, "Disk %s removed from %s.", + cp->provider->name, sc->sc_name); + cp->private = (void *)(uintptr_t)-1; + } - sc->sc_disks[no] = NULL; if (sc->sc_provider != NULL) { sc->sc_provider->flags |= G_PF_WITHER; + G_STRIPE_DEBUG(0, "Device %s deactivated.", + sc->sc_provider->name); g_orphan_provider(sc->sc_provider, ENXIO); sc->sc_provider = NULL; - G_STRIPE_DEBUG(0, "Device %s removed.", sc->sc_name); } if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) - g_access(cp, -cp->acr, -cp->acw, -cp->ace); + return; + sc->sc_disks[cp->index] = NULL; + cp->index = 0; g_detach(cp); g_destroy_consumer(cp); + /* If there are no valid disks anymore, remove device. */ + if (LIST_EMPTY(&sc->sc_geom->consumer)) + g_stripe_destroy(sc, 1); } static void @@ -198,36 +205,20 @@ g_stripe_orphan(struct g_consumer *cp) return; g_stripe_remove_disk(cp); - /* If there are no valid disks anymore, remove device. */ - if (g_stripe_nvalid(sc) == 0) - g_stripe_destroy(sc, 1); } static int g_stripe_access(struct g_provider *pp, int dr, int dw, int de) { - struct g_consumer *cp1, *cp2; + struct g_consumer *cp1, *cp2, *tmp; struct g_stripe_softc *sc; struct g_geom *gp; int error; + g_topology_assert(); gp = pp->geom; sc = gp->softc; - - if (sc == NULL) { - /* - * It looks like geom is being withered. - * In that case we allow only negative requests. - */ - KASSERT(dr <= 0 && dw <= 0 && de <= 0, - ("Positive access request (device=%s).", pp->name)); - if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && - (pp->ace + de) == 0) { - G_STRIPE_DEBUG(0, "Device %s definitely destroyed.", - gp->name); - } - return (0); - } + KASSERT(sc != NULL, ("NULL sc in %s.", __func__)); /* On first open, grab an extra "exclusive" bit */ if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) @@ -236,22 +227,23 @@ g_stripe_access(struct g_provider *pp, i if ((pp->acr + dr) == 0 && (pp->acw + dw) == 0 && (pp->ace + de) == 0) de--; - error = ENXIO; - LIST_FOREACH(cp1, &gp->consumer, consumer) { + LIST_FOREACH_SAFE(cp1, &gp->consumer, consumer, tmp) { error = g_access(cp1, dr, dw, de); - if (error == 0) - continue; - /* - * If we fail here, backout all previous changes. - */ - LIST_FOREACH(cp2, &gp->consumer, consumer) { - if (cp1 == cp2) - return (error); - g_access(cp2, -dr, -dw, -de); + if (error != 0) + goto fail; + if (cp1->acr == 0 && cp1->acw == 0 && cp1->ace == 0 && + cp1->private != NULL) { + g_stripe_remove_disk(cp1); /* May destroy geom. */ } - /* NOTREACHED */ } + return (0); +fail: + LIST_FOREACH(cp2, &gp->consumer, consumer) { + if (cp1 == cp2) + break; + g_access(cp2, -dr, -dw, -de); + } return (error); } @@ -653,6 +645,7 @@ g_stripe_check_and_run(struct g_stripe_s off_t mediasize, ms; u_int no, sectorsize = 0; + g_topology_assert(); if (g_stripe_nvalid(sc) != sc->sc_ndisks) return; @@ -682,7 +675,7 @@ g_stripe_check_and_run(struct g_stripe_s sc->sc_provider->stripeoffset = 0; g_error_provider(sc->sc_provider, 0); - G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_name); + G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_provider->name); } static int @@ -723,6 +716,7 @@ g_stripe_add_disk(struct g_stripe_softc struct g_geom *gp; int error; + g_topology_assert(); /* Metadata corrupted? */ if (no >= sc->sc_ndisks) return (EINVAL); @@ -735,6 +729,8 @@ g_stripe_add_disk(struct g_stripe_softc fcp = LIST_FIRST(&gp->consumer); cp = g_new_consumer(gp); + cp->private = NULL; + cp->index = no; error = g_attach(cp, pp); if (error != 0) { g_destroy_consumer(cp); @@ -765,12 +761,8 @@ g_stripe_add_disk(struct g_stripe_softc } } - cp->private = sc; - cp->index = no; sc->sc_disks[no] = cp; - G_STRIPE_DEBUG(0, "Disk %s attached to %s.", pp->name, sc->sc_name); - g_stripe_check_and_run(sc); return (0); @@ -790,6 +782,7 @@ g_stripe_create(struct g_class *mp, cons struct g_geom *gp; u_int no; + g_topology_assert(); G_STRIPE_DEBUG(1, "Creating device %s (id=%u).", md->md_name, md->md_id); @@ -851,8 +844,8 @@ static int g_stripe_destroy(struct g_stripe_softc *sc, boolean_t force) { struct g_provider *pp; + struct g_consumer *cp, *cp1; struct g_geom *gp; - u_int no; g_topology_assert(); @@ -872,24 +865,22 @@ g_stripe_destroy(struct g_stripe_softc * } } - for (no = 0; no < sc->sc_ndisks; no++) { - if (sc->sc_disks[no] != NULL) - g_stripe_remove_disk(sc->sc_disks[no]); + gp = sc->sc_geom; + LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp1) { + g_stripe_remove_disk(cp); + if (cp1 == NULL) + return (0); /* Recursion happened. */ } + if (!LIST_EMPTY(&gp->consumer)) + return (EINPROGRESS); - gp = sc->sc_geom; gp->softc = NULL; KASSERT(sc->sc_provider == NULL, ("Provider still exists? (device=%s)", gp->name)); free(sc->sc_disks, M_STRIPE); free(sc, M_STRIPE); - - pp = LIST_FIRST(&gp->provider); - if (pp == NULL || (pp->acr == 0 && pp->acw == 0 && pp->ace == 0)) - G_STRIPE_DEBUG(0, "Device %s destroyed.", gp->name); - + G_STRIPE_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); - return (0); } From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:29:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 845C9A67; Fri, 5 Apr 2013 10:29:15 +0000 (UTC) (envelope-from mav@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 688F7DB6; Fri, 5 Apr 2013 10:29: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 r35ATFEJ039377; Fri, 5 Apr 2013 10:29:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35ATFTl039376; Fri, 5 Apr 2013 10:29:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051029.r35ATFTl039376@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249146 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:29:15 -0000 Author: mav Date: Fri Apr 5 10:29:14 2013 New Revision: 249146 URL: http://svnweb.freebsd.org/changeset/base/249146 Log: MFC r227015: Add mutex and two flags to make orphan() call properly asynchronous: - delay consumer closing and detaching on orphan() until all I/Os complete; - prevent new I/Os submission after orphan() called. Previous implementation could destroy consumers still having active requests and worked only because of global workaround made on GEOM level. Modified: stable/9/sys/geom/geom_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_vfs.c ============================================================================== --- stable/9/sys/geom/geom_vfs.c Fri Apr 5 10:27:05 2013 (r249145) +++ stable/9/sys/geom/geom_vfs.c Fri Apr 5 10:29:14 2013 (r249146) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include /* XXX Temporary for VFS_LOCK_GIANT */ @@ -45,6 +47,13 @@ __FBSDID("$FreeBSD$"); */ #include +struct g_vfs_softc { + struct mtx sc_mtx; + struct bufobj *sc_bo; + int sc_active; + int sc_orphaned; +}; + static struct buf_ops __g_vfs_bufops = { .bop_name = "GEOM_VFS", .bop_write = bufwrite, @@ -66,24 +75,32 @@ static struct g_class g_vfs_class = { DECLARE_GEOM_CLASS(g_vfs_class, g_vfs); static void +g_vfs_destroy(void *arg, int flags __unused) +{ + struct g_consumer *cp; + + g_topology_assert(); + cp = arg; + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + g_access(cp, -cp->acr, -cp->acw, -cp->ace); + g_detach(cp); + if (cp->geom->softc == NULL) + g_wither_geom(cp->geom, ENXIO); +} + +static void g_vfs_done(struct bio *bip) { + struct g_consumer *cp; + struct g_vfs_softc *sc; struct buf *bp; - int vfslocked; + int vfslocked, destroy; struct mount *mp; struct vnode *vp; struct cdev *cdevp; - /* - * Provider ('bio_to') could have withered away sometime - * between incrementing the 'nend' in g_io_deliver() and now, - * making 'bio_to' a dangling pointer. We cannot do that - * in g_wither_geom(), as it would require going over - * the 'g_bio_run_up' list, resetting the pointer. - */ - if (bip->bio_from->provider == NULL) - bip->bio_to = NULL; - + cp = bip->bio_from; + sc = cp->geom->softc; /* * Collect statistics on synchronous and asynchronous read * and write counts for disks that have associated filesystems. @@ -134,6 +151,13 @@ g_vfs_done(struct bio *bip) bp->b_ioflags |= BIO_ERROR; bp->b_resid = bp->b_bcount - bip->bio_completed; g_destroy_bio(bip); + + mtx_lock(&sc->sc_mtx); + destroy = ((--sc->sc_active) == 0 && sc->sc_orphaned); + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_post_event(g_vfs_destroy, cp, M_WAITOK, NULL); + vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL)); bufdone(bp); VFS_UNLOCK_GIANT(vfslocked); @@ -142,17 +166,20 @@ g_vfs_done(struct bio *bip) void g_vfs_strategy(struct bufobj *bo, struct buf *bp) { + struct g_vfs_softc *sc; struct g_consumer *cp; struct bio *bip; int vfslocked; cp = bo->bo_private; - /* G_VALID_CONSUMER(cp); We likely lack topology lock */ + sc = cp->geom->softc; /* * If the provider has orphaned us, just return EXIO. */ - if (cp->provider == NULL) { + mtx_lock(&sc->sc_mtx); + if (sc->sc_orphaned) { + mtx_unlock(&sc->sc_mtx); bp->b_error = ENXIO; bp->b_ioflags |= BIO_ERROR; vfslocked = VFS_LOCK_GIANT(((struct mount *)NULL)); @@ -160,6 +187,8 @@ g_vfs_strategy(struct bufobj *bo, struct VFS_UNLOCK_GIANT(vfslocked); return; } + sc->sc_active++; + mtx_unlock(&sc->sc_mtx); bip = g_alloc_bio(); bip->bio_cmd = bp->b_iocmd; @@ -179,14 +208,20 @@ static void g_vfs_orphan(struct g_consumer *cp) { struct g_geom *gp; + struct g_vfs_softc *sc; + int destroy; g_topology_assert(); gp = cp->geom; + sc = gp->softc; g_trace(G_T_TOPOLOGY, "g_vfs_orphan(%p(%s))", cp, gp->name); - if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) - g_access(cp, -cp->acr, -cp->acw, -cp->ace); - g_detach(cp); + mtx_lock(&sc->sc_mtx); + sc->sc_orphaned = 1; + destroy = (sc->sc_active == 0); + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_vfs_destroy(cp, 0); /* * Do not destroy the geom. Filesystem will do that during unmount. @@ -199,6 +234,7 @@ g_vfs_open(struct vnode *vp, struct g_co struct g_geom *gp; struct g_provider *pp; struct g_consumer *cp; + struct g_vfs_softc *sc; struct bufobj *bo; int vfslocked; int error; @@ -214,6 +250,10 @@ g_vfs_open(struct vnode *vp, struct g_co if (pp == NULL) return (ENOENT); gp = g_new_geomf(&g_vfs_class, "%s.%s", fsname, pp->name); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->sc_mtx, "g_vfs", NULL, MTX_DEF); + sc->sc_bo = bo; + gp->softc = sc; cp = g_new_consumer(gp); g_attach(cp, pp); error = g_access(cp, 1, wr, wr); @@ -229,7 +269,6 @@ g_vfs_open(struct vnode *vp, struct g_co bo->bo_ops = g_vfs_bufops; bo->bo_private = cp; bo->bo_bsize = pp->sectorsize; - gp->softc = bo; return (error); } @@ -238,13 +277,17 @@ void g_vfs_close(struct g_consumer *cp) { struct g_geom *gp; - struct bufobj *bo; + struct g_vfs_softc *sc; g_topology_assert(); gp = cp->geom; - bo = gp->softc; - bufobj_invalbuf(bo, V_SAVE, 0, 0); - bo->bo_private = cp->private; - g_wither_geom_close(gp, ENXIO); + sc = gp->softc; + bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); + sc->sc_bo->bo_private = cp->private; + gp->softc = NULL; + mtx_destroy(&sc->sc_mtx); + if (!sc->sc_orphaned || cp->provider == NULL) + g_wither_geom_close(gp, ENXIO); + g_free(sc); } From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:30:37 2013 Return-Path: Delivered-To: svn-src-stable@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 EDE95BEF; Fri, 5 Apr 2013 10:30:37 +0000 (UTC) (envelope-from mav@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 E0B71DCA; Fri, 5 Apr 2013 10:30: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 r35AUbjV041217; Fri, 5 Apr 2013 10:30:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AUb7H041216; Fri, 5 Apr 2013 10:30:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051030.r35AUb7H041216@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249147 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:30:38 -0000 Author: mav Date: Fri Apr 5 10:30:37 2013 New Revision: 249147 URL: http://svnweb.freebsd.org/changeset/base/249147 Log: MFC r228204: Close race between geom destruction on g_vfs_close() when softc destroyed and g_vfs_orphan() call that tries to access softc, intruced at r227015. Modified: stable/9/sys/geom/geom_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_vfs.c ============================================================================== --- stable/9/sys/geom/geom_vfs.c Fri Apr 5 10:29:14 2013 (r249146) +++ stable/9/sys/geom/geom_vfs.c Fri Apr 5 10:30:37 2013 (r249147) @@ -214,8 +214,10 @@ g_vfs_orphan(struct g_consumer *cp) g_topology_assert(); gp = cp->geom; - sc = gp->softc; g_trace(G_T_TOPOLOGY, "g_vfs_orphan(%p(%s))", cp, gp->name); + sc = gp->softc; + if (sc == NULL) + return; mtx_lock(&sc->sc_mtx); sc->sc_orphaned = 1; destroy = (sc->sc_active == 0); From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:35:37 2013 Return-Path: Delivered-To: svn-src-stable@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 74122D98; Fri, 5 Apr 2013 10:35:37 +0000 (UTC) (envelope-from mav@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 63A0CDE5; Fri, 5 Apr 2013 10:35: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 r35AZb5P041987; Fri, 5 Apr 2013 10:35:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AZaTW041976; Fri, 5 Apr 2013 10:35:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051035.r35AZaTW041976@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249148 - in stable/9/sys/geom: . bde uncompress uzip X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:35:37 -0000 Author: mav Date: Fri Apr 5 10:35:36 2013 New Revision: 249148 URL: http://svnweb.freebsd.org/changeset/base/249148 Log: MFC r238198 (by trasz): Fix orphan() methods of several GEOM classes to not assume that there is an error set on the provider. With GEOM resizing, class can become orphaned when it doesn't implement resize() method and the provider size decreases. Modified: stable/9/sys/geom/bde/g_bde.c stable/9/sys/geom/geom_aes.c stable/9/sys/geom/geom_slice.c stable/9/sys/geom/uncompress/g_uncompress.c stable/9/sys/geom/uzip/g_uzip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/bde/g_bde.c ============================================================================== --- stable/9/sys/geom/bde/g_bde.c Fri Apr 5 10:30:37 2013 (r249147) +++ stable/9/sys/geom/bde/g_bde.c Fri Apr 5 10:35:36 2013 (r249148) @@ -77,19 +77,15 @@ g_bde_orphan(struct g_consumer *cp) struct g_geom *gp; struct g_provider *pp; struct g_bde_softc *sc; - int error; g_trace(G_T_TOPOLOGY, "g_bde_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_bde_orphan with error == 0")); gp = cp->geom; sc = gp->softc; gp->flags |= G_GEOM_WITHER; - error = cp->provider->error; LIST_FOREACH(pp, &gp->provider, provider) - g_orphan_provider(pp, error); + g_orphan_provider(pp, ENXIO); bzero(sc, sizeof(struct g_bde_softc)); /* destroy evidence */ return; } Modified: stable/9/sys/geom/geom_aes.c ============================================================================== --- stable/9/sys/geom/geom_aes.c Fri Apr 5 10:30:37 2013 (r249147) +++ stable/9/sys/geom/geom_aes.c Fri Apr 5 10:35:36 2013 (r249148) @@ -241,12 +241,10 @@ g_aes_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_aes_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_aes_orphan with error == 0")); gp = cp->geom; sc = gp->softc; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); bzero(sc, sizeof(struct g_aes_softc)); /* destroy evidence */ g_free(sc); return; Modified: stable/9/sys/geom/geom_slice.c ============================================================================== --- stable/9/sys/geom/geom_slice.c Fri Apr 5 10:30:37 2013 (r249147) +++ stable/9/sys/geom/geom_slice.c Fri Apr 5 10:35:36 2013 (r249148) @@ -522,10 +522,8 @@ g_slice_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_slice_orphan with error == 0")); /* XXX: Not good enough we leak the softc and its suballocations */ g_slice_free(cp->geom->softc); - g_wither_geom(cp->geom, cp->provider->error); + g_wither_geom(cp->geom, ENXIO); } Modified: stable/9/sys/geom/uncompress/g_uncompress.c ============================================================================== --- stable/9/sys/geom/uncompress/g_uncompress.c Fri Apr 5 10:30:37 2013 (r249147) +++ stable/9/sys/geom/uncompress/g_uncompress.c Fri Apr 5 10:35:36 2013 (r249148) @@ -406,13 +406,11 @@ g_uncompress_orphan(struct g_consumer *c g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_uncompress_orphan with error == 0")); gp = cp->geom; g_uncompress_softc_free(gp->softc, gp); gp->softc = NULL; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); } static int Modified: stable/9/sys/geom/uzip/g_uzip.c ============================================================================== --- stable/9/sys/geom/uzip/g_uzip.c Fri Apr 5 10:30:37 2013 (r249147) +++ stable/9/sys/geom/uzip/g_uzip.c Fri Apr 5 10:35:36 2013 (r249148) @@ -313,13 +313,11 @@ g_uzip_orphan(struct g_consumer *cp) g_trace(G_T_TOPOLOGY, "g_uzip_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); - KASSERT(cp->provider->error != 0, - ("g_uzip_orphan with error == 0")); gp = cp->geom; g_uzip_softc_free(gp->softc, gp); gp->softc = NULL; - g_wither_geom(gp, cp->provider->error); + g_wither_geom(gp, ENXIO); } static int From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:50:32 2013 Return-Path: Delivered-To: svn-src-stable@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 B3B63227; Fri, 5 Apr 2013 10:50:32 +0000 (UTC) (envelope-from mav@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 A60B8EA7; Fri, 5 Apr 2013 10:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35AoWoJ047197; Fri, 5 Apr 2013 10:50:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35AoWGN047196; Fri, 5 Apr 2013 10:50:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051050.r35AoWGN047196@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249149 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:50:32 -0000 Author: mav Date: Fri Apr 5 10:50:32 2013 New Revision: 249149 URL: http://svnweb.freebsd.org/changeset/base/249149 Log: MFC r240822, r241022 (by pjd): Use the topology lock to protect list of providers while withering them. It is possible that provider is destroyed while we are iterating over the list. Remove the topology lock from disk_gone(), it might be called with regular mutexes held and the topology lock is an sx lock. The topology lock was there to protect traversing through the list of providers of disk's geom, but it seems that disk's geom has always exactly one provider. Change the code to call g_wither_provider() for this one provider, which is safe to do without holding the topology lock and assert that there is indeed only one provider. Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Fri Apr 5 10:35:36 2013 (r249148) +++ stable/9/sys/geom/geom_disk.c Fri Apr 5 10:50:32 2013 (r249149) @@ -627,9 +627,14 @@ disk_gone(struct disk *dp) struct g_provider *pp; gp = dp->d_geom; - if (gp != NULL) - LIST_FOREACH(pp, &gp->provider, provider) + if (gp != NULL) { + pp = LIST_FIRST(&gp->provider); + if (pp != NULL) { + KASSERT(LIST_NEXT(pp, provider) == NULL, + ("geom %p has more than one provider", gp)); g_wither_provider(pp, ENXIO); + } + } } void From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 10:57:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 821FB3C9; Fri, 5 Apr 2013 10:57:03 +0000 (UTC) (envelope-from mav@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 74926EC6; Fri, 5 Apr 2013 10:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35Av3j2048285; Fri, 5 Apr 2013 10:57:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35Av3oS048284; Fri, 5 Apr 2013 10:57:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051057.r35Av3oS048284@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 10:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249150 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 10:57:03 -0000 Author: mav Date: Fri Apr 5 10:57:02 2013 New Revision: 249150 URL: http://svnweb.freebsd.org/changeset/base/249150 Log: MFC r244716 (by pjd): Reset provider-specific fields when resending I/O request in low memory conditions. This fixes assertion which checks those fields when kernel is compiled with DIAGNOSTIC. Modified: stable/9/sys/geom/geom_io.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_io.c ============================================================================== --- stable/9/sys/geom/geom_io.c Fri Apr 5 10:50:32 2013 (r249149) +++ stable/9/sys/geom/geom_io.c Fri Apr 5 10:57:02 2013 (r249150) @@ -565,6 +565,9 @@ g_io_deliver(struct bio *bp, int error) printf("ENOMEM %p on %p(%s)\n", bp, pp, pp->name); bp->bio_children = 0; bp->bio_inbed = 0; + bp->bio_driver1 = NULL; + bp->bio_driver2 = NULL; + bp->bio_pflags = 0; g_io_request(bp, cp); pace++; return; From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:41:59 2013 Return-Path: Delivered-To: svn-src-stable@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 CA153C56; Fri, 5 Apr 2013 11:41:59 +0000 (UTC) (envelope-from mav@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 BB681EB; Fri, 5 Apr 2013 11:41: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 r35BfxA0062445; Fri, 5 Apr 2013 11:41:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35Bfui1062429; Fri, 5 Apr 2013 11:41:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051141.r35Bfui1062429@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:41:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249152 - in stable/9/sys: cam cam/ata cam/scsi geom geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:41:59 -0000 Author: mav Date: Fri Apr 5 11:41:56 2013 New Revision: 249152 URL: http://svnweb.freebsd.org/changeset/base/249152 Log: MFC r238886, r238892: Implement media change notification for DA and CD removable media devices. It includes three parts: 1) Modifications to CAM to detect media media changes and report them to disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes Asynchronous Notification mechanism to receive events from hardware. Active polling with TEST UNIT READY commands with 3 seconds period is used for incapable hardware. After that both CD and DA drivers work the same way, detecting two conditions: "NOT READY: Medium not present" after medium was detected previously, and "UNIT ATTENTION: Not ready to ready change, medium may have changed". First one reported to disk(9) as media removal, second as media insert/change. To reliably receive second event new AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by generic error handling code in cam_periph_error(). 2) Modifications to GEOM core to handle media remove and change events. Media removal handled by spoiling all consumers attached to the provider. Media change event also schedules provider retaste after spoiling to probe new media. New flag G_CF_ORPHAN was added to consumers to reflect that consumer is in process of destruction. It allows retaste to create new geom instance of the same class, while previous one is still dying. 3) Modifications to some GEOM classes: DEV -- to report media change events to devd; PART class already handles spoiling alike to orphan. Modified: stable/9/sys/cam/ata/ata_all.h stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_ccb.h stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/geom/geom.h stable/9/sys/geom/geom_dev.c stable/9/sys/geom/geom_disk.c stable/9/sys/geom/geom_disk.h stable/9/sys/geom/geom_event.c stable/9/sys/geom/geom_io.c stable/9/sys/geom/geom_slice.c stable/9/sys/geom/geom_subr.c stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.h ============================================================================== --- stable/9/sys/cam/ata/ata_all.h Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/ata/ata_all.h Fri Apr 5 11:41:56 2013 (r249152) @@ -35,6 +35,7 @@ struct ccb_ataio; struct cam_periph; union ccb; +#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ #define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ struct ata_cmd { Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/ata/ata_xpt.c Fri Apr 5 11:41:56 2013 (r249152) @@ -463,6 +463,12 @@ negotiate: 0, 0x02); break; case PROBE_SETAN: + /* Remember what transport thinks about AEN. */ + if (softc->caps & CTS_SATA_CAPS_H_AN) + path->device->inq_flags |= SID_AEN; + else + path->device->inq_flags &= ~SID_AEN; + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -1157,6 +1163,12 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; + /* Remember what transport thinks about AEN. */ + if (softc->caps & CTS_SATA_CAPS_H_AN) + path->device->inq_flags |= SID_AEN; + else + path->device->inq_flags &= ~SID_AEN; + xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/cam_ccb.h Fri Apr 5 11:41:56 2013 (r249152) @@ -755,6 +755,7 @@ struct ccb_relsim { * Definitions for the asynchronous callback CCB fields. */ typedef enum { + AC_UNIT_ATTENTION = 0x4000,/* Device reported UNIT ATTENTION */ AC_ADVINFO_CHANGED = 0x2000,/* Advance info might have changes */ AC_CONTRACT = 0x1000,/* A contractual callback */ AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */ Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/cam_periph.c Fri Apr 5 11:41:56 2013 (r249152) @@ -1604,6 +1604,7 @@ cam_periph_error(union ccb *ccb, cam_fla const char *action_string; cam_status status; int frozen, error, openings, print, lost_device; + int error_code, sense_key, asc, ascq; u_int32_t relsim_flags, timeout; print = 1; @@ -1770,6 +1771,12 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_async(AC_LOST_DEVICE, newpath, NULL); xpt_free_path(newpath); } + + /* Broadcast UNIT ATTENTIONs to all periphs. */ + } else if (scsi_extract_sense_ccb(ccb, + &error_code, &sense_key, &asc, &ascq) && + sense_key == SSD_KEY_UNIT_ATTENTION) { + xpt_async(AC_UNIT_ATTENTION, orig_ccb->ccb_h.path, orig_ccb); } /* Attempt a retry */ Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/cam_xpt.c Fri Apr 5 11:41:56 2013 (r249152) @@ -4053,6 +4053,7 @@ xpt_async_string(u_int32_t async_code) case AC_GETDEV_CHANGED: return ("AC_GETDEV_CHANGED"); case AC_CONTRACT: return ("AC_CONTRACT"); case AC_ADVINFO_CHANGED: return ("AC_ADVINFO_CHANGED"); + case AC_UNIT_ATTENTION: return ("AC_UNIT_ATTENTION"); } return ("AC_UNKNOWN"); } Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 11:41:56 2013 (r249152) @@ -97,6 +97,7 @@ typedef enum { CD_FLAG_NEW_DISC = 0x0002, CD_FLAG_DISC_LOCKED = 0x0004, CD_FLAG_DISC_REMOVABLE = 0x0008, + CD_FLAG_SAW_MEDIA = 0x0010, CD_FLAG_CHANGER = 0x0040, CD_FLAG_ACTIVE = 0x0080, CD_FLAG_SCHED_ON_COMP = 0x0100, @@ -110,6 +111,7 @@ typedef enum { CD_CCB_PROBE = 0x01, CD_CCB_BUFFER_IO = 0x02, CD_CCB_WAITING = 0x03, + CD_CCB_TUR = 0x04, CD_CCB_TYPE_MASK = 0x0F, CD_CCB_RETRY_UA = 0x10 } cd_ccb_state; @@ -154,12 +156,14 @@ struct cd_softc { struct cam_periph *periph; int minimum_command_size; int outstanding_cmds; + int tur; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; STAILQ_HEAD(, cd_mode_params) mode_queue; struct cd_tocdata toc; struct disk *disk; + struct callout mediapoll_c; }; struct cd_page_sizes { @@ -281,6 +285,7 @@ static int cdsendkey(struct cam_periph struct dvd_authinfo *authinfo); static int cdreaddvdstructure(struct cam_periph *periph, struct dvd_struct *dvdstruct); +static timeout_t cdmediapoll; static struct periph_driver cddriver = { @@ -290,6 +295,9 @@ static struct periph_driver cddriver = PERIPHDRIVER_DECLARE(cd, cddriver); +#ifndef CD_DEFAULT_POLL_PERIOD +#define CD_DEFAULT_POLL_PERIOD 3 +#endif #ifndef CD_DEFAULT_RETRY #define CD_DEFAULT_RETRY 4 #endif @@ -303,6 +311,7 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #define CHANGER_MAX_BUSY_SECONDS 15 #endif +static int cd_poll_period = CD_DEFAULT_POLL_PERIOD; static int cd_retry_count = CD_DEFAULT_RETRY; static int cd_timeout = CD_DEFAULT_TIMEOUT; static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; @@ -311,6 +320,9 @@ static int changer_max_busy_seconds = CH static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, "CD Changer"); +SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW, + &cd_poll_period, 0, "Media polling period in seconds"); +TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period); SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW, &cd_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count); @@ -494,6 +506,7 @@ cdcleanup(struct cam_periph *periph) xpt_print(periph->path, "can't remove sysctl context\n"); } + callout_drain(&softc->mediapoll_c); disk_destroy(softc->disk); free(softc, M_DEVBUF); cam_periph_lock(periph); @@ -504,6 +517,7 @@ cdasync(void *callback_arg, u_int32_t co struct cam_path *path, void *arg) { struct cam_periph *periph; + struct cd_softc *softc; periph = (struct cam_periph *)callback_arg; switch (code) { @@ -541,10 +555,39 @@ cdasync(void *callback_arg, u_int32_t co break; } + case AC_UNIT_ATTENTION: + { + union ccb *ccb; + int error_code, sense_key, asc, ascq; + + softc = (struct cd_softc *)periph->softc; + ccb = (union ccb *)arg; + + /* + * Handle all media change UNIT ATTENTIONs except + * our own, as they will be handled by cderror(). + */ + if (xpt_path_periph(ccb->ccb_h.path) != periph && + scsi_extract_sense_ccb(ccb, + &error_code, &sense_key, &asc, &ascq)) { + if (asc == 0x28 && ascq == 0x00) + disk_media_changed(softc->disk, M_NOWAIT); + } + cam_periph_async(periph, code, path, arg); + break; + } + case AC_SCSI_AEN: + softc = (struct cd_softc *)periph->softc; + if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + softc->tur = 1; + xpt_schedule(periph, CAM_PRIORITY_DEV); + } + } + /* FALLTHROUGH */ case AC_SENT_BDR: case AC_BUS_RESET: { - struct cd_softc *softc; struct ccb_hdr *ccbh; softc = (struct cd_softc *)periph->softc; @@ -784,8 +827,8 @@ cdregister(struct cam_periph *periph, vo * Add an async callback so that we get * notified if this device goes away. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - cdasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_SCSI_AEN | AC_UNIT_ATTENTION, cdasync, periph, periph->path); /* * If the target lun is greater than 0, we most likely have a CD @@ -1001,6 +1044,17 @@ cdregister(struct cam_periph *periph, vo } } + /* + * Schedule a periodic media polling events. + */ + callout_init_mtx(&softc->mediapoll_c, periph->sim->mtx, 0); + if ((softc->flags & CD_FLAG_DISC_REMOVABLE) && + (softc->flags & CD_FLAG_CHANGER) == 0 && + (cgd->inq_flags & SID_AEN) == 0 && + cd_poll_period != 0) + callout_reset(&softc->mediapoll_c, cd_poll_period * hz, + cdmediapoll, periph); + cdregisterexit: if ((softc->flags & CD_FLAG_CHANGER) == 0) @@ -1496,8 +1550,25 @@ cdstart(struct cam_periph *periph, union periph->immediate_priority = CAM_PRIORITY_NONE; wakeup(&periph->ccb_list); } else if (bp == NULL) { - xpt_release_ccb(start_ccb); + if (softc->tur) { + softc->tur = 0; + csio = &start_ccb->csio; + scsi_test_unit_ready(csio, + /*retries*/ cd_retry_count, + cddone, + MSG_SIMPLE_Q_TAG, + SSD_FULL_SIZE, + cd_timeout); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = CD_CCB_TUR; + xpt_action(start_ccb); + } else + xpt_release_ccb(start_ccb); } else { + if (softc->tur) { + softc->tur = 0; + cam_periph_release_locked(periph); + } bioq_remove(&softc->bio_queue, bp); scsi_read_write(&start_ccb->csio, @@ -1541,7 +1612,7 @@ cdstart(struct cam_periph *periph, union xpt_action(start_ccb); } - if (bp != NULL) { + if (bp != NULL || softc->tur) { /* Have more work to do, so ensure we stay scheduled */ xpt_schedule(periph, CAM_PRIORITY_NORMAL); } @@ -1835,6 +1906,25 @@ cddone(struct cam_periph *periph, union wakeup(&done_ccb->ccb_h.cbfcnp); return; } + case CD_CCB_TUR: + { + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + + if (cderror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_RECOVERY | SF_NO_PRINT) == + ERESTART) + return; + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + xpt_release_ccb(done_ccb); + cam_periph_release_locked(periph); + return; + } default: break; } @@ -2826,7 +2916,7 @@ cdcheckmedia(struct cam_periph *periph) cdprevent(periph, PR_ALLOW); return (error); } else { - softc->flags |= CD_FLAG_VALID_MEDIA; + softc->flags |= CD_FLAG_SAW_MEDIA | CD_FLAG_VALID_MEDIA; softc->disk->d_sectorsize = softc->params.blksize; softc->disk->d_mediasize = (off_t)softc->params.blksize * softc->params.disksize; @@ -3171,6 +3261,14 @@ cderror(union ccb *ccb, u_int32_t cam_fl &error_code, &sense_key, &asc, &ascq)) { if (sense_key == SSD_KEY_ILLEGAL_REQUEST) error = cd6byteworkaround(ccb); + else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x28 && ascq == 0x00) + disk_media_changed(softc->disk, M_NOWAIT); + else if (sense_key == SSD_KEY_NOT_READY && + asc == 0x3a && (softc->flags & CD_FLAG_SAW_MEDIA)) { + softc->flags &= ~CD_FLAG_SAW_MEDIA; + disk_media_gone(softc->disk, M_NOWAIT); + } } if (error == ERESTART) @@ -3186,6 +3284,26 @@ cderror(union ccb *ccb, u_int32_t cam_fl &softc->saved_ccb)); } +static void +cdmediapoll(void *arg) +{ + struct cam_periph *periph = arg; + struct cd_softc *softc = periph->softc; + + if (softc->flags & CD_FLAG_CHANGER) + return; + + if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + softc->tur = 1; + xpt_schedule(periph, CAM_PRIORITY_DEV); + } + } + /* Queue us up again */ + if (cd_poll_period != 0) + callout_schedule(&softc->mediapoll_c, cd_poll_period * hz); +} + /* * Read table of contents */ Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:41:56 2013 (r249152) @@ -77,6 +77,7 @@ typedef enum { DA_FLAG_NEW_PACK = 0x002, DA_FLAG_PACK_LOCKED = 0x004, DA_FLAG_PACK_REMOVABLE = 0x008, + DA_FLAG_SAW_MEDIA = 0x010, DA_FLAG_NEED_OTAG = 0x020, DA_FLAG_WENT_IDLE = 0x040, DA_FLAG_RETRY_UA = 0x080, @@ -101,6 +102,7 @@ typedef enum { DA_CCB_WAITING = 0x04, DA_CCB_DUMP = 0x05, DA_CCB_DELETE = 0x06, + DA_CCB_TUR = 0x07, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; @@ -150,6 +152,7 @@ struct da_softc { int unmap_max_ranges; int unmap_max_lba; int delete_running; + int tur; da_delete_methods delete_method; struct disk_params params; struct disk *disk; @@ -161,6 +164,7 @@ struct da_softc { uint64_t wwpn; uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; struct scsi_read_capacity_data_long rcaplong; + struct callout mediapoll_c; }; struct da_quirk_entry { @@ -875,6 +879,11 @@ static void dasetgeom(struct cam_periph size_t rcap_size); static timeout_t dasendorderedtag; static void dashutdown(void *arg, int howto); +static timeout_t damediapoll; + +#ifndef DA_DEFAULT_POLL_PERIOD +#define DA_DEFAULT_POLL_PERIOD 3 +#endif #ifndef DA_DEFAULT_TIMEOUT #define DA_DEFAULT_TIMEOUT 60 /* Timeout in seconds */ @@ -889,12 +898,16 @@ static void dashutdown(void *arg, int h #endif +static int da_poll_period = DA_DEFAULT_POLL_PERIOD; static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); +SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RW, + &da_poll_period, 0, "Media polling period in seconds"); +TUNABLE_INT("kern.cam.da.poll_period", &da_poll_period); SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, &da_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count); @@ -984,6 +997,9 @@ daopen(struct disk *dp) (softc->quirks & DA_Q_NO_PREVENT) == 0) daprevent(periph, PR_PREVENT); + if (error == 0) + softc->flags |= DA_FLAG_SAW_MEDIA; + cam_periph_unhold(periph); cam_periph_unlock(periph); @@ -1068,7 +1084,8 @@ daschedule(struct cam_periph *periph) /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || - (!softc->delete_running && bioq_first(&softc->delete_queue))) { + (!softc->delete_running && bioq_first(&softc->delete_queue)) || + softc->tur) { prio = CAM_PRIORITY_NORMAL; } @@ -1315,6 +1332,7 @@ dacleanup(struct cam_periph *periph) xpt_print(periph->path, "can't remove sysctl context\n"); } + callout_drain(&softc->mediapoll_c); disk_destroy(softc->disk); callout_drain(&softc->sendordered_c); free(softc, M_DEVBUF); @@ -1326,6 +1344,7 @@ daasync(void *callback_arg, u_int32_t co struct cam_path *path, void *arg) { struct cam_periph *periph; + struct da_softc *softc; periph = (struct cam_periph *)callback_arg; switch (code) { @@ -1377,10 +1396,43 @@ daasync(void *callback_arg, u_int32_t co } break; } + case AC_UNIT_ATTENTION: + { + union ccb *ccb; + int error_code, sense_key, asc, ascq; + + softc = (struct da_softc *)periph->softc; + ccb = (union ccb *)arg; + + /* + * Handle all UNIT ATTENTIONs except our own, + * as they will be handled by daerror(). + */ + if (xpt_path_periph(ccb->ccb_h.path) != periph && + scsi_extract_sense_ccb(ccb, + &error_code, &sense_key, &asc, &ascq)) { + if (asc == 0x2A && ascq == 0x09) { + xpt_print(ccb->ccb_h.path, + "capacity data has changed\n"); + dareprobe(periph); + } else if (asc == 0x28 && ascq == 0x00) + disk_media_changed(softc->disk, M_NOWAIT); + } + cam_periph_async(periph, code, path, arg); + break; + } + case AC_SCSI_AEN: + softc = (struct da_softc *)periph->softc; + if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + softc->tur = 1; + xpt_schedule(periph, CAM_PRIORITY_DEV); + } + } + /* FALLTHROUGH */ case AC_SENT_BDR: case AC_BUS_RESET: { - struct da_softc *softc; struct ccb_hdr *ccbh; softc = (struct da_softc *)periph->softc; @@ -1711,9 +1763,9 @@ daregister(struct cam_periph *periph, vo * fine without them and the only alternative * would be to not attach the device on failure. */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET - | AC_LOST_DEVICE | AC_ADVINFO_CHANGED, - daasync, periph, periph->path); + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE | + AC_ADVINFO_CHANGED | AC_SCSI_AEN | AC_UNIT_ATTENTION, + daasync, periph, periph->path); /* * Emit an attribute changed notification just in case @@ -1723,6 +1775,16 @@ daregister(struct cam_periph *periph, vo */ disk_attr_changed(softc->disk, "GEOM::physpath", M_NOWAIT); + /* + * Schedule a periodic media polling events. + */ + callout_init_mtx(&softc->mediapoll_c, periph->sim->mtx, 0); + if ((softc->flags & DA_FLAG_PACK_REMOVABLE) && + (cgd->inq_flags & SID_AEN) == 0 && + da_poll_period != 0) + callout_reset(&softc->mediapoll_c, da_poll_period * hz, + damediapoll, periph); + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); @@ -1860,9 +1922,25 @@ dastart(struct cam_periph *periph, union /* Run regular command. */ bp = bioq_takefirst(&softc->bio_queue); if (bp == NULL) { - xpt_release_ccb(start_ccb); + if (softc->tur) { + softc->tur = 0; + scsi_test_unit_ready(&start_ccb->csio, + /*retries*/ da_retry_count, + dadone, + MSG_SIMPLE_Q_TAG, + SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_bp = NULL; + start_ccb->ccb_h.ccb_state = DA_CCB_TUR; + xpt_action(start_ccb); + } else + xpt_release_ccb(start_ccb); break; } + if (softc->tur) { + softc->tur = 0; + cam_periph_release_locked(periph); + } if ((bp->bio_flags & BIO_ORDERED) != 0 || (softc->flags & DA_FLAG_NEED_OTAG) != 0) { @@ -2429,6 +2507,25 @@ dadone(struct cam_periph *periph, union case DA_CCB_DUMP: /* No-op. We're polling */ return; + case DA_CCB_TUR: + { + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + + if (daerror(done_ccb, CAM_RETRY_SELTO, + SF_RETRY_UA | SF_NO_RECOVERY | SF_NO_PRINT) == + ERESTART) + return; + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + xpt_release_ccb(done_ccb); + cam_periph_release_locked(periph); + return; + } default: break; } @@ -2489,6 +2586,13 @@ daerror(union ccb *ccb, u_int32_t cam_fl xpt_print(periph->path, "capacity data has changed\n"); dareprobe(periph); sense_flags |= SF_NO_PRINT; + } else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x28 && ascq == 0x00) + disk_media_changed(softc->disk, M_NOWAIT); + else if (sense_key == SSD_KEY_NOT_READY && + asc == 0x3a && (softc->flags & DA_FLAG_SAW_MEDIA)) { + softc->flags &= ~DA_FLAG_SAW_MEDIA; + disk_media_gone(softc->disk, M_NOWAIT); } } if (error == ERESTART) @@ -2505,6 +2609,23 @@ daerror(union ccb *ccb, u_int32_t cam_fl } static void +damediapoll(void *arg) +{ + struct cam_periph *periph = arg; + struct da_softc *softc = periph->softc; + + if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + softc->tur = 1; + daschedule(periph); + } + } + /* Queue us up again */ + if (da_poll_period != 0) + callout_schedule(&softc->mediapoll_c, da_poll_period * hz); +} + +static void daprevent(struct cam_periph *periph, int action) { struct da_softc *softc; Modified: stable/9/sys/geom/geom.h ============================================================================== --- stable/9/sys/geom/geom.h Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom.h Fri Apr 5 11:41:56 2013 (r249152) @@ -169,7 +169,9 @@ struct g_consumer { struct g_provider *provider; LIST_ENTRY(g_consumer) consumers; /* XXX: better name */ int acr, acw, ace; - int spoiled; + int flags; +#define G_CF_SPOILED 0x1 +#define G_CF_ORPHAN 0x4 struct devstat *stat; u_int nstart, nend; @@ -242,6 +244,8 @@ int g_post_event(g_event_t *func, void * int g_waitfor_event(g_event_t *func, void *arg, int flag, ...); void g_cancel_event(void *ref); int g_attr_changed(struct g_provider *pp, const char *attr, int flag); +int g_media_changed(struct g_provider *pp, int flag); +int g_media_gone(struct g_provider *pp, int flag); void g_orphan_provider(struct g_provider *pp, int error); void g_waitidlelock(void); Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_dev.c Fri Apr 5 11:41:56 2013 (r249152) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -105,6 +106,21 @@ g_dev_print(void) static void g_dev_attrchanged(struct g_consumer *cp, const char *attr) { + struct cdev *dev; + char buf[SPECNAMELEN + 6]; + + if (strcmp(attr, "GEOM::media") == 0) { + dev = cp->geom->softc; + snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); + devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); + dev = cp->cp_alias_dev; + if (dev != NULL) { + snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); + devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, + M_WAITOK); + } + return; + } if (strcmp(attr, "GEOM::physpath") != 0) return; @@ -119,7 +135,6 @@ g_dev_attrchanged(struct g_consumer *cp, g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); g_access(cp, -1, 0, 0); if (error == 0 && strlen(physpath) != 0) { - struct cdev *dev; struct cdev *old_alias_dev; struct cdev **alias_devp; @@ -161,9 +176,6 @@ g_dev_taste(struct g_class *mp, struct g g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); - LIST_FOREACH(cp, &pp->consumers, consumers) - if (cp->geom->class == mp) - return (NULL); gp = g_new_geomf(mp, "%s", pp->name); cp = g_new_consumer(gp); error = g_attach(cp, pp); Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_disk.c Fri Apr 5 11:41:56 2013 (r249152) @@ -649,6 +649,32 @@ disk_attr_changed(struct disk *dp, const (void)g_attr_changed(pp, attr, flag); } +void +disk_media_changed(struct disk *dp, int flag) +{ + struct g_geom *gp; + struct g_provider *pp; + + gp = dp->d_geom; + if (gp != NULL) { + LIST_FOREACH(pp, &gp->provider, provider) + g_media_changed(pp, flag); + } +} + +void +disk_media_gone(struct disk *dp, int flag) +{ + struct g_geom *gp; + struct g_provider *pp; + + gp = dp->d_geom; + if (gp != NULL) { + LIST_FOREACH(pp, &gp->provider, provider) + g_media_gone(pp, flag); + } +} + static void g_kern_disks(void *p, int flag __unused) { Modified: stable/9/sys/geom/geom_disk.h ============================================================================== --- stable/9/sys/geom/geom_disk.h Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_disk.h Fri Apr 5 11:41:56 2013 (r249152) @@ -112,6 +112,8 @@ void disk_create(struct disk *disk, int void disk_destroy(struct disk *disk); void disk_gone(struct disk *disk); void disk_attr_changed(struct disk *dp, const char *attr, int flag); +void disk_media_changed(struct disk *dp, int flag); +void disk_media_gone(struct disk *dp, int flag); #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a Modified: stable/9/sys/geom/geom_event.c ============================================================================== --- stable/9/sys/geom/geom_event.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_event.c Fri Apr 5 11:41:56 2013 (r249152) @@ -202,14 +202,12 @@ g_orphan_register(struct g_provider *pp) * Tell all consumers the bad news. * Don't be surprised if they self-destruct. */ - cp = LIST_FIRST(&pp->consumers); - while (cp != NULL) { - cp2 = LIST_NEXT(cp, consumers); + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { KASSERT(cp->geom->orphan != NULL, ("geom %s has no orphan, class %s", cp->geom->name, cp->geom->class->name)); + cp->flags |= G_CF_ORPHAN; cp->geom->orphan(cp); - cp = cp2; } if (LIST_EMPTY(&pp->consumers) && wf) g_destroy_provider(pp); Modified: stable/9/sys/geom/geom_io.c ============================================================================== --- stable/9/sys/geom/geom_io.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_io.c Fri Apr 5 11:41:56 2013 (r249152) @@ -311,6 +311,8 @@ g_io_check(struct bio *bp) /* if provider is marked for error, don't disturb. */ if (pp->error) return (pp->error); + if (cp->flags & G_CF_ORPHAN) + return (ENXIO); switch(bp->bio_cmd) { case BIO_READ: Modified: stable/9/sys/geom/geom_slice.c ============================================================================== --- stable/9/sys/geom/geom_slice.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_slice.c Fri Apr 5 11:41:56 2013 (r249152) @@ -465,6 +465,7 @@ g_slice_spoiled(struct g_consumer *cp) g_topology_assert(); gp = cp->geom; g_trace(G_T_TOPOLOGY, "g_slice_spoiled(%p/%s)", cp, gp->name); + cp->flags |= G_CF_ORPHAN; gsp = gp->softc; gp->softc = NULL; g_slice_free(gsp); Modified: stable/9/sys/geom/geom_subr.c ============================================================================== --- stable/9/sys/geom/geom_subr.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/geom_subr.c Fri Apr 5 11:41:56 2013 (r249152) @@ -260,10 +260,11 @@ g_modevent(module_t mod, int type, void static void g_retaste_event(void *arg, int flag) { - struct g_class *cp, *mp; - struct g_geom *gp, *gp2; + struct g_class *mp, *mp2; + struct g_geom *gp; struct g_hh00 *hh; struct g_provider *pp; + struct g_consumer *cp; g_topology_assert(); if (flag == EV_CANCEL) /* XXX: can't happen ? */ @@ -280,17 +281,20 @@ g_retaste_event(void *arg, int flag) } g_trace(G_T_TOPOLOGY, "g_retaste(%s)", mp->name); - LIST_FOREACH(cp, &g_classes, class) { - LIST_FOREACH(gp, &cp->geom, geom) { + LIST_FOREACH(mp2, &g_classes, class) { + LIST_FOREACH(gp, &mp2->geom, geom) { LIST_FOREACH(pp, &gp->provider, provider) { if (pp->acr || pp->acw || pp->ace) continue; - LIST_FOREACH(gp2, &mp->geom, geom) { - if (!strcmp(pp->name, gp2->name)) + LIST_FOREACH(cp, &pp->consumers, consumers) { + if (cp->geom->class == mp && + (cp->flags & G_CF_ORPHAN) == 0) break; } - if (gp2 != NULL) - g_wither_geom(gp2, ENXIO); + if (cp != NULL) { + cp->flags |= G_CF_ORPHAN; + g_wither_geom(cp->geom, ENXIO); + } mp->taste(mp, pp, 0); g_topology_assert(); } @@ -531,7 +535,7 @@ g_new_provider_event(void *arg, int flag { struct g_class *mp; struct g_provider *pp; - struct g_consumer *cp; + struct g_consumer *cp, *next_cp; g_topology_assert(); if (flag == EV_CANCEL) @@ -542,11 +546,17 @@ g_new_provider_event(void *arg, int flag G_VALID_PROVIDER(pp); KASSERT(!(pp->flags & G_PF_WITHER), ("g_new_provider_event but withered")); + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, next_cp) { + if ((cp->flags & G_CF_ORPHAN) == 0 && + cp->geom->attrchanged != NULL) + cp->geom->attrchanged(cp, "GEOM::media"); + } LIST_FOREACH(mp, &g_classes, class) { if (mp->taste == NULL) continue; LIST_FOREACH(cp, &pp->consumers, consumers) - if (cp->geom->class == mp) + if (cp->geom->class == mp && + (cp->flags & G_CF_ORPHAN) == 0) break; if (cp != NULL) continue; @@ -803,7 +813,7 @@ g_access(struct g_consumer *cp, int dcr, * are probably just ahead of the event telling us that. Fail * now rather than having to unravel this later. */ - if (cp->geom->spoiled != NULL && cp->spoiled && + if (cp->geom->spoiled != NULL && (cp->flags & G_CF_SPOILED) && (dcr > 0 || dcw > 0 || dce > 0)) return (ENXIO); @@ -953,6 +963,7 @@ g_std_spoiled(struct g_consumer *cp) g_topology_assert(); G_VALID_CONSUMER(cp); g_trace(G_T_TOPOLOGY, "g_std_spoiled(%p)", cp); + cp->flags |= G_CF_ORPHAN; g_detach(cp); gp = cp->geom; LIST_FOREACH(pp, &gp->provider, provider) @@ -988,9 +999,9 @@ g_spoil_event(void *arg, int flag) G_VALID_PROVIDER(pp); for (cp = LIST_FIRST(&pp->consumers); cp != NULL; cp = cp2) { cp2 = LIST_NEXT(cp, consumers); - if (!cp->spoiled) + if ((cp->flags & G_CF_SPOILED) == 0) continue; - cp->spoiled = 0; + cp->flags &= ~G_CF_SPOILED; if (cp->geom->spoiled == NULL) continue; cp->geom->spoiled(cp); @@ -1015,11 +1026,54 @@ g_spoil(struct g_provider *pp, struct g_ KASSERT(cp2->acw == 0, ("spoiling cp->acw = %d", cp2->acw)); */ KASSERT(cp2->ace == 0, ("spoiling cp->ace = %d", cp2->ace)); - cp2->spoiled++; + cp2->flags |= G_CF_SPOILED; } g_post_event(g_spoil_event, pp, M_WAITOK, pp, NULL); } +static void +g_media_changed_event(void *arg, int flag) +{ + struct g_provider *pp; + int retaste; + + g_topology_assert(); + if (flag == EV_CANCEL) + return; + pp = arg; + G_VALID_PROVIDER(pp); + + /* + * If provider was not open for writing, queue retaste after spoiling. + * If it was, retaste will happen automatically on close. + */ + retaste = (pp->acw == 0 && pp->error == 0 && + !(pp->geom->flags & G_GEOM_WITHER)); + g_spoil_event(arg, flag); + if (retaste) + g_post_event(g_new_provider_event, pp, M_WAITOK, pp, NULL); +} + +int +g_media_changed(struct g_provider *pp, int flag) +{ + struct g_consumer *cp; + + LIST_FOREACH(cp, &pp->consumers, consumers) + cp->flags |= G_CF_SPOILED; + return (g_post_event(g_media_changed_event, pp, flag, pp, NULL)); +} + +int +g_media_gone(struct g_provider *pp, int flag) +{ + struct g_consumer *cp; + + LIST_FOREACH(cp, &pp->consumers, consumers) + cp->flags |= G_CF_SPOILED; + return (g_post_event(g_spoil_event, pp, flag, pp, NULL)); +} + int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len) { @@ -1175,15 +1229,15 @@ db_show_geom_consumer(int indent, struct cp->provider); } gprintln(" access: r%dw%de%d", cp->acr, cp->acw, cp->ace); - gprintln(" spoiled: %d", cp->spoiled); + gprintln(" flags: 0x%04x", cp->flags); gprintln(" nstart: %u", cp->nstart); gprintln(" nend: %u", cp->nend); } else { gprintf("consumer: %p (%s), access=r%dw%de%d", cp, cp->provider != NULL ? cp->provider->name : "none", cp->acr, cp->acw, cp->ace); - if (cp->spoiled) - db_printf(", spoiled=%d", cp->spoiled); + if (cp->flags) + db_printf(", flags=0x%04x", cp->flags); db_printf("\n"); } } Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Fri Apr 5 11:30:31 2013 (r249151) +++ stable/9/sys/geom/part/g_part.c Fri Apr 5 11:41:56 2013 (r249152) @@ -2055,6 +2055,7 @@ g_part_spoiled(struct g_consumer *cp) G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, cp->provider->name)); g_topology_assert(); + cp->flags |= G_CF_ORPHAN; g_part_wither(cp->geom, ENXIO); } From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:45:52 2013 Return-Path: Delivered-To: svn-src-stable@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 9E2F0F6D; Fri, 5 Apr 2013 11:45:52 +0000 (UTC) (envelope-from mav@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 8EDE7110; Fri, 5 Apr 2013 11:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BjqZK063133; Fri, 5 Apr 2013 11:45:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BjqBE063132; Fri, 5 Apr 2013 11:45:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051145.r35BjqBE063132@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249154 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:45:52 -0000 Author: mav Date: Fri Apr 5 11:45:52 2013 New Revision: 249154 URL: http://svnweb.freebsd.org/changeset/base/249154 Log: MFC r245251 (by smh): Removes essentially unused variables from scsi_da probe setups PR: kern/169835 Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:42:28 2013 (r249153) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:45:52 2013 (r249154) @@ -2014,7 +2014,6 @@ out: } case DA_STATE_PROBE: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data *rcap; rcap = (struct scsi_read_capacity_data *) @@ -2024,8 +2023,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity(csio, + scsi_read_capacity(&start_ccb->csio, /*retries*/4, dadone, MSG_SIMPLE_Q_TAG, @@ -2039,7 +2037,6 @@ out: } case DA_STATE_PROBE2: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data_long *rcaplong; rcaplong = (struct scsi_read_capacity_data_long *) @@ -2049,8 +2046,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity_16(csio, + scsi_read_capacity_16(&start_ccb->csio, /*retries*/ 4, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:48:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3B88183; Fri, 5 Apr 2013 11:48:35 +0000 (UTC) (envelope-from mav@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 95E91121; Fri, 5 Apr 2013 11:48:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BmZZ1063543; Fri, 5 Apr 2013 11:48:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BmZGa063542; Fri, 5 Apr 2013 11:48:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051148.r35BmZGa063542@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249155 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:48:35 -0000 Author: mav Date: Fri Apr 5 11:48:35 2013 New Revision: 249155 URL: http://svnweb.freebsd.org/changeset/base/249155 Log: MFC r245252 (by smh): Updates delete_method sysctl changes to always maintain disk d_flags DISKFLAG_CANDELETE. While this change makes this layer consistent other layers such as UFS and ZFS BIO_DELETE support may not notice any change made manually via these device sysctls until the device is reopened via a mount. Also corrected var order in dadeletemethodsysctl PR: kern/169801 Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:45:52 2013 (r249154) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:48:35 2013 (r249155) @@ -863,6 +863,8 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemethodset(struct da_softc *softc, + da_delete_methods delete_method); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -1489,7 +1491,7 @@ dasysctlinit(void *context, int pending) */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, - &softc->delete_method, 0, dadeletemethodsysctl, "A", + softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, @@ -1566,14 +1568,33 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) } static int +dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method) +{ + + if (delete_method < 0 || delete_method > DA_DELETE_MAX) + return (EINVAL); + + softc->delete_method = delete_method; + + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; + + return (0); +} + +static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) { char buf[16]; - int error; const char *p; - int i, value; + struct da_softc *softc; + int i, error, value; - value = *(int *)arg1; + softc = (struct da_softc *)arg1; + + value = softc->delete_method; if (value < 0 || value > DA_DELETE_MAX) p = "UNKNOWN"; else @@ -1585,8 +1606,7 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) != 0) continue; - *(int *)arg1 = i; - return (0); + return dadeletemethodset(softc, i); } return (EINVAL); } @@ -2081,24 +2101,24 @@ cmd6workaround(union ccb *ccb) if (softc->delete_method == DA_DELETE_UNMAP) { xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " "switching to WRITE SAME(16) with UNMAP.\n"); - softc->delete_method = DA_DELETE_WS16; + dadeletemethodset(softc, DA_DELETE_WS16); } else if (softc->delete_method == DA_DELETE_WS16) { xpt_print(ccb->ccb_h.path, "WRITE SAME(16) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_WS10) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_ZERO) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); while ((bp = bioq_takefirst(&softc->delete_run_queue)) != NULL) bioq_disksort(&softc->delete_queue, bp); @@ -2344,7 +2364,7 @@ dadone(struct cam_periph *periph, union rcaplong, sizeof(*rcaplong)); if ((lalba & SRC16_LBPME_A) && softc->delete_method == DA_DELETE_NONE) - softc->delete_method = DA_DELETE_UNMAP; + dadeletemethodset(softc, DA_DELETE_UNMAP); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:50:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE502301; Fri, 5 Apr 2013 11:50:05 +0000 (UTC) (envelope-from mav@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 C109512F; Fri, 5 Apr 2013 11:50:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35Bo59E063824; Fri, 5 Apr 2013 11:50:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35Bo5sT063823; Fri, 5 Apr 2013 11:50:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051150.r35Bo5sT063823@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249156 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:50:05 -0000 Author: mav Date: Fri Apr 5 11:50:05 2013 New Revision: 249156 URL: http://svnweb.freebsd.org/changeset/base/249156 Log: MFC r245253 (by smh): Changed scsi_da device requests to use the sysctl tunable value for retry_count and da_default_timeout where their current hardcoded values matched the current default value for said tunables. PR: kern/169976 Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:48:35 2013 (r249155) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:50:05 2013 (r249156) @@ -2044,7 +2044,7 @@ out: break; } scsi_read_capacity(&start_ccb->csio, - /*retries*/4, + /*retries*/da_retry_count, dadone, MSG_SIMPLE_Q_TAG, rcap, @@ -2067,7 +2067,7 @@ out: break; } scsi_read_capacity_16(&start_ccb->csio, - /*retries*/ 4, + /*retries*/ da_retry_count, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, /*lba*/ 0, @@ -2075,7 +2075,7 @@ out: /*pmi*/ 0, rcaplong, /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); + /*timeout*/ da_default_timeout * 1000); start_ccb->ccb_h.ccb_bp = NULL; start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2; xpt_action(start_ccb); From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:52:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F3D3249B; Fri, 5 Apr 2013 11:52:33 +0000 (UTC) (envelope-from mav@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 E6244145; Fri, 5 Apr 2013 11:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BqXjH065750; Fri, 5 Apr 2013 11:52:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BqXSR065749; Fri, 5 Apr 2013 11:52:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051152.r35BqXSR065749@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249157 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:52:34 -0000 Author: mav Date: Fri Apr 5 11:52:33 2013 New Revision: 249157 URL: http://svnweb.freebsd.org/changeset/base/249157 Log: MFC r245306: Do not schedule periph for payload/TUR requests if reprobe is in progress to avoid sending extra READ CAPACITY requests by dastart(). Schedule periph again on reprobe completion, or otherwise it may stuck indefinitely long. This should fix USB explore thread hanging on device unplug, waiting for periph destruction. Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:50:05 2013 (r249156) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:52:33 2013 (r249157) @@ -1081,6 +1081,9 @@ daschedule(struct cam_periph *periph) struct da_softc *softc = (struct da_softc *)periph->softc; uint32_t prio; + if (softc->state != DA_STATE_NORMAL) + return; + /* Check if cam_periph_getccb() was called. */ prio = periph->immediate_priority; @@ -1425,10 +1428,10 @@ daasync(void *callback_arg, u_int32_t co } case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (!softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + daschedule(periph); } } /* FALLTHROUGH */ @@ -2167,6 +2170,7 @@ dadone(struct cam_periph *periph, union struct da_softc *softc; struct ccb_scsiio *csio; u_int32_t priority; + da_ccb_state state; softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; @@ -2174,7 +2178,8 @@ dadone(struct cam_periph *periph, union CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); csio = &done_ccb->csio; - switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { + state = csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK; + switch (state) { case DA_CCB_BUFFER_IO: case DA_CCB_DELETE: { @@ -2272,8 +2277,7 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == - DA_CCB_DELETE) { + if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) { bp1->bio_resid = bp->bio_resid; @@ -2299,7 +2303,7 @@ dadone(struct cam_periph *periph, union rdcap = NULL; rcaplong = NULL; - if (softc->state == DA_STATE_PROBE) + if (state == DA_CCB_PROBE) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else rcaplong = (struct scsi_read_capacity_data_long *) @@ -2312,7 +2316,7 @@ dadone(struct cam_periph *periph, union u_int lbppbe; /* LB per physical block exponent. */ u_int lalba; /* Lowest aligned LBA. */ - if (softc->state == DA_STATE_PROBE) { + if (state == DA_CCB_PROBE) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); lbppbe = 0; @@ -2425,7 +2429,7 @@ dadone(struct cam_periph *periph, union * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). */ - if ((softc->state == DA_STATE_PROBE2) && + if ((state == DA_CCB_PROBE2) && (softc->flags & DA_FLAG_CAN_RC16) && (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || @@ -2505,7 +2509,8 @@ dadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - softc->state = DA_STATE_NORMAL; + softc->state = DA_STATE_NORMAL; + daschedule(periph); wakeup(&softc->disk->d_mediasize); if ((softc->flags & DA_FLAG_PROBED) == 0) { softc->flags |= DA_FLAG_PROBED; @@ -2630,7 +2635,7 @@ damediapoll(void *arg) struct cam_periph *periph = arg; struct da_softc *softc = periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (!softc->tur && softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; daschedule(periph); From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:53:54 2013 Return-Path: Delivered-To: svn-src-stable@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 61CF1608; Fri, 5 Apr 2013 11:53:54 +0000 (UTC) (envelope-from mav@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 52CEF151; Fri, 5 Apr 2013 11:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BrsKW065977; Fri, 5 Apr 2013 11:53:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BrsqC065976; Fri, 5 Apr 2013 11:53:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051153.r35BrsqC065976@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249158 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:53:54 -0000 Author: mav Date: Fri Apr 5 11:53:53 2013 New Revision: 249158 URL: http://svnweb.freebsd.org/changeset/base/249158 Log: MFC r245310: - Add missig xpt_schedule() call for cases when requested immediate CCB priority is lower then payload/TUR one. - Reduce TUR priority and avoid sending them if there are any other outstanding commands, alike to DA driver. Modified: stable/9/sys/cam/scsi/scsi_cd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 11:52:33 2013 (r249157) +++ stable/9/sys/cam/scsi/scsi_cd.c Fri Apr 5 11:53:53 2013 (r249158) @@ -581,7 +581,7 @@ cdasync(void *callback_arg, u_int32_t co if (softc->state == CD_STATE_NORMAL && !softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* FALLTHROUGH */ @@ -1612,9 +1612,11 @@ cdstart(struct cam_periph *periph, union xpt_action(start_ccb); } - if (bp != NULL || softc->tur) { + if (bp != NULL || softc->tur || + periph->immediate_priority != CAM_PRIORITY_NONE) { /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, min(CAM_PRIORITY_NORMAL, + periph->immediate_priority)); } break; } @@ -3293,10 +3295,11 @@ cdmediapoll(void *arg) if (softc->flags & CD_FLAG_CHANGER) return; - if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (softc->state == CD_STATE_NORMAL && !softc->tur && + softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* Queue us up again */ From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:55:53 2013 Return-Path: Delivered-To: svn-src-stable@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 309AA790; Fri, 5 Apr 2013 11:55:53 +0000 (UTC) (envelope-from mav@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 22EC5169; Fri, 5 Apr 2013 11:55:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BtrVd066342; Fri, 5 Apr 2013 11:55:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BtrFW066341; Fri, 5 Apr 2013 11:55:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051155.r35BtrFW066341@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249159 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:55:53 -0000 Author: mav Date: Fri Apr 5 11:55:52 2013 New Revision: 249159 URL: http://svnweb.freebsd.org/changeset/base/249159 Log: MFC r247154: Add DA_Q_NO_PREVENT quirk for Kingston DataTraveler G3 1.00 USB flash. PREVENT ALLOW MEDIUM REMOVAL commands return errors on these devices without returning sense data. In some cases unrelated following commands start to return errors too, that makes device to be dropped by CAM. Modified: stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:53:53 2013 (r249158) +++ stable/9/sys/cam/scsi/scsi_da.c Fri Apr 5 11:55:52 2013 (r249159) @@ -607,6 +607,10 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "Sony", "Sony DSC", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE | DA_Q_NO_PREVENT }, + { + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston", "DataTraveler G3", + "1.00"}, /*quirks*/ DA_Q_NO_PREVENT + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 11:57:42 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09FBB911; Fri, 5 Apr 2013 11:57:42 +0000 (UTC) (envelope-from mav@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 F094A177; Fri, 5 Apr 2013 11:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35BvfJk066620; Fri, 5 Apr 2013 11:57:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35BvfqB066619; Fri, 5 Apr 2013 11:57:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304051157.r35BvfqB066619@svn.freebsd.org> From: Alexander Motin Date: Fri, 5 Apr 2013 11:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249160 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 11:57:42 -0000 Author: mav Date: Fri Apr 5 11:57:41 2013 New Revision: 249160 URL: http://svnweb.freebsd.org/changeset/base/249160 Log: MFC r247161: Hide SEMB port of the SiI3826 Port Multiplier by default to avoid extra errors while it tries to talk via I2C to usually missing external SEP. There is tunable to enable it back when needed. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Fri Apr 5 11:55:52 2013 (r249159) +++ stable/9/sys/cam/ata/ata_pmp.c Fri Apr 5 11:57:41 2013 (r249160) @@ -595,7 +595,9 @@ pmpdone(struct cam_periph *periph, union * causes timeouts if external SEP is not connected * to PMP over I2C. */ - if (softc->pm_pid == 0x37261095 && softc->pm_ports == 6) + if ((softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) && + softc->pm_ports == 6) softc->pm_ports = 5; /* From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 13:26:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A7ECCB9 for ; Fri, 5 Apr 2013 13:26:58 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:64]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0DE70B for ; Fri, 5 Apr 2013 13:26:58 +0000 (UTC) Received: from omta13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by qmta07.emeryville.ca.mail.comcast.net with comcast id LD2j1l00117UAYkA7DSxoX; Fri, 05 Apr 2013 13:26:57 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta13.emeryville.ca.mail.comcast.net with comcast id LDSw1l00F1t3BNj8ZDSw9b; Fri, 05 Apr 2013 13:26:57 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 44B8A73A1C; Fri, 5 Apr 2013 06:26:56 -0700 (PDT) Date: Fri, 5 Apr 2013 06:26:56 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r248352 - in stable/9: etc share/mk Message-ID: <20130405132656.GA38611@icarus.home.lan> References: <201303152132.r2FLWfwx076672@svn.freebsd.org> <201303200918.08803.jhb@freebsd.org> <20130402175903.GA85393@lor.one-eyed-alien.net> <201304021550.43701.jhb@freebsd.org> <20130402213534.GA86221@lor.one-eyed-alien.net> <20130405055834.GA97433@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130405055834.GA97433@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1365168417; bh=+jKCYFUpEEh/cafdvzpBCQFjGuwJU5KRLKtYPdSDX5s=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=Z4z5cvJ+c1DsJV4kMC3b8DlkFLn+a1JXfWxHyNx+qAQgHjStSmmKgkcfeIy0ssDtF XTI1y/MX6ZWYBcy+gGLSkVMQI4AEKeHmfjewv+tVZqjSbogpf9ni6B4j+UXwVDXo7a gndDKzr6cEUPM8eDhXXz4TLywRVziDsnritJMfEjZCzOX9y3MOoKqCU0QIyqEitI1P E+jlRi+3qMb4iitlmTmdXGOTwO7qD1BAg7KfcXYW86HN/zhfxwmuwVJDmfFMrPS5uK M1MvEcU3pUX7GZJG1ar6+/53EWyMoD6S6pXW9JhODX7dZ8OVJDNSrFliRIqwg/HFs8 fZ8rSTNCc9Y7w== Cc: src-committers@freebsd.org, John Baldwin , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 13:26:58 -0000 On Thu, Apr 04, 2013 at 10:58:34PM -0700, Jeremy Chadwick wrote: > On Tue, Apr 02, 2013 at 04:35:34PM -0500, Brooks Davis wrote: > > On Tue, Apr 02, 2013 at 03:50:43PM -0400, John Baldwin wrote: > > > On Tuesday, April 02, 2013 1:59:03 pm Brooks Davis wrote: > > > > On Wed, Mar 20, 2013 at 09:18:08AM -0400, John Baldwin wrote: > > > > > On Tuesday, March 19, 2013 4:06:31 pm Brooks Davis wrote: > > > > > > On Tue, Mar 19, 2013 at 09:49:47PM +0400, Dmitry Morozovsky wrote: > > > > > > > On Tue, 19 Mar 2013, Brooks Davis wrote: > > > > > > > > > > > > > > > > > Replace all known uses of ln in the build process with appropriate > > > > > > > > > > install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK > > > > > > > > > > variables. > > > > > > > > > > > > > > > > > > It seems this merge breaks ``make distribution'' and hence mergemaster if your > > > > > > > > > base system is not updated yet (for example, while updating jail): > > > > > > > > > > > > > > > > Sorry for the delay in responding. I missed this yesterday. > > > > > > > > > > > > > > > > It works for me on a older 9.0-STABLE system where the base install > > > > > > > > doesn't support -l. Did you build world or run "make toolchain" in that > > > > > > > > source tree to build the bootstrap copy of install? > > > > > > > > > > > > > > Yes, this is after full ``make buildworld buildkernel'' process. > > > > > > > > > > > > I've found the problem thanks to misc/177055. It is that mergemaster > > > > > > (and etcupdate) set MAKEOBJDIRPREFIX to something in their > > > > > > temporary directory and thus deprive themselves of bootstrap tools. > > > > > > Unfortunately, I don't see a trivial fix so I've backed this out for > > > > > > now and will work on this in HEAD. > > > > > > > > > > Hummmm. In the case of etcupdate you can use 'etcupdate -B'. That is actually safe > > > > > to do in the common case where you've just updated /usr/src and built the corresponding > > > > > world in /usr/obj. It should possibly even by the default for etcupdate if a DESTDIR > > > > > is not specified. > > > > > > > > Finally getting back to this... > > > > > > > > etcupdate -B would correct the immediate problem for etcupdate. I do > > > > think that making it the default if the tree exists makes sense. It > > > > won't be more broken than a cross installworld is. > > > > > > Hmmm, checking for the obj tree is a bit hackish. I'd rather it were more > > > deterministic. I think I'd like to make it just default to -B and require > > > a new -b flag to build a new tree, but perhaps have it check for a tree > > > and error out if it doesn't exist and you don't give it -b? > > > > Just switching the default seems fine in practice. I guess it would > > probably be useful to keep an option to enable the old behavior. > > > > > > I did a quick test when I first found this issue and it would be easy to > > > > reuse the existing MAKEOBJDIRPREFIX in mergemaster as well. > > > > > > > > I think we'll want to update UPDATING to recommend that the > > > > mergemaster -p stage (and the equivalent for etcupdate) be run using the > > > > version in the source tree, not the installed one. I do wonder if it > > > > would make sense for them to attempt to find and invoke that version so > > > > simplify bootstrapping. > > > > > > Currently etcupdate doesn't implement something like -p. I need to add that as > > > I would prefer to use its conflict resolution for adding users. (That would > > > also let it serve as a full replacement for mergemaster for those who prefer it.) > > > > OK, I'll look at switching the default behavior in mergemaster and > > adding an option to revert to the old behavior. > > > > I'll also change UPDATING to suggest using the mergemaster.sh from the > > source tree for mergemaster -p. > > Please be sure to update the relevant comments in src/Makefile too > (see roughly lines 59 onward). Also, in usr.sbin/mergemaster/mergemaster.sh, it looks like someone left some debugging code around line 637 (the echo statement): http://svnweb.freebsd.org/base/stable/9/usr.sbin/mergemaster/mergemaster.sh?r1=244461&r2=248531 -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable@FreeBSD.ORG Fri Apr 5 19:33:32 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DFE65F57; Fri, 5 Apr 2013 19:33:32 +0000 (UTC) (envelope-from ken@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 C20A9A07; Fri, 5 Apr 2013 19:33:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r35JXWIX000922; Fri, 5 Apr 2013 19:33:32 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r35JXWaC000919; Fri, 5 Apr 2013 19:33:32 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304051933.r35JXWaC000919@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 5 Apr 2013 19:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249167 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Apr 2013 19:33:33 -0000 Author: ken Date: Fri Apr 5 19:33:31 2013 New Revision: 249167 URL: http://svnweb.freebsd.org/changeset/base/249167 Log: MFC r244052 and r245288: r244052 | ken | 2012-12-09 12:53:21 -0700 (Sun, 09 Dec 2012) | 20 lines Fix a couple of CTL locking issues and clean up some duplicated code. ctl_frontend_cam_sim.c: Coalesce cfcs_online() and cfcs_offline() into a single function since these were identical except for one line. Make sure we hold the SIM lock around path creation, and calling xpt_rescan(). scsi_ctl.c: In ctlfe_onoffline(), make sure we hold the SIM lock around path creation and free calls, as well as xpt_action(). In ctlfe_lun_enable(), hold the SIM lock around path and peripheral operations that require it. Sponsored by: Spectra Logic Corporation MFC after: 1 week ------------------------------------------------------------------------ r245228 | ken | 2013-01-09 10:02:08 -0700 (Wed, 09 Jan 2013) | 43 lines Make CTL work a little better with loading and unloading drivers. Previously CTL would leave individual LUNs enabled in the target driver, whether or not the port as a whole was enabled. It would also leave the wildcard LUN enabled indefinitely. This change means that CTL will enable and disable any active LUNs, as well as the wildcard LUN, when enabling and disabling a port. Also, fix a bug that could crop up due to an uninitialized CCB type. ctl.c: Before calling ctl_frontend_online(), run through the LUN list and enable all active LUNs. After calling ctl_frontend_offline(), run through the LUN list and disble all active LUNs. scsi_ctl.c: Before bringing a port online, allocate the wildcard peripheral for that bus. And after taking a port offline, invalidate the wildcard peripheral for that bus. Make sure that we hold the SIM lock around all calls to xpt_action() and other transport layer interfaces that require it. Use CAM_SIM_{LOCK|UNLOCK} consistently to acquire and release the SIM lock. Update a number of outdated comments. Some of these should have been fixed long ago. Actually do LUN disbables now. The newer drivers in the tree work correctly for this as far as I know. Initialize the CCB type to CTLFE_CCB_DEFAULT to avoid a panic due to uninitialized memory. Submitted by: Chuck Tuffli (partially) MFC after: 1 week Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Fri Apr 5 18:09:43 2013 (r249166) +++ stable/9/sys/cam/ctl/ctl.c Fri Apr 5 19:33:31 2013 (r249167) @@ -2263,11 +2263,31 @@ ctl_ioctl(struct cdev *dev, u_long cmd, */ mtx_unlock(&softc->ctl_lock); - if (cmd == CTL_ENABLE_PORT) + if (cmd == CTL_ENABLE_PORT) { + struct ctl_lun *lun; + + STAILQ_FOREACH(lun, &softc->lun_list, + links) { + fe->lun_enable(fe->targ_lun_arg, + lun->target, + lun->lun); + } + ctl_frontend_online(fe); - else if (cmd == CTL_DISABLE_PORT) + } else if (cmd == CTL_DISABLE_PORT) { + struct ctl_lun *lun; + ctl_frontend_offline(fe); + STAILQ_FOREACH(lun, &softc->lun_list, + links) { + fe->lun_disable( + fe->targ_lun_arg, + lun->target, + lun->lun); + } + } + mtx_lock(&softc->ctl_lock); if (cmd == CTL_SET_PORT_WWNS) Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Apr 5 18:09:43 2013 (r249166) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Apr 5 19:33:31 2013 (r249167) @@ -275,7 +275,7 @@ cfcs_shutdown(void) } static void -cfcs_online(void *arg) +cfcs_onoffline(void *arg, int online) { struct cfcs_softc *softc; union ccb *ccb; @@ -283,13 +283,12 @@ cfcs_online(void *arg) softc = (struct cfcs_softc *)arg; mtx_lock(&softc->lock); - softc->online = 1; - mtx_unlock(&softc->lock); + softc->online = online; ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { printf("%s: unable to allocate CCB for rescan\n", __func__); - return; + goto bailout; } if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, @@ -297,37 +296,24 @@ cfcs_online(void *arg) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: can't allocate path for rescan\n", __func__); xpt_free_ccb(ccb); - return; + goto bailout; } xpt_rescan(ccb); + +bailout: + mtx_unlock(&softc->lock); } static void -cfcs_offline(void *arg) +cfcs_online(void *arg) { - struct cfcs_softc *softc; - union ccb *ccb; - - softc = (struct cfcs_softc *)arg; - - mtx_lock(&softc->lock); - softc->online = 0; - mtx_unlock(&softc->lock); - - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - printf("%s: unable to allocate CCB for rescan\n", __func__); - return; - } + cfcs_onoffline(arg, /*online*/ 1); +} - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, - cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - printf("%s: can't allocate path for rescan\n", __func__); - xpt_free_ccb(ccb); - return; - } - xpt_rescan(ccb); +static void +cfcs_offline(void *arg) +{ + cfcs_onoffline(arg, /*online*/ 0); } static int Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Fri Apr 5 18:09:43 2013 (r249166) +++ stable/9/sys/cam/ctl/scsi_ctl.c Fri Apr 5 19:33:31 2013 (r249167) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include typedef enum { + CTLFE_CCB_DEFAULT = 0x00, CTLFE_CCB_WAITING = 0x01 } ctlfe_ccb_types; @@ -304,10 +305,7 @@ ctlfeasync(void *callback_arg, uint32_t case AC_PATH_REGISTERED: { struct ctl_frontend *fe; struct ctlfe_softc *bus_softc; - struct ctlfe_lun_softc *lun_softc; - struct cam_path *path; struct ccb_pathinq *cpi; - cam_status status; int retval; cpi = (struct ccb_pathinq *)arg; @@ -330,7 +328,6 @@ ctlfeasync(void *callback_arg, uint32_t M_NOWAIT | M_ZERO); if (ccb == NULL) { printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); return; } xpt_setup_ccb(&ccb->ccb_h, cpi->ccb_h.path, @@ -448,44 +445,31 @@ ctlfeasync(void *callback_arg, uint32_t mtx_unlock(&ctlfe_list_mtx); } - status = xpt_create_path(&path, /*periph*/ NULL, - bus_softc->path_id,CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD); - if (status != CAM_REQ_CMP) { - printf("%s: unable to create path for wildcard " - "periph\n", __func__); - break; - } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - break; - } - - lun_softc->parent_softc = bus_softc; - lun_softc->flags |= CTLFE_LUN_WILDCARD; - - status = cam_periph_alloc(ctlferegister, - ctlfeoninvalidate, - ctlfecleanup, - ctlfestart, - "ctl", - CAM_PERIPH_BIO, - path, - ctlfeasync, - 0, - lun_softc); + break; + } + case AC_PATH_DEREGISTERED: { + struct ctlfe_softc *softc = NULL; - xpt_free_path(path); + mtx_lock(&ctlfe_list_mtx); + STAILQ_FOREACH(softc, &ctlfe_softc_list, links) { + if (softc->path_id == xpt_path_path_id(path)) { + STAILQ_REMOVE(&ctlfe_softc_list, softc, + ctlfe_softc, links); + break; + } + } + mtx_unlock(&ctlfe_list_mtx); + if (softc != NULL) { + /* + * XXX KDM are we certain at this point that there + * are no outstanding commands for this frontend? + */ + ctl_frontend_deregister(&softc->fe); + free(softc, M_CTLFE); + } break; } - case AC_PATH_DEREGISTERED: - /* ctl_frontend_deregister() */ - break; case AC_CONTRACT: { struct ac_contract *ac; @@ -699,11 +683,14 @@ ctlfecleanup(struct cam_periph *periph) softc = (struct ctlfe_lun_softc *)periph->softc; bus_softc = softc->parent_softc; - STAILQ_REMOVE(&bus_softc->lun_softc_list, softc, ctlfe_lun_softc,links); + STAILQ_REMOVE(&bus_softc->lun_softc_list, softc, ctlfe_lun_softc, links); /* * XXX KDM is there anything else that needs to be done here? */ + + callout_stop(&softc->dma_callout); + free(softc, M_CTLFE); } @@ -717,6 +704,8 @@ ctlfestart(struct cam_periph *periph, un softc->ccbs_alloced++; + start_ccb->ccb_h.ccb_type = CTLFE_CCB_DEFAULT; + ccb_h = TAILQ_FIRST(&softc->work_queue); if (periph->immediate_priority <= periph->pinfo.priority) { panic("shouldn't get to the CCB waiting case!"); @@ -857,8 +846,6 @@ ctlfestart(struct cam_periph *periph, un /* * Datamove call, we need to setup the S/G list. - * If we pass in a S/G list, the isp(4) driver at - * least expects physical/bus addresses. */ cmd_info = (struct ctlfe_lun_cmd_info *) @@ -933,12 +920,13 @@ ctlfestart(struct cam_periph *periph, un int *ti; /* - * XXX KDM this is a temporary hack. The - * isp(4) driver can't deal with S/G lists - * with virtual pointers, so we need to - * go through and send down one virtual - * pointer at a time. + * If we have more S/G list pointers than + * will fit in the available storage in the + * cmd_info structure inside the ctl_io header, + * then we need to send down the pointers + * one element at a time. */ + sglist = (struct ctl_sg_entry *) io->scsiio.kern_data_ptr; ti = &cmd_info->cur_transfer_index; @@ -1405,13 +1393,15 @@ ctlfedone(struct cam_periph *periph, uni break; default: /* - * XXX KDM the isp(4) driver doesn't really - * seem to send errors back for data - * transfers that I can tell. There is one - * case where it'll send CAM_REQ_CMP_ERR, - * but probably not that many more cases. - * So set a generic data phase error here, - * like the SXP driver sets. + * XXX KDM we probably need to figure out a + * standard set of errors that the SIM + * drivers should return in the event of a + * data transfer failure. A data phase + * error will at least point the user to a + * data transfer error of some sort. + * Hopefully the SIM printed out some + * additional information to give the user + * a clue what happened. */ io->io_hdr.port_status = 0xbad1; ctl_set_data_phase_error(&io->scsiio); @@ -1687,17 +1677,24 @@ ctlfe_onoffline(void *arg, int online) set_wwnn = 0; + sim = bus_softc->sim; + + mtx_assert(sim->mtx, MA_OWNED); + status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { printf("%s: unable to create path!\n", __func__); return; } - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); + ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); + if (ccb == NULL) { + printf("%s: unable to malloc CCB!\n", __func__); + xpt_free_path(path); + return; + } xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); - sim = xpt_path_sim(path); - /* * Copan WWN format: * @@ -1715,11 +1712,9 @@ ctlfe_onoffline(void *arg, int online) ccb->ccb_h.func_code = XPT_GET_SIM_KNOB; - CAM_SIM_LOCK(sim); xpt_action(ccb); - CAM_SIM_UNLOCK(sim); if ((ccb->knob.xport_specific.valid & KNOB_VALID_ADDRESS) != 0){ #ifdef RANDOM_WWNN @@ -1817,9 +1812,6 @@ ctlfe_onoffline(void *arg, int online) else ccb->knob.xport_specific.fc.role = KNOB_ROLE_NONE; - - CAM_SIM_LOCK(sim); - xpt_action(ccb); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1836,8 +1828,6 @@ ctlfe_onoffline(void *arg, int online) xpt_free_path(path); - CAM_SIM_UNLOCK(sim); - free(ccb, M_TEMP); return; @@ -1846,13 +1836,111 @@ ctlfe_onoffline(void *arg, int online) static void ctlfe_online(void *arg) { + struct ctlfe_softc *bus_softc; + struct cam_path *path; + cam_status status; + struct ctlfe_lun_softc *lun_softc; + struct cam_sim *sim; + + bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); + + /* + * Create the wildcard LUN before bringing the port online. + */ + status = xpt_create_path(&path, /*periph*/ NULL, + bus_softc->path_id, CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); + if (status != CAM_REQ_CMP) { + printf("%s: unable to create path for wildcard periph\n", + __func__); + CAM_SIM_UNLOCK(sim); + return; + } + + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, + M_NOWAIT | M_ZERO); + if (lun_softc == NULL) { + xpt_print(path, "%s: unable to allocate softc for " + "wildcard periph\n", __func__); + xpt_free_path(path); + CAM_SIM_UNLOCK(sim); + return; + } + + lun_softc->parent_softc = bus_softc; + lun_softc->flags |= CTLFE_LUN_WILDCARD; + + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); + + + status = cam_periph_alloc(ctlferegister, + ctlfeoninvalidate, + ctlfecleanup, + ctlfestart, + "ctl", + CAM_PERIPH_BIO, + path, + ctlfeasync, + 0, + lun_softc); + + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(status); + + printf("%s: CAM error %s (%#x) returned from " + "cam_periph_alloc()\n", __func__, (entry != NULL) ? + entry->status_text : "Unknown", status); + } + + xpt_free_path(path); + ctlfe_onoffline(arg, /*online*/ 1); + + CAM_SIM_UNLOCK(sim); } static void ctlfe_offline(void *arg) { + struct ctlfe_softc *bus_softc; + struct cam_path *path; + cam_status status; + struct cam_periph *periph; + struct cam_sim *sim; + + bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); + ctlfe_onoffline(arg, /*online*/ 0); + + /* + * Disable the wildcard LUN for this port now that we have taken + * the port offline. + */ + status = xpt_create_path(&path, /*periph*/ NULL, + bus_softc->path_id, CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); + if (status != CAM_REQ_CMP) { + CAM_SIM_UNLOCK(sim); + printf("%s: unable to create path for wildcard periph\n", + __func__); + return; + } + + + if ((periph = cam_periph_find(path, "ctl")) != NULL) + cam_periph_invalidate(periph); + + xpt_free_path(path); + + CAM_SIM_UNLOCK(sim); } static int @@ -1883,11 +1971,11 @@ ctlfe_lun_enable(void *arg, struct ctl_i bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; status = xpt_create_path_unlocked(&path, /*periph*/ NULL, bus_softc->path_id, - targ_id.id, - lun_id); + targ_id.id, lun_id); /* XXX KDM need some way to return status to CTL here? */ if (status != CAM_REQ_CMP) { printf("%s: could not create path, status %#x\n", __func__, @@ -1896,14 +1984,13 @@ ctlfe_lun_enable(void *arg, struct ctl_i } softc = malloc(sizeof(*softc), M_CTLFE, M_WAITOK | M_ZERO); - sim = xpt_path_sim(path); - mtx_lock(sim->mtx); + CAM_SIM_LOCK(sim); periph = cam_periph_find(path, "ctl"); if (periph != NULL) { /* We've already got a periph, no need to alloc a new one. */ xpt_free_path(path); free(softc, M_CTLFE); - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); return (0); } @@ -1923,29 +2010,26 @@ ctlfe_lun_enable(void *arg, struct ctl_i xpt_free_path(path); - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); return (0); } /* - * XXX KDM we disable LUN removal here. The problem is that the isp(4) - * driver doesn't currently handle LUN removal properly. We need to keep - * enough state here at the peripheral level even after LUNs have been - * removed inside CTL. - * - * Once the isp(4) driver is fixed, this can be re-enabled. + * This will get called when the user removes a LUN to disable that LUN + * on every bus that is attached to CTL. */ static int ctlfe_lun_disable(void *arg, struct ctl_id targ_id, int lun_id) { -#ifdef NOTYET struct ctlfe_softc *softc; struct ctlfe_lun_softc *lun_softc; + struct cam_sim *sim; softc = (struct ctlfe_softc *)arg; + sim = softc->sim; - mtx_lock(softc->sim->mtx); + CAM_SIM_LOCK(sim); STAILQ_FOREACH(lun_softc, &softc->lun_softc_list, links) { struct cam_path *path; @@ -1957,7 +2041,7 @@ ctlfe_lun_disable(void *arg, struct ctl_ } } if (lun_softc == NULL) { - mtx_unlock(softc->sim->mtx); + CAM_SIM_UNLOCK(sim); printf("%s: can't find target %d lun %d\n", __func__, targ_id.id, lun_id); return (1); @@ -1965,8 +2049,7 @@ ctlfe_lun_disable(void *arg, struct ctl_ cam_periph_invalidate(lun_softc->periph); - mtx_unlock(softc->sim->mtx); -#endif + CAM_SIM_UNLOCK(sim); return (0); } @@ -2131,7 +2214,7 @@ ctlfe_datamove_done(union ctl_io *io) sim = xpt_path_sim(ccb->ccb_h.path); - mtx_lock(sim->mtx); + CAM_SIM_LOCK(sim); periph = xpt_path_periph(ccb->ccb_h.path); @@ -2178,7 +2261,7 @@ ctlfe_datamove_done(union ctl_io *io) xpt_schedule(periph, /*priority*/ 1); } - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); } static void