From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 00:32:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 614C4303; Sun, 9 Dec 2012 00:32:40 +0000 (UTC) (envelope-from alc@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 4468C8FC0C; Sun, 9 Dec 2012 00:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB90We0P050433; Sun, 9 Dec 2012 00:32:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB90WcWW050424; Sun, 9 Dec 2012 00:32:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201212090032.qB90WcWW050424@svn.freebsd.org> From: Alan Cox Date: Sun, 9 Dec 2012 00:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244043 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 00:32:40 -0000 Author: alc Date: Sun Dec 9 00:32:38 2012 New Revision: 244043 URL: http://svnweb.freebsd.org/changeset/base/244043 Log: In the past four years, we've added two new vm object types. Each time, similar changes had to be made in various places throughout the machine- independent virtual memory layer to support the new vm object type. However, in most of these places, it's actually not the type of the vm object that matters to us but instead certain attributes of its pages. For example, OBJT_DEVICE, OBJT_MGTDEVICE, and OBJT_SG objects contain fictitious pages. In other words, in most of these places, we were testing the vm object's type to determine if it contained fictitious (or unmanaged) pages. To both simplify the code in these places and make the addition of future vm object types easier, this change introduces two new vm object flags that describe attributes of the vm object's pages, specifically, whether they are fictitious or unmanaged. Reviewed and tested by: kib Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_fault.c Sun Dec 9 00:32:38 2012 (r244043) @@ -968,8 +968,8 @@ vm_fault_cache_behind(const struct fault VM_OBJECT_LOCK(object); } } - if (first_object->type != OBJT_DEVICE && - first_object->type != OBJT_PHYS && first_object->type != OBJT_SG) { + /* Neither fictitious nor unmanaged pages can be cached. */ + if ((first_object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0) { if (fs->first_pindex < distance) pindex = 0; else Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_map.c Sun Dec 9 00:32:38 2012 (r244043) @@ -2324,8 +2324,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0); } } KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION, @@ -2445,8 +2445,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st saved_start = entry->start; saved_end = entry->end; fictitious = entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0; /* * Release the map lock, relying on the in-transition * mark. Mark the map busy for fork. @@ -2544,8 +2544,8 @@ done: */ vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & + OBJ_FICTITIOUS) != 0); } } next_entry_done: @@ -2681,8 +2681,7 @@ vm_map_entry_unwire(vm_map_t map, vm_map { vm_fault_unwire(map, entry->start, entry->end, entry->object.vm_object != NULL && - (entry->object.vm_object->type == OBJT_DEVICE || - entry->object.vm_object->type == OBJT_SG)); + (entry->object.vm_object->flags & OBJ_FICTITIOUS) != 0); entry->wired_count = 0; } Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_meter.c Sun Dec 9 00:32:38 2012 (r244043) @@ -200,7 +200,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) * synchronization should not impair the accuracy of * the reported statistics. */ - if (object->type == OBJT_DEVICE || object->type == OBJT_SG) { + if ((object->flags & OBJ_FICTITIOUS) != 0) { /* * Devices, like /dev/mem, will badly skew our totals. */ Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_object.c Sun Dec 9 00:32:38 2012 (r244043) @@ -212,15 +212,35 @@ _vm_object_allocate(objtype_t type, vm_p object->root = NULL; object->type = type; + switch (type) { + case OBJT_DEAD: + panic("_vm_object_allocate: can't create OBJT_DEAD"); + case OBJT_DEFAULT: + case OBJT_SWAP: + object->flags = OBJ_ONEMAPPING; + break; + case OBJT_DEVICE: + case OBJT_SG: + object->flags = OBJ_FICTITIOUS | OBJ_UNMANAGED; + break; + case OBJT_MGTDEVICE: + object->flags = OBJ_FICTITIOUS; + break; + case OBJT_PHYS: + object->flags = OBJ_UNMANAGED; + break; + case OBJT_VNODE: + object->flags = 0; + break; + default: + panic("_vm_object_allocate: type %d is undefined", type); + } object->size = size; object->generation = 1; object->ref_count = 1; object->memattr = VM_MEMATTR_DEFAULT; - object->flags = 0; object->cred = NULL; object->charge = 0; - if ((object->type == OBJT_DEFAULT) || (object->type == OBJT_SWAP)) - object->flags = OBJ_ONEMAPPING; object->pg_color = 0; object->handle = NULL; object->backing_object = NULL; @@ -1064,7 +1084,7 @@ shadowlookup: (tobject->flags & OBJ_ONEMAPPING) == 0) { goto unlock_tobject; } - } else if (tobject->type == OBJT_PHYS) + } else if ((tobject->flags & OBJ_UNMANAGED) != 0) goto unlock_tobject; m = vm_page_lookup(tobject, tpindex); if (m == NULL && advise == MADV_WILLNEED) { @@ -1834,7 +1854,7 @@ vm_object_page_remove(vm_object_t object int wirings; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_PHYS) || + KASSERT((object->flags & OBJ_UNMANAGED) == 0 || (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); if (object->resident_page_count == 0) @@ -1918,7 +1938,7 @@ skipmemq: * pages are moved to the cache queue. * * This operation should only be performed on objects that - * contain managed pages. + * contain non-fictitious, managed pages. * * The object must be locked. */ @@ -1929,8 +1949,7 @@ vm_object_page_cache(vm_object_t object, vm_page_t p, next; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - KASSERT((object->type != OBJT_DEVICE && object->type != OBJT_SG && - object->type != OBJT_PHYS), + KASSERT((object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0, ("vm_object_page_cache: illegal object %p", object)); if (object->resident_page_count == 0) return; Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_object.h Sun Dec 9 00:32:38 2012 (r244043) @@ -165,6 +165,8 @@ struct vm_object { /* * Flags */ +#define OBJ_FICTITIOUS 0x0001 /* (c) contains fictitious pages */ +#define OBJ_UNMANAGED 0x0002 /* (c) contains unmanaged pages */ #define OBJ_ACTIVE 0x0004 /* active objects */ #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_page.c Sun Dec 9 00:32:38 2012 (r244043) @@ -1414,9 +1414,8 @@ vm_page_alloc(vm_object_t object, vm_pin mtx_unlock(&vm_page_queue_free_mtx); return (NULL); #if VM_NRESERVLEVEL > 0 - } else if (object == NULL || object->type == OBJT_DEVICE || - object->type == OBJT_SG || - (object->flags & OBJ_COLORED) == 0 || + } else if (object == NULL || (object->flags & (OBJ_COLORED | + OBJ_FICTITIOUS)) != OBJ_COLORED || (m = vm_reserv_alloc_page(object, pindex)) == NULL) { #else } else { @@ -1491,10 +1490,8 @@ vm_page_alloc(vm_object_t object, vm_pin m->flags = flags; mtx_unlock(&vm_page_queue_free_mtx); m->aflags = 0; - if (object == NULL || object->type == OBJT_PHYS) - m->oflags = VPO_UNMANAGED; - else - m->oflags = 0; + m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? + VPO_UNMANAGED : 0; if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ)) == 0) m->oflags |= VPO_BUSY; if (req & VM_ALLOC_WIRED) { @@ -1510,7 +1507,7 @@ vm_page_alloc(vm_object_t object, vm_pin if (object != NULL) { /* Ignore device objects; the pager sets "memattr" for them. */ if (object->memattr != VM_MEMATTR_DEFAULT && - object->type != OBJT_DEVICE && object->type != OBJT_SG) + (object->flags & OBJ_FICTITIOUS) == 0) pmap_page_set_memattr(m, object->memattr); vm_page_insert(m, object, pindex); } else Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sat Dec 8 22:52:39 2012 (r244042) +++ head/sys/vm/vm_pageout.c Sun Dec 9 00:32:38 2012 (r244043) @@ -705,14 +705,14 @@ vm_pageout_object_deactivate_pages(pmap_ int actcount, remove_mode; VM_OBJECT_LOCK_ASSERT(first_object, MA_OWNED); - if (first_object->type == OBJT_DEVICE || - first_object->type == OBJT_SG) + if ((first_object->flags & OBJ_FICTITIOUS) != 0) return; for (object = first_object;; object = backing_object) { if (pmap_resident_count(pmap) <= desired) goto unlock_return; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type == OBJT_PHYS || object->paging_in_progress) + if ((object->flags & OBJ_UNMANAGED) != 0 || + object->paging_in_progress != 0) goto unlock_return; remove_mode = 0; From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 01:08:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DB3ACC8; Sun, 9 Dec 2012 01:08:45 +0000 (UTC) (envelope-from adrian@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 29C8F8FC13; Sun, 9 Dec 2012 01:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB918jh4055045; Sun, 9 Dec 2012 01:08:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB918iUW055043; Sun, 9 Dec 2012 01:08:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212090108.qB918iUW055043@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 01:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244044 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 01:08:45 -0000 Author: adrian Date: Sun Dec 9 01:08:44 2012 New Revision: 244044 URL: http://svnweb.freebsd.org/changeset/base/244044 Log: Don't panic if the stageq here is empty; just fall through with NULL pointers and leave the stage queue flush routine to just do nothing (since both head and tail here will be NULL.) This should quieten the "stageq empty" panic where the stageq itself is empty, but it won't fix the second KASSERT() here "staging queue empty" as that's likely a different underlying problem. PR: kern/174283 Modified: head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_superg.h Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Dec 9 00:32:38 2012 (r244043) +++ head/sys/net80211/ieee80211_superg.c Sun Dec 9 01:08:44 2012 (r244044) @@ -547,6 +547,14 @@ ff_flush(struct mbuf *head, struct mbuf /* * Age frames on the staging queue. + * + * This is called without the comlock held, but it does all its work + * behind the comlock. Because of this, it's possible that the + * staging queue will be serviced between the function which called + * it and now; thus simply checking that the queue has work in it + * may fail. + * + * See PR kern/174283 for more details. */ void ieee80211_ff_age(struct ieee80211com *ic, struct ieee80211_stageq *sq, @@ -557,7 +565,9 @@ ieee80211_ff_age(struct ieee80211com *ic struct ieee80211_node *ni; struct ieee80211_tx_ampdu *tap; +#if 0 KASSERT(sq->head != NULL, ("stageq empty")); +#endif IEEE80211_LOCK(ic); head = sq->head; Modified: head/sys/net80211/ieee80211_superg.h ============================================================================== --- head/sys/net80211/ieee80211_superg.h Sun Dec 9 00:32:38 2012 (r244043) +++ head/sys/net80211/ieee80211_superg.h Sun Dec 9 01:08:44 2012 (r244044) @@ -87,6 +87,10 @@ struct mbuf *ieee80211_ff_check(struct i void ieee80211_ff_age(struct ieee80211com *, struct ieee80211_stageq *, int quanta); +/* + * See ieee80211_ff_age() for a description of the locking + * expectation here. + */ static __inline void ieee80211_ff_flush(struct ieee80211com *ic, int ac) { @@ -96,6 +100,10 @@ ieee80211_ff_flush(struct ieee80211com * ieee80211_ff_age(ic, &sg->ff_stageq[ac], 0x7fffffff); } +/* + * See ieee80211_ff_age() for a description of the locking + * expectation here. + */ static __inline void ieee80211_ff_age_all(struct ieee80211com *ic, int quanta) { From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 04:15:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 57841DA0; Sun, 9 Dec 2012 04:15:52 +0000 (UTC) (envelope-from eadler@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 3BC8B8FC08; Sun, 9 Dec 2012 04:15:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB94FqTP082746; Sun, 9 Dec 2012 04:15:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB94Fq2b082745; Sun, 9 Dec 2012 04:15:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212090415.qB94Fq2b082745@svn.freebsd.org> From: Eitan Adler Date: Sun, 9 Dec 2012 04:15: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: r244045 - stable/9/lib/libc/stdio X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 04:15:52 -0000 Author: eadler Date: Sun Dec 9 04:15:51 2012 New Revision: 244045 URL: http://svnweb.freebsd.org/changeset/base/244045 Log: MFC r243753: The getline function returns the number of characters read, not written. Use clearer text for this. PR: docs/174023 Approved by: cperciva (implicit) Modified: stable/9/lib/libc/stdio/getline.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/getline.3 ============================================================================== --- stable/9/lib/libc/stdio/getline.3 Sun Dec 9 01:08:44 2012 (r244044) +++ stable/9/lib/libc/stdio/getline.3 Sun Dec 9 04:15:51 2012 (r244045) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2010 +.Dd November 30, 2012 .Dt GETLINE 3 .Os .Sh NAME @@ -76,7 +76,7 @@ The .Fn getdelim and .Fn getline -functions return the number of characters written, excluding the +functions return the number of characters stored in the buffer, excluding the terminating .Dv NUL character. From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 04:54:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D59261B; Sun, 9 Dec 2012 04:54:23 +0000 (UTC) (envelope-from attilio@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 3AF968FC12; Sun, 9 Dec 2012 04:54:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB94sNe8087136; Sun, 9 Dec 2012 04:54:23 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB94sNNZ087134; Sun, 9 Dec 2012 04:54:23 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201212090454.qB94sNNZ087134@svn.freebsd.org> From: Attilio Rao Date: Sun, 9 Dec 2012 04:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244046 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 04:54:23 -0000 Author: attilio Date: Sun Dec 9 04:54:22 2012 New Revision: 244046 URL: http://svnweb.freebsd.org/changeset/base/244046 Log: Add a comment on why inlining critical_enter() may not be a good idea for the general case. Reviewed by: bde MFC after: 1 week Modified: head/sys/kern/kern_switch.c Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Sun Dec 9 04:15:51 2012 (r244045) +++ head/sys/kern/kern_switch.c Sun Dec 9 04:54:22 2012 (r244046) @@ -176,6 +176,12 @@ retry: /* * Kernel thread preemption implementation. Critical sections mark * regions of code in which preemptions are not allowed. + * + * It might seem a good idea to inline critical_enter() but, in order + * to prevent instructions reordering by the compiler, a __compiler_membar() + * would have to be used here (the same as sched_pin()). The performance + * penalty imposed by the membar could, then, produce slower code than + * the function call itself, for most cases. */ void critical_enter(void) From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 09:58:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4986A5B2; Sun, 9 Dec 2012 09:58:45 +0000 (UTC) (envelope-from hselasky@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 13E0B8FC13; Sun, 9 Dec 2012 09:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB99witn026928; Sun, 9 Dec 2012 09:58:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB99wiig026926; Sun, 9 Dec 2012 09:58:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212090958.qB99wiig026926@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 9 Dec 2012 09:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244047 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 09:58:45 -0000 Author: hselasky Date: Sun Dec 9 09:58:44 2012 New Revision: 244047 URL: http://svnweb.freebsd.org/changeset/base/244047 Log: Add new USB ID. MFC after: 1 week Submitted by: Artyom Mirgorodskiy Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Dec 9 04:54:22 2012 (r244046) +++ head/sys/dev/usb/serial/u3g.c Sun Dec 9 09:58:44 2012 (r244047) @@ -553,6 +553,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(TOSHIBA, G450, 0), U3G_DEV(TOSHIBA, HSDPA, 0), U3G_DEV(YISO, C893, 0), + U3G_DEV(WETELECOM, WM_D200, 0), /* Autoinstallers */ U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT), U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Dec 9 04:54:22 2012 (r244046) +++ head/sys/dev/usb/usbdevs Sun Dec 9 09:58:44 2012 (r244047) @@ -721,6 +721,7 @@ vendor RTSYSTEMS 0x2100 RTSYSTEMS vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola +vendor WETELECOM 0x22de WeTelecom vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ @@ -4194,6 +4195,9 @@ product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD product WESTERN MYPASSWORD 0x0704 MyPassword External HDD +/* WeTelecom products */ +product WETELECOM WM_D200 0x6801 WM-D200 + /* WIENER Plein & Baus GmbH products */ product WIENERPLEINBAUS PL512 0x0010 PL512 PSU product WIENERPLEINBAUS RCM 0x0011 RCM Remote Control From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 15:25:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E24BC800; Sun, 9 Dec 2012 15:25:34 +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 C672B8FC08; Sun, 9 Dec 2012 15:25:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9FPYH0074745; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9FPYsG074743; Sun, 9 Dec 2012 15:25:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212091525.qB9FPYsG074743@svn.freebsd.org> From: Devin Teske Date: Sun, 9 Dec 2012 15:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244048 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 15:25:35 -0000 Author: dteske Date: Sun Dec 9 15:25:34 2012 New Revision: 244048 URL: http://svnweb.freebsd.org/changeset/base/244048 Log: Use ASCII characters for box/line characters in frames.4th Committed with changes to support the following from loader.conf(5): + console="vidconsole comconsole" (not just console="comconsole") + boot_serial="anything" (not just boot_serial="YES") + boot_multicons="anything" (unsupported in originally-submitted patch) PR: conf/121064 Submitted by: koitsu Reviewed by: gcooper, adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/sys/boot/forth/frames.4th head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/frames.4th ============================================================================== --- head/sys/boot/forth/frames.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/frames.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -12,6 +12,11 @@ variable rt_el variable rb_el variable fill +\ ASCII frames (used when serial console is detected) + 45 constant ascii_dash +124 constant ascii_pipe + 43 constant ascii_plus + s" arch-pc98" environment? [if] \ Single frames 149 constant sh_el @@ -63,7 +68,17 @@ s" arch-pc98" environment? [if] loop ; +: f_ascii ( -- ) ( -- ) \ set frames to ascii + ascii_dash h_el ! + ascii_pipe v_el ! + ascii_plus lt_el ! + ascii_plus lb_el ! + ascii_plus rt_el ! + ascii_plus rb_el ! +; + : f_single ( -- ) \ set frames to single + boot_serial? if f_ascii exit then sh_el h_el ! sv_el v_el ! slt_el lt_el ! @@ -73,6 +88,7 @@ s" arch-pc98" environment? [if] ; : f_double ( -- ) \ set frames to double + boot_serial? if f_ascii exit then dh_el h_el ! dv_el v_el ! dlt_el lt_el ! Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Sun Dec 9 09:58:44 2012 (r244047) +++ head/sys/boot/forth/support.4th Sun Dec 9 15:25:34 2012 (r244048) @@ -201,6 +201,46 @@ create last_module_option sizeof module. : getenv? getenv -1 = if false else drop true then ; +\ determine if a word appears in a string, case-insensitive +: contains? ( addr1 len1 addr2 len2 -- 0 | -1 ) + 2 pick 0= if 2drop 2drop true exit then + dup 0= if 2drop 2drop false exit then + begin + begin + swap dup c@ dup 32 = over 9 = or + over 10 = or over 13 = or swap drop + while 1+ swap 1- repeat + swap 2 pick 1- over < + while + 2over 2over drop over compare-insensitive 0= if + 2 pick over = if 2drop 2drop true exit then + 2 pick tuck - -rot + swap over c@ dup 32 = + over 9 = or over 10 = or over 13 = or + swap drop if 2drop 2drop true exit then + then begin + swap dup c@ + dup 32 = over 9 = or over 10 = or over 13 = or + swap drop if false else true then 2 pick 0> and + while 1+ swap 1- repeat + swap + repeat + 2drop 2drop false +; + +: boot_serial? ( -- 0 | -1 ) + s" console" getenv dup -1 <> if + s" comconsole" 2swap contains? + else drop false then + s" boot_serial" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ console contains comconsole ( or ) boot_serial + s" boot_multicons" getenv dup -1 <> if + swap drop 0> + else drop false then + or \ previous boolean ( or ) boot_multicons +; + \ Private definitions vocabulary support-functions From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 17:27:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 700FA8A1; Sun, 9 Dec 2012 17:27:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 502338FC12; Sun, 9 Dec 2012 17:27:42 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so1828815lah.13 for ; Sun, 09 Dec 2012 09:27:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BdjMQY+z/SKGfcSntiLKelDdhYnzYFUmP3jlrWLv+v8=; b=gn8kwOS7NIW7KrZN5TWxtuiPJsokRGiihL06aC/u+Vdva455bIhB0hQLSaTo4njoDc OWrR1S5L+lMNtdYD9lm8SNIjxHyowz0lr5Gvuxl0pStTB3Te/pCAyOr5MjDghYEJSJ45 wUGo0tEzuvqiTZXd7XHy1wmMVfCx31YbyDwXyV6/+v5miOkWmhJW2FQn6uy7biCzkIxI Kw2XyhwI5XPIIJ5+nK0nzM+i9o97SGoqIVISurTHSXcq8hQ/jTzRIUkW+8m7yaBsgmxq sS58RKIPzBjrA9JdlIgDoKxu1pVccKrR3Zreem9yIjBIhfNAdc00dJ480Dl6OfVD0dsX ZX9A== MIME-Version: 1.0 Received: by 10.112.84.168 with SMTP id a8mr4810670lbz.75.1355074062073; Sun, 09 Dec 2012 09:27:42 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Sun, 9 Dec 2012 09:27:41 -0800 (PST) In-Reply-To: <201211251422.qAPEM8BV074656@svn.freebsd.org> References: <201211251422.qAPEM8BV074656@svn.freebsd.org> Date: Sun, 9 Dec 2012 17:27:41 +0000 X-Google-Sender-Auth: a7Kkxz9PMzXXOI4Xip0qi5vCKfA Message-ID: Subject: Re: svn commit: r243515 - head/sys/kern From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 17:27:44 -0000 On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: > Author: avg > Date: Sun Nov 25 14:22:08 2012 > New Revision: 243515 > URL: http://svnweb.freebsd.org/changeset/base/243515 > > Log: > remove stop_scheduler_on_panic knob > > There has not been any complaints about the default behavior, so there > is no need to keep a knob that enables the worse alternative. > > Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu > spinlock-like logic can be dropped, because only a single CPU is > supposed to win stop_cpus_hard(other_cpus) race and proceed past that > call. While this is true for the sane case, for the case report by Ryan this still breaks. Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 wins and then sets stopping_cpu. When the deadlock happens in the spinning loop, because of generic_stop_cpus() logic CPU0 won't deadlock and will correctly continue, but the problem is that it sets back stopping_cpu to NOCPU, letting CPU1 continuing too and then deadlocking. At the minimum, what I think that should happen is to have the check in panic() as prior this change but with the add I outlined (thus we need to generalize cpustop_handler()). However, it seems to me that generic_stop_cpus() may still be broken by this and we eventually need to fix it. I would then revert this part of the patch and fix it appropriately. Later we can better discuss the generic_stop_cpus() similar race. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 17:51:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B28C8E16; Sun, 9 Dec 2012 17:51:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1F28FC0C; Sun, 9 Dec 2012 17:51:23 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so1920990lbb.13 for ; Sun, 09 Dec 2012 09:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3iCi0Hk1r20dghuz1lyN0yJI6F9AZjQ9yOaOBkPbB/E=; b=x1Zzf3JZa8Q3Iu+HEyqxJ+lEyuDhEQUkBAVkpC10ANHJKMr2fWTqD/Mk2T6hzNkTxu OgWAMehDm9Gk/GWFH5ja/V6wyJfSRYriHZcpVoG1OQ3mnXVvAyCGez2DRSPhDXRDgxTa KwSZ3Yke5NxbfU4sDgn0M9knGnMKI6zl0Ggg2EHfiKPpifIEVDewPBhY9JQW0gEpNsS0 dulxKA3HsMiZf8yGk1B+FcAtmEvsaEqTRprAL58am78xYuzUTyGqW5e/4FbOFNvOp0sy +JePIZHtmsT1dChYiIdfoZ52e+pUCnDGJZdnOkSAryDqFZiHNmsFtUdtk0XRlgWk2P8s vwGg== MIME-Version: 1.0 Received: by 10.112.87.40 with SMTP id u8mr5054504lbz.50.1355075481404; Sun, 09 Dec 2012 09:51:21 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Sun, 9 Dec 2012 09:51:21 -0800 (PST) In-Reply-To: <201206120014.q5C0EsqK018853@svn.freebsd.org> References: <201206120014.q5C0EsqK018853@svn.freebsd.org> Date: Sun, 9 Dec 2012 17:51:21 +0000 X-Google-Sender-Auth: KVT3G0Wzz-egBYGvmiH3iBrf5xs Message-ID: Subject: Re: svn commit: r236938 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/acpica From: Attilio Rao To: Mitsuru IWASAKI Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 17:51:24 -0000 On Tue, Jun 12, 2012 at 1:14 AM, Mitsuru IWASAKI wrote: > Author: iwasaki > Date: Tue Jun 12 00:14:54 2012 > New Revision: 236938 > URL: http://svn.freebsd.org/changeset/base/236938 > > Log: > Share IPI init and startup code of mp_machdep.c with acpi_wakeup.c > as ipi_startup(). > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/amd64/include/smp.h I think that after these changes smp.h should go in x86/ subdir. Infact now amd64 and i386 version are so similar that they can do safely be merged (the only difference being the lazypmap ipi counter and the mpboot exports. If you are interested into it, please make a patch, I'd be happy to review. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:06:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECAFB4B0; Sun, 9 Dec 2012 18:06:28 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id 980AF8FC12; Sun, 9 Dec 2012 18:06:28 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id D4E301005; Sun, 9 Dec 2012 19:06:26 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1v6qjIdiJvJp; Sun, 9 Dec 2012 19:06:24 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id 4E64E1FF9; Sun, 9 Dec 2012 19:06:23 +0100 (CET) Message-ID: <50C4D31E.4080000@smeets.im> Date: Sun, 09 Dec 2012 19:06:22 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Andre Oppermann , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> In-Reply-To: <201211161205.qAGC5Bwr081144@svn.freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2XUNTGKQQBDLJVEWGJVBS" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:06:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XUNTGKQQBDLJVEWGJVBS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 16.11.12 13:05, Andre Oppermann wrote: > Author: andre > Date: Fri Nov 16 12:05:10 2012 > New Revision: 243147 > URL: http://svnweb.freebsd.org/changeset/base/243147 >=20 > Log: > Change fetch(1) to: > =20 > o Report the instantaneous bandwidth instead of an average since the > beginning of the download. > =20 > o At the finish of the download report the average bandwidth and also= > the total time it took instead of 00m00s. > =20 Andre, it looks like this change breaks the bandwidth calculation when using -r 52% of 146 MB -25199509 Bps 03m28s Going back to r243146 fixes it. Florian ------enig2XUNTGKQQBDLJVEWGJVBS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE0x4ACgkQapo8P8lCvwlBsgCeK1XRwTcFa68HE3bfiOEeD7NV 78AAoNTJTMNNcACYSMfyA1IelgDuCsND =HR+/ -----END PGP SIGNATURE----- ------enig2XUNTGKQQBDLJVEWGJVBS-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:27:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E5C539D6; Sun, 9 Dec 2012 18:27:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id E264F8FC12; Sun, 9 Dec 2012 18:27:41 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so1308902wgh.31 for ; Sun, 09 Dec 2012 10:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/VbGk2qhT8BouDMTJNHk9WZN4QQhNjKcqvFzJ29T5zE=; b=QX9bEvdXUCNHXKCS09Y2aYnE23g9H22f7pfQWDhtjT6AwGCgGhxo2B+tWYhMxccOTd r0s6hxI2wpabBzIy6jZh5hYebW8BO1+T/Jkxf/Merm24cD6MGlnuK3Epbrh0GDUMZ4Wf lMh89fP9kBxFp8E3QNKUUvQt3emnfmIPGYFVn0oBg8prqnerxsA4P7mUoeArx+xq4r3Z D8VKYKZK4kavZKBwQI9UHDPrzvHOgYQW/CJs89vGuuN0oXJiWtg0DSJYlPXrtOmMiiNJ EO+y0TNY6YXyjS/EjYVYnHEQBk0I3/YVeR53dU90Z6tPcqKS3sbufkN2uH9qP9QRVBPm IK0A== Received: by 10.180.106.34 with SMTP id gr2mr7209066wib.18.1355077660433; Sun, 09 Dec 2012 10:27:40 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id t17sm8038708wiv.6.2012.12.09.10.27.38 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 10:27:39 -0800 (PST) Date: Sun, 9 Dec 2012 19:27:30 +0100 From: Mateusz Guzik To: Florian Smeets Subject: Re: svn commit: r243147 - head/usr.bin/fetch Message-ID: <20121209182730.GA28989@dft-labs.eu> References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50C4D31E.4080000@smeets.im> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:27:43 -0000 On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: > On 16.11.12 13:05, Andre Oppermann wrote: > > Author: andre > > Date: Fri Nov 16 12:05:10 2012 > > New Revision: 243147 > > URL: http://svnweb.freebsd.org/changeset/base/243147 > > > > Log: > > Change fetch(1) to: > > > > o Report the instantaneous bandwidth instead of an average since the > > beginning of the download. > > > > o At the finish of the download report the average bandwidth and also > > the total time it took instead of 00m00s. > > > > Andre, > > it looks like this change breaks the bandwidth calculation when using -r > > 52% of 146 MB -25199509 Bps 03m28s > > Going back to r243146 fixes it. > Try this: diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..e723d40 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of gettimeofday(&xs->start, NULL); xs->last.tv_sec = xs->last.tv_usec = 0; xs->size = size; - xs->offset = offset; + xs->offset = 0; xs->rcvd = offset; xs->lastrcvd = offset; if (v_tty && v_level > 0) -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:42:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43BFBE4F; Sun, 9 Dec 2012 18:42:08 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id DB6318FC08; Sun, 9 Dec 2012 18:42:07 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id E4EC5108A; Sun, 9 Dec 2012 19:42:06 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6a3prhVXlyid; Sun, 9 Dec 2012 19:42:05 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id 3C1801081; Sun, 9 Dec 2012 19:42:04 +0100 (CET) Message-ID: <50C4DB7A.9050302@smeets.im> Date: Sun, 09 Dec 2012 19:42:02 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> In-Reply-To: <20121209182730.GA28989@dft-labs.eu> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OQMAESFMISHHKKNJLKDJ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:42:08 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OQMAESFMISHHKKNJLKDJ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09.12.12 19:27, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >> On 16.11.12 13:05, Andre Oppermann wrote: >>> Author: andre >>> Date: Fri Nov 16 12:05:10 2012 >>> New Revision: 243147 >>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>> >>> Log: >>> Change fetch(1) to: >>> =20 >>> o Report the instantaneous bandwidth instead of an average since th= e >>> beginning of the download. >>> =20 >>> o At the finish of the download report the average bandwidth and al= so >>> the total time it took instead of 00m00s. >>> =20 >> >> Andre, >> >> it looks like this change breaks the bandwidth calculation when using = -r >> >> 52% of 146 MB -25199509 Bps 03m28s >> >> Going back to r243146 fixes it. >> >=20 > Try this: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..e723d40 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, o= ff_t size, off_t of > gettimeofday(&xs->start, NULL); > xs->last.tv_sec =3D xs->last.tv_usec =3D 0; > xs->size =3D size; > - xs->offset =3D offset; > + xs->offset =3D 0; > xs->rcvd =3D offset; > xs->lastrcvd =3D offset; > if (v_tty && v_level > 0) >=20 That way the bandwidth calculation looks OK but now it counts the time since starting to resume the download and not the time left :) 63% of 146 MB 7069 kBps 00m07s Florian ------enig2OQMAESFMISHHKKNJLKDJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE23oACgkQapo8P8lCvwnVaQCdHhGGQsFzDMcqve+kVqsGsFEJ 4OkAoJUIEMjAovUsgNbos0ASjrAXmbO/ =2JJ9 -----END PGP SIGNATURE----- ------enig2OQMAESFMISHHKKNJLKDJ-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:45:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 120E4FEA; Sun, 9 Dec 2012 18:45:21 +0000 (UTC) (envelope-from adrian@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 EB2A98FC15; Sun, 9 Dec 2012 18:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9IjK2j004011; Sun, 9 Dec 2012 18:45:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9IjKwG004010; Sun, 9 Dec 2012 18:45:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212091845.qB9IjKwG004010@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 18:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r244049 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:45:21 -0000 Author: adrian Date: Sun Dec 9 18:45:20 2012 New Revision: 244049 URL: http://svnweb.freebsd.org/changeset/base/244049 Log: Oops, Devin wasn't ever listed as a mentee. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Dec 9 15:25:34 2012 (r244048) +++ svnadmin/conf/mentors Sun Dec 9 18:45:20 2012 (r244049) @@ -16,6 +16,7 @@ benl philip Co-mentor: simon bgray cognet bryanv grehan davidcs gnn +dteske adrian eadler cperciva eri mlaier Co-mentor: thompsa erwin delphij From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 18:46:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 517611D6; Sun, 9 Dec 2012 18:46:00 +0000 (UTC) (envelope-from adrian@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 36F7E8FC14; Sun, 9 Dec 2012 18:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9Ik0Zj004134; Sun, 9 Dec 2012 18:46:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9Ik0Ag004133; Sun, 9 Dec 2012 18:46:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212091846.qB9Ik0Ag004133@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 18:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r244050 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 18:46:00 -0000 Author: adrian Date: Sun Dec 9 18:45:59 2012 New Revision: 244050 URL: http://svnweb.freebsd.org/changeset/base/244050 Log: Formally/properly release dteske from mentorship. Go forth and code stuff! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Dec 9 18:45:20 2012 (r244049) +++ svnadmin/conf/mentors Sun Dec 9 18:45:59 2012 (r244050) @@ -16,7 +16,6 @@ benl philip Co-mentor: simon bgray cognet bryanv grehan davidcs gnn -dteske adrian eadler cperciva eri mlaier Co-mentor: thompsa erwin delphij From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 19:01:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 065D44B9; Sun, 9 Dec 2012 19:01:33 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC808FC14; Sun, 9 Dec 2012 19:01:31 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so679611wib.13 for ; Sun, 09 Dec 2012 11:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8eRDa8ifi1KxbXGDQY7hAuZmOkSeVgHqMJ0GSy1N/IE=; b=H2zbTIPRi9AuUCAwJnHH+tvGobvtoDEFBnfzI/7GSA2nCNfdw008zAIjzt/GrytKZk nCndFK+EczHoLZcyPhVkHpRHa1zJJjgIS768MfhdISkDrvYSqLXRtZc6Uz1MTVfxbTRl 14T2SHtpR2gpUMiAzs/XDEytek2HXvosB8dxRQPQ94P91dg5ww2vk4YCudTzKT5rYswW TmCiJCBCQ6rZZWa5zvp6PdPDAVoHPm5Q1wedT+NboXJHI0NOlJOVZGx8bfPVErfrNc7h 78sDTHleKjf6pAKwoqkQAZXwkYi8BjNzOpHz9y0Mu3KiUfYZs6tARp/lwfW7D9UQ237C sSxQ== Received: by 10.180.75.135 with SMTP id c7mr7309616wiw.10.1355079690935; Sun, 09 Dec 2012 11:01:30 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id w5sm8159012wiz.10.2012.12.09.11.01.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 11:01:29 -0800 (PST) Date: Sun, 9 Dec 2012 20:01:20 +0100 From: Mateusz Guzik To: Florian Smeets Subject: Re: svn commit: r243147 - head/usr.bin/fetch Message-ID: <20121209190120.GB28989@dft-labs.eu> References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50C4DB7A.9050302@smeets.im> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 19:01:33 -0000 On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: > On 09.12.12 19:27, Mateusz Guzik wrote: > > On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: > >> On 16.11.12 13:05, Andre Oppermann wrote: > >>> Author: andre > >>> Date: Fri Nov 16 12:05:10 2012 > >>> New Revision: 243147 > >>> URL: http://svnweb.freebsd.org/changeset/base/243147 > >>> > >>> Log: > >>> Change fetch(1) to: > >>> > >>> o Report the instantaneous bandwidth instead of an average since the > >>> beginning of the download. > >>> > >>> o At the finish of the download report the average bandwidth and also > >>> the total time it took instead of 00m00s. > >>> > >> > >> Andre, > >> > >> it looks like this change breaks the bandwidth calculation when using -r > >> > >> 52% of 146 MB -25199509 Bps 03m28s > >> > >> Going back to r243146 fixes it. > >> > > > > Try this: > > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > > index 025fcdc..e723d40 100644 > > --- a/usr.bin/fetch/fetch.c > > +++ b/usr.bin/fetch/fetch.c > > @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of > > gettimeofday(&xs->start, NULL); > > xs->last.tv_sec = xs->last.tv_usec = 0; > > xs->size = size; > > - xs->offset = offset; > > + xs->offset = 0; > > xs->rcvd = offset; > > xs->lastrcvd = offset; > > if (v_tty && v_level > 0) > > > > That way the bandwidth calculation looks OK but now it counts the time > since starting to resume the download and not the time left :) > > 63% of 146 MB 7069 kBps 00m07s > Oops.. revert that and try this instead: diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 025fcdc..d3e9b21 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 19:20:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 995AE8CC; Sun, 9 Dec 2012 19:20:29 +0000 (UTC) (envelope-from adrian@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 738668FC12; Sun, 9 Dec 2012 19:20:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9JKT73010063; Sun, 9 Dec 2012 19:20:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9JKTF7010061; Sun, 9 Dec 2012 19:20:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212091920.qB9JKTF7010061@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 19:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244051 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 19:20:29 -0000 Author: adrian Date: Sun Dec 9 19:20:28 2012 New Revision: 244051 URL: http://svnweb.freebsd.org/changeset/base/244051 Log: Atheros SuperG bug fixes, as part of hunting down kern/174283. The stageqdepth (global, over all staging queues) was being kept incorrectly. It was being incremented whenever things were added, but only decremented during a flush. During active fast frames activity it wasn't being decremented, resulting in it always having a non-zero value during normal fast-frames operation. It was only used when checking if the aging queue should be checked; we may as well just defer to each of those staging queue counters (which look correct, thankfully.) Whilst I'm here, add locking assertions in the staging queue add/remove functions. The current crash shows that the staging queue has one frame, but only has a tail pointer set (the head pointer being set to NULL.) I'd like to grab a few more crashes where these locking assertions are in place so I can narrow down the issue between "somehow locking is messed up and things are racy" and "the stage queue head/tail pointer manipulation logic is subtly wrong." Tested: * AR5416 STA, AR5413 AP; with FastFrames enabled in the AR5416 HAL. PR: kern/174283 Modified: head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_superg.h Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Dec 9 18:45:59 2012 (r244050) +++ head/sys/net80211/ieee80211_superg.c Sun Dec 9 19:20:28 2012 (r244051) @@ -560,7 +560,6 @@ void ieee80211_ff_age(struct ieee80211com *ic, struct ieee80211_stageq *sq, int quanta) { - struct ieee80211_superg *sg = ic->ic_superg; struct mbuf *m, *head; struct ieee80211_node *ni; struct ieee80211_tx_ampdu *tap; @@ -582,7 +581,6 @@ ieee80211_ff_age(struct ieee80211com *ic sq->head = m->m_nextpkt; sq->depth--; - sg->ff_stageqdepth--; } if (m == NULL) sq->tail = NULL; @@ -594,9 +592,12 @@ ieee80211_ff_age(struct ieee80211com *ic } static void -stageq_add(struct ieee80211_stageq *sq, struct mbuf *m) +stageq_add(struct ieee80211com *ic, struct ieee80211_stageq *sq, struct mbuf *m) { int age = ieee80211_ffagemax; + + IEEE80211_LOCK_ASSERT(ic); + if (sq->tail != NULL) { sq->tail->m_nextpkt = m; age -= M_AGE_GET(sq->head); @@ -610,10 +611,12 @@ stageq_add(struct ieee80211_stageq *sq, } static void -stageq_remove(struct ieee80211_stageq *sq, struct mbuf *mstaged) +stageq_remove(struct ieee80211com *ic, struct ieee80211_stageq *sq, struct mbuf *mstaged) { struct mbuf *m, *mprev; + IEEE80211_LOCK_ASSERT(ic); + mprev = NULL; for (m = sq->head; m != NULL; m = m->m_nextpkt) { if (m == mstaged) { @@ -725,7 +728,7 @@ ieee80211_ff_check(struct ieee80211_node tap->txa_private = NULL; if (mstaged != NULL) - stageq_remove(sq, mstaged); + stageq_remove(ic, sq, mstaged); IEEE80211_UNLOCK(ic); if (mstaged != NULL) { @@ -745,7 +748,7 @@ ieee80211_ff_check(struct ieee80211_node */ if (mstaged != NULL) { tap->txa_private = NULL; - stageq_remove(sq, mstaged); + stageq_remove(ic, sq, mstaged); IEEE80211_UNLOCK(ic); IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, @@ -766,8 +769,7 @@ ieee80211_ff_check(struct ieee80211_node ("txa_private %p", tap->txa_private)); tap->txa_private = m; - stageq_add(sq, m); - sg->ff_stageqdepth++; + stageq_add(ic, sq, m); IEEE80211_UNLOCK(ic); IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, @@ -806,7 +808,7 @@ ieee80211_ff_node_cleanup(struct ieee802 m = tap->txa_private; if (m != NULL) { tap->txa_private = NULL; - stageq_remove(&sg->ff_stageq[ac], m); + stageq_remove(ic, &sg->ff_stageq[ac], m); m->m_nextpkt = head; head = m; } Modified: head/sys/net80211/ieee80211_superg.h ============================================================================== --- head/sys/net80211/ieee80211_superg.h Sun Dec 9 18:45:59 2012 (r244050) +++ head/sys/net80211/ieee80211_superg.h Sun Dec 9 19:20:28 2012 (r244051) @@ -66,7 +66,6 @@ struct ieee80211_stageq { struct ieee80211_superg { /* fast-frames staging q */ struct ieee80211_stageq ff_stageq[WME_NUM_AC]; - int ff_stageqdepth; /* cumulative depth */ }; void ieee80211_superg_attach(struct ieee80211com *); @@ -109,7 +108,7 @@ ieee80211_ff_age_all(struct ieee80211com { struct ieee80211_superg *sg = ic->ic_superg; - if (sg != NULL && sg->ff_stageqdepth) { + if (sg != NULL) { if (sg->ff_stageq[WME_AC_VO].depth) ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_VO], quanta); if (sg->ff_stageq[WME_AC_VI].depth) From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 19:53:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A6804C2; Sun, 9 Dec 2012 19:53:22 +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 E335D8FC14; Sun, 9 Dec 2012 19:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9JrLnc016537; Sun, 9 Dec 2012 19:53:21 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9JrL34016535; Sun, 9 Dec 2012 19:53:21 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201212091953.qB9JrL34016535@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sun, 9 Dec 2012 19:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244052 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 19:53:22 -0000 Author: ken Date: Sun Dec 9 19:53:21 2012 New Revision: 244052 URL: http://svnweb.freebsd.org/changeset/base/244052 Log: 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 Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Dec 9 19:20:28 2012 (r244051) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Dec 9 19:53:21 2012 (r244052) @@ -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: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Sun Dec 9 19:20:28 2012 (r244051) +++ head/sys/cam/ctl/scsi_ctl.c Sun Dec 9 19:53:21 2012 (r244052) @@ -1687,16 +1687,21 @@ ctlfe_onoffline(void *arg, int online) set_wwnn = 0; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); 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__); + CAM_SIM_UNLOCK(sim); return; } + CAM_SIM_UNLOCK(sim); + ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); - sim = xpt_path_sim(path); /* * Copan WWN format: @@ -1883,27 +1888,30 @@ ctlfe_lun_enable(void *arg, struct ctl_i bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); - status = xpt_create_path_unlocked(&path, /*periph*/ NULL, - bus_softc->path_id, - targ_id.id, - lun_id); + status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_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__, status); + CAM_SIM_UNLOCK(sim); return (1); } + CAM_SIM_UNLOCK(sim); 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,7 +1931,7 @@ ctlfe_lun_enable(void *arg, struct ctl_i xpt_free_path(path); - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 19:53:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3341631; Sun, 9 Dec 2012 19:53:56 +0000 (UTC) (envelope-from flo@smeets.im) Received: from mail.solomo.de (mail.solomo.de [5.9.87.18]) by mx1.freebsd.org (Postfix) with ESMTP id 7241C8FC14; Sun, 9 Dec 2012 19:53:56 +0000 (UTC) Received: from cpos1.nexxtmobile.de (localhost [127.0.0.1]) by mail.solomo.de (Postfix) with ESMTP id 867241214; Sun, 9 Dec 2012 20:53:54 +0100 (CET) X-Virus-Scanned: amavisd-new at nexxtmobile.de Received: from mail.solomo.de ([127.0.0.1]) by cpos1.nexxtmobile.de (cpos1.nexxtmobile.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id r-MBOwv5F49L; Sun, 9 Dec 2012 20:53:52 +0100 (CET) Received: from nibbler-osx.local (b2b-92-50-66-163.unitymedia.biz [92.50.66.163]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.solomo.de (Postfix) with ESMTPSA id F1BD3120B; Sun, 9 Dec 2012 20:53:51 +0100 (CET) Message-ID: <50C4EC4E.6060006@smeets.im> Date: Sun, 09 Dec 2012 20:53:50 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a1 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> <20121209190120.GB28989@dft-labs.eu> In-Reply-To: <20121209190120.GB28989@dft-labs.eu> X-Enigmail-Version: 1.5a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2GWMXOHKMAEKERRJRPQUQ" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 19:53:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2GWMXOHKMAEKERRJRPQUQ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 09.12.12 20:01, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: >> On 09.12.12 19:27, Mateusz Guzik wrote: >>> On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >>>> On 16.11.12 13:05, Andre Oppermann wrote: >>>>> Author: andre >>>>> Date: Fri Nov 16 12:05:10 2012 >>>>> New Revision: 243147 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>>>> >>>>> Log: >>>>> Change fetch(1) to: >>>>> =20 >>>>> o Report the instantaneous bandwidth instead of an average since = the >>>>> beginning of the download. >>>>> =20 >>>>> o At the finish of the download report the average bandwidth and = also >>>>> the total time it took instead of 00m00s. >>>>> =20 >>>> >>>> Andre, >>>> >>>> it looks like this change breaks the bandwidth calculation when usin= g -r >>>> >>>> 52% of 146 MB -25199509 Bps 03m28s >>>> >>>> Going back to r243146 fixes it. >>>> >>> >>> Try this: >>> diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c >>> index 025fcdc..e723d40 100644 >>> --- a/usr.bin/fetch/fetch.c >>> +++ b/usr.bin/fetch/fetch.c >>> @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name,= off_t size, off_t of >>> gettimeofday(&xs->start, NULL); >>> xs->last.tv_sec =3D xs->last.tv_usec =3D 0; >>> xs->size =3D size; >>> - xs->offset =3D offset; >>> + xs->offset =3D 0; >>> xs->rcvd =3D offset; >>> xs->lastrcvd =3D offset; >>> if (v_tty && v_level > 0) >>> >> >> That way the bandwidth calculation looks OK but now it counts the time= >> since starting to resume the download and not the time left :) >> >> 63% of 146 MB 7069 kBps 00m07s >> >=20 > Oops.. revert that and try this instead: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..d3e9b21 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) > if (delta =3D=3D 0.0) { > snprintf(str, sizeof str, "?? Bps"); > } else { > - bps =3D (xs->rcvd - xs->lastrcvd - xs->offset) / delta;= > + bps =3D (xs->rcvd - xs->lastrcvd) / delta; > snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps= )); > } > return (str); >=20 That looks much better. 68% of 146 MB 556 kBps 01m40s Thanks! Florian ------enig2GWMXOHKMAEKERRJRPQUQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlDE7E4ACgkQapo8P8lCvwkdNACffeHvkd0JO8cU8ftkXviDwxeL KzgAoIf2r2Af6pbeyeCA45YCGNZJVuqT =w/Eq -----END PGP SIGNATURE----- ------enig2GWMXOHKMAEKERRJRPQUQ-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 20:26:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14BE6F26; Sun, 9 Dec 2012 20:26: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 F04288FC14; Sun, 9 Dec 2012 20:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9KQpbC024000; Sun, 9 Dec 2012 20:26:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9KQpDl023999; Sun, 9 Dec 2012 20:26:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212092026.qB9KQpDl023999@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 Dec 2012 20:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244053 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 20:26:52 -0000 Author: kib Date: Sun Dec 9 20:26:51 2012 New Revision: 244053 URL: http://svnweb.freebsd.org/changeset/base/244053 Log: Fix typo. MFC after: 3 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Dec 9 19:53:21 2012 (r244052) +++ head/sys/kern/vfs_mount.c Sun Dec 9 20:26:51 2012 (r244053) @@ -711,7 +711,7 @@ sys_mount(td, uap) int error; /* - * Mount flags are now 64-bits. On 32-bit archtectures only + * Mount flags are now 64-bits. On 32-bit architectures only * 32-bits are passed in, but from here on everything handles * 64-bit flags correctly. */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 20:34:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46AEA32D; Sun, 9 Dec 2012 20:34:12 +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 27FC18FC08; Sun, 9 Dec 2012 20:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9KYCjl025392; Sun, 9 Dec 2012 20:34:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9KYCgM025391; Sun, 9 Dec 2012 20:34:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212092034.qB9KYCgM025391@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 Dec 2012 20:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244054 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 20:34:12 -0000 Author: kib Date: Sun Dec 9 20:34:11 2012 New Revision: 244054 URL: http://svnweb.freebsd.org/changeset/base/244054 Log: Remove useless comment. MFC after: 3 days Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Dec 9 20:26:51 2012 (r244053) +++ head/sys/kern/vfs_bio.c Sun Dec 9 20:34:11 2012 (r244054) @@ -2605,8 +2605,6 @@ loop: * If this check ever becomes a bottleneck it may be better to * move it into the else, when gbincore() fails. At the moment * it isn't a problem. - * - * XXX remove if 0 sections (clean this up after its proven) */ if (numfreebuffers == 0) { if (TD_IS_IDLETHREAD(curthread)) From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 20:35:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B39BB4AD; Sun, 9 Dec 2012 20:35:12 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 774818FC08; Sun, 9 Dec 2012 20:35:12 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 76BCC460150; Sun, 9 Dec 2012 14:35:06 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 74939460147; Sun, 9 Dec 2012 14:35:06 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id cYkcu6Rmuwqi; Sun, 9 Dec 2012 14:35:06 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E777046011D; Sun, 9 Dec 2012 14:35:05 -0600 (CST) Message-ID: <50C4F5F7.7080101@rice.edu> Date: Sun, 09 Dec 2012 14:35:03 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:16.0) Gecko/20121111 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> In-Reply-To: <201211290730.qAT7Uhkv016745@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 20:35:12 -0000 Andre, I believe that this change did not actually correct the overflow problem. See below for an explanation. On 11/29/2012 01:30, Andre Oppermann wrote: > Author: andre > Date: Thu Nov 29 07:30:42 2012 > New Revision: 243668 > URL: http://svnweb.freebsd.org/changeset/base/243668 > > Log: > Using a long is the wrong type to represent the realmem and maxmbufmem > variable as they may overflow on i386/PAE and i386 with > 2GB RAM. > > Use 64bit quad_t instead. It has broader kernel infrastructure support > with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. > > Pointed out by: alc, bde > > Modified: > head/sys/kern/subr_param.c > head/sys/sys/mbuf.h > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) > +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) > @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev > int nbuf; > int ngroups_max; /* max # groups per process */ > int nswbuf; > -long maxmbufmem; /* max mbuf memory */ > +quad_t maxmbufmem; /* max mbuf memory */ > pid_t pid_max = PID_MAX; > long maxswzone; /* max swmeta KVA storage */ > long maxbcache; /* max buffer cache KVA storage */ > @@ -271,7 +271,7 @@ init_param1(void) > void > init_param2(long physpages) > { > - long realmem; > + quad_t realmem; > > /* Base parameters */ > maxusers = MAXUSERS; > @@ -332,10 +332,10 @@ init_param2(long physpages) > * available kernel memory (physical or kmem). > * At most it can be 3/4 of available kernel memory. > */ > - realmem = lmin(physpages * PAGE_SIZE, > + realmem = qmin(physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, the product of 1,000,000 and PAGE_SIZE will be a negative number. Likewise, quad_t is a signed type. So, the negative product of 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value when it is passed to qmin(), and qmin() will return a negative number. > maxmbufmem = realmem / 2; > - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); > + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); > if (maxmbufmem > (realmem / 4) * 3) > maxmbufmem = (realmem / 4) * 3; > > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Thu Nov 29 06:26:42 2012 (r243667) > +++ head/sys/sys/mbuf.h Thu Nov 29 07:30:42 2012 (r243668) > @@ -395,7 +395,7 @@ struct mbstat { > * > * The rest of it is defined in kern/kern_mbuf.c > */ > -extern long maxmbufmem; > +extern quad_t maxmbufmem; > extern uma_zone_t zone_mbuf; > extern uma_zone_t zone_clust; > extern uma_zone_t zone_pack; > From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 21:26:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42239BDD; Sun, 9 Dec 2012 21:26:48 +0000 (UTC) (envelope-from rmacklem@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 26EFE8FC14; Sun, 9 Dec 2012 21:26:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9LQm1T035409; Sun, 9 Dec 2012 21:26:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9LQmVS035407; Sun, 9 Dec 2012 21:26:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212092126.qB9LQmVS035407@svn.freebsd.org> From: Rick Macklem Date: Sun, 9 Dec 2012 21:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244055 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 21:26:48 -0000 Author: rmacklem Date: Sun Dec 9 21:26:47 2012 New Revision: 244055 URL: http://svnweb.freebsd.org/changeset/base/244055 Log: Document the new NFS mount options added by r244042. This is a content change. Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Sun Dec 9 20:34:11 2012 (r244054) +++ head/sbin/mount_nfs/mount_nfs.8 Sun Dec 9 21:26:47 2012 (r244055) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd May 3, 2011 +.Dd December 9, 2012 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -175,6 +175,18 @@ Use the NFS Version 3 protocol. Use the NFS Version 4 protocol. This option will force the mount to use TCP transport. +.It Cm minorversion Ns = Ns Aq Ar value +Override the default of 0 for the minor version of the NFS Version 4 protocol. +The only minor version currently supported is 1. +This option is only meaningful when used with the +.Cm nfsv4 +option. +.It Cm pnfs +Enable support for parallel NFS (pNFS) for minor version 1 of the +NFS Version 4 protocol. +This option is only meaningful when used with the +.Cm minorversion +option. .It Cm noconn For UDP mount points, do not do a .Xr connect 2 . From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:23:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63AE6D8D; Sun, 9 Dec 2012 22:23:51 +0000 (UTC) (envelope-from rmacklem@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 47A6C8FC0C; Sun, 9 Dec 2012 22:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MNp15047147; Sun, 9 Dec 2012 22:23:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MNpMn047146; Sun, 9 Dec 2012 22:23:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212092223.qB9MNpMn047146@svn.freebsd.org> From: Rick Macklem Date: Sun, 9 Dec 2012 22:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244056 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:23:51 -0000 Author: rmacklem Date: Sun Dec 9 22:23:50 2012 New Revision: 244056 URL: http://svnweb.freebsd.org/changeset/base/244056 Log: Add "nfsstat -m" support for the two new NFS mount options added by r244042. Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 9 21:26:47 2012 (r244055) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Dec 9 22:23:50 2012 (r244056) @@ -1743,6 +1743,12 @@ void nfscl_retopts(struct nfsmount *nmp, blen = buflen; nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NFSV4) != 0, "nfsv4", &buf, &blen); + if ((nmp->nm_flag & NFSMNT_NFSV4) != 0) { + nfscl_printoptval(nmp, nmp->nm_minorvers, ",minorversion", &buf, + &blen); + nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_PNFS) != 0, ",pnfs", + &buf, &blen); + } nfscl_printopt(nmp, (nmp->nm_flag & NFSMNT_NFSV3) != 0, "nfsv3", &buf, &blen); nfscl_printopt(nmp, (nmp->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0, From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:42:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD395382 for ; Sun, 9 Dec 2012 22:42:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 37AF98FC17 for ; Sun, 9 Dec 2012 22:42:37 +0000 (UTC) Received: (qmail 97264 invoked from network); 10 Dec 2012 00:12:01 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 10 Dec 2012 00:12:01 -0000 Message-ID: <50C513D4.4000306@freebsd.org> Date: Sun, 09 Dec 2012 23:42:28 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> In-Reply-To: <50C4F5F7.7080101@rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:42:38 -0000 On 09.12.2012 21:35, Alan Cox wrote: > Andre, > > I believe that this change did not actually correct the overflow > problem. See below for an explanation. > > On 11/29/2012 01:30, Andre Oppermann wrote: >> Author: andre >> Date: Thu Nov 29 07:30:42 2012 >> New Revision: 243668 >> URL: http://svnweb.freebsd.org/changeset/base/243668 >> >> Log: >> Using a long is the wrong type to represent the realmem and maxmbufmem >> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >> >> Use 64bit quad_t instead. It has broader kernel infrastructure support >> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. >> >> Pointed out by: alc, bde >> >> Modified: >> head/sys/kern/subr_param.c >> head/sys/sys/mbuf.h >> >> Modified: head/sys/kern/subr_param.c >> ============================================================================== >> --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) >> +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) >> @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev >> int nbuf; >> int ngroups_max; /* max # groups per process */ >> int nswbuf; >> -long maxmbufmem; /* max mbuf memory */ >> +quad_t maxmbufmem; /* max mbuf memory */ >> pid_t pid_max = PID_MAX; >> long maxswzone; /* max swmeta KVA storage */ >> long maxbcache; /* max buffer cache KVA storage */ >> @@ -271,7 +271,7 @@ init_param1(void) >> void >> init_param2(long physpages) >> { >> - long realmem; >> + quad_t realmem; >> >> /* Base parameters */ >> maxusers = MAXUSERS; >> @@ -332,10 +332,10 @@ init_param2(long physpages) >> * available kernel memory (physical or kmem). >> * At most it can be 3/4 of available kernel memory. >> */ >> - realmem = lmin(physpages * PAGE_SIZE, >> + realmem = qmin(physpages * PAGE_SIZE, >> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > > > "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, > the product of 1,000,000 and PAGE_SIZE will be a negative number. > Likewise, quad_t is a signed type. So, the negative product of > 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value > when it is passed to qmin(), and qmin() will return a negative number. Thank you taking a second look it. To be honest I got a bit confused on which automatic type expansion applies here. qmax() is defined as this in libkern.h: static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of the computation, which happens in long space, is passed on. This is a function, not a macro. Dang... This change will force the computation to be in quad_t space: - realmem = qmin(physpages * PAGE_SIZE, + realmem = qmin((quad_t)physpages * PAGE_SIZE, VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t type. -- Andre >> maxmbufmem = realmem / 2; >> - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); >> + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); >> if (maxmbufmem > (realmem / 4) * 3) >> maxmbufmem = (realmem / 4) * 3; >> >> >> Modified: head/sys/sys/mbuf.h >> ============================================================================== >> --- head/sys/sys/mbuf.h Thu Nov 29 06:26:42 2012 (r243667) >> +++ head/sys/sys/mbuf.h Thu Nov 29 07:30:42 2012 (r243668) >> @@ -395,7 +395,7 @@ struct mbstat { >> * >> * The rest of it is defined in kern/kern_mbuf.c >> */ >> -extern long maxmbufmem; >> +extern quad_t maxmbufmem; >> extern uma_zone_t zone_mbuf; >> extern uma_zone_t zone_clust; >> extern uma_zone_t zone_pack; >> > D > > From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:53:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 983E2673; Sun, 9 Dec 2012 22:53:54 +0000 (UTC) (envelope-from gjb@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 7CB408FC0C; Sun, 9 Dec 2012 22:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MrsH5052478; Sun, 9 Dec 2012 22:53:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9Mrsce052477; Sun, 9 Dec 2012 22:53:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212092253.qB9Mrsce052477@svn.freebsd.org> From: Glen Barber Date: Sun, 9 Dec 2012 22:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244057 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:53:54 -0000 Author: gjb (doc,ports committer) Date: Sun Dec 9 22:53:53 2012 New Revision: 244057 URL: http://svnweb.freebsd.org/changeset/base/244057 Log: Get 'uname -r' earlier, so it can be used to determine what branch is being run to set BSDINSTALL_DISTSITE accordingly. This change allows non-RELEASE branches to use the FTP snapshots directory for bootonly.iso installations. Approved by: simon Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:23:50 2012 (r244056) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:53:53 2012 (r244057) @@ -191,7 +191,18 @@ MIRROR=`dialog --backtitle "FreeBSD Inst MIRROR_BUTTON=$? exec 3>&- -BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/releases/`uname -m`/`uname -p`/`uname -r`" +_UNAME_R=`uname -r` + +case ${_UNAME_R} in + *-CURRENT|*-STABLE|*-PRERELEASE|*-RC*) + RELDIR="snapshots" + ;; + *) + RELDIR="releases" + ;; +esac + +BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" case $MIRROR_BUTTON in $DIALOG_CANCEL) From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:54:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C4378E; Sun, 9 Dec 2012 22:54:03 +0000 (UTC) (envelope-from andre@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 AA1DB8FC13; Sun, 9 Dec 2012 22:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9Ms3ao052562; Sun, 9 Dec 2012 22:54:03 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9Ms3ge052561; Sun, 9 Dec 2012 22:54:03 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201212092254.qB9Ms3ge052561@svn.freebsd.org> From: Andre Oppermann Date: Sun, 9 Dec 2012 22:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244058 - head/usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:54:03 -0000 Author: andre Date: Sun Dec 9 22:54:03 2012 New Revision: 244058 URL: http://svnweb.freebsd.org/changeset/base/244058 Log: Fix bandwidth reporting when doing a restarted download with "-r". The offset is already accounted for in xs->lastrcvd and doesn't have to be subtracted again. Reported by: Florian Smeets Submitted by: Mateusz Guzik Tested by: Florian Smeets MFC after: 1 week Modified: head/usr.bin/fetch/fetch.c Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Sun Dec 9 22:53:53 2012 (r244057) +++ head/usr.bin/fetch/fetch.c Sun Dec 9 22:54:03 2012 (r244058) @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:55:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B395950; Sun, 9 Dec 2012 22:55:52 +0000 (UTC) (envelope-from gjb@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 F39368FC14; Sun, 9 Dec 2012 22:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MtpPp052913; Sun, 9 Dec 2012 22:55:51 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MtpMH052912; Sun, 9 Dec 2012 22:55:51 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212092255.qB9MtpMH052912@svn.freebsd.org> From: Glen Barber Date: Sun, 9 Dec 2012 22:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244059 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:55:52 -0000 Author: gjb (doc,ports committer) Date: Sun Dec 9 22:55:51 2012 New Revision: 244059 URL: http://svnweb.freebsd.org/changeset/base/244059 Log: Add missed BETA* to list. Approved by: simon (implicit) MFC after: 3 days X-MFC-With: r244058 Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:54:03 2012 (r244058) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Sun Dec 9 22:55:51 2012 (r244059) @@ -194,7 +194,7 @@ exec 3>&- _UNAME_R=`uname -r` case ${_UNAME_R} in - *-CURRENT|*-STABLE|*-PRERELEASE|*-RC*) + *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) RELDIR="snapshots" ;; *) From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 22:56:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 91428AC1; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) (envelope-from adrian@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 6BFC68FC08; Sun, 9 Dec 2012 22:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9MuUqP053075; Sun, 9 Dec 2012 22:56:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9MuTRc053071; Sun, 9 Dec 2012 22:56:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212092256.qB9MuTRc053071@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 22:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244060 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 22:56:30 -0000 Author: adrian Date: Sun Dec 9 22:56:29 2012 New Revision: 244060 URL: http://svnweb.freebsd.org/changeset/base/244060 Log: Handle ath-specific and WME IE's in adhoc mode. The Adhoc support wasn't parsing and handling the ath specific and WME IEs, thus the atheros vendor support and WME TXOP parameters aren't being copied from the peer. It copies the WME parameters from whichever adhoc node it decides to associate to, rather than just having them be statically configured per adhoc node. This may or may not be exactly "right", but it's certainly going to be more convienent for people - they just have to ensure their adhoc nodes are setup with correct WME parameters. Since WME parameters aren't per-node but are configured on hardware TX queues, if some nodes support WME and some don't - or perhaps, have different WME parameters - things will get quite quirky. So ensure that you configure your adhoc nodes with the same WME parameters. Secondly - the Atheros Vendor IE is parsed and operated on per-node, so this should work out ok between nodes that do and don't do Atheros extensions. Once you see a becaon from that node and you setup the association state, it _should_ parse things correctly. TODO: * I do need to ensure that both adhoc setup paths are correctly updating the IE stuff. Ie, if the adhoc node is created by a data frame instead of a beacon frame, it'll come up with no WME/ath IE config. The next beacon frame that it receives from that node will update the state. I just need to sit down and better understand how that's suppose to work in IBSS mode. Tested: * AR5416 <-> AR9280 - fast frames and the WME configuration both popped up. (This is with a local HAL patch that enables the fast frames capability on the AR5416 chipsets.) PR: kern/165969 Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_sta.h Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -745,6 +746,16 @@ adhoc_recv_mgmt(struct ieee80211_node *n memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp)); } + if (scan.wme != NULL && + (ni->ni_flags & IEEE80211_NODE_QOS) && + ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) { + ieee80211_wme_updateparams(vap); + } +#ifdef IEEE80211_SUPPORT_SUPERG + if (scan.ath != NULL) { + ieee80211_parse_athparams(ni, scan.ath, wh); + } +#endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.c Sun Dec 9 22:56:29 2012 (r244060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1086,7 +1087,7 @@ bad: IEEE80211_SCAN_FAIL_STATUS); } -static int +int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, const struct ieee80211_frame *wh) { Modified: head/sys/net80211/ieee80211_sta.h ============================================================================== --- head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:55:51 2012 (r244059) +++ head/sys/net80211/ieee80211_sta.h Sun Dec 9 22:56:29 2012 (r244060) @@ -33,4 +33,10 @@ void ieee80211_sta_attach(struct ieee80211com *); void ieee80211_sta_detach(struct ieee80211com *); void ieee80211_sta_vattach(struct ieee80211vap *); + +/* + * Used by the adhoc/mesh/tdma paths. + */ +extern int ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, + const struct ieee80211_frame *wh); #endif /* !_NET80211_IEEE80211_STA_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 23:01:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A09ECC77 for ; Sun, 9 Dec 2012 23:01:59 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 088688FC13 for ; Sun, 9 Dec 2012 23:01:58 +0000 (UTC) Received: (qmail 97346 invoked from network); 10 Dec 2012 00:31:22 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 10 Dec 2012 00:31:22 -0000 Message-ID: <50C5185D.3080802@freebsd.org> Date: Mon, 10 Dec 2012 00:01:49 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r243147 - head/usr.bin/fetch References: <201211161205.qAGC5Bwr081144@svn.freebsd.org> <50C4D31E.4080000@smeets.im> <20121209182730.GA28989@dft-labs.eu> <50C4DB7A.9050302@smeets.im> <20121209190120.GB28989@dft-labs.eu> In-Reply-To: <20121209190120.GB28989@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Florian Smeets , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 23:01:59 -0000 On 09.12.2012 20:01, Mateusz Guzik wrote: > On Sun, Dec 09, 2012 at 07:42:02PM +0100, Florian Smeets wrote: >> On 09.12.12 19:27, Mateusz Guzik wrote: >>> On Sun, Dec 09, 2012 at 07:06:22PM +0100, Florian Smeets wrote: >>>> On 16.11.12 13:05, Andre Oppermann wrote: >>>>> Author: andre >>>>> Date: Fri Nov 16 12:05:10 2012 >>>>> New Revision: 243147 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243147 >>>>> >>>>> Log: >>>>> Change fetch(1) to: >>>>> >>>>> o Report the instantaneous bandwidth instead of an average since the >>>>> beginning of the download. >>>>> >>>>> o At the finish of the download report the average bandwidth and also >>>>> the total time it took instead of 00m00s. >>>>> >>>> >>>> Andre, >>>> >>>> it looks like this change breaks the bandwidth calculation when using -r >>>> >>>> 52% of 146 MB -25199509 Bps 03m28s >>>> >>>> Going back to r243146 fixes it. >>>> >>> >>> Try this: >>> diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c >>> index 025fcdc..e723d40 100644 >>> --- a/usr.bin/fetch/fetch.c >>> +++ b/usr.bin/fetch/fetch.c >>> @@ -243,7 +243,7 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t of >>> gettimeofday(&xs->start, NULL); >>> xs->last.tv_sec = xs->last.tv_usec = 0; >>> xs->size = size; >>> - xs->offset = offset; >>> + xs->offset = 0; >>> xs->rcvd = offset; >>> xs->lastrcvd = offset; >>> if (v_tty && v_level > 0) >>> >> >> That way the bandwidth calculation looks OK but now it counts the time >> since starting to resume the download and not the time left :) >> >> 63% of 146 MB 7069 kBps 00m07s >> > > Oops.. revert that and try this instead: > diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c > index 025fcdc..d3e9b21 100644 > --- a/usr.bin/fetch/fetch.c > +++ b/usr.bin/fetch/fetch.c > @@ -183,7 +183,7 @@ stat_bps(struct xferstat *xs) > if (delta == 0.0) { > snprintf(str, sizeof str, "?? Bps"); > } else { > - bps = (xs->rcvd - xs->lastrcvd - xs->offset) / delta; > + bps = (xs->rcvd - xs->lastrcvd) / delta; > snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); > } > return (str); Thank you for this patch. Committed as r244058. -- Andre From owner-svn-src-all@FreeBSD.ORG Sun Dec 9 23:56:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DEC477D; Sun, 9 Dec 2012 23:56:30 +0000 (UTC) (envelope-from adrian@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 727A98FC13; Sun, 9 Dec 2012 23:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB9NuUGV064558; Sun, 9 Dec 2012 23:56:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB9NuUdU064557; Sun, 9 Dec 2012 23:56:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212092356.qB9NuUdU064557@svn.freebsd.org> From: Adrian Chadd Date: Sun, 9 Dec 2012 23:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244061 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2012 23:56:30 -0000 Author: adrian Date: Sun Dec 9 23:56:29 2012 New Revision: 244061 URL: http://svnweb.freebsd.org/changeset/base/244061 Log: Undo the previous adhoc commit - doing the WME IE handling here is totally wrong. If we parse the WME IE here, we'll be constantly updating the WME configuration from each WME enabled IBSS node we see. There's a separate issue where the WME configuration is blanked out when the interface is brought up; the WME parameters aren't "sticky." Also, ieee80211_init_neighbor() parses the ath IE, so doing it here isn't required. Sorry about the noise. PR: kern/165969 Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 22:56:29 2012 (r244060) +++ head/sys/net80211/ieee80211_adhoc.c Sun Dec 9 23:56:29 2012 (r244061) @@ -746,16 +746,6 @@ adhoc_recv_mgmt(struct ieee80211_node *n memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp)); } - if (scan.wme != NULL && - (ni->ni_flags & IEEE80211_NODE_QOS) && - ieee80211_parse_wmeparams(vap, scan.wme, wh) > 0) { - ieee80211_wme_updateparams(vap); - } -#ifdef IEEE80211_SUPPORT_SUPERG - if (scan.ath != NULL) { - ieee80211_parse_athparams(ni, scan.ath, wh); - } -#endif if (ni != NULL) { IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 00:16:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D3B1BB9; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) (envelope-from adrian@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 7ED168FC08; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA0GdNO069428; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA0GdPs069427; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212100016.qBA0GdPs069427@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Dec 2012 00:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244062 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 00:16:39 -0000 Author: adrian Date: Mon Dec 10 00:16:38 2012 New Revision: 244062 URL: http://svnweb.freebsd.org/changeset/base/244062 Log: Update the aggressive mode logic to also enable aggressive mode parameters in IBSSes. IBSS was just being plainly ignored here even though aggressive mode was 'on'. This still doesn't fix the "why are the WME parameters reset upon interface down/up" issue. PR: kern/165969 Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Sun Dec 9 23:56:29 2012 (r244061) +++ head/sys/net80211/ieee80211_proto.c Mon Dec 10 00:16:38 2012 (r244062) @@ -996,6 +996,7 @@ ieee80211_wme_updateparams_locked(struct struct wmeParams *chanp, *bssp; enum ieee80211_phymode mode; int i; + int do_aggrmode = 0; /* * Set up the channel access parameters for the physical @@ -1036,11 +1037,38 @@ ieee80211_wme_updateparams_locked(struct * BE uses agressive params to optimize performance of * legacy/non-QoS traffic. */ - if ((vap->iv_opmode == IEEE80211_M_HOSTAP && - (wme->wme_flags & WME_F_AGGRMODE) != 0) || - (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0) || - (vap->iv_flags & IEEE80211_F_WME) == 0) { + + /* Hostap? Only if aggressive mode is enabled */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP && + (wme->wme_flags & WME_F_AGGRMODE) != 0) + do_aggrmode = 1; + + /* + * Station? Only if we're in a non-QoS BSS. + */ + else if ((vap->iv_opmode == IEEE80211_M_STA && + (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0)) + do_aggrmode = 1; + + /* + * IBSS? Only if we we have WME enabled. + */ + else if ((vap->iv_opmode == IEEE80211_M_IBSS) && + (vap->iv_flags & IEEE80211_F_WME)) + do_aggrmode = 1; + + /* + * If WME is disabled on this VAP, default to aggressive mode + * regardless of the configuration. + */ + if ((vap->iv_flags & IEEE80211_F_WME) == 0) + do_aggrmode = 1; + + /* XXX WDS? */ + + /* XXX MBSS? */ + + if (do_aggrmode) { chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; @@ -1058,7 +1086,14 @@ ieee80211_wme_updateparams_locked(struct chanp->wmep_acm, chanp->wmep_aifsn, chanp->wmep_logcwmin, chanp->wmep_logcwmax, chanp->wmep_txopLimit); } - + + + /* + * Change the contention window based on the number of associated + * stations. If the number of associated stations is 1 and + * aggressive mode is enabled, lower the contention window even + * further. + */ if (vap->iv_opmode == IEEE80211_M_HOSTAP && ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) { static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { @@ -1082,8 +1117,15 @@ ieee80211_wme_updateparams_locked(struct IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, "update %s (chan+bss) logcwmin %u\n", ieee80211_wme_acnames[WME_AC_BE], chanp->wmep_logcwmin); - } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX ibss? */ + } + + /* + * Arrange for the beacon update. + * + * XXX what about MBSS, WDS? + */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP + || vap->iv_opmode == IEEE80211_M_IBSS) { /* * Arrange for a beacon update and bump the parameter * set number so associated stations load the new values. From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 01:25:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEE68979; Mon, 10 Dec 2012 01:25:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF6A8FC17; Mon, 10 Dec 2012 01:25:30 +0000 (UTC) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBA1PNDD025268; Mon, 10 Dec 2012 12:25:23 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBA1PCql003215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Dec 2012 12:25:14 +1100 Date: Mon, 10 Dec 2012 12:25:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys In-Reply-To: <50C513D4.4000306@freebsd.org> Message-ID: <20121210111347.L871@besplex.bde.org> References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> <50C513D4.4000306@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=CJhyxmXD c=1 sm=1 a=0p_glaYd98YA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Y5AXMyR2jB0A:10 a=CJE-7khU8NtqFz-BgQEA:9 a=CjuIK1q_8ugA:10 a=rqFzXeojqLPuUmME:21 a=cpdj9V2h1KV6Bcsw:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Cox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 01:25:31 -0000 On Sun, 9 Dec 2012, Andre Oppermann wrote: > On 09.12.2012 21:35, Alan Cox wrote: >> ... >> >> I believe that this change did not actually correct the overflow >> problem. See below for an explanation. >> >> On 11/29/2012 01:30, Andre Oppermann wrote: >>> ... Please trim quotes. >>> >>> Log: >>> Using a long is the wrong type to represent the realmem and maxmbufmem >>> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >>> >>> Use 64bit quad_t instead. It has broader kernel infrastructure support >>> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types. >>> >>> Pointed out by: alc, bde >>> ... >>> Modified: head/sys/kern/subr_param.c >>> ... >>> @@ -332,10 +332,10 @@ init_param2(long physpages) >>> * available kernel memory (physical or kmem). >>> * At most it can be 3/4 of available kernel memory. >>> */ >>> - realmem = lmin(physpages * PAGE_SIZE, >>> + realmem = qmin(physpages * PAGE_SIZE, >>> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); >> >> >> "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, >> the product of 1,000,000 and PAGE_SIZE will be a negative number. >> Likewise, quad_t is a signed type. So, the negative product of >> 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value >> when it is passed to qmin(), and qmin() will return a negative number. > > Thank you taking a second look it. > > To be honest I got a bit confused on which automatic type expansion > applies here. This is a vanilla overflow bug. It has nothing to do with type extension, except that type extension beyond long doesn't occur for multiplication of longs. It has little to do with signedness, except that with signed longs the overflow occurs at LONG_MAX (2G-1 on i386) instead of at ULONG_MAX (4G-1 on i386). The above part of the patch also shows one of the many style bugs in this and previous commits (random indentation of the continued line -- 2 tabs instead of 4 spaces). > qmax() is defined as this in libkern.h: > static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } > > Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of the > computation, which happens in long space, is passed on. This is a function, > not a macro. Dang... No, that is backwards. With a macro, the result of the multiplicaton is passed on (unless the macro is very broken and has type casts which to break its type-genericness). With the qmin() function, the result of the multiplication is converted to quad_t. But the mmultiplication has already overflowed, giving an undefined result of type long. (This assumes that PAGE_SIZE has type long or smaller. It is normally a literal int constant like 4096. Any type for this constant would increase bugs in this area. physpages has type long. As with all binary operations, the operands are first converted to a minimal common type that is at least as large as both and also at least as large as int. This type is long. Multiplication of longs then overflows mainly in the PAE case.) > This change will force the computation to be in quad_t space: > > - realmem = qmin(physpages * PAGE_SIZE, > + realmem = qmin((quad_t)physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); Indeed. > VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t > type. This has little to do with its type, except that the type is not larger than quad_t. Actually, it is larger on most 64-bit arches including amd6d, so the above code only works accidentally. It depends on kva not covering more than half of the address space. Now the type errors are: - there is no such type as 'unsigned vm_offset_t' (unsigned foo_t is a syntax error for any typedefed type foo_t). I think you mean that vm_offset_t is an unsigned type. It is not the plain unsigned type on 64-bit arches, so you shouldn't mean that. - the type of constants like VM_MAX_KERNEL_ADDRESS is unclear. Most constants are defined as literals. But VM_{MAX,MIN}_KERNEL_ADDRESS happen to be defined using macros. The macros are quite MD. On i386, the macro is VADDR() which casts parameters to vm_offset_t. I think most parameters in the macro are literals with type int. Also, vm_offset_t is larger than int, so no further promotion occurs and the result has type vm_offset_t. On amd64, the macro is KVADDR() which casts parameters to unsigned long. Again (but more obviously) there is no further promotion, and the result has type unsigned long. vm_offset_t is unsigned long too, so the result has type unsigned long too. I discussed casts of parameters in macros with jake@ in connection with PAE. I had added casts to some macros to reduce some popular overflow bugs and type errors. jake preferred not to cast. It can be difficult to find the right cast to use, since the right cast is often different for PAE (but many cases could be handled by using a typedef that varies with PAE), and the correct cast is context-dependent (sometimes you know that a page count is small, so multiplying it by PAGE_SIZE can't overflow a signed int). I now agree with jake -- the caller must cast as necessary, the same as if the computation is explicit. - it is not a type error to do the subtraction in vm_offset_t arithmetic. VM_MAX_KERNEL_ADDRESS must be >= VM_MIN_KERNEL_ADDRESS, so the result cannot "overflow" to a "negative" value. - the result of the subtraction has type unsigned or unsigned long on most or all arches. On most 32-bit arches including i386, even unsigned long is smaller than quad_t (but vm_offset_t is plain unsigned). On most or all 64-bit arches including amd64, unsigned long is larger than quad_t (since both are 64 bits but quad_t is signed). Thus the result of the subtraction is demoted when qmin() is called. Overflow may occur. Overflow can easily occur, but apparently doesn't. It would occur if the kernel used more than half of the 64-bit address space. This would take a very sparse mapping and hardware support for this so that it doesn't take too many page tables. Apparently, amd64 doesn't have this, so overflow doesn't occur in practice on at least amd64. If overflow occurred, it would normally give a negative value and the result of the qmin() would be clamping down to this negative value. So the case where kva is "infinite" (more than half of a 64-bit address space) is broken. I like to use signed types and thus qmin(). qmin() would be necessary if any of the expressions had a subtraction that could give a negative result. But it doesn't work for certain unsigned types like 64-bit vm_offset_t. >>> maxmbufmem = realmem / 2; >>> - TUNABLE_LONG_FETCH("kern.maxmbufmem", &maxmbufmem); >>> + TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); >>> if (maxmbufmem > (realmem / 4) * 3) >>> maxmbufmem = (realmem / 4) * 3; More style bugs (excessive parentheses around division) are visible in this part of the patch. Some of the instances of this style bug in kern now are: % subr_param.c: if (maxfiles > (physpages / 4)) It is even more excessive to have parentheses around a simple arithmetic operand. % subr_param.c: if (maxmbufmem > (realmem / 4) * 3) There are no excessive parentheses around the arithmetic operand here, but internal ones in it. % subr_param.c: maxmbufmem = (realmem / 4) * 3; % sys_pipe.c: if (amountpipekva > (3 * maxpipekva) / 4) { This opposite order for multiplying by 3/4 is safe here because maxpipekva can't be very large. It might be safe above too. It is more natural, so should be used if possible. % sys_pipe.c: if ((amountpipekva > (3 * maxpipekva) / 4) && This condition also has excessive parentheses around all of its '&&' terms and misindentation for all of its continuation lines containing the other terms. % uipc_socket.c: over = (head->so_qlen > 3 * head->so_qlimit / 2); Correct use of parentheses. None for the arithmetic expression. The ones used are unnecessary too, but now they are useful because the expression is farily complicated and not idiomatic. Any parentheses for the idiomatic inner terms would obfuscate the outer ones. % vfs_bio.c: maxbuf = (LONG_MAX / 3) / BKVASIZE; Excessive. % vfs_bio.c: while ((long)hidirtybuffers * BKVASIZE > 3 * hibufspace / 4) { Correct. 3 * x / 4 may be more readable than x * 3 / 4 too. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:26:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D3192D5; Mon, 10 Dec 2012 02:26:02 +0000 (UTC) (envelope-from eadler@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 61F998FC0C; Mon, 10 Dec 2012 02:26:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2Q2l6093692; Mon, 10 Dec 2012 02:26:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2Q2WY093690; Mon, 10 Dec 2012 02:26:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100226.qBA2Q2WY093690@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244063 - head/usr.bin/locate/locate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:26:02 -0000 Author: eadler Date: Mon Dec 10 02:26:01 2012 New Revision: 244063 URL: http://svnweb.freebsd.org/changeset/base/244063 Log: Give users a hint when their locate database is too small. Reviewed by: wblock, gcooper Reviewed by: "Lowell Gilbert" Approved by: cperciva (implicit) MFC after: 3 weeks Modified: head/usr.bin/locate/locate/locate.c Modified: head/usr.bin/locate/locate/locate.c ============================================================================== --- head/usr.bin/locate/locate/locate.c Mon Dec 10 00:16:38 2012 (r244062) +++ head/usr.bin/locate/locate/locate.c Mon Dec 10 02:26:01 2012 (r244063) @@ -292,7 +292,9 @@ search_mmap(db, s) err(1, "`%s'", db); len = sb.st_size; if (len < (2*NBG)) - errx(1, "database too small: %s", db); + errx(1, + "database too small: %s\nRun /usr/libexec/locate.updatedb", + db); if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:33:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABCCE5B5; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) (envelope-from eadler@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 8EDFB8FC0C; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2XHR9095254; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2XHqc095248; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100233.qBA2XHqc095248@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:33:17 +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: r244064 - stable/8/usr.sbin/chkgrp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:33:17 -0000 Author: eadler Date: Mon Dec 10 02:33:16 2012 New Revision: 244064 URL: http://svnweb.freebsd.org/changeset/base/244064 Log: MFC r243084: Add support for a -q flag. While here make the custom argument parsing use getopt instead of hacking on it more. This change also fixes the method of silencing the compiler warning about gfn being used uninitialized. Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/chkgrp/chkgrp.8 stable/8/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/8/usr.sbin/chkgrp/ (props changed) Modified: stable/8/usr.sbin/chkgrp/chkgrp.8 ============================================================================== --- stable/8/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:26:01 2012 (r244063) +++ stable/8/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:16 2012 (r244064) @@ -34,6 +34,7 @@ .Nd check the syntax of the group file .Sh SYNOPSIS .Nm +.Op Fl q .Op Ar groupfile .Sh DESCRIPTION The @@ -47,6 +48,12 @@ contains whitespace, and that the third numeric. It will also check for invalid characters in the group names and group members. +The following options are available: +.Bl -tag -width indent +.It Fl q +This option disables printing of text when the group format +is correct. +.El .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Modified: stable/8/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/8/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:26:01 2012 (r244063) +++ stable/8/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:16 2012 (r244064) @@ -34,11 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static char empty[] = { 0 }; -static void +static void __dead2 usage(void) { fprintf(stderr, "usage: chkgrp [groupfile]\n"); @@ -50,24 +51,33 @@ main(int argc, char *argv[]) { unsigned int i; size_t len; + int quiet; + int ch; int n = 0, k, e = 0; char *line, *f[4], *p; const char *cp, *gfn; FILE *gf; - /* check arguments */ - switch (argc) { - case 1: - gfn = "/etc/group"; - break; - case 2: - gfn = argv[1]; - break; - default: - gfn = NULL; /* silence compiler */ - usage(); + quiet = 0; + while ((ch = getopt(argc, argv, "q")) != -1) { + switch (ch) { + case 'q': + quiet = 1; + break; + case '?': + default: + printf("hello\n"); + usage(); + } } + if (optind == argc) + gfn = "/etc/group"; + else if (optind == argc - 1) + gfn = argv[optind]; + else + usage(); + /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ @@ -163,7 +173,7 @@ main(int argc, char *argv[]) /* done */ fclose(gf); - if (e == 0) + if (e == 0 && quiet == 0) printf("%s is fine\n", gfn); exit(e ? EX_DATAERR : EX_OK); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:33:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C711A5B6; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) (envelope-from eadler@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 AAC228FC13; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2XHAA095258; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2XHQl095250; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100233.qBA2XHQl095250@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:33:17 +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: r244065 - stable/7/usr.sbin/chkgrp X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:33:17 -0000 Author: eadler Date: Mon Dec 10 02:33:16 2012 New Revision: 244065 URL: http://svnweb.freebsd.org/changeset/base/244065 Log: MFC r243084: Add support for a -q flag. While here make the custom argument parsing use getopt instead of hacking on it more. This change also fixes the method of silencing the compiler warning about gfn being used uninitialized. Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/chkgrp/chkgrp.8 stable/7/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/7/usr.sbin/chkgrp/ (props changed) Modified: stable/7/usr.sbin/chkgrp/chkgrp.8 ============================================================================== --- stable/7/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:16 2012 (r244064) +++ stable/7/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:16 2012 (r244065) @@ -34,6 +34,7 @@ .Nd check the syntax of the group file .Sh SYNOPSIS .Nm +.Op Fl q .Op Ar groupfile .Sh DESCRIPTION The @@ -47,6 +48,12 @@ contains whitespace, and that the third numeric. It will also check for invalid characters in the group names and group members. +The following options are available: +.Bl -tag -width indent +.It Fl q +This option disables printing of text when the group format +is correct. +.El .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Modified: stable/7/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/7/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:16 2012 (r244064) +++ stable/7/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:16 2012 (r244065) @@ -34,11 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static char empty[] = { 0 }; -static void +static void __dead2 usage(void) { fprintf(stderr, "usage: chkgrp [groupfile]\n"); @@ -50,24 +51,33 @@ main(int argc, char *argv[]) { unsigned int i; size_t len; + int quiet; + int ch; int n = 0, k, e = 0; char *line, *f[4], *p; const char *cp, *gfn; FILE *gf; - /* check arguments */ - switch (argc) { - case 1: - gfn = "/etc/group"; - break; - case 2: - gfn = argv[1]; - break; - default: - gfn = NULL; /* silence compiler */ - usage(); + quiet = 0; + while ((ch = getopt(argc, argv, "q")) != -1) { + switch (ch) { + case 'q': + quiet = 1; + break; + case '?': + default: + printf("hello\n"); + usage(); + } } + if (optind == argc) + gfn = "/etc/group"; + else if (optind == argc - 1) + gfn = argv[optind]; + else + usage(); + /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ @@ -163,7 +173,7 @@ main(int argc, char *argv[]) /* done */ fclose(gf); - if (e == 0) + if (e == 0 && quiet == 0) printf("%s is fine\n", gfn); exit(e ? EX_DATAERR : EX_OK); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:33:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0640C5B7; Mon, 10 Dec 2012 02:33:18 +0000 (UTC) (envelope-from eadler@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 DDF1A8FC14; Mon, 10 Dec 2012 02:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2XHbZ095264; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2XHw1095257; Mon, 10 Dec 2012 02:33:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100233.qBA2XHw1095257@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:33:17 +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: r244066 - stable/9/usr.sbin/chkgrp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:33:18 -0000 Author: eadler Date: Mon Dec 10 02:33:17 2012 New Revision: 244066 URL: http://svnweb.freebsd.org/changeset/base/244066 Log: MFC r243084: Add support for a -q flag. While here make the custom argument parsing use getopt instead of hacking on it more. This change also fixes the method of silencing the compiler warning about gfn being used uninitialized. Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/chkgrp/chkgrp.8 stable/9/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/9/usr.sbin/chkgrp/ (props changed) Modified: stable/9/usr.sbin/chkgrp/chkgrp.8 ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:16 2012 (r244065) +++ stable/9/usr.sbin/chkgrp/chkgrp.8 Mon Dec 10 02:33:17 2012 (r244066) @@ -34,6 +34,7 @@ .Nd check the syntax of the group file .Sh SYNOPSIS .Nm +.Op Fl q .Op Ar groupfile .Sh DESCRIPTION The @@ -47,6 +48,12 @@ contains whitespace, and that the third numeric. It will also check for invalid characters in the group names and group members. +The following options are available: +.Bl -tag -width indent +.It Fl q +This option disables printing of text when the group format +is correct. +.El .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Modified: stable/9/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:16 2012 (r244065) +++ stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:17 2012 (r244066) @@ -34,11 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static char empty[] = { 0 }; -static void +static void __dead2 usage(void) { fprintf(stderr, "usage: chkgrp [groupfile]\n"); @@ -50,24 +51,33 @@ main(int argc, char *argv[]) { unsigned int i; size_t len; + int quiet; + int ch; int n = 0, k, e = 0; char *line, *f[4], *p; const char *cp, *gfn; FILE *gf; - /* check arguments */ - switch (argc) { - case 1: - gfn = "/etc/group"; - break; - case 2: - gfn = argv[1]; - break; - default: - gfn = NULL; /* silence compiler */ - usage(); + quiet = 0; + while ((ch = getopt(argc, argv, "q")) != -1) { + switch (ch) { + case 'q': + quiet = 1; + break; + case '?': + default: + printf("hello\n"); + usage(); + } } + if (optind == argc) + gfn = "/etc/group"; + else if (optind == argc - 1) + gfn = argv[optind]; + else + usage(); + /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ @@ -163,7 +173,7 @@ main(int argc, char *argv[]) /* done */ fclose(gf); - if (e == 0) + if (e == 0 && quiet == 0) printf("%s is fine\n", gfn); exit(e ? EX_DATAERR : EX_OK); } From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:35:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 609789FA; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) (envelope-from eadler@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 43BA38FC15; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ZKvW095919; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2ZKsA095917; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100235.qBA2ZKsA095917@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:35: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: r244067 - stable/9/usr.sbin/chkgrp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:35:20 -0000 Author: eadler Date: Mon Dec 10 02:35:19 2012 New Revision: 244067 URL: http://svnweb.freebsd.org/changeset/base/244067 Log: MFC r243077: Fix error code if file isn't readable. Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/9/usr.sbin/chkgrp/ (props changed) Modified: stable/9/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:33:17 2012 (r244066) +++ stable/9/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:19 2012 (r244067) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) - err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ + err(EX_NOINPUT, "%s", gfn); /* check line by line */ while (++n) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:35:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D33739FB; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) (envelope-from eadler@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 B7AC68FC16; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ZKKT095943; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2ZKvF095942; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100235.qBA2ZKvF095942@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:35:20 +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: r244068 - stable/8/usr.sbin/chkgrp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:35:20 -0000 Author: eadler Date: Mon Dec 10 02:35:20 2012 New Revision: 244068 URL: http://svnweb.freebsd.org/changeset/base/244068 Log: MFC r243077: Fix error code if file isn't readable. Approved by: cperciva (implicit) Modified: stable/8/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/8/usr.sbin/chkgrp/ (props changed) Modified: stable/8/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/8/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:19 2012 (r244067) +++ stable/8/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:20 2012 (r244068) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) - err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ + err(EX_NOINPUT, "%s", gfn); /* check line by line */ while (++n) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:35:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E66909FC; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) (envelope-from eadler@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 CB5358FC17; Mon, 10 Dec 2012 02:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ZKuq095945; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2ZKB1095944; Mon, 10 Dec 2012 02:35:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100235.qBA2ZKB1095944@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:35:20 +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: r244069 - stable/7/usr.sbin/chkgrp X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:35:21 -0000 Author: eadler Date: Mon Dec 10 02:35:20 2012 New Revision: 244069 URL: http://svnweb.freebsd.org/changeset/base/244069 Log: MFC r243077: Fix error code if file isn't readable. Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/chkgrp/chkgrp.c Directory Properties: stable/7/usr.sbin/chkgrp/ (props changed) Modified: stable/7/usr.sbin/chkgrp/chkgrp.c ============================================================================== --- stable/7/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:20 2012 (r244068) +++ stable/7/usr.sbin/chkgrp/chkgrp.c Mon Dec 10 02:35:20 2012 (r244069) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) /* open group file */ if ((gf = fopen(gfn, "r")) == NULL) - err(EX_IOERR, "%s", gfn); /* XXX - is IO_ERR the correct exit code? */ + err(EX_NOINPUT, "%s", gfn); /* check line by line */ while (++n) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:40:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7546A1F0; Mon, 10 Dec 2012 02:40:07 +0000 (UTC) (envelope-from eadler@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 593038FC13; Mon, 10 Dec 2012 02:40:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2e79M097060; Mon, 10 Dec 2012 02:40:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2e7DI097059; Mon, 10 Dec 2012 02:40:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100240.qBA2e7DI097059@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:40:07 +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: r244070 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:40:07 -0000 Author: eadler Date: Mon Dec 10 02:40:06 2012 New Revision: 244070 URL: http://svnweb.freebsd.org/changeset/base/244070 Log: MFC r243101: Using set -x produces output on stderr instead of stdout. It also doesn't work with make -s. Prefer the use of builtin make features. PR: misc/126312 Approved by: cperciva (implicit) Modified: stable/8/etc/Makefile Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/Makefile ============================================================================== --- stable/8/etc/Makefile Mon Dec 10 02:35:20 2012 (r244069) +++ stable/8/etc/Makefile Mon Dec 10 02:40:06 2012 (r244070) @@ -184,8 +184,7 @@ distribution: cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_BIND_MTREE} != "no" - @if [ ! -e ${DESTDIR}/etc/namedb ]; then \ - set -x; \ + if [ ! -e ${DESTDIR}/etc/namedb ]; then \ ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \ fi .endif @@ -231,9 +230,8 @@ distribution: .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail - @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ + if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ ! -f ${DESTDIR}/etc/aliases ]; then \ - set -x; \ ln -s mail/aliases ${DESTDIR}/etc/aliases; \ fi .endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:40:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB7F01F6; Mon, 10 Dec 2012 02:40:08 +0000 (UTC) (envelope-from eadler@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 90BE78FC14; Mon, 10 Dec 2012 02:40:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2e8Qa097096; Mon, 10 Dec 2012 02:40:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2e8s7097095; Mon, 10 Dec 2012 02:40:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100240.qBA2e8s7097095@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:40:08 +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: r244071 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:40:08 -0000 Author: eadler Date: Mon Dec 10 02:40:08 2012 New Revision: 244071 URL: http://svnweb.freebsd.org/changeset/base/244071 Log: MFC r243101: Using set -x produces output on stderr instead of stdout. It also doesn't work with make -s. Prefer the use of builtin make features. PR: misc/126312 Approved by: cperciva (implicit) Modified: stable/9/etc/Makefile Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Mon Dec 10 02:40:06 2012 (r244070) +++ stable/9/etc/Makefile Mon Dec 10 02:40:08 2012 (r244071) @@ -217,8 +217,7 @@ distribution: cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_BIND_MTREE} != "no" - @if [ ! -e ${DESTDIR}/etc/namedb ]; then \ - set -x; \ + if [ ! -e ${DESTDIR}/etc/namedb ]; then \ ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \ fi .endif @@ -264,9 +263,8 @@ distribution: .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${ETCMAIL} ${DESTDIR}/etc/mail - @if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ + if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ ! -f ${DESTDIR}/etc/aliases ]; then \ - set -x; \ ln -s mail/aliases ${DESTDIR}/etc/aliases; \ fi .endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:44:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CE27607; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) (envelope-from eadler@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 4BBE68FC08; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ilqH098100; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2ikTW098087; Mon, 10 Dec 2012 02:44:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100244.qBA2ikTW098087@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:44:46 +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: r244072 - in stable/8: usr.bin/pr usr.sbin/nfscbd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:44:47 -0000 Author: eadler Date: Mon Dec 10 02:44:46 2012 New Revision: 244072 URL: http://svnweb.freebsd.org/changeset/base/244072 Log: MFC r243238: Standardize EXIT STATUS instructions in man pages when possible. Approved by: cperciva (implicit) Modified: stable/8/usr.bin/pr/pr.1 stable/8/usr.sbin/nfscbd/nfscbd.8 Directory Properties: stable/8/usr.bin/pr/ (props changed) stable/8/usr.sbin/nfscbd/ (props changed) Modified: stable/8/usr.bin/pr/pr.1 ============================================================================== --- stable/8/usr.bin/pr/pr.1 Mon Dec 10 02:40:08 2012 (r244071) +++ stable/8/usr.bin/pr/pr.1 Mon Dec 10 02:44:46 2012 (r244072) @@ -361,9 +361,7 @@ and require that both arguments, if present, not be separated from the option letter. .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh DIAGNOSTICS If .Nm Modified: stable/8/usr.sbin/nfscbd/nfscbd.8 ============================================================================== --- stable/8/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:40:08 2012 (r244071) +++ stable/8/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:44:46 2012 (r244072) @@ -76,10 +76,8 @@ has been specified. For more information on what callbacks and Open Delegations do, see .%T "Network File System (NFS) Version 4 Protocol" , RFC3530 . -.Pp -The -.Nm -utility exits 0 on success or >0 if an error occurred. +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr nfsv4 4 , .Xr mount_nfs 8 From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:44:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76558608; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) (envelope-from eadler@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 53F618FC0C; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2il3u098101; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2iliL098099; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100244.qBA2iliL098099@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:44:47 +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: r244073 - stable/7/usr.bin/pr X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:44:47 -0000 Author: eadler Date: Mon Dec 10 02:44:46 2012 New Revision: 244073 URL: http://svnweb.freebsd.org/changeset/base/244073 Log: MFC r243238: Standardize EXIT STATUS instructions in man pages when possible. Approved by: cperciva (implicit) Modified: stable/7/usr.bin/pr/pr.1 Directory Properties: stable/7/usr.bin/pr/ (props changed) Modified: stable/7/usr.bin/pr/pr.1 ============================================================================== --- stable/7/usr.bin/pr/pr.1 Mon Dec 10 02:44:46 2012 (r244072) +++ stable/7/usr.bin/pr/pr.1 Mon Dec 10 02:44:46 2012 (r244073) @@ -361,9 +361,7 @@ and require that both arguments, if present, not be separated from the option letter. .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh DIAGNOSTICS If .Nm From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 02:44:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30E4A609; Mon, 10 Dec 2012 02:44:48 +0000 (UTC) (envelope-from eadler@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 EFCA78FC12; Mon, 10 Dec 2012 02:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA2ilO9098112; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA2il7G098109; Mon, 10 Dec 2012 02:44:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212100244.qBA2il7G098109@svn.freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 02:44: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: r244074 - in stable/9: usr.bin/pr usr.bin/seq usr.sbin/nfscbd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 02:44:48 -0000 Author: eadler Date: Mon Dec 10 02:44:47 2012 New Revision: 244074 URL: http://svnweb.freebsd.org/changeset/base/244074 Log: MFC r243238: Standardize EXIT STATUS instructions in man pages when possible. Approved by: cperciva (implicit) Modified: stable/9/usr.bin/pr/pr.1 stable/9/usr.bin/seq/seq.1 stable/9/usr.sbin/nfscbd/nfscbd.8 Directory Properties: stable/9/usr.bin/pr/ (props changed) stable/9/usr.bin/seq/ (props changed) stable/9/usr.sbin/nfscbd/ (props changed) Modified: stable/9/usr.bin/pr/pr.1 ============================================================================== --- stable/9/usr.bin/pr/pr.1 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.bin/pr/pr.1 Mon Dec 10 02:44:47 2012 (r244074) @@ -361,9 +361,7 @@ and require that both arguments, if present, not be separated from the option letter. .Sh EXIT STATUS -The -.Nm -utility exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh DIAGNOSTICS If .Nm Modified: stable/9/usr.bin/seq/seq.1 ============================================================================== --- stable/9/usr.bin/seq/seq.1 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.bin/seq/seq.1 Mon Dec 10 02:44:47 2012 (r244074) @@ -127,10 +127,8 @@ If any sequence numbers will be printed the default conversion is changed to .Cm %e . .El -.Pp -The -.Nm -utility exits 0 on success and non-zero if an error occurs. +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES .Bd -literal -offset indent # seq 1 3 Modified: stable/9/usr.sbin/nfscbd/nfscbd.8 ============================================================================== --- stable/9/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:44:46 2012 (r244073) +++ stable/9/usr.sbin/nfscbd/nfscbd.8 Mon Dec 10 02:44:47 2012 (r244074) @@ -77,10 +77,8 @@ has been specified. For more information on what callbacks and Open Delegations do, see .%T "Network File System (NFS) Version 4 Protocol" , RFC3530. -.Pp -The -.Nm -utility exits 0 on success or >0 if an error occurred. +.Sh EXIT STATUS +.Ex -std .Sh SEE ALSO .Xr nfsv4 4 , .Xr mount_nfs 8 From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 03:11:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A50CECDD; Mon, 10 Dec 2012 03:11:21 +0000 (UTC) (envelope-from grog@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 877A28FC13; Mon, 10 Dec 2012 03:11:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA3BLmM004060; Mon, 10 Dec 2012 03:11:21 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA3BKL6004047; Mon, 10 Dec 2012 03:11:20 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212100311.qBA3BKL6004047@svn.freebsd.org> From: Greg Lehey Date: Mon, 10 Dec 2012 03:11: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: r244075 - stable/9/bin/ls X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 03:11:21 -0000 Author: grog Date: Mon Dec 10 03:11:19 2012 New Revision: 244075 URL: http://svnweb.freebsd.org/changeset/base/244075 Log: MFC to r242840: Add y flag and environment variable LS_SAMESORT to specify the same sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. Modified: stable/9/bin/ls/Makefile stable/9/bin/ls/cmp.c stable/9/bin/ls/ls.1 stable/9/bin/ls/ls.c stable/9/bin/ls/ls.h stable/9/bin/ls/print.c stable/9/bin/ls/util.c Modified: stable/9/bin/ls/Makefile ============================================================================== --- stable/9/bin/ls/Makefile Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/Makefile Mon Dec 10 03:11:19 2012 (r244075) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 # $FreeBSD$ +.include + PROG= ls SRCS= cmp.c ls.c print.c util.c DPADD= ${LIBUTIL} Modified: stable/9/bin/ls/cmp.c ============================================================================== --- stable/9/bin/ls/cmp.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/cmp.c Mon Dec 10 03:11:19 2012 (r244075) @@ -78,6 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_mtim.tv_nsec < a->fts_statp->st_mtim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -104,6 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) if (b->fts_statp->st_atim.tv_nsec < a->fts_statp->st_atim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -130,6 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * if (b->fts_statp->st_birthtim.tv_nsec < a->fts_statp->st_birthtim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } @@ -156,6 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b if (b->fts_statp->st_ctim.tv_nsec < a->fts_statp->st_ctim.tv_nsec) return (-1); + if (f_samesort) + return (strcoll(b->fts_name, a->fts_name)); + else return (strcoll(a->fts_name, b->fts_name)); } Modified: stable/9/bin/ls/ls.1 ============================================================================== --- stable/9/bin/ls/ls.1 Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.1 Mon Dec 10 03:11:19 2012 (r244075) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd November 8, 2012 .Dt LS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1 +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, .Op Fl D Ar format .Op Ar .Sh DESCRIPTION @@ -130,6 +130,8 @@ This option is equivalent to defining .Ev CLICOLOR in the environment. (See below.) +This functionality can be compiled out by removing the definition of +.Ev COLORLS . .It Fl H Symbolic links on the command line are followed. This option is assumed if @@ -249,12 +251,35 @@ subsection below, except (if the long fo the directory totals are not output when the output is in a single column, even if multi-column output is requested. .It Fl t -Sort by time modified (most recently modified -first) before sorting the operands in lexicographical -order. +Sort by descending time modified (most recently modified first). If two files +have the same modification timestamp, sort their names in ascending +lexicographical order. +The +.Fl r +option reverses both of these sort orders. +.Pp +Note that these sort orders are contradictory: the time sequence is in +descending order, the lexicographical sort is in ascending order. +This behavior is mandated by +.St -p1003.2 . +This feature can cause problems listing files stored with sequential names on +FAT file systems, such as from digital cameras, where it is possible to have +more than one image with the same timestamp. +In such a case, the photos cannot be listed in the sequence in which +they were taken. +To ensure the same sort order for time and for lexicographical sorting, set the +environment variable +.Ev LS_SAMESORT +or use the +.Fl y +option. +This causes +.Nm +to reverse the lexicographal sort order when sorting files with the +same modification timestamp. .It Fl u Use time of last access, -instead of last modification +instead of time of last modification of the file for sorting .Pq Fl t or printing @@ -268,6 +293,15 @@ The same as .Fl C , except that the multi-column output is produced with entries sorted across, rather than down, the columns. +.It Fl y +When the +.Fl t +option is set, sort the alphabetical output in the same order as the time output. +This has the same effect as setting +.Ev LS_SAMESORT . +See the description of the +.Fl t +option for more details. .It Fl 1 (The numeric digit .Dq one . ) @@ -275,6 +309,15 @@ Force output to be one entry per line. This is the default when output is not to a terminal. +.It Fl , +(Comma) When the +.Fl l +option is set, print file sizes grouped and separated by thousands using the +non-monetary separator returned by +.Xr localeconv 3 , +typically a comma or period. +If no locale is set, or the locale does not have a non-monetary separator, this +option has no effect. .El .Pp The @@ -357,8 +400,7 @@ option is given, the numeric ID's are displayed. .Pp If the file is a character special or block special file, -the major and minor device numbers for the file are displayed -in the size field. +the device number for the file is displayed in the size field. If the file is a symbolic link the pathname of the linked-to file is preceded by .Dq Li -> . @@ -530,7 +572,7 @@ variable is defined. .It Ev CLICOLOR_FORCE Color sequences are normally disabled if the output is not directed to a terminal. -This can be overridden by setting this flag. +This can be overridden by setting this variable. The .Ev TERM variable still needs to reference a color capable terminal however @@ -656,6 +698,14 @@ Not all columns have changeable widths. The fields are, in order: inode, block count, number of links, user name, group name, flags, file size, file name. +.It Ev LS_SAMESORT +If this variable is set, the +.Fl t +option sorts the names of files with the same modification timestamp in the same +sense as the time sort. +See the description of the +.Fl t +option for more details. .It Ev TERM The .Ev CLICOLOR @@ -679,6 +729,7 @@ specification. .Xr getfacl 1 , .Xr sort 1 , .Xr xterm 1 , +.Xr localeconv 3 , .Xr strftime 3 , .Xr strmode 3 , .Xr termcap 5 , @@ -717,3 +768,9 @@ option description might be a feature th based on the fact that single-column output usually goes to something other than a terminal. It is debatable whether this is a design bug. +.Pp +.St -p1003.2 +mandates opposite sort orders for files with the same timestamp when +sorting with the +.Fl t +option. Modified: stable/9/bin/ls/ls.c ============================================================================== --- stable/9/bin/ls/ls.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.c Mon Dec 10 03:11:19 2012 (r244075) @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Be #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include @@ -109,10 +109,11 @@ int termwidth = 80; /* default terminal int f_humanval; /* show human-readable file sizes */ int f_inode; /* print inode */ static int f_kblocks; /* print size in kilobytes */ + int f_label; /* show MAC label */ static int f_listdir; /* list actual directory, not contents */ static int f_listdot; /* list files beginning with . */ -static int f_noautodot; /* do not automatically enable -A for root */ int f_longform; /* long listing format */ +static int f_noautodot; /* do not automatically enable -A for root */ static int f_nofollow; /* don't follow symbolic link arguments */ int f_nonprint; /* show unprintables as ? */ static int f_nosort; /* don't sort output */ @@ -122,19 +123,21 @@ static int f_numericonly; /* don't conve int f_octal_escape; /* like f_octal but use C escapes if possible */ static int f_recursive; /* ls subdirectories also */ static int f_reversesort; /* reverse whatever sort is used */ - int f_sectime; /* print the real time for all files */ + int f_samesort; /* sort time and name in same direction */ + int f_sectime; /* print full time information */ static int f_singlecol; /* use single column output */ int f_size; /* list size in short listing */ +static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ -static int f_timesort; /* sort by time vice name */ + int f_thousands; /* show file sizes with thousands separators */ char *f_timeformat; /* user-specified time format */ -static int f_sizesort; +static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ - int f_label; /* show MAC label */ + #ifdef COLORLS int f_color; /* add type in color for non-regular files */ @@ -180,8 +183,10 @@ main(int argc, char *argv[]) } fts_options = FTS_PHYSICAL; - while ((ch = getopt(argc, argv, - "1ABCD:FGHILPRSTUWZabcdfghiklmnopqrstuwx")) != -1) { + if (getenv("LS_SAMESORT")) + f_samesort = 1; + while ((ch = getopt(argc, argv, + "1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,")) != -1) { switch (ch) { /* * The -1, -C, -x and -l options all override each other so @@ -192,17 +197,9 @@ main(int argc, char *argv[]) f_longform = 0; f_stream = 0; break; - case 'B': - f_nonprint = 0; - f_octal = 1; - f_octal_escape = 0; - break; case 'C': f_sortacross = f_longform = f_singlecol = 0; break; - case 'D': - f_timeformat = optarg; - break; case 'l': f_longform = 1; f_singlecol = 0; @@ -229,16 +226,46 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; + case 'a': + fts_options |= FTS_SEEDOT; + /* FALLTHROUGH */ + case 'A': + f_listdot = 1; + break; + /* The -t and -S options override each other. */ + case 'S': + f_sizesort = 1; + f_timesort = 0; + break; + case 't': + f_timesort = 1; + f_sizesort = 0; + break; + /* Other flags. Please keep alphabetic. */ + case ',': + f_thousands = 1; + break; + case 'B': + f_nonprint = 0; + f_octal = 1; + f_octal_escape = 0; + break; + case 'D': + f_timeformat = optarg; + break; case 'F': f_type = 1; f_slash = 0; break; + case 'G': + setenv("CLICOLOR", "", 1); + break; case 'H': fts_options |= FTS_COMFOLLOW; f_nofollow = 0; break; - case 'G': - setenv("CLICOLOR", "", 1); + case 'I': + f_noautodot = 1; break; case 'L': fts_options &= ~FTS_PHYSICAL; @@ -254,14 +281,19 @@ main(int argc, char *argv[]) case 'R': f_recursive = 1; break; - case 'a': - fts_options |= FTS_SEEDOT; - /* FALLTHROUGH */ - case 'A': - f_listdot = 1; + case 'T': + f_sectime = 1; break; - case 'I': - f_noautodot = 1; + case 'W': + f_whiteout = 1; + break; + case 'Z': + f_label = 1; + break; + case 'b': + f_nonprint = 0; + f_octal = 0; + f_octal_escape = 1; break; /* The -d option turns off the -R option. */ case 'd': @@ -309,33 +341,13 @@ main(int argc, char *argv[]) case 's': f_size = 1; break; - case 'T': - f_sectime = 1; - break; - /* The -t and -S options override each other. */ - case 't': - f_timesort = 1; - f_sizesort = 0; - break; - case 'S': - f_sizesort = 1; - f_timesort = 0; - break; - case 'W': - f_whiteout = 1; - break; - case 'b': - f_nonprint = 0; - f_octal = 0; - f_octal_escape = 1; - break; case 'w': f_nonprint = 0; f_octal = 0; f_octal_escape = 0; break; - case 'Z': - f_label = 1; + case 'y': + f_samesort = 1; break; default: case '?': @@ -414,8 +426,8 @@ main(int argc, char *argv[]) fts_options |= FTS_WHITEOUT; #endif - /* If -l or -s, figure out block size. */ - if (f_longform || f_size) { + /* If -i, -l or -s, figure out block size. */ + if (f_inode || f_longform || f_size) { if (f_kblocks) blocksize = 2; else { @@ -561,9 +573,10 @@ display(const FTSENT *p, FTSENT *list, i NAMES *np; off_t maxsize; long maxblock; - u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; + uintmax_t maxinode; + u_long btotal, labelstrlen, maxlen, maxnlink; u_long maxlabelstr; - u_int devstrlen; + u_int sizelen; int maxflags; gid_t maxgroup; uid_t maxuser; @@ -572,7 +585,6 @@ display(const FTSENT *p, FTSENT *list, i int entries, needstats; const char *user, *group; char *flags, *labelstr = NULL; - char buf[STRBUF_SIZEOF(u_quad_t) + 1]; char ngroup[STRBUF_SIZEOF(uid_t) + 1]; char nuser[STRBUF_SIZEOF(gid_t) + 1]; @@ -581,8 +593,9 @@ display(const FTSENT *p, FTSENT *list, i btotal = 0; initmax = getenv("LS_COLWIDTHS"); /* Fields match -lios order. New ones should be added at the end. */ - maxlabelstr = maxblock = maxinode = maxlen = maxnlink = + maxlabelstr = maxblock = maxlen = maxnlink = 0; maxuser = maxgroup = maxflags = maxsize = 0; + maxinode = 0; if (initmax != NULL && *initmax != '\0') { char *initmax2, *jinitmax; int ninitmax; @@ -610,7 +623,7 @@ display(const FTSENT *p, FTSENT *list, i strcpy(initmax2, "0"); ninitmax = sscanf(jinitmax, - " %lu : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", + " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", &maxinode, &maxblock, &maxnlink, &maxuser, &maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr); f_notabs = 1; @@ -656,7 +669,8 @@ display(const FTSENT *p, FTSENT *list, i MAKENINES(maxsize); free(jinitmax); } - devstrlen = 0; + d.s_size = 0; + sizelen = 0; flags = NULL; for (cur = list, entries = 0; cur; cur = cur->fts_link) { if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) { @@ -796,14 +810,12 @@ label_out: np->group = &np->data[ulen + 1]; (void)strcpy(np->group, group); - if ((S_ISCHR(sp->st_mode) || - S_ISBLK(sp->st_mode)) && - devstrlen < DEVSTR_HEX_LEN) { - if (minor(sp->st_rdev) > 255 || - minor(sp->st_rdev) < 0) - devstrlen = DEVSTR_HEX_LEN; - else - devstrlen = DEVSTR_LEN; + if (S_ISCHR(sp->st_mode) || + S_ISBLK(sp->st_mode)) { + sizelen = snprintf(NULL, 0, + "%#jx", (uintmax_t)sp->st_rdev); + if (d.s_size < sizelen) + d.s_size = sizelen; } if (f_flags) { @@ -837,25 +849,20 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - (void)snprintf(buf, sizeof(buf), "%lu", maxblock); - d.s_block = strlen(buf); + d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; - (void)snprintf(buf, sizeof(buf), "%lu", maxinode); - d.s_inode = strlen(buf); - (void)snprintf(buf, sizeof(buf), "%lu", maxnlink); - d.s_nlink = strlen(buf); - if (f_humanval) - d.s_size = HUMANVALSTR_LEN; - else { - (void)snprintf(buf, sizeof(buf), "%ju", maxsize); - d.s_size = strlen(buf); - } - if (d.s_size < devstrlen) - d.s_size = devstrlen; + d.s_inode = snprintf(NULL, 0, "%ju", maxinode); + d.s_nlink = snprintf(NULL, 0, "%lu", maxnlink); + sizelen = f_humanval ? HUMANVALSTR_LEN : + snprintf(NULL, 0, "%ju", maxsize); + if (d.s_size < sizelen) + d.s_size = sizelen; d.s_user = maxuser; } + if (f_thousands) /* make space for commas */ + d.s_size += (d.s_size - 1) / 3; printfcn(&d); output = 1; Modified: stable/9/bin/ls/ls.h ============================================================================== --- stable/9/bin/ls/ls.h Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/ls.h Mon Dec 10 03:11:19 2012 (r244075) @@ -36,8 +36,6 @@ #define NO_PRINT 1 #define HUMANVALSTR_LEN 5 -#define DEVSTR_LEN 8 -#define DEVSTR_HEX_LEN 15 extern long blocksize; /* block size units */ @@ -51,11 +49,13 @@ extern int f_longform; /* long listing extern int f_octal; /* print unprintables in octal */ extern int f_octal_escape; /* like f_octal but use C escapes if possible */ extern int f_nonprint; /* show unprintables as ? */ +extern int f_samesort; /* sort time and name in same direction */ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ extern int f_statustime; /* use time of last mode change */ +extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ extern int f_notabs; /* don't use tab-separated multi-col output */ extern int f_type; /* add type character for non-regular files */ Modified: stable/9/bin/ls/print.c ============================================================================== --- stable/9/bin/ls/print.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/print.c Mon Dec 10 03:11:19 2012 (r244075) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,7 +152,8 @@ printlong(const DISPLAY *dp) continue; sp = p->fts_statp; if (f_inode) - (void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino); + (void)printf("%*ju ", + dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) (void)printf("%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); @@ -327,7 +329,8 @@ printaname(const FTSENT *p, u_long inode sp = p->fts_statp; chcnt = 0; if (f_inode) - chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); + chcnt += printf("%*ju ", + (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) chcnt += printf("%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); @@ -351,16 +354,8 @@ printaname(const FTSENT *p, u_long inode static void printdev(size_t width, dev_t dev) { - char buf[DEVSTR_HEX_LEN + 1]; - if (minor(dev) > 255 || minor(dev) < 0) - (void)snprintf(buf, sizeof(buf), "%3d, 0x%08x", - major(dev), (u_int)minor(dev)); - else - (void)snprintf(buf, sizeof(buf), "%3d, %3d", - major(dev), minor(dev)); - - (void)printf("%*s ", (u_int)width, buf); + (void)printf("%#*jx ", (u_int)width, (uintmax_t)dev); } static void @@ -611,6 +606,10 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); + } else if (f_thousands) { /* with commas */ + /* This format assignment needed to work round gcc bug. */ + const char *format = "%*j'd "; + (void)printf(format, (u_int)width, bytes); } else (void)printf("%*jd ", (u_int)width, bytes); } Modified: stable/9/bin/ls/util.c ============================================================================== --- stable/9/bin/ls/util.c Mon Dec 10 02:44:47 2012 (r244074) +++ stable/9/bin/ls/util.c Mon Dec 10 03:11:19 2012 (r244075) @@ -222,9 +222,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #else - "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwx1] [-D format]" + "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [-D format]" #endif " [file ...]\n"); exit(1); From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 05:14:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8874E2DE; Mon, 10 Dec 2012 05:14:05 +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 5279C8FC08; Mon, 10 Dec 2012 05:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA5E5Xp027209; Mon, 10 Dec 2012 05:14:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA5E574027208; Mon, 10 Dec 2012 05:14:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212100514.qBA5E574027208@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 05:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244076 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 05:14:05 -0000 Author: kib Date: Mon Dec 10 05:14:04 2012 New Revision: 244076 URL: http://svnweb.freebsd.org/changeset/base/244076 Log: Do not ignore zero address, possibly returned by the vm_map_find() call. The function indicates a failure by the TRUE return value. To be extra safe, assert that the return value from the following vm_map_insert() indicates success. Fix style issues in the nearby lines, reformulate the comment. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Dec 10 03:11:19 2012 (r244075) +++ head/sys/kern/vfs_bio.c Mon Dec 10 05:14:04 2012 (r244076) @@ -2107,15 +2107,16 @@ restart: if (maxsize != bp->b_kvasize) { vm_offset_t addr = 0; + int rv; bfreekva(bp); vm_map_lock(buffer_map); if (vm_map_findspace(buffer_map, - vm_map_min(buffer_map), maxsize, &addr)) { + vm_map_min(buffer_map), maxsize, &addr)) { /* - * Uh oh. Buffer map is to fragmented. We - * must defragment the map. + * Buffer map is too fragmented. + * We must defragment the map. */ atomic_add_int(&bufdefragcnt, 1); vm_map_unlock(buffer_map); @@ -2124,22 +2125,21 @@ restart: brelse(bp); goto restart; } - if (addr) { - vm_map_insert(buffer_map, NULL, 0, - addr, addr + maxsize, - VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); - - bp->b_kvabase = (caddr_t) addr; - bp->b_kvasize = maxsize; - atomic_add_long(&bufspace, bp->b_kvasize); - atomic_add_int(&bufreusecnt, 1); - } + rv = vm_map_insert(buffer_map, NULL, 0, addr, + addr + maxsize, VM_PROT_ALL, VM_PROT_ALL, + MAP_NOFAULT); + KASSERT(rv == KERN_SUCCESS, + ("vm_map_insert(buffer_map) rv %d", rv)); vm_map_unlock(buffer_map); + bp->b_kvabase = (caddr_t)addr; + bp->b_kvasize = maxsize; + atomic_add_long(&bufspace, bp->b_kvasize); + atomic_add_int(&bufreusecnt, 1); } bp->b_saveaddr = bp->b_kvabase; bp->b_data = bp->b_saveaddr; } - return(bp); + return (bp); } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 05:14:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88A5144D; Mon, 10 Dec 2012 05:14:35 +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 5146A8FC15; Mon, 10 Dec 2012 05:14:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA5EZeo027336; Mon, 10 Dec 2012 05:14:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA5EZFE027334; Mon, 10 Dec 2012 05:14:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212100514.qBA5EZFE027334@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 05:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244077 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 05:14:35 -0000 Author: kib Date: Mon Dec 10 05:14:34 2012 New Revision: 244077 URL: http://svnweb.freebsd.org/changeset/base/244077 Log: Add amd64-specific ddb command "show pte". The command displays the hierarchy of the page table entries which map the specified address. Reviewed by: alc (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Dec 10 05:14:04 2012 (r244076) +++ head/sys/amd64/amd64/pmap.c Mon Dec 10 05:14:34 2012 (r244077) @@ -5446,3 +5446,46 @@ pmap_align_superpage(vm_object_t object, else *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } + +#include "opt_ddb.h" +#ifdef DDB +#include + +DB_SHOW_COMMAND(pte, pmap_print_pte) +{ + pmap_t pmap; + pml4_entry_t *pml4; + pdp_entry_t *pdp; + pd_entry_t *pde; + pt_entry_t *pte; + vm_offset_t va; + + if (have_addr) { + va = (vm_offset_t)addr; + pmap = PCPU_GET(curpmap); /* XXX */ + } else { + db_printf("show pte addr\n"); + return; + } + pml4 = pmap_pml4e(pmap, va); + db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + if ((*pml4 & PG_V) == 0) { + db_printf("\n"); + return; + } + pdp = pmap_pml4e_to_pdpe(pml4, va); + db_printf(" pdpe %#016lx", *pdp); + if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { + db_printf("\n"); + return; + } + pde = pmap_pdpe_to_pde(pdp, va); + db_printf(" pde %#016lx", *pde); + if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { + db_printf("\n"); + return; + } + pte = pmap_pde_to_pte(pde, va); + db_printf(" pte %#016lx\n", *pte); +} +#endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 07:00:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E106624; Mon, 10 Dec 2012 07:00:47 +0000 (UTC) (envelope-from adrian@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 12B8E8FC13; Mon, 10 Dec 2012 07:00:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA70ke4047080; Mon, 10 Dec 2012 07:00:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA70kO7047079; Mon, 10 Dec 2012 07:00:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212100700.qBA70kO7047079@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Dec 2012 07:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244078 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 07:00:47 -0000 Author: adrian Date: Mon Dec 10 07:00:46 2012 New Revision: 244078 URL: http://svnweb.freebsd.org/changeset/base/244078 Log: Adjust the channel to correctly setup the HT flags when transitioning an IBSS VAP to RUN. An 11n IBSS was beaconing HTINFO/HTCAP IE's that didn't have any HT information setup (like the HT TX/RX MCS bitmask.) Tested: * AR9280, IBSS - both a statically setup channel and a scanned channel PR: kern/172955 Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Dec 10 05:14:34 2012 (r244077) +++ head/sys/net80211/ieee80211_adhoc.c Mon Dec 10 07:00:46 2012 (r244078) @@ -171,7 +171,9 @@ adhoc_newstate(struct ieee80211vap *vap, * Already have a channel; bypass the * scan and startup immediately. */ - ieee80211_create_ibss(vap, vap->iv_des_chan); + ieee80211_create_ibss(vap, + ieee80211_ht_adjust_channel(ic, + vap->iv_des_chan, vap->iv_flags_ht)); break; } /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 08:39:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03059DAB; Mon, 10 Dec 2012 08:39:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C82D58FC17; Mon, 10 Dec 2012 08:39:48 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id B72A546B35; Mon, 10 Dec 2012 03:39:47 -0500 (EST) Date: Mon, 10 Dec 2012 08:39:47 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Konstantin Belousov Subject: Re: svn commit: r244077 - head/sys/amd64/amd64 In-Reply-To: <201212100514.qBA5EZFE027334@svn.freebsd.org> Message-ID: References: <201212100514.qBA5EZFE027334@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 08:39:49 -0000 On Mon, 10 Dec 2012, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 10 05:14:34 2012 > New Revision: 244077 > URL: http://svnweb.freebsd.org/changeset/base/244077 > > Log: > Add amd64-specific ddb command "show pte". The command displays the > hierarchy of the page table entries which map the specified address. > > Reviewed by: alc (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Ah, very nice indeed -- I'd actually like to see similar MD page table dumping routines for other architectures, especially MIPS with its software-defined page tables. Robert From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 09:15:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89294DF2; Mon, 10 Dec 2012 09:15:34 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCFE8FC12; Mon, 10 Dec 2012 09:15:34 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 921E2460147; Mon, 10 Dec 2012 03:15:33 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 8FFCC46013B; Mon, 10 Dec 2012 03:15:33 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id ThRFQF2CO2kH; Mon, 10 Dec 2012 03:15:33 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 0CEBE46011D; Mon, 10 Dec 2012 03:15:32 -0600 (CST) Message-ID: <50C5A832.2080801@rice.edu> Date: Mon, 10 Dec 2012 03:15:30 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:16.0) Gecko/20121111 Thunderbird/16.0.2 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r243668 - in head/sys: kern sys References: <201211290730.qAT7Uhkv016745@svn.freebsd.org> <50C4F5F7.7080101@rice.edu> <50C513D4.4000306@freebsd.org> In-Reply-To: <50C513D4.4000306@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 09:15:34 -0000 On 12/09/2012 16:42, Andre Oppermann wrote: > On 09.12.2012 21:35, Alan Cox wrote: >> Andre, >> >> I believe that this change did not actually correct the overflow >> problem. See below for an explanation. >> >> On 11/29/2012 01:30, Andre Oppermann wrote: >>> Author: andre >>> Date: Thu Nov 29 07:30:42 2012 >>> New Revision: 243668 >>> URL: http://svnweb.freebsd.org/changeset/base/243668 >>> >>> Log: >>> Using a long is the wrong type to represent the realmem and >>> maxmbufmem >>> variable as they may overflow on i386/PAE and i386 with > 2GB RAM. >>> >>> Use 64bit quad_t instead. It has broader kernel infrastructure >>> support >>> with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available >>> types. >>> >>> Pointed out by: alc, bde >>> >>> Modified: >>> head/sys/kern/subr_param.c >>> head/sys/sys/mbuf.h >>> >>> Modified: head/sys/kern/subr_param.c >>> ============================================================================== >>> >>> --- head/sys/kern/subr_param.c Thu Nov 29 06:26:42 2012 (r243667) >>> +++ head/sys/kern/subr_param.c Thu Nov 29 07:30:42 2012 (r243668) >>> @@ -93,7 +93,7 @@ int ncallout; /* maximum # of timer ev >>> int nbuf; >>> int ngroups_max; /* max # groups per process */ >>> int nswbuf; >>> -long maxmbufmem; /* max mbuf memory */ >>> +quad_t maxmbufmem; /* max mbuf memory */ >>> pid_t pid_max = PID_MAX; >>> long maxswzone; /* max swmeta KVA storage */ >>> long maxbcache; /* max buffer cache KVA storage */ >>> @@ -271,7 +271,7 @@ init_param1(void) >>> void >>> init_param2(long physpages) >>> { >>> - long realmem; >>> + quad_t realmem; >>> >>> /* Base parameters */ >>> maxusers = MAXUSERS; >>> @@ -332,10 +332,10 @@ init_param2(long physpages) >>> * available kernel memory (physical or kmem). >>> * At most it can be 3/4 of available kernel memory. >>> */ >>> - realmem = lmin(physpages * PAGE_SIZE, >>> + realmem = qmin(physpages * PAGE_SIZE, >>> VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); >> >> >> "physpages" is a signed long. Suppose it is 1,000,000. On i386/PAE, >> the product of 1,000,000 and PAGE_SIZE will be a negative number. >> Likewise, quad_t is a signed type. So, the negative product of >> 1,000,000 and PAGE_SIZE will be sign extended to a 64-bit signed value >> when it is passed to qmin(), and qmin() will return a negative number. > > Thank you taking a second look it. > > To be honest I got a bit confused on which automatic type expansion > applies here. > > qmax() is defined as this in libkern.h: > static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : > b); } > > Wouldn't physpages be expanded to quad_t? Hmm, no, only the result of > the > computation, which happens in long space, is passed on. This is a > function, > not a macro. Dang... > > This change will force the computation to be in quad_t space: > > - realmem = qmin(physpages * PAGE_SIZE, > + realmem = qmin((quad_t)physpages * PAGE_SIZE, > VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); > > VM_[MAX|MIN]_KERNEL_ADDRESS is safe as it is of the unsigned vm_offset_t > type. > This change looks ok. As Bruce mentioned, can you also change the indentation of the next line to match style(9) before you commit the change? Alan From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 11:26:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5417AFBF; Mon, 10 Dec 2012 11:26:19 +0000 (UTC) (envelope-from pluknet@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 1DAA28FC08; Mon, 10 Dec 2012 11:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBABQI72000282; Mon, 10 Dec 2012 11:26:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBABQIVq000281; Mon, 10 Dec 2012 11:26:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201212101126.qBABQIVq000281@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 10 Dec 2012 11:26:18 +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: r244079 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 11:26:19 -0000 Author: pluknet Date: Mon Dec 10 11:26:18 2012 New Revision: 244079 URL: http://svnweb.freebsd.org/changeset/base/244079 Log: MFC rr243398-243399: - core(5) references sysctl debug.num_cores, but it is really debug.ncores. - [mdoc] remove hard sentence breaks. PR: docs/173831 Modified: stable/9/share/man/man5/core.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/core.5 ============================================================================== --- stable/9/share/man/man5/core.5 Mon Dec 10 07:00:46 2012 (r244078) +++ stable/9/share/man/man5/core.5 Mon Dec 10 11:26:18 2012 (r244079) @@ -32,7 +32,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 22, 2010 +.Dd November 22, 2012 .Dt CORE 5 .Os .Sh NAME @@ -78,8 +78,9 @@ name: Machine hostname. .It Em \&%I An index starting at zero until the sysctl -.Em debug.num_cores -is reached. This can be useful for limiting the number of corefiles +.Em debug.ncores +is reached. +This can be useful for limiting the number of corefiles generated by a particular process. .It Em \&%N process name. @@ -117,9 +118,11 @@ When COMPRESS_USER_CORES is included the if core files will be compressed: .Bl -tag -width "kern.compress_user_cores_gzlevel" -compact -offset "12345" .It Em kern.compress_user_cores_gzlevel -Gzip compression level. Defaults to -1. +Gzip compression level. +Defaults to -1. .It Em kern.compress_user_cores -Actually compress user cores. Core files will have the suffix +Actually compress user cores. +Core files will have the suffix .Em .gz appended to them. .El From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 12:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FDE8819; Mon, 10 Dec 2012 12:19:04 +0000 (UTC) (envelope-from andre@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 6480F8FC12; Mon, 10 Dec 2012 12:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBACJ4VB007911; Mon, 10 Dec 2012 12:19:04 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBACJ4v2007910; Mon, 10 Dec 2012 12:19:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201212101219.qBACJ4v2007910@svn.freebsd.org> From: Andre Oppermann Date: Mon, 10 Dec 2012 12:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244080 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 12:19:04 -0000 Author: andre Date: Mon Dec 10 12:19:03 2012 New Revision: 244080 URL: http://svnweb.freebsd.org/changeset/base/244080 Log: Prevent long type overflow of realmem calculation on ILP32 by forcing calculation to be in quad_t space. Fix style issue with second parameter to qmin(). Reported by: alc Reviewed by: bde, alc Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Mon Dec 10 11:26:18 2012 (r244079) +++ head/sys/kern/subr_param.c Mon Dec 10 12:19:03 2012 (r244080) @@ -332,8 +332,8 @@ init_param2(long physpages) * available kernel memory (physical or kmem). * At most it can be 3/4 of available kernel memory. */ - realmem = qmin(physpages * PAGE_SIZE, - VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); + realmem = qmin((quad_t)physpages * PAGE_SIZE, + VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS); maxmbufmem = realmem / 2; TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem); if (maxmbufmem > (realmem / 4) * 3) From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 12:47:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 353FC4CE; Mon, 10 Dec 2012 12:47:34 +0000 (UTC) (envelope-from glebius@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 174AF8FC1A; Mon, 10 Dec 2012 12:47:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAClXBM011941; Mon, 10 Dec 2012 12:47:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAClXoc011940; Mon, 10 Dec 2012 12:47:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212101247.qBAClXoc011940@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 10 Dec 2012 12:47: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: r244081 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 12:47:34 -0000 Author: glebius Date: Mon Dec 10 12:47:33 2012 New Revision: 244081 URL: http://svnweb.freebsd.org/changeset/base/244081 Log: Merge r242474: Remove separate paragraph on ASCII messages and instead provide this information along with messages documentation, like this done in manual pages for other netgraph nodes. Submitted by: Mamontov Roman Modified: stable/9/share/man/man4/ng_netflow.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_netflow.4 ============================================================================== --- stable/9/share/man/man4/ng_netflow.4 Mon Dec 10 12:19:03 2012 (r244080) +++ stable/9/share/man/man4/ng_netflow.4 Mon Dec 10 12:47:33 2012 (r244081) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 2, 2011 +.Dd Nov 2, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME @@ -101,15 +101,15 @@ node. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width indent -.It Dv NGM_NETFLOW_INFO +.It Dv NGM_NETFLOW_INFO Pq Ic info Returns some node statistics and the current timeout values in a .Vt "struct ng_netflow_info" . -.It Dv NGM_NETFLOW_IFINFO +.It Dv NGM_NETFLOW_IFINFO Pq Ic ifinfo Returns information about the .Va iface Ns Ar N hook. The hook number is passed as an argument. -.It Dv NGM_NETFLOW_SETDLT +.It Dv NGM_NETFLOW_SETDLT Pq Ic setdlt Sets data link type on the .Va iface Ns Ar N hook. @@ -119,7 +119,7 @@ This message type uses as an argument: .Bd -literal -offset 4n struct ng_netflow_setdlt { - uint16_t iface; /* which iface to operate on */ + uint16_t iface; /* which iface dlt change */ uint8_t dlt; /* DLT_XXX from bpf.h */ }; .Ed @@ -128,7 +128,7 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise message send operation will return an error. -.It Dv NGM_NETFLOW_SETIFINDEX +.It Dv NGM_NETFLOW_SETIFINDEX Pq Ic setifindex In some cases, .Nm may be unable to determine the input interface index of a packet. @@ -148,8 +148,8 @@ This message requires as an argument: .Bd -literal -offset 4n struct ng_netflow_setifindex { - u_int16_t iface; /* which iface to operate on */ - u_int16_t index; /* new index */ + uint16_t iface; /* which iface index change */ + uint16_t index; /* new index */ }; .Ed .Pp @@ -157,26 +157,26 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise the message send operation will return an error. -.It Dv NGM_NETFLOW_SETTIMEOUTS +.It Dv NGM_NETFLOW_SETTIMEOUTS Pq Ic settimeouts Sets values in seconds for NetFlow active/inactive timeouts. This message requires .Vt "struct ng_netflow_settimeouts" as an argument: .Bd -literal -offset 4n struct ng_netflow_settimeouts { - uint32_t inactive_timeout; - uint32_t active_timeout; + uint32_t inactive_timeout; /* flow inactive timeout */ + uint32_t active_timeout; /* flow active timeout */ }; .Ed -.It Dv NGM_NETFLOW_SETCONFIG +.It Dv NGM_NETFLOW_SETCONFIG Pq Ic setconfig Sets configuration for the specified interface. This message requires .Vt "struct ng_netflow_setconfig" as an argument: .Bd -literal -offset 4n struct ng_netflow_setconfig { - u_int16_t iface; - u_int32_t conf; + uint16_t iface; /* which iface config change */ + uint32_t conf; /* new config */ #define NG_NETFLOW_CONF_INGRESS 1 #define NG_NETFLOW_CONF_EGRESS 2 #define NG_NETFLOW_CONF_ONCE 4 @@ -193,29 +193,29 @@ NG_NETFLOW_CONF_THISONCE defines that pa if it several times passes via exactly this netflow node. Last two options are important to avoid duplicate accounting when both ingress and egress NetFlow are enabled. -.It Dv NGM_NETFLOW_SETTEMPLATE +.It Dv NGM_NETFLOW_SETTEMPLATE Pq Ic settemplate Sets various timeouts to announce data flow templates (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_settemplate" as an argument: .Bd -literal -offset 4n struct ng_netflow_settemplate { - uint16_t time; - uint16_t packets; + uint16_t time; /* max time between announce */ + uint16_t packets; /* max packets between announce */ }; .Ed .Pp Value of time field represents time in seconds to re-announce data templates. Value of packets field represents maximum packets count between re-announcing data templates. -.It Dv NGM_NETFLOW_SETMTU +.It Dv NGM_NETFLOW_SETMTU Pq Ic setmtu Sets export interface MTU to build packets of specified size (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_setmtu" as an argument: .Bd -literal -offset 4n -struct ng_netflow_settemtu { - uint16_t mtu; +struct ng_netflow_setemtu { + uint16_t mtu; /* MTU for packet */ }; .Ed .Pp @@ -229,37 +229,15 @@ not directly from See also .Sx BUGS section. -.It Dv NGM_NETFLOW_V9INFO +.It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a -.Vt "struct ng_netflow_v9info" . -.El -.Sh ASCII CONTROL MESSAGES -Most binary control messages have an -.Tn ASCII -equivalent. -The supported -.Tn ASCII -commands are: -.Pp -.Bl -tag -width ".Dv NGM_NETFLOW_SETTIMEOUTS" -compact -.It Dv NGM_NETFLOW_INFO -.Qq Li info -.It Dv NGM_NETFLOW_IFINFO -.Qq Li "ifinfo %u" -.It Dv NGM_NETFLOW_SETDLT -.Qq Li "setdlt { iface = %u dlt = %u }" -.It Dv NGM_NETFLOW_SETIFINDEX -.Qq Li "setifindex { iface = %u index = %u }" -.It Dv NGM_NETFLOW_SETTIMEOUTS -.Qq Li "settimeouts { inactive = %u active = %u }" -.It Dv NGM_NETFLOW_SETCONFIG -.Qq Li "setconfig { iface = %u conf = %u }" -.It Dv NGM_NETFLOW_SETTEMPLATE -.Qq Li "settemplate { time = %u packets = %u }" -.It Dv NGM_NETFLOW_SETMTU -.Qq Li "setmtu { mtu = %u }" -.It Dv NGM_NETFLOW_V9INFO -.Qq Li v9info +.Bd -literal -offset 4n +struct ng_netflow_v9info { + uint16_t templ_packets; /* v9 template packets */ + uint16_t templ_time; /* v9 template time */ + uint16_t mtu; /* v9 MTU */ +}; +.Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 13:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66F12E15; Mon, 10 Dec 2012 13:08:15 +0000 (UTC) (envelope-from glebius@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 49DB18FC13; Mon, 10 Dec 2012 13:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAD8F9e015189; Mon, 10 Dec 2012 13:08:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAD8FNg015188; Mon, 10 Dec 2012 13:08:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212101308.qBAD8FNg015188@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 10 Dec 2012 13:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244082 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 13:08:15 -0000 Author: glebius Date: Mon Dec 10 13:08:14 2012 New Revision: 244082 URL: http://svnweb.freebsd.org/changeset/base/244082 Log: NGM_NETFLOW_SHOW reports IPv6 flows as well. Submitted by: Dmitry Luhtionov Modified: head/share/man/man4/ng_netflow.4 Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Mon Dec 10 12:47:33 2012 (r244081) +++ head/share/man/man4/ng_netflow.4 Mon Dec 10 13:08:14 2012 (r244082) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 2, 2012 +.Dd December 10, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME @@ -254,9 +254,6 @@ It is called from .Xr flowctl 8 , not directly from .Xr ngctl 8 . -See also -.Sx BUGS -section. .It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a .Bd -literal -offset 4n @@ -349,7 +346,6 @@ written by Cache snapshot obtained via .Dv NGM_NETFLOW_SHOW command may lack some percentage of entries under severe load. -IPv6 flows are not shown. .Pp The .Nm From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 14:36:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8C77541; Mon, 10 Dec 2012 14:36:52 +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 C80708FC15; Mon, 10 Dec 2012 14:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAEaqS0033880; Mon, 10 Dec 2012 14:36:52 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAEamSL033849; Mon, 10 Dec 2012 14:36:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212101436.qBAEamSL033849@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 Dec 2012 14:36: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: r244087 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 14:36:53 -0000 Author: mm Date: Mon Dec 10 14:36:48 2012 New Revision: 244087 URL: http://svnweb.freebsd.org/changeset/base/244087 Log: MFC recent ZFS changes from illumos: 243503, 243524, 243525, 243560, 243561 MFC r243503: Illumos 13879:4eac7a87eff2 3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb() 3330 space_seg_t should have its own kmem_cache 3331 deferred frees should happen after sync_pass 1 3335 make SYNC_PASS_* constants tunable New loader-only tunables: vfs.zfs.sync_pass_deferred_free vfs.zfs.sync_pass_dont_compress vfs.zfs.sync_pass_rewrite References: https://www.illumos.org/issues/3329 https://www.illumos.org/issues/3330 https://www.illumos.org/issues/3331 https://www.illumos.org/issues/3335 MFC r243524: Import the zio nop-write improvement from Illumos. To reduce I/O, nop-write omits overwriting data if the checksum (cryptographically secure) of new data matches the checksum of existing data. It also saves space if snapshots are in use. It currently works only on datasets with enabled compression, disabled deduplication and sha256 checksums. IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 3236 zio nop-write References: https://www.illumos.org/issues/3236 MFC r243525: Add loader(8) tunable to enable/disable nopwrite functionality: vfs.zfs.nopwrite_enabled MFC r243560: Introduce a new dataset aclmode setting "restricted" to protect ACL's being destroyed or corrupted by a drive-by chmod. illumos-gate 13889:a67716f16746 3254 add support in zfs for aclmode=restricted MFC r243561: Update manpage dates in zfs.8 and zpool.8 Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:36:48 2012 (r244087) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2012 +.Dd November 26, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -754,7 +754,7 @@ If no inheritable .Tn ACE Ns s exist that affect the mode, then the mode is set in accordance to the requested mode from the application. -.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough +.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough | restricted Controls how an .Tn ACL is modified during @@ -784,6 +784,32 @@ indicates that no changes are made to th other than creating or updating the necessary .Tn ACL entries to represent the new mode of the file or directory. +An +.Sy aclmode +property of +.Cm restricted +will cause the +.Xr chmod 2 +operation to return an error when used on any file or directory which has +a non-trivial +.Tn ACL +whose entries can not be represented by a mode. +.Xr chmod 2 +is required to change the set user ID, set group ID, or sticky bits on a file +or directory, as they do not have equivalent +.Tn ACL +entries. +In order to use +.Xr chmod 2 +on a file or directory with a non-trivial +.Tn ACL +when +.Sy aclmode +is set to +.Cm restricted , +you must first remove all +.Tn ACL +entries which do not represent the current mode. .It Sy atime Ns = Ns Cm on | off Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:36:48 2012 (r244087) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2011 +.Dd November 15, 2012 .Dt ZPOOL 8 .Os .Sh NAME Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:36:48 2012 (r244087) @@ -204,6 +204,7 @@ enum ztest_io_type { ZTEST_IO_WRITE_ZEROES, ZTEST_IO_TRUNCATE, ZTEST_IO_SETATTR, + ZTEST_IO_REWRITE, ZTEST_IO_TYPES }; @@ -1859,6 +1860,12 @@ ztest_get_data(void *arg, lr_write_t *lr DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -2004,6 +2011,9 @@ ztest_remove(ztest_ds_t *zd, ztest_od_t continue; } + /* + * No object was found. + */ if (od->od_object == 0) continue; @@ -2119,6 +2129,7 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t static void ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset) { + int err; ztest_block_tag_t wbt; dmu_object_info_t doi; enum ztest_io_type io_type; @@ -2171,6 +2182,25 @@ ztest_io(ztest_ds_t *zd, uint64_t object case ZTEST_IO_SETATTR: (void) ztest_setattr(zd, object); break; + + case ZTEST_IO_REWRITE: + (void) rw_rdlock(&ztest_name_lock); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_COMPRESSION, + ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + (void) rw_unlock(&ztest_name_lock); + + VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data, + DMU_READ_NO_PREFETCH)); + + (void) ztest_write(zd, object, offset, blocksize, data); + break; } (void) rw_unlock(&zd->zd_zilog_lock); @@ -2258,7 +2288,12 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; - VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); + /* + * We grab the zd_dirobj_lock to ensure that no other thread is + * updating the zil (i.e. adding in-memory log records) and the + * zd_zilog_lock to block any I/O. + */ + VERIFY0(mutex_lock(&zd->zd_dirobj_lock)); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -4906,8 +4941,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ */ for (int i = 0; i < copies; i++) { uint64_t offset = i * blocksize; - VERIFY(dmu_buf_hold(os, object, offset, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db, + DMU_READ_NO_PREFETCH)); ASSERT(db->db_offset == offset); ASSERT(db->db_size == blocksize); ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) || @@ -4923,8 +4958,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ /* * Find out what block we got. */ - VERIFY(dmu_buf_hold(os, object, 0, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, 0, FTAG, &db, + DMU_READ_NO_PREFETCH)); blk = *((dmu_buf_impl_t *)db)->db_blkptr; dmu_buf_rele(db, FTAG); @@ -5602,6 +5637,8 @@ ztest_freeze(void) kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); VERIFY3U(0, ==, ztest_dataset_open(0)); + spa->spa_debug = B_TRUE; + ztest_spa = spa; /* * Force the first log block to be transactionally allocated. Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:36:48 2012 (r244087) @@ -109,6 +109,7 @@ zfs_prop_init(void) { "discard", ZFS_ACL_DISCARD }, { "groupmask", ZFS_ACL_GROUPMASK }, { "passthrough", ZFS_ACL_PASSTHROUGH }, + { "restricted", ZFS_ACL_RESTRICTED }, { NULL } }; @@ -217,7 +218,8 @@ zfs_prop_init(void) "hidden | visible", "SNAPDIR", snapdir_table); zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); + "discard | groupmask | passthrough | restricted", "ACLMODE", + acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 10 14:36:48 2012 (r244087) @@ -3606,6 +3606,12 @@ arc_write_done(zio_t *zio) arc_hdr_destroy(exists); exists = buf_hash_insert(hdr, &hash_lock); ASSERT3P(exists, ==, NULL); + } else if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + /* nopwrite */ + ASSERT(zio->io_prop.zp_nopwrite); + if (!BP_EQUAL(&zio->io_bp_orig, zio->io_bp)) + panic("bad nopwrite, hdr=%p exists=%p", + (void *)hdr, (void *)exists); } else { /* Dedup */ ASSERT(hdr->b_datacnt == 1); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 10 14:36:48 2012 (r244087) @@ -768,13 +768,15 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp)) { + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { spa_t *spa; DB_GET_SPA(&spa, db); zio_free(spa, txg, bp); } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; + dr->dt.dl.dr_nopwrite = B_FALSE; + /* * Release the already-written buffer, so we leave it in * a consistent dirty state. Note that all callers are @@ -2172,6 +2174,13 @@ dmu_buf_freeable(dmu_buf_t *dbuf) return (res); } +blkptr_t * +dmu_buf_get_blkptr(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + return (dbi->db_blkptr); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { @@ -2514,7 +2523,11 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b ASSERT0(zio->io_error); ASSERT(db->db_blkptr == bp); - if (zio->io_flags & ZIO_FLAG_IO_REWRITE) { + /* + * For nopwrites and rewrites we ensure that the bp matches our + * original and bypass all the accounting. + */ + if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { objset_t *os; @@ -2705,7 +2718,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, - dr->dt.dl.dr_copies); + dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Dec 10 14:36:48 2012 (r244087) @@ -40,11 +40,21 @@ #include #include #include +#include #include #ifdef _KERNEL #include #endif +/* + * Enable/disable nopwrite feature. + */ +int zfs_nopwrite_enabled = 1; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled); +SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, + &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -1287,6 +1297,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf mutex_enter(&db->db_mtx); ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC); if (zio->io_error == 0) { + dr->dt.dl.dr_nopwrite = !!(zio->io_flags & ZIO_FLAG_NOPWRITE); + if (dr->dt.dl.dr_nopwrite) { + blkptr_t *bp = zio->io_bp; + blkptr_t *bp_orig = &zio->io_bp_orig; + uint8_t chksum = BP_GET_CHECKSUM(bp_orig); + + ASSERT(BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); + ASSERT(zio_checksum_table[chksum].ci_dedup); + } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; @@ -1308,11 +1328,22 @@ dmu_sync_late_arrival_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; dmu_sync_arg_t *dsa = zio->io_private; + blkptr_t *bp_orig = &zio->io_bp_orig; if (zio->io_error == 0 && !BP_IS_HOLE(bp)) { - ASSERT(zio->io_bp->blk_birth == zio->io_txg); - ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); - zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + /* + * If we didn't allocate a new block (i.e. ZIO_FLAG_NOPWRITE) + * then there is nothing to do here. Otherwise, free the + * newly allocated block in this txg. + */ + if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + ASSERT(BP_EQUAL(bp, bp_orig)); + } else { + ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_bp->blk_birth == zio->io_txg); + ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); + zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + } } dmu_tx_commit(dsa->dsa_tx); @@ -1357,7 +1388,7 @@ dmu_sync_late_arrival(zio_t *pio, objset * * Return values: * - * EEXIST: this txg has already been synced, so there's nothing to to. + * EEXIST: this txg has already been synced, so there's nothing to do. * The caller should not log the write. * * ENOENT: the block was dbuf_free_range()'d, so there's nothing to do. @@ -1389,7 +1420,6 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s dnode_t *dn; ASSERT(pio != NULL); - ASSERT(BP_IS_HOLE(bp)); ASSERT(txg != 0); SET_BOOKMARK(&zb, ds->ds_object, @@ -1444,6 +1474,23 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s return (ENOENT); } + ASSERT(dr->dr_next == NULL || dr->dr_next->dr_txg < txg); + + /* + * Assume the on-disk data is X, the current syncing data is Y, + * and the current in-memory data is Z (currently in dmu_sync). + * X and Z are identical but Y is has been modified. Normally, + * when X and Z are the same we will perform a nopwrite but if Y + * is different we must disable nopwrite since the resulting write + * of Y to disk can free the block containing X. If we allowed a + * nopwrite to occur the block pointing to Z would reference a freed + * block. Since this is a rare case we simplify this by disabling + * nopwrite if the current dmu_sync-ing dbuf has been modified in + * a previous transaction. + */ + if (dr->dr_next) + zp.zp_nopwrite = B_FALSE; + ASSERT(dr->dr_txg == txg); if (dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC || dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { @@ -1519,7 +1566,6 @@ dmu_object_set_compress(objset_t *os, ui int zfs_mdcomp_disable = 0; TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable); -SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); @@ -1532,15 +1578,27 @@ dmu_write_policy(objset_t *os, dnode_t * enum zio_checksum checksum = os->os_checksum; enum zio_compress compress = os->os_compress; enum zio_checksum dedup_checksum = os->os_dedup_checksum; - boolean_t dedup; + boolean_t dedup = B_FALSE; + boolean_t nopwrite = B_FALSE; boolean_t dedup_verify = os->os_dedup_verify; int copies = os->os_copies; /* - * Determine checksum setting. + * We maintain different write policies for each of the following + * types of data: + * 1. metadata + * 2. preallocated blocks (i.e. level-0 blocks of a dump device) + * 3. all other level 0 blocks */ if (ismd) { /* + * XXX -- we should design a compression algorithm + * that specializes in arrays of bps. + */ + compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : + ZIO_COMPRESS_LZJB; + + /* * Metadata always gets checksummed. If the data * checksum is multi-bit correctable, and it's not a * ZBT-style checksum, then it's suitable for metadata @@ -1550,45 +1608,47 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; - } else { - checksum = zio_checksum_select(dn->dn_checksum, checksum); - } + } else if (wp & WP_NOFILL) { + ASSERT(level == 0); - /* - * Determine compression setting. - */ - if (ismd) { /* - * XXX -- we should design a compression algorithm - * that specializes in arrays of bps. + * If we're writing preallocated blocks, we aren't actually + * writing them so don't set any policy properties. These + * blocks are currently only used by an external subsystem + * outside of zfs (i.e. dump) and not written by the zio + * pipeline. */ - compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : - ZIO_COMPRESS_LZJB; + compress = ZIO_COMPRESS_OFF; + checksum = ZIO_CHECKSUM_OFF; } else { compress = zio_compress_select(dn->dn_compress, compress); - } - /* - * Determine dedup setting. If we are in dmu_sync(), we won't - * actually dedup now because that's all done in syncing context; - * but we do want to use the dedup checkum. If the checksum is not - * strong enough to ensure unique signatures, force dedup_verify. - */ - dedup = (!ismd && dedup_checksum != ZIO_CHECKSUM_OFF); - if (dedup) { - checksum = dedup_checksum; - if (!zio_checksum_table[checksum].ci_dedup) - dedup_verify = 1; - } + checksum = (dedup_checksum == ZIO_CHECKSUM_OFF) ? + zio_checksum_select(dn->dn_checksum, checksum) : + dedup_checksum; - if (wp & WP_DMU_SYNC) - dedup = 0; + /* + * Determine dedup setting. If we are in dmu_sync(), + * we won't actually dedup now because that's all + * done in syncing context; but we do want to use the + * dedup checkum. If the checksum is not strong + * enough to ensure unique signatures, force + * dedup_verify. + */ + if (dedup_checksum != ZIO_CHECKSUM_OFF) { + dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; + if (!zio_checksum_table[checksum].ci_dedup) + dedup_verify = B_TRUE; + } - if (wp & WP_NOFILL) { - ASSERT(!ismd && level == 0); - checksum = ZIO_CHECKSUM_OFF; - compress = ZIO_COMPRESS_OFF; - dedup = B_FALSE; + /* + * Enable nopwrite if we have a cryptographically secure + * checksum that has no known collisions (i.e. SHA-256) + * and compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually exclusive. + */ + nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } zp->zp_checksum = checksum; @@ -1598,6 +1658,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; + zp->zp_nopwrite = nopwrite; } int Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:36:48 2012 (r244087) @@ -440,7 +440,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * clean up our in-memory structures accumulated while syncing: * * - move dead blocks from the pending deadlist to the on-disk deadlist - * - clean up zil records * - release hold from dsl_dataset_dirty() */ while (ds = list_remove_head(&synced_datasets)) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:36:48 2012 (r244087) @@ -881,8 +881,9 @@ metaslab_activate(metaslab_t *msp, uint6 if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { space_map_load_wait(sm); if (!sm->sm_loaded) { - int error = space_map_load(sm, sm_ops, SM_FREE, - &msp->ms_smo, + space_map_obj_t *smo = &msp->ms_smo; + + int error = space_map_load(sm, sm_ops, SM_FREE, smo, spa_meta_objset(msp->ms_group->mg_vd->vdev_spa)); if (error) { metaslab_group_sort(msp->ms_group, msp, 0); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 10 14:36:48 2012 (r244087) @@ -138,6 +138,7 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* u uint_t zio_taskq_basedc = 80; /* base duty cycle */ boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ +extern int zfs_sync_pass_deferred_free; /* * This (illegal) pool name is used when temporarily importing a spa_t in order @@ -6227,7 +6228,7 @@ spa_sync(spa_t *spa, uint64_t txg) spa_errlog_sync(spa, txg); dsl_pool_sync(dp, txg); - if (pass <= SYNC_PASS_DEFERRED_FREE) { + if (pass < zfs_sync_pass_deferred_free) { zio_t *zio = zio_root(spa, NULL, NULL, 0); bplist_iterate(free_bpl, spa_free_sync_cb, zio, tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:36:48 2012 (r244087) @@ -1619,6 +1619,7 @@ spa_init(int mode) #endif /* illumos */ refcount_sysinit(); unique_init(); + space_map_init(); zio_init(); dmu_init(); zil_init(); @@ -1641,6 +1642,7 @@ spa_fini(void) zil_fini(); dmu_fini(); zio_fini(); + space_map_fini(); unique_fini(); refcount_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:36:48 2012 (r244087) @@ -32,6 +32,23 @@ #include #include +static kmem_cache_t *space_seg_cache; + +void +space_map_init(void) +{ + ASSERT(space_seg_cache == NULL); + space_seg_cache = kmem_cache_create("space_seg_cache", + sizeof (space_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +space_map_fini(void) +{ + kmem_cache_destroy(space_seg_cache); + space_seg_cache = NULL; +} + /* * Space map routines. * NOTE: caller is responsible for all locking. @@ -124,7 +141,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); } ss_after->ss_start = ss_before->ss_start; - kmem_free(ss_before, sizeof (*ss_before)); + kmem_cache_free(space_seg_cache, ss_before); ss = ss_after; } else if (merge_before) { ss_before->ss_end = end; @@ -137,7 +154,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); ss = ss_after; } else { - ss = kmem_alloc(sizeof (*ss), KM_SLEEP); + ss = kmem_cache_alloc(space_seg_cache, KM_SLEEP); ss->ss_start = start; ss->ss_end = end; avl_insert(&sm->sm_root, ss, where); @@ -183,7 +200,7 @@ space_map_remove(space_map_t *sm, uint64 avl_remove(sm->sm_pp_root, ss); if (left_over && right_over) { - newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP); + newseg = kmem_cache_alloc(space_seg_cache, KM_SLEEP); newseg->ss_start = end; newseg->ss_end = ss->ss_end; ss->ss_end = start; @@ -196,7 +213,7 @@ space_map_remove(space_map_t *sm, uint64 ss->ss_start = end; } else { avl_remove(&sm->sm_root, ss); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); ss = NULL; } @@ -236,7 +253,7 @@ space_map_vacate(space_map_t *sm, space_ while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { if (func != NULL) func(mdest, ss->ss_start, ss->ss_end - ss->ss_start); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } sm->sm_space = 0; } @@ -408,7 +425,7 @@ space_map_sync(space_map_t *sm, uint8_t spa_t *spa = dmu_objset_spa(os); void *cookie = NULL; space_seg_t *ss; - uint64_t bufsize, start, size, run_len; + uint64_t bufsize, start, size, run_len, delta, sm_space; uint64_t *entry, *entry_map, *entry_map_end; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -437,11 +454,13 @@ space_map_sync(space_map_t *sm, uint8_t SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx)); + delta = 0; + sm_space = sm->sm_space; while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { size = ss->ss_end - ss->ss_start; start = (ss->ss_start - sm->sm_start) >> sm->sm_shift; - sm->sm_space -= size; + delta += size; size >>= sm->sm_shift; while (size) { @@ -463,7 +482,7 @@ space_map_sync(space_map_t *sm, uint8_t start += run_len; size -= run_len; } - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } if (entry != entry_map) { @@ -475,8 +494,15 @@ space_map_sync(space_map_t *sm, uint8_t smo->smo_objsize += size; } + /* + * Ensure that the space_map's accounting wasn't changed + * while we were in the middle of writing it out. + */ + VERIFY3U(sm->sm_space, ==, sm_space); + zio_buf_free(entry_map, bufsize); + sm->sm_space -= delta; VERIFY0(sm->sm_space); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:36:48 2012 (r244087) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DBUF_H @@ -130,6 +131,7 @@ typedef struct dbuf_dirty_record { blkptr_t dr_overridden_by; override_states_t dr_override_state; uint8_t dr_copies; + boolean_t dr_nopwrite; } dl; } dt; } dbuf_dirty_record_t; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:36:48 2012 (r244087) @@ -505,6 +505,11 @@ void dmu_evict_user(objset_t *os, dmu_bu void *dmu_buf_get_user(dmu_buf_t *db); /* + * Returns the blkptr associated with this dbuf, or NULL if not set. + */ +struct blkptr *dmu_buf_get_blkptr(dmu_buf_t *db); + +/* * Indicate that you are going to modify the buffer's data (db_data). * * The transaction (tx) must be assigned to a txg (ie. you've called Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:36:48 2012 (r244087) @@ -21,7 +21,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:36:48 2012 (r244087) @@ -489,14 +489,6 @@ extern int spa_scan_stop(spa_t *spa); extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ extern void spa_sync_allpools(void); -/* - * DEFERRED_FREE must be large enough that regular blocks are not - * deferred. XXX so can't we change it back to 1? - */ -#define SYNC_PASS_DEFERRED_FREE 2 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* spa namespace global mutex */ extern kmutex_t spa_namespace_lock; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:36:48 2012 (r244087) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPACE_MAP_H #define _SYS_SPACE_MAP_H @@ -136,6 +140,8 @@ struct space_map_ops { typedef void space_map_func_t(space_map_t *sm, uint64_t start, uint64_t size); +extern void space_map_init(void); +extern void space_map_fini(void); extern void space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift, kmutex_t *lp); extern void space_map_destroy(space_map_t *sm); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:36:48 2012 (r244087) @@ -186,7 +186,9 @@ enum zio_flag { ZIO_FLAG_RAW = 1 << 21, ZIO_FLAG_GANG_CHILD = 1 << 22, ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24 + ZIO_FLAG_GODFATHER = 1 << 24, + ZIO_FLAG_NOPWRITE = 1 << 25, + ZIO_FLAG_REEXECUTED = 1 << 26, }; #define ZIO_FLAG_MUSTSUCCEED 0 @@ -285,8 +287,9 @@ typedef struct zio_prop { dmu_object_type_t zp_type; uint8_t zp_level; uint8_t zp_copies; - uint8_t zp_dedup; - uint8_t zp_dedup_verify; + boolean_t zp_dedup; + boolean_t zp_dedup_verify; + boolean_t zp_nopwrite; } zio_prop_t; typedef struct zio_cksum_report zio_cksum_report_t; @@ -454,7 +457,8 @@ extern zio_t *zio_rewrite(zio_t *pio, sp void *data, uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, zbookmark_t *zb); -extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies); +extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, + boolean_t nopwrite); extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:36:48 2012 (r244087) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _ZIO_IMPL_H #define _ZIO_IMPL_H @@ -34,6 +38,70 @@ extern "C" { #endif /* + * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * + * The ZFS I/O pipeline is comprised of various stages which are defined + * in the zio_stage enum below. The individual stages are used to construct + * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. + * + * I/O operations: (XXX - provide detail for each of the operations) + * + * Read: + * Write: + * Free: + * Claim: + * Ioctl: + * + * Although the most common pipeline are used by the basic I/O operations + * above, there are some helper pipelines (one could consider them + * sub-pipelines) which are used internally by the ZIO module and are + * explained below: + * + * Interlock Pipeline: + * The interlock pipeline is the most basic pipeline and is used by all + * of the I/O operations. The interlock pipeline does not perform any I/O + * and is used to coordinate the dependencies between I/Os that are being + * issued (i.e. the parent/child relationship). + * + * Vdev child Pipeline: + * The vdev child pipeline is responsible for performing the physical I/O. + * It is in this pipeline where the I/O are queued and possibly cached. + * + * In addition to performing I/O, the pipeline is also responsible for + * data transformations. The transformations performed are based on the + * specific properties that user may have selected and modify the + * behavior of the pipeline. Examples of supported transformations are + * compression, dedup, and nop writes. Transformations will either modify + * the data or the pipeline. This list below further describes each of + * the supported transformations: + * + * Compression: + * ZFS supports three different flavors of compression -- gzip, lzjb, and + * zle. Compression occurs as part of the write pipeline and is performed + * in the ZIO_STAGE_WRITE_BP_INIT stage. + * + * Dedup: + * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and + * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing + * read pipeline if the dedup bit is set on the block pointer. + * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage + * and added to a write pipeline if a user has enabled dedup on that + * particular dataset. + * + * NOP Write: + * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage + * and is added to an existing write pipeline if a crypographically + * secure checksum (i.e. SHA256) is enabled and compression is turned on. + * The NOP write stage will compare the checksums of the current data + * on-disk (level-0 blocks only) and the data that is currently being written. + * If the checksum values are identical then the pipeline is converted to + * an interlock pipeline skipping block allocation and bypassing the + * physical I/O. The nop write feature can handle writes in either + * syncing or open context (i.e. zil writes) and as a result is mutually + * exclusive with dedup. + */ + +/* * zio pipeline stage definitions */ enum zio_stage { @@ -46,27 +114,29 @@ enum zio_stage { ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ - ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */ - ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */ - ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */ - ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */ + ZIO_STAGE_NOP_WRITE = 1 << 6, /* -W--- */ - ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */ - ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */ + ZIO_STAGE_DDT_READ_START = 1 << 7, /* R---- */ + ZIO_STAGE_DDT_READ_DONE = 1 << 8, /* R---- */ + ZIO_STAGE_DDT_WRITE = 1 << 9, /* -W--- */ + ZIO_STAGE_DDT_FREE = 1 << 10, /* --F-- */ - ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */ - ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */ - ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */ + ZIO_STAGE_GANG_ASSEMBLE = 1 << 11, /* RWFC- */ + ZIO_STAGE_GANG_ISSUE = 1 << 12, /* RWFC- */ - ZIO_STAGE_READY = 1 << 15, /* RWFCI */ + ZIO_STAGE_DVA_ALLOCATE = 1 << 13, /* -W--- */ + ZIO_STAGE_DVA_FREE = 1 << 14, /* --F-- */ + ZIO_STAGE_DVA_CLAIM = 1 << 15, /* ---C- */ - ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RW--I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--- */ - ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RW--I */ + ZIO_STAGE_READY = 1 << 16, /* RWFCI */ - ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ + ZIO_STAGE_VDEV_IO_START = 1 << 17, /* RW--I */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 18, /* RW--- */ + ZIO_STAGE_VDEV_IO_ASSESS = 1 << 19, /* RW--I */ - ZIO_STAGE_DONE = 1 << 20 /* RWFCI */ + ZIO_STAGE_CHECKSUM_VERIFY = 1 << 20, /* R---- */ + + ZIO_STAGE_DONE = 1 << 21 /* RWFCI */ }; #define ZIO_INTERLOCK_STAGES \ @@ -143,6 +213,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ 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 Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 10 14:36:48 2012 (r244087) @@ -1206,6 +1206,12 @@ zfs_get_data(void *arg, lr_write_t *lr, DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -3254,6 +3260,12 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED && + !(zp->z_pflags & ZFS_ACL_TRIVIAL)) { + err = EPERM; + goto out; + } + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) goto out; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:13:44 2012 (r244086) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:36:48 2012 (r244087) @@ -89,6 +89,31 @@ extern vmem_t *zio_alloc_arena; extern int zfs_mg_alloc_failures; /* + * The following actions directly effect the spa's sync-to-convergence logic. + * The values below define the sync pass when we start performing the action. + * Care should be taken when changing these values as they directly impact + * spa_sync() performance. Tuning these values may introduce subtle performance + * pathologies and should only be done in the context of performance analysis. + * These tunables will eventually be removed and replaced with #defines once + * enough analysis has been done to determine optimal values. + * + * The 'zfs_sync_pass_deferred_free' pass must be greater than 1 to ensure that + * regular blocks are not deferred. + */ +int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_deferred_free", &zfs_sync_pass_deferred_free); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_deferred_free, CTLFLAG_RDTUN, + &zfs_sync_pass_deferred_free, 0, "defer frees starting in this pass"); +int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_dont_compress", &zfs_sync_pass_dont_compress); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_dont_compress, CTLFLAG_RDTUN, + &zfs_sync_pass_dont_compress, 0, "don't compress starting in this pass"); +int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_rewrite", &zfs_sync_pass_rewrite); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_rewrite, CTLFLAG_RDTUN, + &zfs_sync_pass_rewrite, 0, "rewrite new bps starting in this pass"); + +/* * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ @@ -650,9 +675,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 14:37:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E2376A5; Mon, 10 Dec 2012 14:37:23 +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 0E5348FC08; Mon, 10 Dec 2012 14:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAEbNDM034019; Mon, 10 Dec 2012 14:37:23 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAEbIYY033985; Mon, 10 Dec 2012 14:37:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212101437.qBAEbIYY033985@svn.freebsd.org> From: Martin Matuska Date: Mon, 10 Dec 2012 14:37: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: r244088 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 14:37:23 -0000 Author: mm Date: Mon Dec 10 14:37:18 2012 New Revision: 244088 URL: http://svnweb.freebsd.org/changeset/base/244088 Log: MFC recent ZFS changes from illumos: 243503, 243524, 243525, 243560, 243561 MFC r243503: Illumos 13879:4eac7a87eff2 3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb() 3330 space_seg_t should have its own kmem_cache 3331 deferred frees should happen after sync_pass 1 3335 make SYNC_PASS_* constants tunable New loader-only tunables: vfs.zfs.sync_pass_deferred_free vfs.zfs.sync_pass_dont_compress vfs.zfs.sync_pass_rewrite References: https://www.illumos.org/issues/3329 https://www.illumos.org/issues/3330 https://www.illumos.org/issues/3331 https://www.illumos.org/issues/3335 MFC r243524: Import the zio nop-write improvement from Illumos. To reduce I/O, nop-write omits overwriting data if the checksum (cryptographically secure) of new data matches the checksum of existing data. It also saves space if snapshots are in use. It currently works only on datasets with enabled compression, disabled deduplication and sha256 checksums. IllumOS 13887:196932ec9e6a and 13888:7204b3392a58 3236 zio nop-write References: https://www.illumos.org/issues/3236 MFC r243525: Add loader(8) tunable to enable/disable nopwrite functionality: vfs.zfs.nopwrite_enabled MFC r243560: Introduce a new dataset aclmode setting "restricted" to protect ACL's being destroyed or corrupted by a drive-by chmod. illumos-gate 13889:a67716f16746 3254 add support in zfs for aclmode=restricted MFC r243561: Update manpage dates in zfs.8 and zpool.8 Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.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/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (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/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Dec 10 14:37:18 2012 (r244088) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2012 +.Dd November 26, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -753,7 +753,7 @@ If no inheritable .Tn ACE Ns s exist that affect the mode, then the mode is set in accordance to the requested mode from the application. -.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough +.It Sy aclmode Ns = Ns Cm discard | groupmask | passthrough | restricted Controls how an .Tn ACL is modified during @@ -783,6 +783,32 @@ indicates that no changes are made to th other than creating or updating the necessary .Tn ACL entries to represent the new mode of the file or directory. +An +.Sy aclmode +property of +.Cm restricted +will cause the +.Xr chmod 2 +operation to return an error when used on any file or directory which has +a non-trivial +.Tn ACL +whose entries can not be represented by a mode. +.Xr chmod 2 +is required to change the set user ID, set group ID, or sticky bits on a file +or directory, as they do not have equivalent +.Tn ACL +entries. +In order to use +.Xr chmod 2 +on a file or directory with a non-trivial +.Tn ACL +when +.Sy aclmode +is set to +.Cm restricted , +you must first remove all +.Tn ACL +entries which do not represent the current mode. .It Sy atime Ns = Ns Cm on | off Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Dec 10 14:37:18 2012 (r244088) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2011 +.Dd November 15, 2012 .Dt ZPOOL 8 .Os .Sh NAME Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Dec 10 14:37:18 2012 (r244088) @@ -204,6 +204,7 @@ enum ztest_io_type { ZTEST_IO_WRITE_ZEROES, ZTEST_IO_TRUNCATE, ZTEST_IO_SETATTR, + ZTEST_IO_REWRITE, ZTEST_IO_TYPES }; @@ -1859,6 +1860,12 @@ ztest_get_data(void *arg, lr_write_t *lr DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -2004,6 +2011,9 @@ ztest_remove(ztest_ds_t *zd, ztest_od_t continue; } + /* + * No object was found. + */ if (od->od_object == 0) continue; @@ -2119,6 +2129,7 @@ ztest_prealloc(ztest_ds_t *zd, uint64_t static void ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset) { + int err; ztest_block_tag_t wbt; dmu_object_info_t doi; enum ztest_io_type io_type; @@ -2171,6 +2182,25 @@ ztest_io(ztest_ds_t *zd, uint64_t object case ZTEST_IO_SETATTR: (void) ztest_setattr(zd, object); break; + + case ZTEST_IO_REWRITE: + (void) rw_rdlock(&ztest_name_lock); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + err = ztest_dsl_prop_set_uint64(zd->zd_name, + ZFS_PROP_COMPRESSION, + ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), + B_FALSE); + VERIFY(err == 0 || err == ENOSPC); + (void) rw_unlock(&ztest_name_lock); + + VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data, + DMU_READ_NO_PREFETCH)); + + (void) ztest_write(zd, object, offset, blocksize, data); + break; } (void) rw_unlock(&zd->zd_zilog_lock); @@ -2258,7 +2288,12 @@ ztest_zil_remount(ztest_ds_t *zd, uint64 { objset_t *os = zd->zd_os; - VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0); + /* + * We grab the zd_dirobj_lock to ensure that no other thread is + * updating the zil (i.e. adding in-memory log records) and the + * zd_zilog_lock to block any I/O. + */ + VERIFY0(mutex_lock(&zd->zd_dirobj_lock)); (void) rw_wrlock(&zd->zd_zilog_lock); /* zfsvfs_teardown() */ @@ -4906,8 +4941,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ */ for (int i = 0; i < copies; i++) { uint64_t offset = i * blocksize; - VERIFY(dmu_buf_hold(os, object, offset, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, offset, FTAG, &db, + DMU_READ_NO_PREFETCH)); ASSERT(db->db_offset == offset); ASSERT(db->db_size == blocksize); ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) || @@ -4923,8 +4958,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_ /* * Find out what block we got. */ - VERIFY(dmu_buf_hold(os, object, 0, FTAG, &db, - DMU_READ_NO_PREFETCH) == 0); + VERIFY0(dmu_buf_hold(os, object, 0, FTAG, &db, + DMU_READ_NO_PREFETCH)); blk = *((dmu_buf_impl_t *)db)->db_blkptr; dmu_buf_rele(db, FTAG); @@ -5602,6 +5637,8 @@ ztest_freeze(void) kernel_init(FREAD | FWRITE); VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG)); VERIFY3U(0, ==, ztest_dataset_open(0)); + spa->spa_debug = B_TRUE; + ztest_spa = spa; /* * Force the first log block to be transactionally allocated. Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Dec 10 14:37:18 2012 (r244088) @@ -109,6 +109,7 @@ zfs_prop_init(void) { "discard", ZFS_ACL_DISCARD }, { "groupmask", ZFS_ACL_GROUPMASK }, { "passthrough", ZFS_ACL_PASSTHROUGH }, + { "restricted", ZFS_ACL_RESTRICTED }, { NULL } }; @@ -217,7 +218,8 @@ zfs_prop_init(void) "hidden | visible", "SNAPDIR", snapdir_table); zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); + "discard | groupmask | passthrough | restricted", "ACLMODE", + acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", 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 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Dec 10 14:37:18 2012 (r244088) @@ -3606,6 +3606,12 @@ arc_write_done(zio_t *zio) arc_hdr_destroy(exists); exists = buf_hash_insert(hdr, &hash_lock); ASSERT3P(exists, ==, NULL); + } else if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + /* nopwrite */ + ASSERT(zio->io_prop.zp_nopwrite); + if (!BP_EQUAL(&zio->io_bp_orig, zio->io_bp)) + panic("bad nopwrite, hdr=%p exists=%p", + (void *)hdr, (void *)exists); } else { /* Dedup */ ASSERT(hdr->b_datacnt == 1); 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 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Dec 10 14:37:18 2012 (r244088) @@ -768,13 +768,15 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp)) { + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { spa_t *spa; DB_GET_SPA(&spa, db); zio_free(spa, txg, bp); } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; + dr->dt.dl.dr_nopwrite = B_FALSE; + /* * Release the already-written buffer, so we leave it in * a consistent dirty state. Note that all callers are @@ -2172,6 +2174,13 @@ dmu_buf_freeable(dmu_buf_t *dbuf) return (res); } +blkptr_t * +dmu_buf_get_blkptr(dmu_buf_t *db) +{ + dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; + return (dbi->db_blkptr); +} + static void dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) { @@ -2514,7 +2523,11 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b ASSERT0(zio->io_error); ASSERT(db->db_blkptr == bp); - if (zio->io_flags & ZIO_FLAG_IO_REWRITE) { + /* + * For nopwrites and rewrites we ensure that the bp matches our + * original and bypass all the accounting. + */ + if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { objset_t *os; @@ -2705,7 +2718,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, - dr->dt.dl.dr_copies); + dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); 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 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Dec 10 14:37:18 2012 (r244088) @@ -40,11 +40,21 @@ #include #include #include +#include #include #ifdef _KERNEL #include #endif +/* + * Enable/disable nopwrite feature. + */ +int zfs_nopwrite_enabled = 1; +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled); +SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, + &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -1287,6 +1297,16 @@ dmu_sync_done(zio_t *zio, arc_buf_t *buf mutex_enter(&db->db_mtx); ASSERT(dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC); if (zio->io_error == 0) { + dr->dt.dl.dr_nopwrite = !!(zio->io_flags & ZIO_FLAG_NOPWRITE); + if (dr->dt.dl.dr_nopwrite) { + blkptr_t *bp = zio->io_bp; + blkptr_t *bp_orig = &zio->io_bp_orig; + uint8_t chksum = BP_GET_CHECKSUM(bp_orig); + + ASSERT(BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_prop.zp_compress != ZIO_COMPRESS_OFF); + ASSERT(zio_checksum_table[chksum].ci_dedup); + } dr->dt.dl.dr_overridden_by = *zio->io_bp; dr->dt.dl.dr_override_state = DR_OVERRIDDEN; dr->dt.dl.dr_copies = zio->io_prop.zp_copies; @@ -1308,11 +1328,22 @@ dmu_sync_late_arrival_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; dmu_sync_arg_t *dsa = zio->io_private; + blkptr_t *bp_orig = &zio->io_bp_orig; if (zio->io_error == 0 && !BP_IS_HOLE(bp)) { - ASSERT(zio->io_bp->blk_birth == zio->io_txg); - ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); - zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + /* + * If we didn't allocate a new block (i.e. ZIO_FLAG_NOPWRITE) + * then there is nothing to do here. Otherwise, free the + * newly allocated block in this txg. + */ + if (zio->io_flags & ZIO_FLAG_NOPWRITE) { + ASSERT(BP_EQUAL(bp, bp_orig)); + } else { + ASSERT(BP_IS_HOLE(bp_orig) || !BP_EQUAL(bp, bp_orig)); + ASSERT(zio->io_bp->blk_birth == zio->io_txg); + ASSERT(zio->io_txg > spa_syncing_txg(zio->io_spa)); + zio_free(zio->io_spa, zio->io_txg, zio->io_bp); + } } dmu_tx_commit(dsa->dsa_tx); @@ -1357,7 +1388,7 @@ dmu_sync_late_arrival(zio_t *pio, objset * * Return values: * - * EEXIST: this txg has already been synced, so there's nothing to to. + * EEXIST: this txg has already been synced, so there's nothing to do. * The caller should not log the write. * * ENOENT: the block was dbuf_free_range()'d, so there's nothing to do. @@ -1389,7 +1420,6 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s dnode_t *dn; ASSERT(pio != NULL); - ASSERT(BP_IS_HOLE(bp)); ASSERT(txg != 0); SET_BOOKMARK(&zb, ds->ds_object, @@ -1444,6 +1474,23 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s return (ENOENT); } + ASSERT(dr->dr_next == NULL || dr->dr_next->dr_txg < txg); + + /* + * Assume the on-disk data is X, the current syncing data is Y, + * and the current in-memory data is Z (currently in dmu_sync). + * X and Z are identical but Y is has been modified. Normally, + * when X and Z are the same we will perform a nopwrite but if Y + * is different we must disable nopwrite since the resulting write + * of Y to disk can free the block containing X. If we allowed a + * nopwrite to occur the block pointing to Z would reference a freed + * block. Since this is a rare case we simplify this by disabling + * nopwrite if the current dmu_sync-ing dbuf has been modified in + * a previous transaction. + */ + if (dr->dr_next) + zp.zp_nopwrite = B_FALSE; + ASSERT(dr->dr_txg == txg); if (dr->dt.dl.dr_override_state == DR_IN_DMU_SYNC || dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { @@ -1519,7 +1566,6 @@ dmu_object_set_compress(objset_t *os, ui int zfs_mdcomp_disable = 0; TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable); -SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); @@ -1532,15 +1578,27 @@ dmu_write_policy(objset_t *os, dnode_t * enum zio_checksum checksum = os->os_checksum; enum zio_compress compress = os->os_compress; enum zio_checksum dedup_checksum = os->os_dedup_checksum; - boolean_t dedup; + boolean_t dedup = B_FALSE; + boolean_t nopwrite = B_FALSE; boolean_t dedup_verify = os->os_dedup_verify; int copies = os->os_copies; /* - * Determine checksum setting. + * We maintain different write policies for each of the following + * types of data: + * 1. metadata + * 2. preallocated blocks (i.e. level-0 blocks of a dump device) + * 3. all other level 0 blocks */ if (ismd) { /* + * XXX -- we should design a compression algorithm + * that specializes in arrays of bps. + */ + compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : + ZIO_COMPRESS_LZJB; + + /* * Metadata always gets checksummed. If the data * checksum is multi-bit correctable, and it's not a * ZBT-style checksum, then it's suitable for metadata @@ -1550,45 +1608,47 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; - } else { - checksum = zio_checksum_select(dn->dn_checksum, checksum); - } + } else if (wp & WP_NOFILL) { + ASSERT(level == 0); - /* - * Determine compression setting. - */ - if (ismd) { /* - * XXX -- we should design a compression algorithm - * that specializes in arrays of bps. + * If we're writing preallocated blocks, we aren't actually + * writing them so don't set any policy properties. These + * blocks are currently only used by an external subsystem + * outside of zfs (i.e. dump) and not written by the zio + * pipeline. */ - compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY : - ZIO_COMPRESS_LZJB; + compress = ZIO_COMPRESS_OFF; + checksum = ZIO_CHECKSUM_OFF; } else { compress = zio_compress_select(dn->dn_compress, compress); - } - /* - * Determine dedup setting. If we are in dmu_sync(), we won't - * actually dedup now because that's all done in syncing context; - * but we do want to use the dedup checkum. If the checksum is not - * strong enough to ensure unique signatures, force dedup_verify. - */ - dedup = (!ismd && dedup_checksum != ZIO_CHECKSUM_OFF); - if (dedup) { - checksum = dedup_checksum; - if (!zio_checksum_table[checksum].ci_dedup) - dedup_verify = 1; - } + checksum = (dedup_checksum == ZIO_CHECKSUM_OFF) ? + zio_checksum_select(dn->dn_checksum, checksum) : + dedup_checksum; - if (wp & WP_DMU_SYNC) - dedup = 0; + /* + * Determine dedup setting. If we are in dmu_sync(), + * we won't actually dedup now because that's all + * done in syncing context; but we do want to use the + * dedup checkum. If the checksum is not strong + * enough to ensure unique signatures, force + * dedup_verify. + */ + if (dedup_checksum != ZIO_CHECKSUM_OFF) { + dedup = (wp & WP_DMU_SYNC) ? B_FALSE : B_TRUE; + if (!zio_checksum_table[checksum].ci_dedup) + dedup_verify = B_TRUE; + } - if (wp & WP_NOFILL) { - ASSERT(!ismd && level == 0); - checksum = ZIO_CHECKSUM_OFF; - compress = ZIO_COMPRESS_OFF; - dedup = B_FALSE; + /* + * Enable nopwrite if we have a cryptographically secure + * checksum that has no known collisions (i.e. SHA-256) + * and compression is enabled. We don't enable nopwrite if + * dedup is enabled as the two features are mutually exclusive. + */ + nopwrite = (!dedup && zio_checksum_table[checksum].ci_dedup && + compress != ZIO_COMPRESS_OFF && zfs_nopwrite_enabled); } zp->zp_checksum = checksum; @@ -1598,6 +1658,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; + zp->zp_nopwrite = nopwrite; } int Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Dec 10 14:37:18 2012 (r244088) @@ -440,7 +440,6 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * clean up our in-memory structures accumulated while syncing: * * - move dead blocks from the pending deadlist to the on-disk deadlist - * - clean up zil records * - release hold from dsl_dataset_dirty() */ while (ds = list_remove_head(&synced_datasets)) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Dec 10 14:37:18 2012 (r244088) @@ -881,8 +881,9 @@ metaslab_activate(metaslab_t *msp, uint6 if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { space_map_load_wait(sm); if (!sm->sm_loaded) { - int error = space_map_load(sm, sm_ops, SM_FREE, - &msp->ms_smo, + space_map_obj_t *smo = &msp->ms_smo; + + int error = space_map_load(sm, sm_ops, SM_FREE, smo, spa_meta_objset(msp->ms_group->mg_vd->vdev_spa)); if (error) { metaslab_group_sort(msp->ms_group, msp, 0); 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 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Dec 10 14:37:18 2012 (r244088) @@ -138,6 +138,7 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* u uint_t zio_taskq_basedc = 80; /* base duty cycle */ boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ +extern int zfs_sync_pass_deferred_free; /* * This (illegal) pool name is used when temporarily importing a spa_t in order @@ -6227,7 +6228,7 @@ spa_sync(spa_t *spa, uint64_t txg) spa_errlog_sync(spa, txg); dsl_pool_sync(dp, txg); - if (pass <= SYNC_PASS_DEFERRED_FREE) { + if (pass < zfs_sync_pass_deferred_free) { zio_t *zio = zio_root(spa, NULL, NULL, 0); bplist_iterate(free_bpl, spa_free_sync_cb, zio, tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Dec 10 14:37:18 2012 (r244088) @@ -1619,6 +1619,7 @@ spa_init(int mode) #endif /* illumos */ refcount_sysinit(); unique_init(); + space_map_init(); zio_init(); dmu_init(); zil_init(); @@ -1641,6 +1642,7 @@ spa_fini(void) zil_fini(); dmu_fini(); zio_fini(); + space_map_fini(); unique_fini(); refcount_fini(); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Mon Dec 10 14:37:18 2012 (r244088) @@ -32,6 +32,23 @@ #include #include +static kmem_cache_t *space_seg_cache; + +void +space_map_init(void) +{ + ASSERT(space_seg_cache == NULL); + space_seg_cache = kmem_cache_create("space_seg_cache", + sizeof (space_seg_t), 0, NULL, NULL, NULL, NULL, NULL, 0); +} + +void +space_map_fini(void) +{ + kmem_cache_destroy(space_seg_cache); + space_seg_cache = NULL; +} + /* * Space map routines. * NOTE: caller is responsible for all locking. @@ -124,7 +141,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); } ss_after->ss_start = ss_before->ss_start; - kmem_free(ss_before, sizeof (*ss_before)); + kmem_cache_free(space_seg_cache, ss_before); ss = ss_after; } else if (merge_before) { ss_before->ss_end = end; @@ -137,7 +154,7 @@ space_map_add(space_map_t *sm, uint64_t avl_remove(sm->sm_pp_root, ss_after); ss = ss_after; } else { - ss = kmem_alloc(sizeof (*ss), KM_SLEEP); + ss = kmem_cache_alloc(space_seg_cache, KM_SLEEP); ss->ss_start = start; ss->ss_end = end; avl_insert(&sm->sm_root, ss, where); @@ -183,7 +200,7 @@ space_map_remove(space_map_t *sm, uint64 avl_remove(sm->sm_pp_root, ss); if (left_over && right_over) { - newseg = kmem_alloc(sizeof (*newseg), KM_SLEEP); + newseg = kmem_cache_alloc(space_seg_cache, KM_SLEEP); newseg->ss_start = end; newseg->ss_end = ss->ss_end; ss->ss_end = start; @@ -196,7 +213,7 @@ space_map_remove(space_map_t *sm, uint64 ss->ss_start = end; } else { avl_remove(&sm->sm_root, ss); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); ss = NULL; } @@ -236,7 +253,7 @@ space_map_vacate(space_map_t *sm, space_ while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { if (func != NULL) func(mdest, ss->ss_start, ss->ss_end - ss->ss_start); - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } sm->sm_space = 0; } @@ -408,7 +425,7 @@ space_map_sync(space_map_t *sm, uint8_t spa_t *spa = dmu_objset_spa(os); void *cookie = NULL; space_seg_t *ss; - uint64_t bufsize, start, size, run_len; + uint64_t bufsize, start, size, run_len, delta, sm_space; uint64_t *entry, *entry_map, *entry_map_end; ASSERT(MUTEX_HELD(sm->sm_lock)); @@ -437,11 +454,13 @@ space_map_sync(space_map_t *sm, uint8_t SM_DEBUG_SYNCPASS_ENCODE(spa_sync_pass(spa)) | SM_DEBUG_TXG_ENCODE(dmu_tx_get_txg(tx)); + delta = 0; + sm_space = sm->sm_space; while ((ss = avl_destroy_nodes(&sm->sm_root, &cookie)) != NULL) { size = ss->ss_end - ss->ss_start; start = (ss->ss_start - sm->sm_start) >> sm->sm_shift; - sm->sm_space -= size; + delta += size; size >>= sm->sm_shift; while (size) { @@ -463,7 +482,7 @@ space_map_sync(space_map_t *sm, uint8_t start += run_len; size -= run_len; } - kmem_free(ss, sizeof (*ss)); + kmem_cache_free(space_seg_cache, ss); } if (entry != entry_map) { @@ -475,8 +494,15 @@ space_map_sync(space_map_t *sm, uint8_t smo->smo_objsize += size; } + /* + * Ensure that the space_map's accounting wasn't changed + * while we were in the middle of writing it out. + */ + VERIFY3U(sm->sm_space, ==, sm_space); + zio_buf_free(entry_map, bufsize); + sm->sm_space -= delta; VERIFY0(sm->sm_space); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Dec 10 14:37:18 2012 (r244088) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DBUF_H @@ -130,6 +131,7 @@ typedef struct dbuf_dirty_record { blkptr_t dr_overridden_by; override_states_t dr_override_state; uint8_t dr_copies; + boolean_t dr_nopwrite; } dl; } dt; } dbuf_dirty_record_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Dec 10 14:37:18 2012 (r244088) @@ -505,6 +505,11 @@ void dmu_evict_user(objset_t *os, dmu_bu void *dmu_buf_get_user(dmu_buf_t *db); /* + * Returns the blkptr associated with this dbuf, or NULL if not set. + */ +struct blkptr *dmu_buf_get_blkptr(dmu_buf_t *db); + +/* * Indicate that you are going to modify the buffer's data (db_data). * * The transaction (tx) must be assigned to a txg (ie. you've called Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Dec 10 14:37:18 2012 (r244088) @@ -21,7 +21,10 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +/* + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Dec 10 14:37:18 2012 (r244088) @@ -489,14 +489,6 @@ extern int spa_scan_stop(spa_t *spa); extern void spa_sync(spa_t *spa, uint64_t txg); /* only for DMU use */ extern void spa_sync_allpools(void); -/* - * DEFERRED_FREE must be large enough that regular blocks are not - * deferred. XXX so can't we change it back to 1? - */ -#define SYNC_PASS_DEFERRED_FREE 2 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* spa namespace global mutex */ extern kmutex_t spa_namespace_lock; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Mon Dec 10 14:37:18 2012 (r244088) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPACE_MAP_H #define _SYS_SPACE_MAP_H @@ -136,6 +140,8 @@ struct space_map_ops { typedef void space_map_func_t(space_map_t *sm, uint64_t start, uint64_t size); +extern void space_map_init(void); +extern void space_map_fini(void); extern void space_map_create(space_map_t *sm, uint64_t start, uint64_t size, uint8_t shift, kmutex_t *lp); extern void space_map_destroy(space_map_t *sm); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Dec 10 14:37:18 2012 (r244088) @@ -186,7 +186,9 @@ enum zio_flag { ZIO_FLAG_RAW = 1 << 21, ZIO_FLAG_GANG_CHILD = 1 << 22, ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24 + ZIO_FLAG_GODFATHER = 1 << 24, + ZIO_FLAG_NOPWRITE = 1 << 25, + ZIO_FLAG_REEXECUTED = 1 << 26, }; #define ZIO_FLAG_MUSTSUCCEED 0 @@ -285,8 +287,9 @@ typedef struct zio_prop { dmu_object_type_t zp_type; uint8_t zp_level; uint8_t zp_copies; - uint8_t zp_dedup; - uint8_t zp_dedup_verify; + boolean_t zp_dedup; + boolean_t zp_dedup_verify; + boolean_t zp_nopwrite; } zio_prop_t; typedef struct zio_cksum_report zio_cksum_report_t; @@ -454,7 +457,8 @@ extern zio_t *zio_rewrite(zio_t *pio, sp void *data, uint64_t size, zio_done_func_t *done, void *private, int priority, enum zio_flag flags, zbookmark_t *zb); -extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies); +extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, + boolean_t nopwrite); extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Dec 10 14:37:18 2012 (r244088) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _ZIO_IMPL_H #define _ZIO_IMPL_H @@ -34,6 +38,70 @@ extern "C" { #endif /* + * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * + * The ZFS I/O pipeline is comprised of various stages which are defined + * in the zio_stage enum below. The individual stages are used to construct + * these basic I/O operations: Read, Write, Free, Claim, and Ioctl. + * + * I/O operations: (XXX - provide detail for each of the operations) + * + * Read: + * Write: + * Free: + * Claim: + * Ioctl: + * + * Although the most common pipeline are used by the basic I/O operations + * above, there are some helper pipelines (one could consider them + * sub-pipelines) which are used internally by the ZIO module and are + * explained below: + * + * Interlock Pipeline: + * The interlock pipeline is the most basic pipeline and is used by all + * of the I/O operations. The interlock pipeline does not perform any I/O + * and is used to coordinate the dependencies between I/Os that are being + * issued (i.e. the parent/child relationship). + * + * Vdev child Pipeline: + * The vdev child pipeline is responsible for performing the physical I/O. + * It is in this pipeline where the I/O are queued and possibly cached. + * + * In addition to performing I/O, the pipeline is also responsible for + * data transformations. The transformations performed are based on the + * specific properties that user may have selected and modify the + * behavior of the pipeline. Examples of supported transformations are + * compression, dedup, and nop writes. Transformations will either modify + * the data or the pipeline. This list below further describes each of + * the supported transformations: + * + * Compression: + * ZFS supports three different flavors of compression -- gzip, lzjb, and + * zle. Compression occurs as part of the write pipeline and is performed + * in the ZIO_STAGE_WRITE_BP_INIT stage. + * + * Dedup: + * Dedup reads are handled by the ZIO_STAGE_DDT_READ_START and + * ZIO_STAGE_DDT_READ_DONE stages. These stages are added to an existing + * read pipeline if the dedup bit is set on the block pointer. + * Writing a dedup block is performed by the ZIO_STAGE_DDT_WRITE stage + * and added to a write pipeline if a user has enabled dedup on that + * particular dataset. + * + * NOP Write: + * The NOP write feature is performed by the ZIO_STAGE_NOP_WRITE stage + * and is added to an existing write pipeline if a crypographically + * secure checksum (i.e. SHA256) is enabled and compression is turned on. + * The NOP write stage will compare the checksums of the current data + * on-disk (level-0 blocks only) and the data that is currently being written. + * If the checksum values are identical then the pipeline is converted to + * an interlock pipeline skipping block allocation and bypassing the + * physical I/O. The nop write feature can handle writes in either + * syncing or open context (i.e. zil writes) and as a result is mutually + * exclusive with dedup. + */ + +/* * zio pipeline stage definitions */ enum zio_stage { @@ -46,27 +114,29 @@ enum zio_stage { ZIO_STAGE_CHECKSUM_GENERATE = 1 << 5, /* -W--- */ - ZIO_STAGE_DDT_READ_START = 1 << 6, /* R---- */ - ZIO_STAGE_DDT_READ_DONE = 1 << 7, /* R---- */ - ZIO_STAGE_DDT_WRITE = 1 << 8, /* -W--- */ - ZIO_STAGE_DDT_FREE = 1 << 9, /* --F-- */ + ZIO_STAGE_NOP_WRITE = 1 << 6, /* -W--- */ - ZIO_STAGE_GANG_ASSEMBLE = 1 << 10, /* RWFC- */ - ZIO_STAGE_GANG_ISSUE = 1 << 11, /* RWFC- */ + ZIO_STAGE_DDT_READ_START = 1 << 7, /* R---- */ + ZIO_STAGE_DDT_READ_DONE = 1 << 8, /* R---- */ + ZIO_STAGE_DDT_WRITE = 1 << 9, /* -W--- */ + ZIO_STAGE_DDT_FREE = 1 << 10, /* --F-- */ - ZIO_STAGE_DVA_ALLOCATE = 1 << 12, /* -W--- */ - ZIO_STAGE_DVA_FREE = 1 << 13, /* --F-- */ - ZIO_STAGE_DVA_CLAIM = 1 << 14, /* ---C- */ + ZIO_STAGE_GANG_ASSEMBLE = 1 << 11, /* RWFC- */ + ZIO_STAGE_GANG_ISSUE = 1 << 12, /* RWFC- */ - ZIO_STAGE_READY = 1 << 15, /* RWFCI */ + ZIO_STAGE_DVA_ALLOCATE = 1 << 13, /* -W--- */ + ZIO_STAGE_DVA_FREE = 1 << 14, /* --F-- */ + ZIO_STAGE_DVA_CLAIM = 1 << 15, /* ---C- */ - ZIO_STAGE_VDEV_IO_START = 1 << 16, /* RW--I */ - ZIO_STAGE_VDEV_IO_DONE = 1 << 17, /* RW--- */ - ZIO_STAGE_VDEV_IO_ASSESS = 1 << 18, /* RW--I */ + ZIO_STAGE_READY = 1 << 16, /* RWFCI */ - ZIO_STAGE_CHECKSUM_VERIFY = 1 << 19, /* R---- */ + ZIO_STAGE_VDEV_IO_START = 1 << 17, /* RW--I */ + ZIO_STAGE_VDEV_IO_DONE = 1 << 18, /* RW--- */ + ZIO_STAGE_VDEV_IO_ASSESS = 1 << 19, /* RW--I */ - ZIO_STAGE_DONE = 1 << 20 /* RWFCI */ + ZIO_STAGE_CHECKSUM_VERIFY = 1 << 20, /* R---- */ + + ZIO_STAGE_DONE = 1 << 21 /* RWFCI */ }; #define ZIO_INTERLOCK_STAGES \ @@ -143,6 +213,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ + ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ 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 Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 10 14:37:18 2012 (r244088) @@ -1207,6 +1207,12 @@ zfs_get_data(void *arg, lr_write_t *lr, DMU_READ_NO_PREFETCH); if (error == 0) { + blkptr_t *obp = dmu_buf_get_blkptr(db); + if (obp) { + ASSERT(BP_IS_HOLE(bp)); + *bp = *obp; + } + zgd->zgd_db = db; zgd->zgd_bp = bp; @@ -3255,6 +3261,12 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED && + !(zp->z_pflags & ZFS_ACL_TRIVIAL)) { + err = EPERM; + goto out; + } + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) goto out; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:36:48 2012 (r244087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Dec 10 14:37:18 2012 (r244088) @@ -89,6 +89,31 @@ extern vmem_t *zio_alloc_arena; extern int zfs_mg_alloc_failures; /* + * The following actions directly effect the spa's sync-to-convergence logic. + * The values below define the sync pass when we start performing the action. + * Care should be taken when changing these values as they directly impact + * spa_sync() performance. Tuning these values may introduce subtle performance + * pathologies and should only be done in the context of performance analysis. + * These tunables will eventually be removed and replaced with #defines once + * enough analysis has been done to determine optimal values. + * + * The 'zfs_sync_pass_deferred_free' pass must be greater than 1 to ensure that + * regular blocks are not deferred. + */ +int zfs_sync_pass_deferred_free = 2; /* defer frees starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_deferred_free", &zfs_sync_pass_deferred_free); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_deferred_free, CTLFLAG_RDTUN, + &zfs_sync_pass_deferred_free, 0, "defer frees starting in this pass"); +int zfs_sync_pass_dont_compress = 5; /* don't compress starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_dont_compress", &zfs_sync_pass_dont_compress); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_dont_compress, CTLFLAG_RDTUN, + &zfs_sync_pass_dont_compress, 0, "don't compress starting in this pass"); +int zfs_sync_pass_rewrite = 2; /* rewrite new bps starting in this pass */ +TUNABLE_INT("vfs.zfs.sync_pass_rewrite", &zfs_sync_pass_rewrite); +SYSCTL_INT(_vfs_zfs, OID_AUTO, sync_pass_rewrite, CTLFLAG_RDTUN, + &zfs_sync_pass_rewrite, 0, "rewrite new bps starting in this pass"); + +/* * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ @@ -650,9 +675,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 15:29:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DEC99CFB; Mon, 10 Dec 2012 15:29:56 +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 C20018FC0C; Mon, 10 Dec 2012 15:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAFTuDE044743; Mon, 10 Dec 2012 15:29:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAFTuV2044742; Mon, 10 Dec 2012 15:29:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212101529.qBAFTuV2044742@svn.freebsd.org> From: Devin Teske Date: Mon, 10 Dec 2012 15:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244089 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 15:29:56 -0000 Author: dteske Date: Mon Dec 10 15:29:56 2012 New Revision: 244089 URL: http://svnweb.freebsd.org/changeset/base/244089 Log: Add support for comma-separated values (whitespace-separated still supported). PR: conf/121064 Submitted by: koitsu Reviewed by: jh Modified: head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Mon Dec 10 14:37:18 2012 (r244088) +++ head/sys/boot/forth/support.4th Mon Dec 10 15:29:56 2012 (r244089) @@ -207,20 +207,20 @@ create last_module_option sizeof module. dup 0= if 2drop 2drop false exit then begin begin - swap dup c@ dup 32 = over 9 = or - over 10 = or over 13 = or swap drop + swap dup c@ dup 32 = over 9 = or over 10 = or + over 13 = or over 44 = or swap drop while 1+ swap 1- repeat swap 2 pick 1- over < while 2over 2over drop over compare-insensitive 0= if 2 pick over = if 2drop 2drop true exit then 2 pick tuck - -rot + swap over c@ dup 32 = - over 9 = or over 10 = or over 13 = or + over 9 = or over 10 = or over 13 = or over 44 = or swap drop if 2drop 2drop true exit then then begin - swap dup c@ - dup 32 = over 9 = or over 10 = or over 13 = or - swap drop if false else true then 2 pick 0> and + swap dup c@ dup 32 = over 9 = or over 10 = or + over 13 = or over 44 = or swap drop + if false else true then 2 pick 0> and while 1+ swap 1- repeat swap repeat From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 16:14:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74EAB207; Mon, 10 Dec 2012 16:14:45 +0000 (UTC) (envelope-from ghelmer@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 599438FC08; Mon, 10 Dec 2012 16:14:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAGEjDp053844; Mon, 10 Dec 2012 16:14:45 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAGEixe053838; Mon, 10 Dec 2012 16:14:44 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201212101614.qBAGEixe053838@svn.freebsd.org> From: Guy Helmer Date: Mon, 10 Dec 2012 16:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244090 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 16:14:45 -0000 Author: ghelmer Date: Mon Dec 10 16:14:44 2012 New Revision: 244090 URL: http://svnweb.freebsd.org/changeset/base/244090 Log: Changes to resolve races in bpfread() and catchpacket() that, at worst, cause kernel panics. Add a flag to the bpf descriptor to indicate whether the hold buffer is in use. In bpfread(), set the "hold buffer in use" flag before dropping the descriptor lock during the call to bpf_uiomove(). Everywhere else the hold buffer is used or changed, wait while the hold buffer is in use by bpfread(). Add a KASSERT in bpfread() after re-acquiring the descriptor lock to assist uncovering any additional hold buffer races. Modified: head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf.c Mon Dec 10 16:14:44 2012 (r244090) @@ -819,6 +819,7 @@ bpfopen(struct cdev *dev, int flags, int * particular buffer method. */ bpf_buffer_init(d); + d->bd_hbuf_in_use = 0; d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; d->bd_direction = BPF_D_INOUT; @@ -872,6 +873,9 @@ bpfread(struct cdev *dev, struct uio *ui callout_stop(&d->bd_callout); timed_out = (d->bd_state == BPF_TIMED_OUT); d->bd_state = BPF_IDLE; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET|PCATCH, "bd_hbuf", 0); /* * If the hold buffer is empty, then do a timed sleep, which * ends when the timeout expires or when enough packets @@ -940,27 +944,27 @@ bpfread(struct cdev *dev, struct uio *ui /* * At this point, we know we have something in the hold slot. */ + d->bd_hbuf_in_use = 1; BPFD_UNLOCK(d); /* * Move data from hold buffer into user space. * We know the entire buffer is transferred since * we checked above that the read buffer is bpf_bufsize bytes. - * - * XXXRW: More synchronization needed here: what if a second thread - * issues a read on the same fd at the same time? Don't want this - * getting invalidated. + * + * We do not have to worry about simultaneous reads because + * we waited for sole access to the hold buffer above. */ error = bpf_uiomove(d, d->bd_hbuf, d->bd_hlen, uio); BPFD_LOCK(d); - if (d->bd_hbuf != NULL) { - /* Free the hold buffer only if it is still valid. */ - d->bd_fbuf = d->bd_hbuf; - d->bd_hbuf = NULL; - d->bd_hlen = 0; - bpf_buf_reclaimed(d); - } + KASSERT(d->bd_hbuf != NULL, ("bpfread: lost bd_hbuf")); + d->bd_fbuf = d->bd_hbuf; + d->bd_hbuf = NULL; + d->bd_hlen = 0; + bpf_buf_reclaimed(d); + d->bd_hbuf_in_use = 0; + wakeup(&d->bd_hbuf_in_use); BPFD_UNLOCK(d); return (error); @@ -1114,6 +1118,9 @@ reset_d(struct bpf_d *d) BPFD_LOCK_ASSERT(d); + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, PRINET, + "bd_hbuf", 0); if ((d->bd_hbuf != NULL) && (d->bd_bufmode != BPF_BUFMODE_ZBUF || bpf_canfreebuf(d))) { /* Free the hold buffer. */ @@ -1254,6 +1261,9 @@ bpfioctl(struct cdev *dev, u_long cmd, c BPFD_LOCK(d); n = d->bd_slen; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); if (d->bd_hbuf) n += d->bd_hlen; BPFD_UNLOCK(d); @@ -1967,6 +1977,9 @@ filt_bpfread(struct knote *kn, long hint ready = bpf_ready(d); if (ready) { kn->kn_data = d->bd_slen; + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); if (d->bd_hbuf) kn->kn_data += d->bd_hlen; } else if (d->bd_rtout > 0 && d->bd_state == BPF_IDLE) { @@ -2299,6 +2312,9 @@ catchpacket(struct bpf_d *d, u_char *pkt * spot to do it. */ if (d->bd_fbuf == NULL && bpf_canfreebuf(d)) { + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); d->bd_fbuf = d->bd_hbuf; d->bd_hbuf = NULL; d->bd_hlen = 0; @@ -2341,6 +2357,9 @@ catchpacket(struct bpf_d *d, u_char *pkt ++d->bd_dcount; return; } + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); ROTATE_BUFFERS(d); do_wakeup = 1; curlen = 0; Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf.h Mon Dec 10 16:14:44 2012 (r244090) @@ -1235,7 +1235,8 @@ SYSCTL_DECL(_net_bpf); /* * Rotate the packet buffers in descriptor d. Move the store buffer into the * hold slot, and the free buffer ino the store slot. Zero the length of the - * new store buffer. Descriptor lock should be held. + * new store buffer. Descriptor lock should be held. Hold buffer must + * not be marked "in use". */ #define ROTATE_BUFFERS(d) do { \ (d)->bd_hbuf = (d)->bd_sbuf; \ Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpf_buffer.c Mon Dec 10 16:14:44 2012 (r244090) @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define PRINET 26 /* interruptible */ + /* * Implement historical kernel memory buffering model for BPF: two malloc(9) * kernel buffers are hung off of the descriptor. The size is fixed prior to @@ -189,6 +191,9 @@ bpf_buffer_ioctl_sblen(struct bpf_d *d, return (EINVAL); } + while (d->bd_hbuf_in_use) + mtx_sleep(&d->bd_hbuf_in_use, &d->bd_lock, + PRINET, "bd_hbuf", 0); /* Free old buffers if set */ if (d->bd_fbuf != NULL) free(d->bd_fbuf, M_BPF); Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Mon Dec 10 15:29:56 2012 (r244089) +++ head/sys/net/bpfdesc.h Mon Dec 10 16:14:44 2012 (r244090) @@ -63,6 +63,7 @@ struct bpf_d { caddr_t bd_sbuf; /* store slot */ caddr_t bd_hbuf; /* hold slot */ caddr_t bd_fbuf; /* free slot */ + int bd_hbuf_in_use; /* don't rotate buffers */ int bd_slen; /* current length of store buffer */ int bd_hlen; /* current length of hold buffer */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 17:34:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52AF2F39; Mon, 10 Dec 2012 17:34:34 +0000 (UTC) (envelope-from brooks@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 1CD258FC15; Mon, 10 Dec 2012 17:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAHYXe9069807; Mon, 10 Dec 2012 17:34:33 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAHYXtR069806; Mon, 10 Dec 2012 17:34:33 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212101734.qBAHYXtR069806@svn.freebsd.org> From: Brooks Davis Date: Mon, 10 Dec 2012 17:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244091 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 17:34:34 -0000 Author: brooks Date: Mon Dec 10 17:34:33 2012 New Revision: 244091 URL: http://svnweb.freebsd.org/changeset/base/244091 Log: Improve style(9) compliance of function declarations. Modified: head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Mon Dec 10 16:14:44 2012 (r244090) +++ head/lib/libc/locale/setrunelocale.c Mon Dec 10 17:34:33 2012 (r244091) @@ -73,9 +73,11 @@ static int __setrunelocale(struct xloca #define __collate_chain_pri_table (table->__collate_chain_pri_table) -static void destruct_ctype(void *v) +static void +destruct_ctype(void *v) { struct xlocale_ctype *l = v; + if (strcmp(l->runes->__encoding, "EUC") == 0) free(l->runes->__variable); if (&_DefaultRuneLocale != l->runes) @@ -83,13 +85,17 @@ static void destruct_ctype(void *v) free(l); } -const _RuneLocale *__getCurrentRuneLocale(void) +const _RuneLocale * +__getCurrentRuneLocale(void) { + return XLOCALE_CTYPE(__get_locale())->runes; } -static void free_runes(_RuneLocale *rl) +static void +free_runes(_RuneLocale *rl) { + /* FIXME: The "EUC" check here is a hideous abstraction violation. */ if ((rl != &_DefaultRuneLocale) && (rl)) { if (strcmp(rl->__encoding, "EUC") == 0) { @@ -191,7 +197,8 @@ __wrap_setrunelocale(const char *locale) #ifndef __NO_TLS void -__set_thread_rune_locale(locale_t loc) { +__set_thread_rune_locale(locale_t loc) +{ if (loc == NULL) { _ThreadRuneLocale = &_DefaultRuneLocale; @@ -205,6 +212,7 @@ void * __ctype_load(const char *locale, locale_t unused) { struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); + l->header.header.destructor = destruct_ctype; if (__setrunelocale(l, locale)) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 17:55:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5B6C7FC for ; Mon, 10 Dec 2012 17:55:53 +0000 (UTC) (envelope-from pacific@capacificservices.com) Received: from kinesis.swishmail.com (kinesis.swishmail.com [208.72.57.27]) by mx1.freebsd.org (Postfix) with ESMTP id 68B228FC0C for ; Mon, 10 Dec 2012 17:55:53 +0000 (UTC) Received: (qmail 78162 invoked by uid 89); 10 Dec 2012 17:49:11 -0000 Received: from unknown (HELO HP25276278018) (pacific@capacificservices.com@101.172.191.242) by kinesis.swishmail.com with ESMTPA; 10 Dec 2012 17:49:11 -0000 From: Jutta Carlisle To: svn-src-all@freebsd.org Subject: Fwd: Your Photos X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Message-Id: <20121210175553.A5B6C7FC@hub.freebsd.org> Date: Mon, 10 Dec 2012 17:55:53 +0000 (UTC) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 17:55:53 -0000 SGVsbG8sIA0KeW91ciBwaG90b3MgICAgaHR0cDovL2JyYXNpbGVpcmUuY29tL21haWwuaHRt From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 17:56:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 483C0918; Mon, 10 Dec 2012 17:56:53 +0000 (UTC) (envelope-from jilles@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 2DC808FC12; Mon, 10 Dec 2012 17:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAHurdB073913; Mon, 10 Dec 2012 17:56:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAHupqa073901; Mon, 10 Dec 2012 17:56:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212101756.qBAHupqa073901@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 10 Dec 2012 17:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244092 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 17:56:53 -0000 Author: jilles Date: Mon Dec 10 17:56:51 2012 New Revision: 244092 URL: http://svnweb.freebsd.org/changeset/base/244092 Log: libc: Make various internal file descriptors close-on-exec. These are obtained via fopen(). Modified: head/lib/libc/gen/fmtmsg.c head/lib/libc/gen/getcap.c head/lib/libc/gen/getgrent.c head/lib/libc/gen/getnetgrent.c head/lib/libc/gen/getttyent.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/getutxent.c Modified: head/lib/libc/gen/fmtmsg.c ============================================================================== --- head/lib/libc/gen/fmtmsg.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/fmtmsg.c Mon Dec 10 17:56:51 2012 (r244092) @@ -83,7 +83,7 @@ def: if (output == NULL) return (MM_NOCON); if (*output != '\0') { - if ((fp = fopen("/dev/console", "a")) == NULL) { + if ((fp = fopen("/dev/console", "ae")) == NULL) { free(output); return (MM_NOCON); } Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getcap.c Mon Dec 10 17:56:51 2012 (r244092) @@ -654,7 +654,7 @@ cgetnext(char **bp, char **db_array) if (dbp == NULL) dbp = db_array; - if (pfp == NULL && (pfp = fopen(*dbp, "r")) == NULL) { + if (pfp == NULL && (pfp = fopen(*dbp, "re")) == NULL) { (void)cgetclose(); return (-1); } @@ -679,7 +679,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (0); } else if ((pfp = - fopen(*dbp, "r")) == NULL) { + fopen(*dbp, "re")) == NULL) { (void)cgetclose(); return (-1); } else Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getgrent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -810,7 +810,7 @@ files_setgrent(void *retval, void *mdata if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); break; case ENDGRENT: if (st->fp != NULL) { @@ -861,7 +861,7 @@ files_group(void *retval, void *mdata, v if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; return (NS_UNAVAIL); } @@ -1251,7 +1251,7 @@ compat_setgrent(void *retval, void *mdat if (st->fp != NULL) rewind(st->fp); else if (stayopen) - st->fp = fopen(_PATH_GROUP, "r"); + st->fp = fopen(_PATH_GROUP, "re"); set_setent(dtab, mdata); (void)_nsdispatch(NULL, dtab, NSDB_GROUP_COMPAT, "setgrent", compatsrc, 0); @@ -1335,7 +1335,7 @@ compat_group(void *retval, void *mdata, if (*errnop != 0) return (NS_UNAVAIL); if (st->fp == NULL && - ((st->fp = fopen(_PATH_GROUP, "r")) == NULL)) { + ((st->fp = fopen(_PATH_GROUP, "re")) == NULL)) { *errnop = errno; rv = NS_UNAVAIL; goto fin; Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getnetgrent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -173,7 +173,7 @@ setnetgrent(const char *group) if (((stat(_PATH_NETGROUP, &_yp_statp) < 0) && errno == ENOENT) || _yp_statp.st_size == 0) _use_only_yp = _netgr_yp_enabled = 1; - if ((netf = fopen(_PATH_NETGROUP,"r")) != NULL ||_use_only_yp){ + if ((netf = fopen(_PATH_NETGROUP,"re")) != NULL ||_use_only_yp){ /* * Icky: grab the first character of the netgroup file * and turn on NIS if it's a '+'. rewind the stream @@ -197,7 +197,7 @@ setnetgrent(const char *group) return; } #else - if ((netf = fopen(_PATH_NETGROUP, "r"))) { + if ((netf = fopen(_PATH_NETGROUP, "re"))) { #endif if (parse_netgrp(group)) endnetgrent(); Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getttyent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -211,7 +211,7 @@ setttyent(void) if (tf) { rewind(tf); return (1); - } else if ( (tf = fopen(_PATH_TTYS, "r")) ) + } else if ( (tf = fopen(_PATH_TTYS, "re")) ) return (1); return (0); } Modified: head/lib/libc/gen/getusershell.c ============================================================================== --- head/lib/libc/gen/getusershell.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getusershell.c Mon Dec 10 17:56:51 2012 (r244092) @@ -115,7 +115,7 @@ _local_initshells(rv, cb_data, ap) sl_free(sl, 1); sl = sl_init(); - if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) + if ((fp = fopen(_PATH_SHELLS, "re")) == NULL) return NS_UNAVAIL; cp = line; Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Mon Dec 10 17:34:33 2012 (r244091) +++ head/lib/libc/gen/getutxent.c Mon Dec 10 17:56:51 2012 (r244092) @@ -71,7 +71,7 @@ setutxdb(int db, const char *file) if (uf != NULL) fclose(uf); - uf = fopen(file, "r"); + uf = fopen(file, "re"); if (uf == NULL) return (-1); From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 18:47:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42C61C0D; Mon, 10 Dec 2012 18:47:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9D52B8FC12; Mon, 10 Dec 2012 18:47:50 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBAIlk7H076371; Mon, 10 Dec 2012 20:47:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBAIlk7H076371 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBAIlk1X076370; Mon, 10 Dec 2012 20:47:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 10 Dec 2012 20:47:46 +0200 From: Konstantin Belousov To: Robert Watson Subject: Re: svn commit: r244077 - head/sys/amd64/amd64 Message-ID: <20121210184746.GT3013@kib.kiev.ua> References: <201212100514.qBA5EZFE027334@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="N+O7Igoq2jFl2p2/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 18:47:51 -0000 --N+O7Igoq2jFl2p2/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2012 at 08:39:47AM +0000, Robert Watson wrote: >=20 > On Mon, 10 Dec 2012, Konstantin Belousov wrote: >=20 > > Author: kib > > Date: Mon Dec 10 05:14:34 2012 > > New Revision: 244077 > > URL: http://svnweb.freebsd.org/changeset/base/244077 > > > > Log: > > Add amd64-specific ddb command "show pte". The command displays the > > hierarchy of the page table entries which map the specified address. > > > > Reviewed by: alc (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week >=20 > Ah, very nice indeed -- I'd actually like to see similar MD page table > dumping routines for other architectures, especially MIPS with its > software-defined page tables. The facility is indeed MD, so it is up to the maintainers of the architectures to add this or similar command for their stuff. --N+O7Igoq2jFl2p2/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQxi5QAAoJEJDCuSvBvK1Bjp8QAJoKwIgWhR647t9arrJlRvSN UJ9qe1b9vSosmDcamxaF63ujb2/3XEAjsBCdz+88AAI92cpyvWL9vnWyma9a9FWD 3e3Bf4PzIm7/zBgOy+j6ngrG/o7SXLQljcoNSUswRwqR4RvbIWnLB1b3omVzb8cr PgfbqUKvlKhni5IUP6cs5Eovl04OXIj2goOgz44Q81vTyg3PgCPoGSwfHE3ck9p+ nb9G3UXSKXe2LpQn2GoBc29UH6CZvNtvfwV1LyV0lHJn7ZPWxTeP9lBRUmNUCf9F ZFQhnrNUBQQNfxn2k8I0Z0YMrGMG5ueEMGPP4ZKERsyHoUghijlyVdDNQVe5/kTL Kh+GjHiC4CSLLjquJ2tGQDz/YH6f2+DiAyH1rL3c+4fbra+oqk2bufMHMImy9VVY E2yDojPD8G2VtA2ir3D9E0v6BfH8m8VyZXVLVIkGuLVUpiHLJJMHKH1L+0k+fs2G W2u0n9g/Dx/ncpf3LNbWuCUbHBmm9BltvU8F7pSliYtNKzoRDNHQH3vNfgXxMU4E +zVhb3AWytwBB7Ohb0j0ZjZ8P6HiR/TVNPrnPau73n4iT+har8KfKTFL06xv6Zhx gz2i670Sl6jYaD7tSU+asHe+MnNMPnIVLqzYcaW6Vx+CO8VmgAJEM4ZaBYd875g7 nK/bWvn9+NTjxjd9zfTt =l5rE -----END PGP SIGNATURE----- --N+O7Igoq2jFl2p2/-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 19:33:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09F5F1A9; Mon, 10 Dec 2012 19:33:41 +0000 (UTC) (envelope-from gnn@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 E23508FC0C; Mon, 10 Dec 2012 19:33:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAJXeNb095902; Mon, 10 Dec 2012 19:33:40 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAJXehD095898; Mon, 10 Dec 2012 19:33:40 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201212101933.qBAJXehD095898@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 10 Dec 2012 19:33: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: r244093 - in stable/9/sys: cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 19:33:41 -0000 Author: gnn Date: Mon Dec 10 19:33:39 2012 New Revision: 244093 URL: http://svnweb.freebsd.org/changeset/base/244093 Log: MFC: 238537,238552 Add support for walltimestamp in DTrace. Submitted by: Fabian Keil Includes correction by: avg Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/9/sys/kern/kern_tc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 10 19:33:39 2012 (r244093) @@ -43,6 +43,8 @@ extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -456,8 +458,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ Modified: stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 10 19:33:39 2012 (r244093) @@ -45,6 +45,8 @@ extern uintptr_t kernelbase; extern uintptr_t dtrace_in_probe_addr; extern int dtrace_in_probe; +extern void dtrace_getnanotime(struct timespec *tsp); + int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); typedef struct dtrace_invop_hdlr { @@ -457,8 +459,11 @@ dtrace_gethrtime() uint64_t dtrace_gethrestime(void) { - printf("%s(%d): XXX\n",__func__,__LINE__); - return (0); + struct timespec current_time; + + dtrace_getnanotime(¤t_time); + + return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ Modified: stable/9/sys/kern/kern_tc.c ============================================================================== --- stable/9/sys/kern/kern_tc.c Mon Dec 10 17:56:51 2012 (r244092) +++ stable/9/sys/kern/kern_tc.c Mon Dec 10 19:33:39 2012 (r244093) @@ -110,6 +110,8 @@ SYSCTL_INT(_kern_timecounter, OID_AUTO, static void tc_windup(void); static void cpu_tick_calibrate(int); +void dtrace_getnanotime(struct timespec *tsp); + static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS) { @@ -303,6 +305,24 @@ getmicrotime(struct timeval *tvp) } /* + * This is a clone of getnanotime and used for walltimestamps. + * The dtrace_ prefix prevents fbt from creating probes for + * it so walltimestamp can be safely used in all fbt probes. + */ +void +dtrace_getnanotime(struct timespec *tsp) +{ + struct timehands *th; + u_int gen; + + do { + th = timehands; + gen = th->th_generation; + *tsp = th->th_nanotime; + } while (gen == 0 || gen != th->th_generation); +} + +/* * Initialize a new timecounter and possibly use it. */ void From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 20:44:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 572B1477; Mon, 10 Dec 2012 20:44:10 +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 3C9F58FC12; Mon, 10 Dec 2012 20:44:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAKiAWn009463; Mon, 10 Dec 2012 20:44:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAKiAb1009462; Mon, 10 Dec 2012 20:44:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212102044.qBAKiAb1009462@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 10 Dec 2012 20:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244095 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 20:44:10 -0000 Author: kib Date: Mon Dec 10 20:44:09 2012 New Revision: 244095 URL: http://svnweb.freebsd.org/changeset/base/244095 Log: Do not yield while owning a mutex. The Giant reacquire in the kern_yield() is problematic than. The owned mutex is the mount interlock, and it is in fact not needed to guarantee the stability of the mount list of active vnodes, so fix the the issue by only taking the mount interlock for MNT_REF and MNT_REL operations. While there, augment the unconditional yield by some amount of spinning [1]. Reported and tested by: pho Reviewed by: attilio Submitted by: attilio [1] MFC after: 3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 10 20:10:20 2012 (r244094) +++ head/sys/kern/vfs_subr.c Mon Dec 10 20:44:09 2012 (r244095) @@ -4717,9 +4717,8 @@ __mnt_vnode_next_active(struct vnode **m if (should_yield()) kern_yield(PRI_UNCHANGED); - MNT_ILOCK(mp); -restart: mtx_lock(&vnode_free_list_mtx); +restart: KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); vp = TAILQ_NEXT(*mvp, v_actfreelist); while (vp != NULL) { @@ -4728,8 +4727,11 @@ restart: continue; } if (!VI_TRYLOCK(vp)) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + if (should_yield()) { + mtx_unlock(&vnode_free_list_mtx); + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + } goto restart; } if (vp->v_mount == mp && vp->v_type != VMARKER && @@ -4744,14 +4746,12 @@ restart: if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); __mnt_vnode_markerfree_active(mvp, mp); - /* MNT_IUNLOCK(mp); -- done in above function */ mtx_assert(MNT_MTX(mp), MA_NOTOWNED); return (NULL); } TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_IUNLOCK(mp); ASSERT_VI_LOCKED(vp, "active iter"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); @@ -4765,10 +4765,12 @@ __mnt_vnode_first_active(struct vnode ** *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); MNT_ILOCK(mp); MNT_REF(mp); + MNT_IUNLOCK(mp); (*mvp)->v_type = VMARKER; + (*mvp)->v_mount = mp; -restart: mtx_lock(&vnode_free_list_mtx); +restart: vp = TAILQ_FIRST(&mp->mnt_activevnodelist); while (vp != NULL) { if (vp->v_type == VMARKER) { @@ -4776,8 +4778,11 @@ restart: continue; } if (!VI_TRYLOCK(vp)) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + if (should_yield()) { + mtx_unlock(&vnode_free_list_mtx); + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + } goto restart; } if (vp->v_mount == mp && vp->v_type != VMARKER && @@ -4791,16 +4796,15 @@ restart: /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); + MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); free(*mvp, M_VNODE_MARKER); *mvp = NULL; return (NULL); } - (*mvp)->v_mount = mp; TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_IUNLOCK(mp); ASSERT_VI_LOCKED(vp, "active iter first"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); @@ -4810,17 +4814,15 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *mp) { - if (*mvp == NULL) { - MNT_IUNLOCK(mp); + if (*mvp == NULL) return; - } - - mtx_assert(MNT_MTX(mp), MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); + mtx_lock(&vnode_free_list_mtx); TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); + MNT_ILOCK(mp); MNT_REL(mp); MNT_IUNLOCK(mp); free(*mvp, M_VNODE_MARKER); From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 20:52:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6C7D7EE; Mon, 10 Dec 2012 20:52:52 +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 A395A8FC16; Mon, 10 Dec 2012 20:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAKqqv1011016; Mon, 10 Dec 2012 20:52:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAKqqnY011015; Mon, 10 Dec 2012 20:52:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212102052.qBAKqqnY011015@svn.freebsd.org> From: Xin LI Date: Mon, 10 Dec 2012 20:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244096 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 20:52:53 -0000 Author: delphij Date: Mon Dec 10 20:52:52 2012 New Revision: 244096 URL: http://svnweb.freebsd.org/changeset/base/244096 Log: Sync pf.os with OpenBSD: add a handful of linux signatures from p0fv2 and some other signatures from observation. MFC after: 2 weeks Modified: head/etc/pf.os Modified: head/etc/pf.os ============================================================================== --- head/etc/pf.os Mon Dec 10 20:44:09 2012 (r244095) +++ head/etc/pf.os Mon Dec 10 20:52:52 2012 (r244096) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $OpenBSD: pf.os,v 1.25 2010/10/18 15:55:27 deraadt Exp $ +# $OpenBSD: pf.os,v 1.26 2012/08/03 12:25:16 jsg Exp $ # passive OS fingerprinting # ------------------------- # @@ -226,7 +226,13 @@ S2:64:1:60:M*,S,T,N,W0: Linux:2.4::Linu S3:64:1:60:M*,S,T,N,W0: Linux:2.4:.18-21:Linux 2.4.18 and newer S4:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4/2.6 <= 2.6.7 S4:64:1:60:M*,S,T,N,W0: Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7 -S4:64:1:60:M*,S,T,N,W7: Linux:2.6:8:Linux 2.6.8 and newer (?) + +S4:64:1:60:M*,S,T,N,W5: Linux:2.6::Linux 2.6 (newer, 1) +S4:64:1:60:M*,S,T,N,W6: Linux:2.6::Linux 2.6 (newer, 2) +S4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 3) +T4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 4) + +S10:64:1:60:M*,S,T,N,W4: Linux:3.0::Linux 3.0 S3:64:1:60:M*,S,T,N,W1: Linux:2.5::Linux 2.5 (sometimes 2.4) S4:64:1:60:M*,S,T,N,W1: Linux:2.5-2.6::Linux 2.5/2.6 @@ -429,6 +435,8 @@ S44:128:1:48:M*,N,N,S: Windows:XP:SP1: 32767:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows SP1, 2000 SP4 32767:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP4 +8192:128:1:52:M*,N,W2,N,N,S: Windows:Vista::Windows Vista/7 + # Odds, ends, mods: S52:128:1:48:M1260,N,N,S: Windows:2000:cisco:Windows XP/2000 via Cisco From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 21:18:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9F3DED4; Mon, 10 Dec 2012 21:18:02 +0000 (UTC) (envelope-from gnn@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 AC2D08FC16; Mon, 10 Dec 2012 21:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBALI2ed015691; Mon, 10 Dec 2012 21:18:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBALI2Rk015690; Mon, 10 Dec 2012 21:18:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201212102118.qBALI2Rk015690@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 10 Dec 2012 21:18:02 +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: r244097 - stable/9/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 21:18:02 -0000 Author: gnn Date: Mon Dec 10 21:18:02 2012 New Revision: 244097 URL: http://svnweb.freebsd.org/changeset/base/244097 Log: MFC: 238979 When we return with an error we cannot unlock the mutex, because it's been freed. Protect against that, hopefully unlikely, case. Reviewed by: rpaulo Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Directory Properties: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Mon Dec 10 20:52:52 2012 (r244096) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Mon Dec 10 21:18:02 2012 (r244097) @@ -942,7 +942,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, (int)dpr->dpr_pid, strerror(err)); } - (void) pthread_mutex_unlock(&dpr->dpr_lock); + if (err == 0) + (void) pthread_mutex_unlock(&dpr->dpr_lock); (void) pthread_attr_destroy(&a); return (err); From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 21:41:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21212790; Mon, 10 Dec 2012 21:41:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E244B8FC0C; Mon, 10 Dec 2012 21:41:39 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 44A8FB94A; Mon, 10 Dec 2012 16:41:39 -0500 (EST) From: John Baldwin To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include Date: Mon, 10 Dec 2012 14:47:09 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <201212071208.28158.jhb@freebsd.org> <50C2832C.9080501@intel.com> In-Reply-To: <50C2832C.9080501@intel.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201212101447.09407.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 10 Dec 2012 16:41:39 -0500 (EST) Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 21:41:40 -0000 On Friday, December 07, 2012 7:00:44 pm Carl Delsey wrote: > On 12/07/12 10:08, John Baldwin wrote: > > On Thursday, December 06, 2012 5:33:32 pm Jim Harris wrote: > >> Author: jimharris > >> Date: Thu Dec 6 22:33:31 2012 > >> New Revision: 243960 > >> URL: http://svnweb.freebsd.org/changeset/base/243960 > >> > >> Log: > >> Add amd64 implementations for 8-byte bus_space routines. > >> > >> Submitted by: Carl Delsey > >> Discussed with: jhb, rwatson > >> Reviewed by: jimharris > >> MFC after: 1 week > >> > >> Modified: > >> head/sys/amd64/include/bus.h > >> head/sys/i386/include/bus.h > >> head/sys/x86/include/bus.h > > Do we still want the link errors on i386? Do you get a compile error now? > > > You get a compile error now, since the function prototypes don't exist > for i386. That was the case in the old code too. The comments about > forcing a link error were incorrect or obsolete. Ok, sounds good to me, thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 22:13:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20BAD44C; Mon, 10 Dec 2012 22:13:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E0F338FC17; Mon, 10 Dec 2012 22:13:13 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5DA81B94A; Mon, 10 Dec 2012 17:13:13 -0500 (EST) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles Date: Mon, 10 Dec 2012 16:56:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212101656.04306.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 10 Dec 2012 17:13:13 -0500 (EST) Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:13:14 -0000 On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: > On 26 October 2012 10:10, Nathan Whitehorn wrote: > > No. It is staying for the duration of the branch. So this MFC may have been > > premature. > > As I said previously: I MFCed this because it is a low-impact change > and it makes future MFCs easier in the event that the fortune file > changes again. I think it is fine to start training users to not use sysintall, but when doing an MFC like this, you need to refine the message to be relevant to the branch you are merging to if needed. Blindly copying and pasting the original message is nomt always appropriate. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 22:19:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 078187AF for ; Mon, 10 Dec 2012 22:19:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 66F0B8FC20 for ; Mon, 10 Dec 2012 22:19:32 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3056147lah.13 for ; Mon, 10 Dec 2012 14:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=JL9nQsoBWMbwG+I5QMU1rmr7UNhAJaYmlXi6S2xwjNk=; b=m3t+k0b9xYRYlWS7yVVOXmasIgeqZJz+LGl59z586BrJiKCJM/ETQMLyP2sDDtXPjY UAmgbr5Q+/7D2FqpT26qcHYm2dW1XHxuZXOjzrcT+V6/5yr0xZsjsIuvs4L1mSxXIisO ARdG+NP4b1O4wKKPh3b9dDSCmSFl4CvEbEuc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=JL9nQsoBWMbwG+I5QMU1rmr7UNhAJaYmlXi6S2xwjNk=; b=G5fIwCbCsCZH+esKSwgoVr6zVM2c53lutkLz6y8v8/s5L9YCNy24S9S8E22er9PWV1 29wy2h3tzFC0bVuRPWsf+AeHNPP2qNkVT3+kbFGu2l9GsxOgxCLgeJTwzgaekkTt/UVn QXcDyK2Zg6ogm1Eoj7CJShBAI1ccbW+cODinOIY8znJoKe2CuOO9khrMy3yO1aKqhAqR Ds/t5obYvAiVgdsQ6HwtCM3y4kzVHk7PxVcBCaS/ijsv4S2q4jPTDiph+QP5NkvppWYt pfpmWRR7G2CE4LFhnfpA2OS179hrNl0aNIbA1M3wzPsAq3GIGhfGbioykdiqorrRfxXL 6FWQ== Received: by 10.152.144.201 with SMTP id so9mr15459536lab.24.1355177971147; Mon, 10 Dec 2012 14:19:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.43.229 with HTTP; Mon, 10 Dec 2012 14:19:00 -0800 (PST) In-Reply-To: <201212101656.04306.jhb@freebsd.org> References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> <201212101656.04306.jhb@freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 17:19:00 -0500 X-Google-Sender-Auth: -JoG_YibfABoE03aLdl0y3_Horc Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlTlzp+JeYzeXKPILM/aDwSerg9zZgnYeIzqMUn8aiEVFhFpngUnJVq3V/eo2hJvcg4UzWN Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:19:33 -0000 On 10 December 2012 16:56, John Baldwin wrote: > On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: >> On 26 October 2012 10:10, Nathan Whitehorn wrote: >> > No. It is staying for the duration of the branch. So this MFC may have been >> > premature. >> >> As I said previously: I MFCed this because it is a low-impact change >> and it makes future MFCs easier in the event that the fortune file >> changes again. > > I think it is fine to start training users to not use sysintall, but > when doing an MFC like this, you need to refine the message to be > relevant to the branch you are merging to if needed. Blindly > copying and pasting the original message is nomt always appropriate. See r242109 and r242110: I clarified it in those commits. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 22:23:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FD80C89 for ; Mon, 10 Dec 2012 22:23:50 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D000B8FC14 for ; Mon, 10 Dec 2012 22:23:49 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3062299lah.13 for ; Mon, 10 Dec 2012 14:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=53Iua9Nqj8kG9CXRHsGDxT4XLj7zbm4Bi0xB+t9RsDw=; b=sA72HiM+4q6afSof4wYYMuXowc0W82G4PM5qkIi2Sd56Icn2Lk2LJmJkKAJbBcC33O /XaaOInIXhvbv7IxZxmOoFPI2Sq83b4ry5++wfR1wTWNUwjTpkTyhok04LC6G4CcHHmz CZa2fOrUtJHtbQ2j43RqyX/gsq9jkw10/2kUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=53Iua9Nqj8kG9CXRHsGDxT4XLj7zbm4Bi0xB+t9RsDw=; b=Wmbxp4f2EcrWoJ4kcYrS4vxHy06U3XJkSIjRhVOXfbHxxqamhnIUuMmMaErW/TWXl1 VuUw3i4xogGvHZaogXYTjIZEzNQL5RvAEvv4zXc6Aa7U+GyNYTrrRhX6Q1k/fz4JZJws Ijogoaxb8fEL269e7Rwuq2OLUGJqfOLltI9VJaQ+ztuhrtikZXf301kCRPREOHqDeyxi 8fFY7ZnbOiddhOBRkKLUQrhtiMvWGTlKHIedVCMVBQHDMDpEuPV3m5sd/EXhD69IK+AW pTZl6i9CPnZ4dmrkmOuxUooO7jij0farfNRbwT/EVjnJLD/BXlFs++0QW5LYnw8FcBnv V7jw== Received: by 10.112.29.104 with SMTP id j8mr6822561lbh.0.1355178228684; Mon, 10 Dec 2012 14:23:48 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.43.229 with HTTP; Mon, 10 Dec 2012 14:23:18 -0800 (PST) In-Reply-To: References: <201210260034.q9Q0YRmY082297@svn.freebsd.org> <508A99C3.20705@freebsd.org> <201212101656.04306.jhb@freebsd.org> From: Eitan Adler Date: Mon, 10 Dec 2012 17:23:18 -0500 X-Google-Sender-Auth: nI0Dd8IbtZR5aWPi1t5LlKDdGCw Message-ID: Subject: Re: svn commit: r242109 - stable/9/games/fortune/datfiles To: John Baldwin Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnsHoAbQi8IuWLeOt3esvzYvKspfMhDTGJFSUppyGLKsLPrv7S487RStZ6t+gQxqe5uLMyD Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Nathan Whitehorn , Ronald Klop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 22:23:50 -0000 On 10 December 2012 17:19, Eitan Adler wrote: > On 10 December 2012 16:56, John Baldwin wrote: >> On Friday, October 26, 2012 11:23:17 am Eitan Adler wrote: >>> On 26 October 2012 10:10, Nathan Whitehorn wrote: >>> > No. It is staying for the duration of the branch. So this MFC may have been >>> > premature. >>> >>> As I said previously: I MFCed this because it is a low-impact change >>> and it makes future MFCs easier in the event that the fortune file >>> changes again. >> >> I think it is fine to start training users to not use sysintall, but >> when doing an MFC like this, you need to refine the message to be >> relevant to the branch you are merging to if needed. Blindly >> copying and pasting the original message is nomt always appropriate. > > See r242109 and r242110: I clarified it in those commits. I meant r242110 and r242111 -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:09:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 882B7914; Mon, 10 Dec 2012 23:09:57 +0000 (UTC) (envelope-from alfred@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 688028FC0C; Mon, 10 Dec 2012 23:09:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBAN9v7Y033965; Mon, 10 Dec 2012 23:09:57 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBAN9uCf033959; Mon, 10 Dec 2012 23:09:56 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102309.qBAN9uCf033959@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244098 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:09:57 -0000 Author: alfred Date: Mon Dec 10 23:09:55 2012 New Revision: 244098 URL: http://svnweb.freebsd.org/changeset/base/244098 Log: make sysctls kern.{bootfile,conftxt} read-only MFC after: 1 month Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Dec 10 21:18:02 2012 (r244097) +++ head/sys/kern/kern_mib.c Mon Dec 10 23:09:55 2012 (r244098) @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RD, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, @@ -377,15 +377,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur /* Actual kernel configuration options. */ extern char kernconfstring[]; -static int -sysctl_kern_config(SYSCTL_HANDLER_ARGS) -{ - return (sysctl_handle_string(oidp, kernconfstring, - strlen(kernconfstring), req)); -} - -SYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW, - 0, 0, sysctl_kern_config, "", "Kernel configuration file"); +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, + "Kernel configuration file"); #endif static int From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:11:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDC73C54; Mon, 10 Dec 2012 23:11:26 +0000 (UTC) (envelope-from alfred@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 D39F78FC0C; Mon, 10 Dec 2012 23:11:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANBQe1034368; Mon, 10 Dec 2012 23:11:26 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANBQwt034367; Mon, 10 Dec 2012 23:11:26 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102311.qBANBQwt034367@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244099 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:11:27 -0000 Author: alfred Date: Mon Dec 10 23:11:26 2012 New Revision: 244099 URL: http://svnweb.freebsd.org/changeset/base/244099 Log: allow KASSERT to enter KDB. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Dec 10 23:09:55 2012 (r244098) +++ head/sys/kern/kern_shutdown.c Mon Dec 10 23:11:26 2012 (r244099) @@ -542,6 +542,9 @@ shutdown_reset(void *junk, int howto) #ifdef INVARIANTS static int kassert_warn_only = 0; +#ifdef KDB +static int kassert_do_kdb = 0; +#endif #ifdef KTR static int kassert_do_ktr = 0; #endif @@ -558,6 +561,12 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, war "KASSERT triggers a panic (1) or just a warning (0)"); TUNABLE_INT("debug.kassert.warn_only", &kassert_warn_only); +#ifdef KDB +SYSCTL_INT(_debug_kassert, OID_AUTO, do_kdb, CTLFLAG_RW | CTLFLAG_TUN, + &kassert_do_kdb, 0, "KASSERT will enter the debugger"); +TUNABLE_INT("debug.kassert.do_kdb", &kassert_do_kdb); +#endif + #ifdef KTR SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_RW | CTLFLAG_TUN, &kassert_do_ktr, 0, @@ -650,6 +659,11 @@ kassert_panic(const char *fmt, ...) kdb_backtrace(); } } +#ifdef KDB + if (kassert_do_kdb) { + kdb_enter(KDB_WHY_KASSERT, buf); + } +#endif atomic_add_int(&kassert_warnings, 1); } #endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:12:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4874CDF0; Mon, 10 Dec 2012 23:12:52 +0000 (UTC) (envelope-from alfred@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 2E3038FC1C; Mon, 10 Dec 2012 23:12:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANCqwJ034706; Mon, 10 Dec 2012 23:12:52 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANCq34034705; Mon, 10 Dec 2012 23:12:52 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102312.qBANCq34034705@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244100 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:12:52 -0000 Author: alfred Date: Mon Dec 10 23:12:51 2012 New Revision: 244100 URL: http://svnweb.freebsd.org/changeset/base/244100 Log: Add constant missed in r244099 KDB entered due to KASSERT. Modified: head/sys/sys/kdb.h Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Mon Dec 10 23:11:26 2012 (r244099) +++ head/sys/sys/kdb.h Mon Dec 10 23:12:51 2012 (r244100) @@ -97,6 +97,7 @@ int kdb_trap(int, int, struct trapframe extern const char * volatile kdb_why; #define KDB_WHY_UNSET NULL /* No reason set. */ #define KDB_WHY_PANIC "panic" /* panic() was called. */ +#define KDB_WHY_KASSERT "kassert" /* kassert failed. */ #define KDB_WHY_SYSCTL "sysctl" /* Sysctl entered debugger. */ #define KDB_WHY_BOOTFLAGS "bootflags" /* Boot flags were set. */ #define KDB_WHY_WITNESS "witness" /* Witness entered debugger. */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:14:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C072F70; Mon, 10 Dec 2012 23:14:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CE3568FC08; Mon, 10 Dec 2012 23:14:52 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBANEmro002803; Tue, 11 Dec 2012 01:14:48 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBANEmro002803 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBANEmxp002802; Tue, 11 Dec 2012 01:14:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 11 Dec 2012 01:14:48 +0200 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: svn commit: r244098 - head/sys/kern Message-ID: <20121210231448.GX3013@kib.kiev.ua> References: <201212102309.qBAN9uCf033959@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cMBqRQ/74NaVL1Kq" Content-Disposition: inline In-Reply-To: <201212102309.qBAN9uCf033959@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:14:53 -0000 --cMBqRQ/74NaVL1Kq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Mon Dec 10 23:09:55 2012 > New Revision: 244098 > URL: http://svnweb.freebsd.org/changeset/base/244098 >=20 > Log: > make sysctls kern.{bootfile,conftxt} read-only You just break installkernel. --cMBqRQ/74NaVL1Kq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQxmznAAoJEJDCuSvBvK1BeY4P/0KjX5peERIB8I0NYaTPn7jq fdd/kEakvXmK+oy6uSyzLUjqTWAoZlTzk/F0TVF1T+rXXZjIsFjjGOJcUlqSuJcg jBmlDSXuf0Bs2jEQE5XfOHc50YR1CGQOkWk8DT28mOw8p0QtMQQNcBUJqhNFKgAt W9/qu3cHuBMrYf5cJSgE3Up1FTVhdeaIGzjHoeNYW9svgoZVbZ5rEFj+vswzXV1x xaaDdJftM3j8qTPJWXQ/r2aPG3Tq9GrlLRwFFYHpJGJMPcfEN22c0Ct1BkyYAI3D AyrVM1Hw7D43FmNxTQsMHuhTNv6dd8dQDR4Xo77IwUwkE4mJOu8/EuVKnLRWFuMW bs9UTCmFT/pG94cpXVyWEH1Z9uiR5k6pUOGS7kH4domwucWlab5IbcWb8fuHuLt+ VyLqoUfkQ7YjC/L7nYXvn7zxMCIXweeJKvG6tWsRZo3J7yOEOT9zxsmixAga49op tjhNmByIxLs0f3+f8gdQpXSY4tCuRFJ3/Yu7xnkYbyTLOHf9Idf/A2K1CPCgzmJs HQHdYGYn6bdakKnArGvyqKanCYALc0POzK6hGeL+H1ZqaKDgm00P32hyY46kOBUL 1qEW7VCmxQAgc6OxDuQPjr7dV3+oBXrWs1d+bECuTFTGNewEGNcc+kq0OHHu7JhN zwCivCzGlJhOt2D7KimE =Dg9C -----END PGP SIGNATURE----- --cMBqRQ/74NaVL1Kq-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:17:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87A24258; Mon, 10 Dec 2012 23:17:09 +0000 (UTC) (envelope-from alfred@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 6AABA8FC12; Mon, 10 Dec 2012 23:17:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBANH9Lm035653; Mon, 10 Dec 2012 23:17:09 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBANH92o035652; Mon, 10 Dec 2012 23:17:09 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212102317.qBANH92o035652@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 10 Dec 2012 23:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244101 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:17:09 -0000 Author: alfred Date: Mon Dec 10 23:17:08 2012 New Revision: 244101 URL: http://svnweb.freebsd.org/changeset/base/244101 Log: Add CTLFLAG_STATS to sysctl flags In preparation for sysctl(8) growing the ability to only print out boot/run-time tunables we need a way to differentiate between RW sysctl nodes that tune a particular thing, or simply export a stat that we want to allow the sysadmin to reset to 0 (or some other value). To do so, we add the CTLFLAG_STATS which should be OR'd into the CTLFLAGs when exporting a "writable/resettable" statistic node via sysctl. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Dec 10 23:12:51 2012 (r244100) +++ head/sys/sys/sysctl.h Mon Dec 10 23:17:08 2012 (r244101) @@ -90,6 +90,7 @@ struct ctlname { #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ +#define CTLFLAG_STATS 0x00002000 /* Statistics, not a tuneable */ #define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:20:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C5B2733; Mon, 10 Dec 2012 23:20:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id A9EB78FC15; Mon, 10 Dec 2012 23:20:18 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 0916A40003; Tue, 11 Dec 2012 00:20:18 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id F314E40005; Tue, 11 Dec 2012 00:20:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 363A140003; Tue, 11 Dec 2012 00:20:17 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL0cx01Mqz8hVn; Tue, 11 Dec 2012 00:20:17 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id UyWPydcg3Eqv; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL0ct4M9nz8hVm; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL0ct41jfz9Ctj; Tue, 11 Dec 2012 00:20:14 +0100 (CET) Message-ID: <50C66E2E.5040302@freebsd.org> Date: Tue, 11 Dec 2012 00:20:14 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Jim Harris Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> In-Reply-To: <201212062233.qB6MXWpP046167@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:20:19 -0000 On 12/06/12 23:33, Jim Harris wrote: > Author: jimharris > Date: Thu Dec 6 22:33:31 2012 > New Revision: 243960 > URL: http://svnweb.freebsd.org/changeset/base/243960 > > Log: > Add amd64 implementations for 8-byte bus_space routines. > > +#include > #include > + > +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ > + KASSERT((tag) == X86_BUS_SPACE_MEM, \ > + ("%s: can only handle mem space", __func__)) > + > +static __inline uint64_t > +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, > + bus_size_t ofs) > +{ > + > + KASSERT_BUS_SPACE_MEM_ONLY(tag); > + > + return (*(volatile uint64_t *)(bsh + ofs)); > +} Hi! Can the include of and the added KASSERTs please be hidden under #ifdef _KERNEL or something similar? devel/libpciaccess from the experimental xorg-dev tree (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) uses machine/bus.h on amd64 and i386 to be able to read/write to the pci bus, and this change breaks the compile of devel/libpciaccess. It is probably so that libpciaccess is wrong in using but I have no idea how to fix it. If you have a better suggestion on how to fix libpciaccess I am all ears. Regards! -- Niclas Zeising From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:33:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9CA0E34; Mon, 10 Dec 2012 23:33:04 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 901988FC13; Mon, 10 Dec 2012 23:33:04 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 15:32:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,254,1355126400"; d="scan'208";a="179153612" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 15:32:57 -0800 Message-ID: <50C67129.6090704@intel.com> Date: Mon, 10 Dec 2012 16:32:57 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> In-Reply-To: <50C66E2E.5040302@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:33:05 -0000 On 12/10/12 16:20, Niclas Zeising wrote: > On 12/06/12 23:33, Jim Harris wrote: >> Author: jimharris >> Date: Thu Dec 6 22:33:31 2012 >> New Revision: 243960 >> URL: http://svnweb.freebsd.org/changeset/base/243960 >> >> Log: >> Add amd64 implementations for 8-byte bus_space routines. >> >> +#include >> #include >> + >> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >> + ("%s: can only handle mem space", __func__)) >> + >> +static __inline uint64_t >> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >> + bus_size_t ofs) >> +{ >> + >> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >> + >> + return (*(volatile uint64_t *)(bsh + ofs)); >> +} > Hi! > Can the include of and the added KASSERTs please be hidden > under #ifdef _KERNEL or something similar? devel/libpciaccess from the > experimental xorg-dev tree > (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) > uses machine/bus.h on amd64 and i386 to be able to read/write to the pci > bus, and this change breaks the compile of devel/libpciaccess. > It is probably so that libpciaccess is wrong in using > but I have no idea how to fix it. If you have a better suggestion on > how to fix libpciaccess I am all ears. > Regards! Does libpciaccess make use of the bus_space_read/write_* routines in these files, or does it just use some constants and types from them? From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:38:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4198EC; Mon, 10 Dec 2012 23:38:14 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 81BCF8FC0C; Mon, 10 Dec 2012 23:38:14 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 1565E1A3C1C; Mon, 10 Dec 2012 15:38:14 -0800 (PST) Message-ID: <50C67272.4080008@mu.org> Date: Mon, 10 Dec 2012 15:38:26 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> In-Reply-To: <20121210231448.GX3013@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:38:14 -0000 On 12/10/12 3:14 PM, Konstantin Belousov wrote: > On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >> Author: alfred >> Date: Mon Dec 10 23:09:55 2012 >> New Revision: 244098 >> URL: http://svnweb.freebsd.org/changeset/base/244098 >> >> Log: >> make sysctls kern.{bootfile,conftxt} read-only > You just break installkernel. My apologies, give me a few moments to double check this and I will back out. -Alfred From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:40:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C83D278; Mon, 10 Dec 2012 23:40:22 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 5F7748FC14; Mon, 10 Dec 2012 23:40:21 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4B64F40006; Tue, 11 Dec 2012 00:40:20 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3B51740005; Tue, 11 Dec 2012 00:40:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 7DD1B40003; Tue, 11 Dec 2012 00:40:19 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL143137Kz8hVn; Tue, 11 Dec 2012 00:40:19 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id CvAV-5ZiHyT3; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1404N7Gz8hVm; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [10.32.0.4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL1403k25z9Ctj; Tue, 11 Dec 2012 00:40:16 +0100 (CET) Message-ID: <50C672D0.9090908@freebsd.org> Date: Tue, 11 Dec 2012 00:40:00 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> In-Reply-To: <50C67129.6090704@intel.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:40:22 -0000 On 12/11/12 00:32, Carl Delsey wrote: > On 12/10/12 16:20, Niclas Zeising wrote: >> On 12/06/12 23:33, Jim Harris wrote: >>> Author: jimharris >>> Date: Thu Dec 6 22:33:31 2012 >>> New Revision: 243960 >>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>> >>> Log: >>> Add amd64 implementations for 8-byte bus_space routines. >>> +#include >>> #include >>> + >>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>> + ("%s: can only handle mem space", __func__)) >>> + >>> +static __inline uint64_t >>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>> + bus_size_t ofs) >>> +{ >>> + >>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>> + >>> + return (*(volatile uint64_t *)(bsh + ofs)); >>> +} >> Hi! >> Can the include of and the added KASSERTs please be hidden >> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >> experimental xorg-dev tree >> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >> uses machine/bus.h on amd64 and i386 to be able to read/write to the pci >> bus, and this change breaks the compile of devel/libpciaccess. >> It is probably so that libpciaccess is wrong in using >> but I have no idea how to fix it. If you have a better suggestion on >> how to fix libpciaccess I am all ears. >> Regards! > Does libpciaccess make use of the bus_space_read/write_* routines in > these files, or does it just use some constants and types from them? > libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in x86/bus.h. It does not use the quad functions. Regards! -- Niclas Zeising From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:50:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0080B672; Mon, 10 Dec 2012 23:50:56 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 787B68FC0C; Mon, 10 Dec 2012 23:50:56 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 973CB1A3C1B; Mon, 10 Dec 2012 15:50:55 -0800 (PST) Message-ID: <50C6756B.80607@mu.org> Date: Mon, 10 Dec 2012 15:51:07 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> <50C67272.4080008@mu.org> In-Reply-To: <50C67272.4080008@mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:50:57 -0000 On 12/10/12 3:38 PM, Alfred Perlstein wrote: > On 12/10/12 3:14 PM, Konstantin Belousov wrote: >> On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >>> Author: alfred >>> Date: Mon Dec 10 23:09:55 2012 >>> New Revision: 244098 >>> URL: http://svnweb.freebsd.org/changeset/base/244098 >>> >>> Log: >>> make sysctls kern.{bootfile,conftxt} read-only >> You just break installkernel. > My apologies, give me a few moments to double check this and I will > back out. So first off "installkernel" was not broken, the error is ignored by make, hence why I didn't see it. Second off, this is pretty broken, the first time you "installkernel" it gets it right, the second time it just seems to set kern.bootfile to /boot/kernel.old/kernel no even though that's not really the boot kernel. I will back out the change, but this just seems off. If we are going to change kern.bootfile, then we ought to detect when it's no longer valid at all and just zero it. or pretty much do something else. -Alfred From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 23:54:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1111E94C; Mon, 10 Dec 2012 23:54:56 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id AE6448FC17; Mon, 10 Dec 2012 23:54:55 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 15:54:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,254,1355126400"; d="scan'208";a="179160694" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 15:54:54 -0800 Message-ID: <50C6764E.4040804@intel.com> Date: Mon, 10 Dec 2012 16:54:54 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> In-Reply-To: <50C672D0.9090908@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 23:54:56 -0000 On 12/10/12 16:40, Niclas Zeising wrote: > On 12/11/12 00:32, Carl Delsey wrote: >> On 12/10/12 16:20, Niclas Zeising wrote: >>> On 12/06/12 23:33, Jim Harris wrote: >>>> Author: jimharris >>>> Date: Thu Dec 6 22:33:31 2012 >>>> New Revision: 243960 >>>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>>> >>>> Log: >>>> Add amd64 implementations for 8-byte bus_space routines. >>>> +#include >>>> #include >>>> + >>>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>>> + ("%s: can only handle mem space", __func__)) >>>> + >>>> +static __inline uint64_t >>>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>>> + bus_size_t ofs) >>>> +{ >>>> + >>>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>>> + >>>> + return (*(volatile uint64_t *)(bsh + ofs)); >>>> +} >>> Hi! >>> Can the include of and the added KASSERTs please be hidden >>> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >>> experimental xorg-dev tree >>> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >>> uses machine/bus.h on amd64 and i386 to be able to read/write to the pci >>> bus, and this change breaks the compile of devel/libpciaccess. >>> It is probably so that libpciaccess is wrong in using >>> but I have no idea how to fix it. If you have a better suggestion on >>> how to fix libpciaccess I am all ears. >>> Regards! >> Does libpciaccess make use of the bus_space_read/write_* routines in >> these files, or does it just use some constants and types from them? >> > libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in > x86/bus.h. It does not use the quad functions. > Regards! Ok. In that case I won't ifdef out the functions themselves, just the KASSERT in case libpciaccess expands in the future to 8 byte accesses :-) I had another related change in the works. I'll add this change in. Thanks, Carl From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 00:08:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD264DFE; Tue, 11 Dec 2012 00:08:29 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 614308FC08; Tue, 11 Dec 2012 00:08:29 +0000 (UTC) Received: from kruse-124.4.ixsystems.com (drawbridge.ixsystems.com [206.40.55.65]) by elvis.mu.org (Postfix) with ESMTPSA id 2909B1A3DCA; Mon, 10 Dec 2012 16:08:29 -0800 (PST) Message-ID: <50C67989.7070401@mu.org> Date: Mon, 10 Dec 2012 16:08:41 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r244098 - head/sys/kern References: <201212102309.qBAN9uCf033959@svn.freebsd.org> <20121210231448.GX3013@kib.kiev.ua> <50C67272.4080008@mu.org> <50C6756B.80607@mu.org> In-Reply-To: <50C6756B.80607@mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 00:08:29 -0000 On 12/10/12 3:51 PM, Alfred Perlstein wrote: > On 12/10/12 3:38 PM, Alfred Perlstein wrote: >> On 12/10/12 3:14 PM, Konstantin Belousov wrote: >>> On Mon, Dec 10, 2012 at 11:09:56PM +0000, Alfred Perlstein wrote: >>>> Author: alfred >>>> Date: Mon Dec 10 23:09:55 2012 >>>> New Revision: 244098 >>>> URL: http://svnweb.freebsd.org/changeset/base/244098 >>>> >>>> Log: >>>> make sysctls kern.{bootfile,conftxt} read-only >>> You just break installkernel. >> My apologies, give me a few moments to double check this and I will >> back out. > > So first off "installkernel" was not broken, the error is ignored by > make, hence why I didn't see it. > > Second off, this is pretty broken, the first time you "installkernel" > it gets it right, the second time it just seems to set kern.bootfile > to /boot/kernel.old/kernel no even though that's not really the boot > kernel. > > I will back out the change, but this just seems off. > > If we are going to change kern.bootfile, then we ought to detect when > it's no longer valid at all and just zero it. or pretty much do > something else. > > -Alfred > and.. derp. Florian explained how this works, how it doesn't rename kern.bootfile after the first rename of the kernel. I'll be backing out the change now and adding some comments to the code shortly. From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 00:10:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4C6EF85; Tue, 11 Dec 2012 00:10:20 +0000 (UTC) (envelope-from alfred@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 B92048FC08; Tue, 11 Dec 2012 00:10:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB0AKK1046469; Tue, 11 Dec 2012 00:10:20 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB0AKGN046468; Tue, 11 Dec 2012 00:10:20 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110010.qBB0AKGN046468@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 00:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244103 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 00:10:20 -0000 Author: alfred Date: Tue Dec 11 00:10:20 2012 New Revision: 244103 URL: http://svnweb.freebsd.org/changeset/base/244103 Log: back out half of 244098. kern.bootfile needs to be rw for installkernel. Pointed out by: kib, flo Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Dec 11 00:07:19 2012 (r244102) +++ head/sys/kern/kern_mib.c Tue Dec 11 00:10:20 2012 (r244103) @@ -141,7 +141,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RD, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 00:19:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C6047BA; Tue, 11 Dec 2012 00:19:59 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6938FC14; Tue, 11 Dec 2012 00:19:58 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id EBBB140003; Tue, 11 Dec 2012 01:19:57 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E06DC40005; Tue, 11 Dec 2012 01:19:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (h-45-105.a163.priv.bahnhof.se [94.254.45.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 3444D40003; Tue, 11 Dec 2012 01:19:56 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1xm07LXz8hVt; Tue, 11 Dec 2012 01:19:56 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id hMiSGTdE9ni2; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [10.1.0.4]) by mx.daemonic.se (Postfix) with ESMTPS id 3YL1xj45N8z8hVm; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Received: from vivi.daemonic.se (vivi.daemonic.se [10.32.0.4]) by mail.daemonic.se (Postfix) with ESMTPSA id 3YL1xj3gjNz9CwY; Tue, 11 Dec 2012 01:19:53 +0100 (CET) Message-ID: <50C67C29.4070408@freebsd.org> Date: Tue, 11 Dec 2012 01:19:53 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Carl Delsey Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> In-Reply-To: <50C6764E.4040804@intel.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 00:19:59 -0000 On 12/11/12 00:54, Carl Delsey wrote: > On 12/10/12 16:40, Niclas Zeising wrote: >> On 12/11/12 00:32, Carl Delsey wrote: >>> On 12/10/12 16:20, Niclas Zeising wrote: >>>> On 12/06/12 23:33, Jim Harris wrote: >>>>> Author: jimharris >>>>> Date: Thu Dec 6 22:33:31 2012 >>>>> New Revision: 243960 >>>>> URL: http://svnweb.freebsd.org/changeset/base/243960 >>>>> >>>>> Log: >>>>> Add amd64 implementations for 8-byte bus_space routines. >>>>> +#include >>>>> #include >>>>> + >>>>> +#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ >>>>> + KASSERT((tag) == X86_BUS_SPACE_MEM, \ >>>>> + ("%s: can only handle mem space", __func__)) >>>>> + >>>>> +static __inline uint64_t >>>>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, >>>>> + bus_size_t ofs) >>>>> +{ >>>>> + >>>>> + KASSERT_BUS_SPACE_MEM_ONLY(tag); >>>>> + >>>>> + return (*(volatile uint64_t *)(bsh + ofs)); >>>>> +} >>>> Hi! >>>> Can the include of and the added KASSERTs please be >>>> hidden >>>> under #ifdef _KERNEL or something similar? devel/libpciaccess from the >>>> experimental xorg-dev tree >>>> (http://trillian.chruetertee.ch/ports/browser/trunk/devel/libpciaccess) >>>> uses machine/bus.h on amd64 and i386 to be able to read/write to the >>>> pci >>>> bus, and this change breaks the compile of devel/libpciaccess. >>>> It is probably so that libpciaccess is wrong in using >>>> but I have no idea how to fix it. If you have a better suggestion on >>>> how to fix libpciaccess I am all ears. >>>> Regards! >>> Does libpciaccess make use of the bus_space_read/write_* routines in >>> these files, or does it just use some constants and types from them? >>> >> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >> x86/bus.h. It does not use the quad functions. >> Regards! > Ok. In that case I won't ifdef out the functions themselves, just the > KASSERT in case libpciaccess expands in the future to 8 byte accesses > :-) I had another related change in the works. I'll add this change in. Sounds good to me, thank you very much! Don't forget to ifdef the include o as well as the KASSERTs. Regards! -- Niclas Zeising From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 01:12:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7B3E1BC; Tue, 11 Dec 2012 01:12:29 +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 9BB7C8FC17; Tue, 11 Dec 2012 01:12:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1CTvU058444; Tue, 11 Dec 2012 01:12:29 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1CTDj058443; Tue, 11 Dec 2012 01:12:29 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212110112.qBB1CTDj058443@svn.freebsd.org> From: Xin LI Date: Tue, 11 Dec 2012 01:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244104 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 01:12:29 -0000 Author: delphij Date: Tue Dec 11 01:12:29 2012 New Revision: 244104 URL: http://svnweb.freebsd.org/changeset/base/244104 Log: In parse(): - Only operate on copy, don't operate on source. - Eliminate home-rolled strsep(). - Constify the parameter. MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Dec 11 00:10:20 2012 (r244103) +++ head/sbin/sysctl/sysctl.c Tue Dec 11 01:12:29 2012 (r244104) @@ -62,7 +62,7 @@ static int aflag, bflag, dflag, eflag, h static int Nflag, nflag, oflag, qflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); -static void parse(char *); +static void parse(const char *); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -161,7 +161,7 @@ main(int argc, char **argv) * Set a new value if requested. */ static void -parse(char *string) +parse(const char *string) { int len, i, j; void *newval = 0; @@ -176,12 +176,11 @@ parse(char *string) char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; u_int kind; - bufp = buf; + cp = buf; if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) errx(1, "oid too long: '%s'", string); - if ((cp = strchr(string, '=')) != NULL) { - *strchr(buf, '=') = '\0'; - *cp++ = '\0'; + bufp = strsep(&cp, "="); + if (cp != NULL) { while (isspace(*cp)) cp++; newval = cp; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 01:23:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF8BD4E3; Tue, 11 Dec 2012 01:23:51 +0000 (UTC) (envelope-from alfred@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 D27F78FC12; Tue, 11 Dec 2012 01:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1Np5p060504; Tue, 11 Dec 2012 01:23:51 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1NpOV060501; Tue, 11 Dec 2012 01:23:51 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110123.qBB1NpOV060501@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 01:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244105 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 01:23:52 -0000 Author: alfred Date: Tue Dec 11 01:23:50 2012 New Revision: 244105 URL: http://svnweb.freebsd.org/changeset/base/244105 Log: Switch the hardwired WITNESS panics to kassert_panic. This is an ongoing effort to provide runtime debug information useful in the field that does not panic existing installations. This gives us the flexibility needed when shipping images to a potentially large audience with WITNESS enabled without worrying about formerly non-fatal LORs hurting a release. Sponsored by: iXsystems Modified: head/sys/kern/kern_shutdown.c head/sys/kern/subr_witness.c head/sys/sys/systm.h Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/kern/kern_shutdown.c Tue Dec 11 01:23:50 2012 (r244105) @@ -540,7 +540,7 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef INVARIANTS +#if defined(WITNESS) || defined(INVARIANTS) static int kassert_warn_only = 0; #ifdef KDB static int kassert_do_kdb = 0; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/kern/subr_witness.c Tue Dec 11 01:23:50 2012 (r244105) @@ -822,16 +822,16 @@ witness_init(struct lock_object *lock, c class = LOCK_CLASS(lock); if ((lock->lo_flags & LO_RECURSABLE) != 0 && (class->lc_flags & LC_RECURSABLE) == 0) - panic("%s: lock (%s) %s can not be recursable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be recursable", + __func__, class->lc_name, lock->lo_name); if ((lock->lo_flags & LO_SLEEPABLE) != 0 && (class->lc_flags & LC_SLEEPABLE) == 0) - panic("%s: lock (%s) %s can not be sleepable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be sleepable", + __func__, class->lc_name, lock->lo_name); if ((lock->lo_flags & LO_UPGRADABLE) != 0 && (class->lc_flags & LC_UPGRADABLE) == 0) - panic("%s: lock (%s) %s can not be upgradable", __func__, - class->lc_name, lock->lo_name); + kassert_panic("%s: lock (%s) %s can not be upgradable", + __func__, class->lc_name, lock->lo_name); /* * If we shouldn't watch this lock, then just clear lo_witness. @@ -847,7 +847,8 @@ witness_init(struct lock_object *lock, c pending_locks[pending_cnt].wh_lock = lock; pending_locks[pending_cnt++].wh_type = type; if (pending_cnt > WITNESS_PENDLIST) - panic("%s: pending locks list is too small, bump it\n", + panic("%s: pending locks list is too small, " + "increase WITNESS_PENDLIST\n", __func__); } else lock->lo_witness = enroll(type, class); @@ -1073,7 +1074,8 @@ witness_checkorder(struct lock_object *l * all spin locks. */ if (td->td_critnest != 0 && !kdb_active) - panic("blockable sleep lock (%s) %s @ %s:%d", + kassert_panic("acquiring blockable sleep lock with " + "spinlock or critical section held (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); @@ -1117,7 +1119,7 @@ witness_checkorder(struct lock_object *l fixup_filename(file), line); printf("while exclusively locked from %s:%d\n", fixup_filename(lock1->li_file), lock1->li_line); - panic("share->excl"); + kassert_panic("share->excl"); } if ((lock1->li_flags & LI_EXCLUSIVE) == 0 && (flags & LOP_EXCLUSIVE) != 0) { @@ -1126,7 +1128,7 @@ witness_checkorder(struct lock_object *l fixup_filename(file), line); printf("while share locked from %s:%d\n", fixup_filename(lock1->li_file), lock1->li_line); - panic("excl->share"); + kassert_panic("excl->share"); } return; } @@ -1433,26 +1435,30 @@ witness_upgrade(struct lock_object *lock class = LOCK_CLASS(lock); if (witness_watch) { if ((lock->lo_flags & LO_UPGRADABLE) == 0) - panic("upgrade of non-upgradable lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of non-upgradable lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((class->lc_flags & LC_SLEEPLOCK) == 0) - panic("upgrade of non-sleep lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of non-sleep lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); if (instance == NULL) - panic("upgrade of unlocked lock (%s) %s @ %s:%d", + kassert_panic("upgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) != 0) - panic("upgrade of exclusive lock (%s) %s @ %s:%d", + kassert_panic( + "upgrade of exclusive lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((instance->li_flags & LI_RECURSEMASK) != 0) - panic("upgrade of recursed lock (%s) %s r=%d @ %s:%d", + kassert_panic( + "upgrade of recursed lock (%s) %s r=%d @ %s:%d", class->lc_name, lock->lo_name, instance->li_flags & LI_RECURSEMASK, fixup_filename(file), line); @@ -1473,26 +1479,30 @@ witness_downgrade(struct lock_object *lo class = LOCK_CLASS(lock); if (witness_watch) { if ((lock->lo_flags & LO_UPGRADABLE) == 0) - panic("downgrade of non-upgradable lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of non-upgradable lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((class->lc_flags & LC_SLEEPLOCK) == 0) - panic("downgrade of non-sleep lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of non-sleep lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); if (instance == NULL) - panic("downgrade of unlocked lock (%s) %s @ %s:%d", + kassert_panic("downgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) == 0) - panic("downgrade of shared lock (%s) %s @ %s:%d", + kassert_panic( + "downgrade of shared lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((instance->li_flags & LI_RECURSEMASK) != 0) - panic("downgrade of recursed lock (%s) %s r=%d @ %s:%d", + kassert_panic( + "downgrade of recursed lock (%s) %s r=%d @ %s:%d", class->lc_name, lock->lo_name, instance->li_flags & LI_RECURSEMASK, fixup_filename(file), line); @@ -1535,7 +1545,7 @@ witness_unlock(struct lock_object *lock, * eventual register locks and remove them. */ if (witness_watch > 0) - panic("lock (%s) %s not locked @ %s:%d", class->lc_name, + kassert_panic("lock (%s) %s not locked @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); else return; @@ -1548,7 +1558,7 @@ found: lock->lo_name, fixup_filename(file), line); printf("while exclusively locked from %s:%d\n", fixup_filename(instance->li_file), instance->li_line); - panic("excl->ushare"); + kassert_panic("excl->ushare"); } if ((instance->li_flags & LI_EXCLUSIVE) == 0 && witness_watch > 0 && (flags & LOP_EXCLUSIVE) != 0) { @@ -1557,7 +1567,7 @@ found: printf("while share locked from %s:%d\n", fixup_filename(instance->li_file), instance->li_line); - panic("share->uexcl"); + kassert_panic("share->uexcl"); } /* If we are recursed, unrecurse. */ if ((instance->li_flags & LI_RECURSEMASK) > 0) { @@ -1571,7 +1581,7 @@ found: if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) { printf("forbidden unlock of (%s) %s @ %s:%d\n", class->lc_name, lock->lo_name, fixup_filename(file), line); - panic("lock marked norelease"); + kassert_panic("lock marked norelease"); } /* Otherwise, remove this item from the list. */ @@ -1626,7 +1636,8 @@ witness_thread_exit(struct thread *td) witness_list_lock(&lle->ll_children[i], printf); } - panic("Thread %p cannot exit while holding sleeplocks\n", td); + kassert_panic( + "Thread %p cannot exit while holding sleeplocks\n", td); } witness_lock_list_free(lle); } @@ -1707,7 +1718,7 @@ witness_warn(int flags, struct lock_obje } else sched_unpin(); if (flags & WARN_PANIC && n) - panic("%s", __func__); + kassert_panic("%s", __func__); else witness_debugger(n); return (n); @@ -1753,7 +1764,7 @@ enroll(const char *description, struct l } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) typelist = &w_sleep; else - panic("lock class %s is not sleep or spin", + kassert_panic("lock class %s is not sleep or spin", lock_class->lc_name); mtx_lock_spin(&w_mtx); @@ -1784,7 +1795,7 @@ found: w->w_refcount++; mtx_unlock_spin(&w_mtx); if (lock_class != w->w_class) - panic( + kassert_panic( "lock (%s) %s does not match earlier (%s) lock", description, lock_class->lc_name, w->w_class->lc_name); @@ -1918,7 +1929,8 @@ itismychild(struct witness *parent, stru if (!witness_lock_type_equal(parent, child)) { if (witness_cold == 0) mtx_unlock_spin(&w_mtx); - panic("%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " + kassert_panic( + "%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " "the same lock type", __func__, parent->w_name, parent->w_class->lc_name, child->w_name, child->w_class->lc_name); @@ -2192,7 +2204,7 @@ witness_save(struct lock_object *lock, c } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); *filep = instance->li_file; *linep = instance->li_line; @@ -2225,7 +2237,7 @@ witness_restore(struct lock_object *lock } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); lock->lo_witness->w_file = file; lock->lo_witness->w_line = line; @@ -2249,13 +2261,13 @@ witness_assert(const struct lock_object else if ((class->lc_flags & LC_SPINLOCK) != 0) instance = find_instance(PCPU_GET(spinlocks), lock); else { - panic("Lock (%s) %s is not sleep or spin!", + kassert_panic("Lock (%s) %s is not sleep or spin!", class->lc_name, lock->lo_name); } switch (flags) { case LA_UNLOCKED: if (instance != NULL) - panic("Lock (%s) %s locked @ %s:%d.", + kassert_panic("Lock (%s) %s locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; @@ -2269,34 +2281,36 @@ witness_assert(const struct lock_object case LA_XLOCKED | LA_RECURSED: case LA_XLOCKED | LA_NOTRECURSED: if (instance == NULL) { - panic("Lock (%s) %s not locked @ %s:%d.", + kassert_panic("Lock (%s) %s not locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; } if ((flags & LA_XLOCKED) != 0 && (instance->li_flags & LI_EXCLUSIVE) == 0) - panic("Lock (%s) %s not exclusively locked @ %s:%d.", + kassert_panic( + "Lock (%s) %s not exclusively locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_SLOCKED) != 0 && (instance->li_flags & LI_EXCLUSIVE) != 0) - panic("Lock (%s) %s exclusively locked @ %s:%d.", + kassert_panic( + "Lock (%s) %s exclusively locked @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_RECURSED) != 0 && (instance->li_flags & LI_RECURSEMASK) == 0) - panic("Lock (%s) %s not recursed @ %s:%d.", + kassert_panic("Lock (%s) %s not recursed @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); if ((flags & LA_NOTRECURSED) != 0 && (instance->li_flags & LI_RECURSEMASK) != 0) - panic("Lock (%s) %s recursed @ %s:%d.", + kassert_panic("Lock (%s) %s recursed @ %s:%d.", class->lc_name, lock->lo_name, fixup_filename(file), line); break; default: - panic("Invalid lock assertion at %s:%d.", + kassert_panic("Invalid lock assertion at %s:%d.", fixup_filename(file), line); } @@ -2322,7 +2336,7 @@ witness_setflag(struct lock_object *lock } instance = find_instance(lock_list, lock); if (instance == NULL) - panic("%s: lock (%s) %s not locked", __func__, + kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); if (set) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Dec 11 01:12:29 2012 (r244104) +++ head/sys/sys/systm.h Tue Dec 11 01:23:50 2012 (r244105) @@ -72,9 +72,11 @@ extern int vm_guest; /* Running as virt */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; -#ifdef INVARIANTS /* The option is always available */ +#if defined(WITNESS) || defined(INVARIANTS) void kassert_panic(const char *fmt, ...); +#endif +#ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { \ if (__predict_false(!(exp))) \ kassert_panic msg; \ From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 01:28:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81E81695; Tue, 11 Dec 2012 01:28:07 +0000 (UTC) (envelope-from alfred@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 674768FC08; Tue, 11 Dec 2012 01:28:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1S7fo061275; Tue, 11 Dec 2012 01:28:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1S7rh061270; Tue, 11 Dec 2012 01:28:07 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110128.qBB1S7rh061270@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 01:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244106 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 01:28:07 -0000 Author: alfred Date: Tue Dec 11 01:28:06 2012 New Revision: 244106 URL: http://svnweb.freebsd.org/changeset/base/244106 Log: Allow sysctl to filter boot and runtime tunables. Add the following flags to sysctl: -W - show only writable sysctls -T - show only tuneable sysctls This can be used to create a /var/run/sysctl.boot to compare set tunables versus booted tunables. Sponsored by: iXsystems Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Tue Dec 11 01:23:50 2012 (r244105) +++ head/sbin/sysctl/sysctl.8 Tue Dec 11 01:28:06 2012 (r244106) @@ -36,11 +36,11 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoqx +.Op Fl bdehiNnoRTqx .Ar name Ns Op = Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoqx +.Op Fl bdehNnoRTqx .Fl a .Sh DESCRIPTION The @@ -121,6 +121,11 @@ sixteen bytes of the value. Suppress some warnings generated by .Nm to standard error. +.It Fl T +Display only variables that are setable via loader (CTLFLAG_TUN). +.It Fl W +Display only wriable variables that are not statistical. +Useful for determining the set of runtime tunable sysctls. .It Fl X Equivalent to .Fl x a Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Dec 11 01:23:50 2012 (r244105) +++ head/sbin/sysctl/sysctl.c Tue Dec 11 01:28:06 2012 (r244106) @@ -59,7 +59,7 @@ static const char rcsid[] = #include static int aflag, bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, xflag, warncount; +static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); static void parse(const char *); @@ -74,8 +74,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqx] name[=value] ...", - " sysctl [-bdehNnoqx] -a"); + "usage: sysctl [-bdehiNnoqTWx] name[=value] ...", + " sysctl [-bdehNnoqTWx] -a"); exit(1); } @@ -88,7 +88,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehiNnoqwxX")) != -1) { + while ((ch = getopt(argc, argv, "AabdehiNnoqTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -124,10 +124,16 @@ main(int argc, char **argv) case 'q': qflag = 1; break; + case 'T': + Tflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; + case 'W': + Wflag = 1; + break; case 'X': /* compatibility */ aflag = xflag = 1; @@ -181,6 +187,11 @@ parse(const char *string) errx(1, "oid too long: '%s'", string); bufp = strsep(&cp, "="); if (cp != NULL) { + /* Tflag just lists tunables, do not allow assignment */ + if (Tflag || Wflag) { + warnx("Can't set variables when using -T or -W"); + usage(); + } while (isspace(*cp)) cp++; newval = cp; @@ -602,6 +613,14 @@ show_var(int *oid, int nlen) sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; + /* if Wflag then only list sysctls that are writeable and not stats. */ + if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) + return 1; + + /* if Tflag then only list sysctls that are tuneables. */ + if (Tflag && (kind & CTLFLAG_TUN) == 0) + return 1; + switch (ctltype) { case CTLTYPE_STRING: if (!nflag) From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 01:49:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB5C3C8C; Tue, 11 Dec 2012 01:49:57 +0000 (UTC) (envelope-from kevlo@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 AFCA58FC13; Tue, 11 Dec 2012 01:49:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB1nviU065243; Tue, 11 Dec 2012 01:49:57 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB1nvGj065242; Tue, 11 Dec 2012 01:49:57 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201212110149.qBB1nvGj065242@svn.freebsd.org> From: Kevin Lo Date: Tue, 11 Dec 2012 01:49:57 +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: r244107 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 01:49:57 -0000 Author: kevlo Date: Tue Dec 11 01:49:57 2012 New Revision: 244107 URL: http://svnweb.freebsd.org/changeset/base/244107 Log: MFC r235767: Add missing header needed by free(). Reported by: tinderbox Modified: stable/9/lib/libc/net/nsparser.y Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/nsparser.y ============================================================================== --- stable/9/lib/libc/net/nsparser.y Tue Dec 11 01:28:06 2012 (r244106) +++ stable/9/lib/libc/net/nsparser.y Tue Dec 11 01:49:57 2012 (r244107) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #define _NS_PRIVATE #include #include +#include #include #include #include "un-namespace.h" From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 02:40:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E23767D; Tue, 11 Dec 2012 02:40:02 +0000 (UTC) (envelope-from kevlo@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 236398FC15; Tue, 11 Dec 2012 02:40:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB2e2PK074919; Tue, 11 Dec 2012 02:40:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB2e1Dj074917; Tue, 11 Dec 2012 02:40:01 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201212110240.qBB2e1Dj074917@svn.freebsd.org> From: Kevin Lo Date: Tue, 11 Dec 2012 02:40:01 +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: r244108 - stable/9/bin/expr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 02:40:02 -0000 Author: kevlo Date: Tue Dec 11 02:40:01 2012 New Revision: 244108 URL: http://svnweb.freebsd.org/changeset/base/244108 Log: MFC r235771: Remove redundant declaration of yyparse. Reported by: tinderbox Modified: stable/9/bin/expr/expr.y Directory Properties: stable/9/bin/expr/ (props changed) Modified: stable/9/bin/expr/expr.y ============================================================================== --- stable/9/bin/expr/expr.y Tue Dec 11 01:49:57 2012 (r244107) +++ stable/9/bin/expr/expr.y Tue Dec 11 02:40:01 2012 (r244108) @@ -74,7 +74,6 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); -int yyparse(void); %} From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 04:12:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ADCCD70; Tue, 11 Dec 2012 04:12:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id D6B1E8FC13; Tue, 11 Dec 2012 04:12:14 +0000 (UTC) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBB46jDC007867; Tue, 11 Dec 2012 15:06:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBB46XOC013141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Dec 2012 15:06:35 +1100 Date: Tue, 11 Dec 2012 15:06:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Niclas Zeising Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include In-Reply-To: <50C67C29.4070408@freebsd.org> Message-ID: <20121211144118.L959@besplex.bde.org> References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> <50C67C29.4070408@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=fev1UDsF c=1 sm=1 a=5qa8e7V8SQ0A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=2DPJxBlv9iIA:10 a=FPw1pQDZFgkkUDttQVMA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, Jim Harris , Carl Delsey , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 04:12:15 -0000 On Tue, 11 Dec 2012, Niclas Zeising wrote: > On 12/11/12 00:54, Carl Delsey wrote: >> On 12/10/12 16:40, Niclas Zeising wrote: >>> ... >>> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >>> x86/bus.h. It does not use the quad functions. >>> Regards! >> Ok. In that case I won't ifdef out the functions themselves, just the >> KASSERT in case libpciaccess expands in the future to 8 byte accesses >> :-) I had another related change in the works. I'll add this change in. > > Sounds good to me, thank you very much! > Don't forget to ifdef the include o as well as the KASSERTs. Including it at all is namespace pollution. It is a bug for any kernel .c file to not include always and early in its includes, because other includes may have KASSERT()s in them. Not all includes that uses KASSERT() have the namespace pollution, so adding it to some just breaks detection of the bug in some cases. The folowing headers in have the pollution: libkern.h, mbuf.h, pmckern.h, refcount.h. refcount.h only has the pollution if _KERNEL is defined. It handles the problem of polluting userland (though I think userland should be rewarded by syntax errors if it uses refcount.h or machine/bus.h) by supplying a dummy KASSERT() for the !_KERNEL case. The following headers in use KASSERT(): buf.h, eventhandler.h, lock.h, mbuf.h, mount.h, mutex.h, osd.h, proc.h, random.h, refcount.h. Most of them are missing the pollution. The pollution in libkern.h is circular: libkern.h includes systm.h, and systm.h includes libkern.h. systm.h's include of libkern.h and of many other headers like machine/atomic.h and machine/cpufunc.h is standard pollution -- direct includes of these are style bugs, and not including systm.h always and early is a bug because it may break more than KASSERT() (other headers may also use inlines in libkern.h etc.). The circular pollution in libkern.h is used because most files in libkern don't include systm.h directly; they mostly only include libkern.h directly. This and other pollution in mbuf.h is especially disgusting since mbuf.h is one of few headers that I managed to finish the #include de-pollution of in FreeBSD-3 or 2. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 04:19:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35460E0; Tue, 11 Dec 2012 04:19:52 +0000 (UTC) (envelope-from adrian@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 1AD768FC13; Tue, 11 Dec 2012 04:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB4JpwK094173; Tue, 11 Dec 2012 04:19:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB4JpfZ094171; Tue, 11 Dec 2012 04:19:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212110419.qBB4JpfZ094171@svn.freebsd.org> From: Adrian Chadd Date: Tue, 11 Dec 2012 04:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244109 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 04:19:52 -0000 Author: adrian Date: Tue Dec 11 04:19:51 2012 New Revision: 244109 URL: http://svnweb.freebsd.org/changeset/base/244109 Log: There's no need to use a TXQ pointer here; we specifically need the hardware queue ID when queuing to EDMA descriptors. This is a small part of trying to reduce the size of ath_buf entries. Modified: head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Dec 11 02:40:01 2012 (r244108) +++ head/sys/dev/ath/if_ath_tx.c Tue Dec 11 04:19:51 2012 (r244109) @@ -372,7 +372,6 @@ ath_tx_chaindesclist(struct ath_softc *s uint32_t segLenList[4]; int numTxMaps = 1; int isFirstDesc = 1; - int qnum; /* * XXX There's txdma and txdma_mgmt; the descriptor @@ -426,18 +425,16 @@ ath_tx_chaindesclist(struct ath_softc *s bf->bf_daddr + dd->dd_descsize * (dsp + 1)); /* - * XXX this assumes that bfs_txq is the actual destination - * hardware queue at this point. It may not have been assigned, - * it may actually be pointing to the multicast software - * TXQ id. These must be fixed! + * XXX This assumes that bfs_txq is the actual destination + * hardware queue at this point. It may not have been + * assigned, it may actually be pointing to the multicast + * software TXQ id. These must be fixed! */ - qnum = bf->bf_state.bfs_txq->axq_qnum; - ath_hal_filltxdesc(ah, (struct ath_desc *) ds , bufAddrList , segLenList , bf->bf_descid /* XXX desc id */ - , qnum + , bf->bf_state.bfs_tx_queue , isFirstDesc /* first segment */ , i == bf->bf_nseg - 1 /* last segment */ , (struct ath_desc *) ds0 /* first descriptor */ @@ -478,7 +475,8 @@ ath_tx_chaindesclist(struct ath_softc *s isFirstDesc = 0; #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT) - ath_printtxbuf(sc, bf, qnum, 0, 0); + ath_printtxbuf(sc, bf, bf->bf_state.bfs_tx_queue, + 0, 0); #endif bf->bf_lastds = (struct ath_desc *) ds; @@ -697,11 +695,11 @@ ath_tx_setds_11n(struct ath_softc *sc, s * during the beacon setup code. * * XXX TODO: since the AR9300 EDMA TX queue support wants the QCU ID - * as part of the TX descriptor, bf_state.bfs_txq must be updated + * as part of the TX descriptor, bf_state.bfs_tx_queue must be updated * with the actual hardware txq, or all of this will fall apart. * * XXX It may not be a bad idea to just stuff the QCU ID into bf_state - * and retire bfs_txq; then make sure the CABQ QCU ID is populated + * and retire bfs_tx_queue; then make sure the CABQ QCU ID is populated * correctly. */ static void @@ -1840,7 +1838,7 @@ ath_tx_start(struct ath_softc *sc, struc /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = tid; - bf->bf_state.bfs_txq = txq; + bf->bf_state.bfs_tx_queue = txq->axq_qnum; bf->bf_state.bfs_pri = pri; /* @@ -1858,7 +1856,7 @@ ath_tx_start(struct ath_softc *sc, struc * queue, so the descriptor setup functions will * correctly initialise the descriptor 'qcuId' field. */ - bf->bf_state.bfs_txq = sc->sc_cabq; + bf->bf_state.bfs_tx_queue = sc->sc_cabq->axq_qnum; } /* Do the generic frame setup */ @@ -2114,7 +2112,7 @@ ath_tx_raw_start(struct ath_softc *sc, s /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = WME_AC_TO_TID(pri); - bf->bf_state.bfs_txq = sc->sc_ac2q[pri]; + bf->bf_state.bfs_tx_queue = sc->sc_ac2q[pri]->axq_qnum; bf->bf_state.bfs_pri = pri; /* XXX this should be done in ath_tx_setrate() */ @@ -2713,16 +2711,8 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s struct ath_txq *txq, struct ath_buf *bf) { struct ath_tid *tid = &an->an_tid[bf->bf_state.bfs_tid]; -// struct ath_txq *txq = bf->bf_state.bfs_txq; struct ieee80211_tx_ampdu *tap; - if (txq != bf->bf_state.bfs_txq) { - device_printf(sc->sc_dev, "%s: txq %d != bfs_txq %d!\n", - __func__, - txq->axq_qnum, - bf->bf_state.bfs_txq->axq_qnum); - } - ATH_TX_LOCK_ASSERT(sc); tap = ath_tx_get_tx_tid(an, tid->tid); @@ -2821,9 +2811,8 @@ ath_tx_swq(struct ath_softc *sc, struct /* Set local packet state, used to queue packets to hardware */ /* XXX potentially duplicate info, re-check */ - /* XXX remember, txq must be the hardware queue, not the av_mcastq */ bf->bf_state.bfs_tid = tid; - bf->bf_state.bfs_txq = txq; + bf->bf_state.bfs_tx_queue = txq->axq_qnum; bf->bf_state.bfs_pri = pri; /* @@ -4869,8 +4858,6 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft } queuepkt: - //txq = bf->bf_state.bfs_txq; - /* Set completion handler, multi-frame aggregate or not */ bf->bf_comp = ath_tx_aggr_comp; @@ -4936,8 +4923,6 @@ ath_tx_tid_hw_queue_norm(struct ath_soft ATH_TID_REMOVE(tid, bf, bf_list); - KASSERT(txq == bf->bf_state.bfs_txq, ("txqs not equal!\n")); - /* Sanity check! */ if (tid->tid != bf->bf_state.bfs_tid) { device_printf(sc->sc_dev, "%s: bfs_tid %d !=" Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Dec 11 02:40:01 2012 (r244108) +++ head/sys/dev/ath/if_athvar.h Tue Dec 11 04:19:51 2012 (r244109) @@ -241,8 +241,7 @@ struct ath_buf { uint8_t bfs_tid; /* packet TID (or TID_MAX for no QoS) */ uint8_t bfs_nframes; /* number of frames in aggregate */ uint8_t bfs_pri; /* packet AC priority */ - - struct ath_txq *bfs_txq; /* eventual dest hardware TXQ */ + uint8_t bfs_tx_queue; /* destination hardware TX queue */ u_int32_t bfs_aggr:1, /* part of aggregate? */ bfs_aggrburst:1, /* part of aggregate burst? */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 05:11:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D44A6A9D; Tue, 11 Dec 2012 05:11:28 +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 A11BE8FC1A; Tue, 11 Dec 2012 05:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB5BSD8003910; Tue, 11 Dec 2012 05:11:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB5BSt2003909; Tue, 11 Dec 2012 05:11:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212110511.qBB5BSt2003909@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 11 Dec 2012 05:11: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: r244110 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 05:11:28 -0000 Author: kib Date: Tue Dec 11 05:11:28 2012 New Revision: 244110 URL: http://svnweb.freebsd.org/changeset/base/244110 Log: MFC r243868: Do not allocate buffer of the 255 bytes length on the stack. Modified: stable/9/sys/kern/vfs_mountroot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mountroot.c ============================================================================== --- stable/9/sys/kern/vfs_mountroot.c Tue Dec 11 04:19:51 2012 (r244109) +++ stable/9/sys/kern/vfs_mountroot.c Tue Dec 11 05:11:28 2012 (r244110) @@ -672,10 +672,11 @@ parse_mount_dev_present(const char *dev) return (error != 0) ? 0 : 1; } +#define ERRMSGL 255 static int parse_mount(char **conf) { - char errmsg[255]; + char *errmsg; struct mntarg *ma; char *dev, *fs, *opts, *tok; int delay, error, timeout; @@ -707,7 +708,7 @@ parse_mount(char **conf) printf("Trying to mount root from %s:%s [%s]...\n", fs, dev, (opts != NULL) ? opts : ""); - bzero(errmsg, sizeof(errmsg)); + errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO); if (vfs_byname(fs) == NULL) { strlcpy(errmsg, "unknown file system", sizeof(errmsg)); @@ -734,7 +735,7 @@ parse_mount(char **conf) ma = mount_arg(ma, "fstype", fs, -1); ma = mount_arg(ma, "fspath", "/", -1); ma = mount_arg(ma, "from", dev, -1); - ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); ma = mount_arg(ma, "ro", NULL, 0); ma = parse_mountroot_options(ma, opts); error = kernel_mount(ma, MNT_ROOTFS); @@ -748,11 +749,13 @@ parse_mount(char **conf) printf(".\n"); } free(fs, M_TEMP); + free(errmsg, M_TEMP); if (opts != NULL) free(opts, M_TEMP); /* kernel_mount can return -1 on error. */ return ((error < 0) ? EDOOFUS : error); } +#undef ERRMSGL static int vfs_mountroot_parse(struct sbuf *sb, struct mount *mpdevfs) From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 05:59:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C674191D; Tue, 11 Dec 2012 05:59:16 +0000 (UTC) (envelope-from alfred@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 ACAC28FC13; Tue, 11 Dec 2012 05:59:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB5xGbN012409; Tue, 11 Dec 2012 05:59:16 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB5xGAB012408; Tue, 11 Dec 2012 05:59:16 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110559.qBB5xGAB012408@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 05:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244111 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 05:59:16 -0000 Author: alfred Date: Tue Dec 11 05:59:16 2012 New Revision: 244111 URL: http://svnweb.freebsd.org/changeset/base/244111 Log: Fix WITNESS when INVARIANT_SUPPORT is defined. This fixes tinderbox breakage from r244105. Pointed out by: adrian Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 05:11:28 2012 (r244110) +++ head/sys/kern/subr_witness.c Tue Dec 11 05:59:16 2012 (r244111) @@ -2263,6 +2263,7 @@ witness_assert(const struct lock_object else { kassert_panic("Lock (%s) %s is not sleep or spin!", class->lc_name, lock->lo_name); + return; } switch (flags) { case LA_UNLOCKED: From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 06:34:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04B2854F; Tue, 11 Dec 2012 06:34:49 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD368FC14; Tue, 11 Dec 2012 06:34:48 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 10 Dec 2012 22:34:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,256,1355126400"; d="scan'208";a="179264706" Received: from crdelsey-mobl2.amr.corp.intel.com (HELO [10.254.19.32]) ([10.254.19.32]) by AZSMGA002.ch.intel.com with ESMTP; 10 Dec 2012 22:34:34 -0800 Message-ID: <50C6D3FA.6050308@intel.com> Date: Mon, 10 Dec 2012 23:34:34 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r243960 - in head/sys: amd64/include i386/include x86/include References: <201212062233.qB6MXWpP046167@svn.freebsd.org> <50C66E2E.5040302@freebsd.org> <50C67129.6090704@intel.com> <50C672D0.9090908@freebsd.org> <50C6764E.4040804@intel.com> <50C67C29.4070408@freebsd.org> <20121211144118.L959@besplex.bde.org> In-Reply-To: <20121211144118.L959@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Niclas Zeising X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 06:34:49 -0000 On 12/10/2012 9:06 PM, Bruce Evans wrote: > On Tue, 11 Dec 2012, Niclas Zeising wrote: > >> On 12/11/12 00:54, Carl Delsey wrote: >>> On 12/10/12 16:40, Niclas Zeising wrote: >>>> ... >>>> libpciaccess uses bus_space_[read,write]_[1,2,4], which are defined in >>>> x86/bus.h. It does not use the quad functions. >>>> Regards! >>> Ok. In that case I won't ifdef out the functions themselves, just the >>> KASSERT in case libpciaccess expands in the future to 8 byte accesses >>> :-) I had another related change in the works. I'll add this change >>> in. >> >> Sounds good to me, thank you very much! >> Don't forget to ifdef the include o as well as the >> KASSERTs. > > Including it at all is namespace pollution. > > It is a bug for any kernel .c file to not include always > and early in its includes, because other includes may have KASSERT()s > in them. Not all includes that uses KASSERT() have the namespace > pollution, so adding it to some just breaks detection of the bug in > some cases. > > The folowing headers in have the pollution: libkern.h, mbuf.h, > pmckern.h, refcount.h. refcount.h only has the pollution if _KERNEL is > defined. It handles the problem of polluting userland (though I think > userland should be rewarded by syntax errors if it uses refcount.h or > machine/bus.h) by supplying a dummy KASSERT() for the !_KERNEL case. > > The following headers in use KASSERT(): buf.h, eventhandler.h, > lock.h, mbuf.h, mount.h, mutex.h, osd.h, proc.h, random.h, refcount.h. > Most of them are missing the pollution. > > The pollution in libkern.h is circular: libkern.h includes systm.h, and > systm.h includes libkern.h. systm.h's include of libkern.h and of many > other headers like machine/atomic.h and machine/cpufunc.h is standard > pollution -- direct includes of these are style bugs, and not including > systm.h always and early is a bug because it may break more than > KASSERT() > (other headers may also use inlines in libkern.h etc.). The circular > pollution in libkern.h is used because most files in libkern don't > include > systm.h directly; they mostly only include libkern.h directly. > > This and other pollution in mbuf.h is especially disgusting since > mbuf.h is one of few headers that I managed to finish the #include > de-pollution of in FreeBSD-3 or 2. > > Bruce Thanks Bruce. I'll fix that in my change. It will make the bus.h file a bit cleaner. This information should probably be in style(9). It talks a bit about how to include header files but it doesn't mention any of these details that I noticed. I'll take a stab at adding some of this info if I get a chance in the next few weeks. Carl From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 07:08:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D516B2DD; Tue, 11 Dec 2012 07:08:14 +0000 (UTC) (envelope-from alfred@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 B059B8FC15; Tue, 11 Dec 2012 07:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB78Ekf025289; Tue, 11 Dec 2012 07:08:14 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB78EWx025288; Tue, 11 Dec 2012 07:08:14 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212110708.qBB78EWx025288@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 11 Dec 2012 07:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244112 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 07:08:15 -0000 Author: alfred Date: Tue Dec 11 07:08:14 2012 New Revision: 244112 URL: http://svnweb.freebsd.org/changeset/base/244112 Log: Cleanup more of the kassert_panic. fix compile warnings on !amd64 and NULL derefs that would happen if kassert_panic() would return. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Dec 11 05:59:16 2012 (r244111) +++ head/sys/kern/subr_witness.c Tue Dec 11 07:08:14 2012 (r244112) @@ -1446,10 +1446,12 @@ witness_upgrade(struct lock_object *lock fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("upgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); + return; + } if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) != 0) kassert_panic( @@ -1490,10 +1492,12 @@ witness_downgrade(struct lock_object *lo fixup_filename(file), line); } instance = find_instance(curthread->td_sleeplocks, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("downgrade of unlocked lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); + return; + } if (witness_watch) { if ((instance->li_flags & LI_EXCLUSIVE) == 0) kassert_panic( @@ -1544,11 +1548,13 @@ witness_unlock(struct lock_object *lock, * We have to make sure we flush these queues, so just search for * eventual register locks and remove them. */ - if (witness_watch > 0) + if (witness_watch > 0) { kassert_panic("lock (%s) %s not locked @ %s:%d", class->lc_name, lock->lo_name, fixup_filename(file), line); - else return; + } else { + return; + } found: /* First, check for shared/exclusive mismatches. */ @@ -1761,11 +1767,13 @@ enroll(const char *description, struct l return (NULL); else typelist = &w_spin; - } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) + } else if ((lock_class->lc_flags & LC_SLEEPLOCK)) { typelist = &w_sleep; - else + } else { kassert_panic("lock class %s is not sleep or spin", lock_class->lc_name); + return (NULL); + } mtx_lock_spin(&w_mtx); w = witness_hash_get(description); @@ -1921,19 +1929,26 @@ adopt(struct witness *parent, struct wit static void itismychild(struct witness *parent, struct witness *child) { + int unlocked; MPASS(child != NULL && parent != NULL); if (witness_cold == 0) mtx_assert(&w_mtx, MA_OWNED); if (!witness_lock_type_equal(parent, child)) { - if (witness_cold == 0) + if (witness_cold == 0) { + unlocked = 1; mtx_unlock_spin(&w_mtx); + } else { + unlocked = 0; + } kassert_panic( "%s: parent \"%s\" (%s) and child \"%s\" (%s) are not " "the same lock type", __func__, parent->w_name, parent->w_class->lc_name, child->w_name, child->w_class->lc_name); + if (unlocked) + mtx_lock_spin(&w_mtx); } adopt(parent, child); } @@ -2203,9 +2218,11 @@ witness_save(struct lock_object *lock, c lock_list = PCPU_GET(spinlocks); } instance = find_instance(lock_list, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); + return; + } *filep = instance->li_file; *linep = instance->li_line; } @@ -2241,6 +2258,8 @@ witness_restore(struct lock_object *lock class->lc_name, lock->lo_name); lock->lo_witness->w_file = file; lock->lo_witness->w_line = line; + if (instance == NULL) + return; instance->li_file = file; instance->li_line = line; } @@ -2336,9 +2355,11 @@ witness_setflag(struct lock_object *lock lock_list = PCPU_GET(spinlocks); } instance = find_instance(lock_list, lock); - if (instance == NULL) + if (instance == NULL) { kassert_panic("%s: lock (%s) %s not locked", __func__, class->lc_name, lock->lo_name); + return; + } if (set) instance->li_flags |= flag; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 08:37:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5540BC54; Tue, 11 Dec 2012 08:37:09 +0000 (UTC) (envelope-from glebius@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 1F9878FC17; Tue, 11 Dec 2012 08:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB8b8YI042269; Tue, 11 Dec 2012 08:37:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB8b8m8042268; Tue, 11 Dec 2012 08:37:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212110837.qBB8b8m8042268@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Dec 2012 08:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244113 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 08:37:09 -0000 Author: glebius Date: Tue Dec 11 08:37:08 2012 New Revision: 244113 URL: http://svnweb.freebsd.org/changeset/base/244113 Log: Merge 1.127 from OpenBSD, that closes a regression from 1.125 (merged as r242694): do better detection of when we have a better version of the tcp sequence windows than our peer. this resolves the last of the pfsync traffic storm issues ive been able to produce, and therefore makes it possible to do usable active-active statuful firewalls with pf. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Tue Dec 11 07:08:14 2012 (r244112) +++ head/sys/netpfil/pf/if_pfsync.c Tue Dec 11 08:37:08 2012 (r244113) @@ -47,7 +47,7 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions - * 1.125 - rewrite merge or stale processing + * 1.125, 1.127 - rewrite merge or stale processing * 1.128 - cleanups * 1.146 - bzero() mbuf before sparsely filling it with data * 1.170 - SIOCSIFMTU checks @@ -787,12 +787,15 @@ pfsync_upd_tcp(struct pf_state *st, stru if ((st->src.state > src->state && (st->src.state < PF_TCPS_PROXY_SRC || src->state >= PF_TCPS_PROXY_SRC)) || - SEQ_GT(st->src.seqlo, ntohl(src->seqlo))) + + (st->src.state == src->state && + SEQ_GT(st->src.seqlo, ntohl(src->seqlo)))) sync++; else pf_state_peer_ntoh(src, &st->src); - if (st->dst.state > dst->state || + if ((st->dst.state > dst->state) || + (st->dst.state >= TCPS_SYN_SENT && SEQ_GT(st->dst.seqlo, ntohl(dst->seqlo)))) sync++; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 08:43:01 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A06C6ECE; Tue, 11 Dec 2012 08:43:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 594EC8FC0C; Tue, 11 Dec 2012 08:43:00 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA22885; Tue, 11 Dec 2012 10:42:59 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TiLQY-000K4m-JR; Tue, 11 Dec 2012 10:42:58 +0200 Message-ID: <50C6F211.4010701@FreeBSD.org> Date: Tue, 11 Dec 2012 10:42:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> In-Reply-To: <201212110708.qBB78EWx025288@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 08:43:01 -0000 on 11/12/2012 09:08 Alfred Perlstein said the following: > Author: alfred > Date: Tue Dec 11 07:08:14 2012 > New Revision: 244112 > URL: http://svnweb.freebsd.org/changeset/base/244112 > > Log: > Cleanup more of the kassert_panic. > > fix compile warnings on !amd64 and NULL derefs that would happen > if kassert_panic() would return. Would it make sense to develop this feature in a branch? Get it compiled, tested and reviewed, and only then merged? Especially given that this is infrastructural code and not an isolated driver. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 09:38:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A64368EB; Tue, 11 Dec 2012 09:38:13 +0000 (UTC) (envelope-from bapt@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 896CE8FC08; Tue, 11 Dec 2012 09:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBB9cDkT053553; Tue, 11 Dec 2012 09:38:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBB9cDMr053552; Tue, 11 Dec 2012 09:38:13 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212110938.qBB9cDMr053552@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 11 Dec 2012 09:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244114 - head/sys/dev/agp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 09:38:13 -0000 Author: bapt Date: Tue Dec 11 09:38:12 2012 New Revision: 244114 URL: http://svnweb.freebsd.org/changeset/base/244114 Log: Add pci id for the xeon hd4000 (IvyBridge server GT2) Submitted by: François Tigeot Obtained from: dragonfly MFC after: 3 days Modified: head/sys/dev/agp/agp_i810.c Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Tue Dec 11 08:37:08 2012 (r244113) +++ head/sys/dev/agp/agp_i810.c Tue Dec 11 09:38:12 2012 (r244114) @@ -729,6 +729,11 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x016a8086, + .name = "IvyBridge server GT2 IG", + .driver = &agp_i810_sb_driver + }, + { .devid = 0, } }; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 12:32:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83EAEC63; Tue, 11 Dec 2012 12:32:14 +0000 (UTC) (envelope-from emaste@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 501698FC21; Tue, 11 Dec 2012 12:32:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCWEW5090957; Tue, 11 Dec 2012 12:32:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCWCsx090938; Tue, 11 Dec 2012 12:32:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111232.qBBCWCsx090938@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:32: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: r244115 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:32:14 -0000 Author: emaste Date: Tue Dec 11 12:32:11 2012 New Revision: 244115 URL: http://svnweb.freebsd.org/changeset/base/244115 Log: MFC r242936: Set optimized_out instead of reporting an error. This provides a better display when debugging code compiled with optimization on. GDB git revision e8395b4efd184f745070afb953f451f99e922be7 (prior to GDB's switch to GPLv3), modified for the interfaces provided by GDB 6.1.1. 2005-02-28 Daniel Jacobowitz * dwarf2loc.c (loclist_read_variable): Set optimized_out instead of reporting an error. * valprint.c (value_check_printable): New function. (common_val_print): New function. Use value_check_printable. (value_print): Use value_check_printable. * value.h (common_val_print): Add prototype. * c-valprint.c (c_val_print): Use common_val_print. * cp-valprint.c (cp_print_value_fields): Likewise. (cp_print_hpacc_virtual_table_entries): Likewise. * f-valprint.c (f_val_print): Likewise. * jv-valprint.c (java_value_print, java_print_value_fields): Likewise. * scm-valprint.c (scm_value_print): Likewise. * stack.c (print_frame_args): Likewise. * varobj.c (c_value_of_variable): Likewise. * p-valprint.c (pascal_val_print, pascal_value_print): Likewise. (pascal_object_print_value_fields): Likewise. Update call to pascal_object_print_static_field. (pascal_object_print_static_field): Remove TYPE argument. Use common_val_print. Sponsored by: ADARA Networks Modified: stable/9/contrib/gdb/gdb/c-valprint.c stable/9/contrib/gdb/gdb/cp-valprint.c stable/9/contrib/gdb/gdb/dwarf2loc.c stable/9/contrib/gdb/gdb/f-valprint.c stable/9/contrib/gdb/gdb/jv-valprint.c stable/9/contrib/gdb/gdb/p-valprint.c stable/9/contrib/gdb/gdb/scm-valprint.c stable/9/contrib/gdb/gdb/stack.c stable/9/contrib/gdb/gdb/valprint.c stable/9/contrib/gdb/gdb/value.h stable/9/contrib/gdb/gdb/varobj.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/c-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/c-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/c-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -232,9 +232,8 @@ c_val_print (struct type *type, char *va wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, + deref_ref, recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -283,15 +282,8 @@ c_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse, pretty); } else fputs_filtered ("???", stream); Modified: stable/9/contrib/gdb/gdb/cp-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -361,8 +361,7 @@ cp_print_value_fields (struct type *type (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr + offset, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), - 0, 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -426,8 +425,7 @@ cp_print_value_fields (struct type *type v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long), *(unsigned long *) (valaddr + offset)); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); fields_seen = 1; if (vtblprint) @@ -791,8 +789,7 @@ cp_print_hpacc_virtual_table_entries (st VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */ /* print out the entry */ - val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (vf, stream, format, 0, recurse + 1, pretty); field_physname = TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi); /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */ Modified: stable/9/contrib/gdb/gdb/dwarf2loc.c ============================================================================== --- stable/9/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 12:32:11 2012 (r244115) @@ -492,9 +492,14 @@ loclist_read_variable (struct symbol *sy data = find_location_expression (dlbaton, &size, frame ? get_frame_pc (frame) : 0); if (data == NULL) - error ("Variable \"%s\" is not available.", SYMBOL_NATURAL_NAME (symbol)); - - val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, dlbaton->objfile); + { + val = allocate_value (SYMBOL_TYPE (symbol)); + VALUE_LVAL (val) = not_lval; + VALUE_OPTIMIZED_OUT (val) = 1; + } + else + val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, + dlbaton->objfile); return val; } Modified: stable/9/contrib/gdb/gdb/f-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/f-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/f-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -444,15 +444,8 @@ f_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, recurse, + pretty); } else fputs_filtered ("???", stream); Modified: stable/9/contrib/gdb/gdb/jv-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -189,8 +189,7 @@ java_value_print (struct value *val, str else fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 2, 1, pretty); + common_val_print (v, stream, format, 2, 1, pretty); things_printed++; i += reps; @@ -242,8 +241,7 @@ java_value_print (struct value *val, str return 0; } - return (val_print (type, VALUE_CONTENTS (val), 0, address, - stream, format, 1, 0, pretty)); + return common_val_print (val, stream, format, 1, 0, pretty); } /* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the @@ -391,8 +389,7 @@ java_print_value_fields (struct type *ty v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, - 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -411,9 +408,8 @@ java_print_value_fields (struct type *ty struct type *t = check_typedef (VALUE_TYPE (v)); if (TYPE_CODE (t) == TYPE_CODE_STRUCT) v = value_addr (v); - val_print (VALUE_TYPE (v), - VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v), - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, + pretty); } } else if (TYPE_FIELD_TYPE (type, i) == NULL) Modified: stable/9/contrib/gdb/gdb/p-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/p-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/p-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -238,9 +238,8 @@ pascal_val_print (struct type *type, cha wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, deref_ref, + recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -291,10 +290,8 @@ pascal_val_print (struct type *type, cha unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), 0, - VALUE_ADDRESS (deref_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse + 1, pretty); } else fputs_filtered ("???", stream); @@ -565,9 +562,7 @@ pascal_value_print (struct value *val, s fprintf_filtered (stream, ") "); } } - return val_print (type, VALUE_CONTENTS (val), VALUE_EMBEDDED_OFFSET (val), - VALUE_ADDRESS (val) + VALUE_OFFSET (val), - stream, format, 1, 0, pretty); + return common_val_print (val, stream, format, 1, 0, pretty); } @@ -583,7 +578,7 @@ static int pascal_static_field_print; /* static struct obstack dont_print_vb_obstack; static struct obstack dont_print_statmem_obstack; -static void pascal_object_print_static_field (struct type *, struct value *, +static void pascal_object_print_static_field (struct value *, struct ui_file *, int, int, enum val_prettyprint); @@ -844,8 +839,7 @@ pascal_object_print_value_fields (struct v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -864,9 +858,8 @@ pascal_object_print_value_fields (struct if (v == NULL) fputs_filtered ("", stream); else - pascal_object_print_static_field (TYPE_FIELD_TYPE (type, i), v, - stream, format, recurse + 1, - pretty); + pascal_object_print_static_field (v, stream, format, + recurse + 1, pretty); } else { @@ -1005,14 +998,16 @@ pascal_object_print_value (struct type * static member classes in an obstack and refuse to print them more than once. - VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY + VAL contains the value to print, STREAM, RECURSE, and PRETTY have the same meanings as in c_val_print. */ static void -pascal_object_print_static_field (struct type *type, struct value *val, +pascal_object_print_static_field (struct value *val, struct ui_file *stream, int format, int recurse, enum val_prettyprint pretty) { + struct type *type = VALUE_TYPE (val); + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) { CORE_ADDR *first_dont_print; @@ -1041,8 +1036,7 @@ pascal_object_print_static_field (struct stream, format, recurse, pretty, NULL, 1); return; } - val_print (type, VALUE_CONTENTS (val), 0, VALUE_ADDRESS (val), - stream, format, 0, recurse, pretty); + common_val_print (val, stream, format, 0, recurse, pretty); } void Modified: stable/9/contrib/gdb/gdb/scm-valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -390,6 +390,5 @@ int scm_value_print (struct value *val, struct ui_file *stream, int format, enum val_prettyprint pretty) { - return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), stream, format, 1, 0, pretty)); + return (common_val_print (val, stream, format, 1, 0, pretty)); } Modified: stable/9/contrib/gdb/gdb/stack.c ============================================================================== --- stable/9/contrib/gdb/gdb/stack.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/stack.c Tue Dec 11 12:32:11 2012 (r244115) @@ -354,9 +354,7 @@ print_frame_args (struct symbol *func, s if (val) { - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), - stb->stream, 0, 0, 2, Val_no_prettyprint); + common_val_print (val, stb->stream, 0, 0, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); } else Modified: stable/9/contrib/gdb/gdb/valprint.c ============================================================================== --- stable/9/contrib/gdb/gdb/valprint.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/valprint.c Tue Dec 11 12:32:11 2012 (r244115) @@ -150,25 +150,66 @@ val_print (struct type *type, char *vala stream, format, deref_ref, recurse, pretty)); } -/* Print the value VAL in C-ish syntax on stream STREAM. - FORMAT is a format-letter, or 0 for print in natural format of data type. - If the object printed is a string pointer, returns - the number of string bytes printed. */ +/* Check whether the value VAL is printable. Return 1 if it is; + return 0 and print an appropriate error message to STREAM if it + is not. */ -int -value_print (struct value *val, struct ui_file *stream, int format, - enum val_prettyprint pretty) +static int +value_check_printable (struct value *val, struct ui_file *stream) { if (val == 0) { - printf_filtered ("
"); + fprintf_filtered (stream, "
"); return 0; } + if (VALUE_OPTIMIZED_OUT (val)) { - printf_filtered (""); + fprintf_filtered (stream, ""); return 0; } + + return 1; +} + +/* Print the value VAL onto stream STREAM according to FORMAT (a + letter, or 0 for natural format using TYPE). + + If DEREF_REF is nonzero, then dereference references, otherwise just print + them like pointers. + + The PRETTY parameter controls prettyprinting. + + If the data are a string pointer, returns the number of string characters + printed. + + This is a preferable interface to val_print, above, because it uses + GDB's value mechanism. */ + +int +common_val_print (struct value *val, struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + + return val_print (VALUE_TYPE(val), VALUE_CONTENTS_ALL (val), + VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val), + stream, format, deref_ref, recurse, pretty); +} + +/* Print the value VAL in C-ish syntax on stream STREAM. + FORMAT is a format-letter, or 0 for print in natural format of data type. + If the object printed is a string pointer, returns + the number of string bytes printed. */ + +int +value_print (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + return LA_VALUE_PRINT (val, stream, format, pretty); } Modified: stable/9/contrib/gdb/gdb/value.h ============================================================================== --- stable/9/contrib/gdb/gdb/value.h Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/value.h Tue Dec 11 12:32:11 2012 (r244115) @@ -523,6 +523,11 @@ extern int val_print (struct type * type int deref_ref, int recurse, enum val_prettyprint pretty); +extern int common_val_print (struct value *val, + struct ui_file *stream, int format, + int deref_ref, int recurse, + enum val_prettyprint pretty); + extern int val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream); extern void print_variable_value (struct symbol * var, Modified: stable/9/contrib/gdb/gdb/varobj.c ============================================================================== --- stable/9/contrib/gdb/gdb/varobj.c Tue Dec 11 09:38:12 2012 (r244114) +++ stable/9/contrib/gdb/gdb/varobj.c Tue Dec 11 12:32:11 2012 (r244115) @@ -2093,10 +2093,8 @@ c_value_of_variable (struct varobj *var) if (VALUE_LAZY (var->value)) gdb_value_fetch_lazy (var->value); - val_print (VALUE_TYPE (var->value), - VALUE_CONTENTS_RAW (var->value), 0, - VALUE_ADDRESS (var->value), stb, - format_code[(int) var->format], 1, 0, 0); + common_val_print (var->value, stb, + format_code[(int) var->format], 1, 0, 0); thevalue = ui_file_xstrdup (stb, &dummy); do_cleanups (old_chain); return thevalue; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 12:34:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49E7A104; Tue, 11 Dec 2012 12:34:47 +0000 (UTC) (envelope-from emaste@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 14DE88FC13; Tue, 11 Dec 2012 12:34:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCYkw4091768; Tue, 11 Dec 2012 12:34:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCYksK091767; Tue, 11 Dec 2012 12:34:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111234.qBBCYksK091767@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:34:46 +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: r244116 - stable/9/contrib/gdb/gdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:34:47 -0000 Author: emaste Date: Tue Dec 11 12:34:46 2012 New Revision: 244116 URL: http://svnweb.freebsd.org/changeset/base/244116 Log: MFC r242943: Do not unwind past a zero PC frame. This improves GDB usability when debugging code compiled with optimization. Upstream GDB revision f0031b6d3ae9b164b3747986ab898190bd4dcf8c (prior to GDB's switch to GPLv3), with frame_debug_got_null_frame expanded inline. | 2004-12-12 Andrew Cagney | | * frame.c (get_prev_frame): When unwinding normal frames, check | that the PC isn't zero. Sponsored by: ADARA Networks Modified: stable/9/contrib/gdb/gdb/frame.c Directory Properties: stable/9/contrib/gdb/ (props changed) Modified: stable/9/contrib/gdb/gdb/frame.c ============================================================================== --- stable/9/contrib/gdb/gdb/frame.c Tue Dec 11 12:32:11 2012 (r244115) +++ stable/9/contrib/gdb/gdb/frame.c Tue Dec 11 12:34:46 2012 (r244116) @@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_ return NULL; } + /* Assume that the only way to get a zero PC is through something + like a SIGSEGV or a dummy frame, and hence that NORMAL frames + will never unwind a zero PC. */ + if (this_frame->level > 0 + && get_frame_type (this_frame) == NORMAL_FRAME + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { + if (frame_debug) + { + fprintf_unfiltered (gdb_stdlog, "-> "); + fprint_frame (gdb_stdlog, this_frame->prev); + fprintf_unfiltered (gdb_stdlog, " // zero PC \n"); + } + return NULL; + } + /* Only try to do the unwind once. */ if (this_frame->prev_p) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 12:40:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1C163DA; Tue, 11 Dec 2012 12:40:54 +0000 (UTC) (envelope-from glebius@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 B506B8FC08; Tue, 11 Dec 2012 12:40:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCesIW092915; Tue, 11 Dec 2012 12:40:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCesUU092914; Tue, 11 Dec 2012 12:40:54 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212111240.qBBCesUU092914@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 11 Dec 2012 12:40: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: r244117 - stable/9/bin/expr X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:40:54 -0000 Author: glebius Date: Tue Dec 11 12:40:54 2012 New Revision: 244117 URL: http://svnweb.freebsd.org/changeset/base/244117 Log: Revert r244108. yyparse() declaration isn't redundant in stable/9. Reported by: tinderbox :) Modified: stable/9/bin/expr/expr.y Modified: stable/9/bin/expr/expr.y ============================================================================== --- stable/9/bin/expr/expr.y Tue Dec 11 12:34:46 2012 (r244116) +++ stable/9/bin/expr/expr.y Tue Dec 11 12:40:54 2012 (r244117) @@ -74,6 +74,7 @@ int to_integer(struct val *); void to_string(struct val *); int yyerror(const char *); int yylex(void); +int yyparse(void); %} From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 12:57:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 811DD93E; Tue, 11 Dec 2012 12:57:11 +0000 (UTC) (envelope-from emaste@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 636FA8FC12; Tue, 11 Dec 2012 12:57:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCvBb8095810; Tue, 11 Dec 2012 12:57:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCv9u4095793; Tue, 11 Dec 2012 12:57:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111257.qBBCv9u4095793@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:57:09 +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: r244118 - stable/8/contrib/gdb/gdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:57:11 -0000 Author: emaste Date: Tue Dec 11 12:57:08 2012 New Revision: 244118 URL: http://svnweb.freebsd.org/changeset/base/244118 Log: MFC r242936: Set optimized_out instead of reporting an error. This provides a better display when debugging code compiled with optimization on. GDB git revision e8395b4efd184f745070afb953f451f99e922be7 (prior to GDB's switch to GPLv3), modified for the interfaces provided by GDB 6.1.1. 2005-02-28 Daniel Jacobowitz * dwarf2loc.c (loclist_read_variable): Set optimized_out instead of reporting an error. * valprint.c (value_check_printable): New function. (common_val_print): New function. Use value_check_printable. (value_print): Use value_check_printable. * value.h (common_val_print): Add prototype. * c-valprint.c (c_val_print): Use common_val_print. * cp-valprint.c (cp_print_value_fields): Likewise. (cp_print_hpacc_virtual_table_entries): Likewise. * f-valprint.c (f_val_print): Likewise. * jv-valprint.c (java_value_print, java_print_value_fields): Likewise. * scm-valprint.c (scm_value_print): Likewise. * stack.c (print_frame_args): Likewise. * varobj.c (c_value_of_variable): Likewise. * p-valprint.c (pascal_val_print, pascal_value_print): Likewise. (pascal_object_print_value_fields): Likewise. Update call to pascal_object_print_static_field. (pascal_object_print_static_field): Remove TYPE argument. Use common_val_print. Sponsored by: ADARA Networks Modified: stable/8/contrib/gdb/gdb/c-valprint.c stable/8/contrib/gdb/gdb/cp-valprint.c stable/8/contrib/gdb/gdb/dwarf2loc.c stable/8/contrib/gdb/gdb/f-valprint.c stable/8/contrib/gdb/gdb/jv-valprint.c stable/8/contrib/gdb/gdb/p-valprint.c stable/8/contrib/gdb/gdb/scm-valprint.c stable/8/contrib/gdb/gdb/stack.c stable/8/contrib/gdb/gdb/valprint.c stable/8/contrib/gdb/gdb/value.h stable/8/contrib/gdb/gdb/varobj.c Directory Properties: stable/8/contrib/gdb/ (props changed) Modified: stable/8/contrib/gdb/gdb/c-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/c-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/c-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -232,9 +232,8 @@ c_val_print (struct type *type, char *va wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, + deref_ref, recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -283,15 +282,8 @@ c_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse, pretty); } else fputs_filtered ("???", stream); Modified: stable/8/contrib/gdb/gdb/cp-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/cp-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -361,8 +361,7 @@ cp_print_value_fields (struct type *type (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr + offset, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), - 0, 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -426,8 +425,7 @@ cp_print_value_fields (struct type *type v = value_from_pointer (lookup_pointer_type (builtin_type_unsigned_long), *(unsigned long *) (valaddr + offset)); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); fields_seen = 1; if (vtblprint) @@ -791,8 +789,7 @@ cp_print_hpacc_virtual_table_entries (st VALUE_TYPE (vf) = VALUE_TYPE (v); /* make it a pointer */ /* print out the entry */ - val_print (VALUE_TYPE (vf), VALUE_CONTENTS (vf), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (vf, stream, format, 0, recurse + 1, pretty); field_physname = TYPE_FN_FIELD_PHYSNAME (TYPE_FN_FIELDLIST1 (type, fn), oi); /* pai: (temp) FIXME Maybe this should be DMGL_ANSI */ Modified: stable/8/contrib/gdb/gdb/dwarf2loc.c ============================================================================== --- stable/8/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/dwarf2loc.c Tue Dec 11 12:57:08 2012 (r244118) @@ -492,9 +492,14 @@ loclist_read_variable (struct symbol *sy data = find_location_expression (dlbaton, &size, frame ? get_frame_pc (frame) : 0); if (data == NULL) - error ("Variable \"%s\" is not available.", SYMBOL_NATURAL_NAME (symbol)); - - val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, dlbaton->objfile); + { + val = allocate_value (SYMBOL_TYPE (symbol)); + VALUE_LVAL (val) = not_lval; + VALUE_OPTIMIZED_OUT (val) = 1; + } + else + val = dwarf2_evaluate_loc_desc (symbol, frame, data, size, + dlbaton->objfile); return val; } Modified: stable/8/contrib/gdb/gdb/f-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/f-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/f-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -444,15 +444,8 @@ f_val_print (struct type *type, char *va unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), - 0, - VALUE_ADDRESS (deref_val), - stream, - format, - deref_ref, - recurse, - pretty); + common_val_print (deref_val, stream, format, deref_ref, recurse, + pretty); } else fputs_filtered ("???", stream); Modified: stable/8/contrib/gdb/gdb/jv-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/jv-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -189,8 +189,7 @@ java_value_print (struct value *val, str else fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1); - val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0, - stream, format, 2, 1, pretty); + common_val_print (v, stream, format, 2, 1, pretty); things_printed++; i += reps; @@ -242,8 +241,7 @@ java_value_print (struct value *val, str return 0; } - return (val_print (type, VALUE_CONTENTS (val), 0, address, - stream, format, 1, 0, pretty)); + return common_val_print (val, stream, format, 1, 0, pretty); } /* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the @@ -391,8 +389,7 @@ java_print_value_fields (struct type *ty v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, - 0, stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -411,9 +408,8 @@ java_print_value_fields (struct type *ty struct type *t = check_typedef (VALUE_TYPE (v)); if (TYPE_CODE (t) == TYPE_CODE_STRUCT) v = value_addr (v); - val_print (VALUE_TYPE (v), - VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v), - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, + pretty); } } else if (TYPE_FIELD_TYPE (type, i) == NULL) Modified: stable/8/contrib/gdb/gdb/p-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/p-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/p-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -238,9 +238,8 @@ pascal_val_print (struct type *type, cha wtype = TYPE_TARGET_TYPE (type); } vt_val = value_at (wtype, vt_address, NULL); - val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0, - VALUE_ADDRESS (vt_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (vt_val, stream, format, deref_ref, + recurse + 1, pretty); if (pretty) { fprintf_filtered (stream, "\n"); @@ -291,10 +290,8 @@ pascal_val_print (struct type *type, cha unpack_pointer (lookup_pointer_type (builtin_type_void), valaddr + embedded_offset), NULL); - val_print (VALUE_TYPE (deref_val), - VALUE_CONTENTS (deref_val), 0, - VALUE_ADDRESS (deref_val), stream, format, - deref_ref, recurse + 1, pretty); + common_val_print (deref_val, stream, format, deref_ref, + recurse + 1, pretty); } else fputs_filtered ("???", stream); @@ -565,9 +562,7 @@ pascal_value_print (struct value *val, s fprintf_filtered (stream, ") "); } } - return val_print (type, VALUE_CONTENTS (val), VALUE_EMBEDDED_OFFSET (val), - VALUE_ADDRESS (val) + VALUE_OFFSET (val), - stream, format, 1, 0, pretty); + return common_val_print (val, stream, format, 1, 0, pretty); } @@ -583,7 +578,7 @@ static int pascal_static_field_print; /* static struct obstack dont_print_vb_obstack; static struct obstack dont_print_statmem_obstack; -static void pascal_object_print_static_field (struct type *, struct value *, +static void pascal_object_print_static_field (struct value *, struct ui_file *, int, int, enum val_prettyprint); @@ -844,8 +839,7 @@ pascal_object_print_value_fields (struct v = value_from_longest (TYPE_FIELD_TYPE (type, i), unpack_field_as_long (type, valaddr, i)); - val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0, - stream, format, 0, recurse + 1, pretty); + common_val_print (v, stream, format, 0, recurse + 1, pretty); } } else @@ -864,9 +858,8 @@ pascal_object_print_value_fields (struct if (v == NULL) fputs_filtered ("", stream); else - pascal_object_print_static_field (TYPE_FIELD_TYPE (type, i), v, - stream, format, recurse + 1, - pretty); + pascal_object_print_static_field (v, stream, format, + recurse + 1, pretty); } else { @@ -1005,14 +998,16 @@ pascal_object_print_value (struct type * static member classes in an obstack and refuse to print them more than once. - VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY + VAL contains the value to print, STREAM, RECURSE, and PRETTY have the same meanings as in c_val_print. */ static void -pascal_object_print_static_field (struct type *type, struct value *val, +pascal_object_print_static_field (struct value *val, struct ui_file *stream, int format, int recurse, enum val_prettyprint pretty) { + struct type *type = VALUE_TYPE (val); + if (TYPE_CODE (type) == TYPE_CODE_STRUCT) { CORE_ADDR *first_dont_print; @@ -1041,8 +1036,7 @@ pascal_object_print_static_field (struct stream, format, recurse, pretty, NULL, 1); return; } - val_print (type, VALUE_CONTENTS (val), 0, VALUE_ADDRESS (val), - stream, format, 0, recurse, pretty); + common_val_print (val, stream, format, 0, recurse, pretty); } void Modified: stable/8/contrib/gdb/gdb/scm-valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/scm-valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -390,6 +390,5 @@ int scm_value_print (struct value *val, struct ui_file *stream, int format, enum val_prettyprint pretty) { - return (val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), stream, format, 1, 0, pretty)); + return (common_val_print (val, stream, format, 1, 0, pretty)); } Modified: stable/8/contrib/gdb/gdb/stack.c ============================================================================== --- stable/8/contrib/gdb/gdb/stack.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/stack.c Tue Dec 11 12:57:08 2012 (r244118) @@ -354,9 +354,7 @@ print_frame_args (struct symbol *func, s if (val) { - val_print (VALUE_TYPE (val), VALUE_CONTENTS (val), 0, - VALUE_ADDRESS (val), - stb->stream, 0, 0, 2, Val_no_prettyprint); + common_val_print (val, stb->stream, 0, 0, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); } else Modified: stable/8/contrib/gdb/gdb/valprint.c ============================================================================== --- stable/8/contrib/gdb/gdb/valprint.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/valprint.c Tue Dec 11 12:57:08 2012 (r244118) @@ -150,25 +150,66 @@ val_print (struct type *type, char *vala stream, format, deref_ref, recurse, pretty)); } -/* Print the value VAL in C-ish syntax on stream STREAM. - FORMAT is a format-letter, or 0 for print in natural format of data type. - If the object printed is a string pointer, returns - the number of string bytes printed. */ +/* Check whether the value VAL is printable. Return 1 if it is; + return 0 and print an appropriate error message to STREAM if it + is not. */ -int -value_print (struct value *val, struct ui_file *stream, int format, - enum val_prettyprint pretty) +static int +value_check_printable (struct value *val, struct ui_file *stream) { if (val == 0) { - printf_filtered ("
"); + fprintf_filtered (stream, "
"); return 0; } + if (VALUE_OPTIMIZED_OUT (val)) { - printf_filtered (""); + fprintf_filtered (stream, ""); return 0; } + + return 1; +} + +/* Print the value VAL onto stream STREAM according to FORMAT (a + letter, or 0 for natural format using TYPE). + + If DEREF_REF is nonzero, then dereference references, otherwise just print + them like pointers. + + The PRETTY parameter controls prettyprinting. + + If the data are a string pointer, returns the number of string characters + printed. + + This is a preferable interface to val_print, above, because it uses + GDB's value mechanism. */ + +int +common_val_print (struct value *val, struct ui_file *stream, int format, + int deref_ref, int recurse, enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + + return val_print (VALUE_TYPE(val), VALUE_CONTENTS_ALL (val), + VALUE_EMBEDDED_OFFSET (val), VALUE_ADDRESS (val), + stream, format, deref_ref, recurse, pretty); +} + +/* Print the value VAL in C-ish syntax on stream STREAM. + FORMAT is a format-letter, or 0 for print in natural format of data type. + If the object printed is a string pointer, returns + the number of string bytes printed. */ + +int +value_print (struct value *val, struct ui_file *stream, int format, + enum val_prettyprint pretty) +{ + if (!value_check_printable (val, stream)) + return 0; + return LA_VALUE_PRINT (val, stream, format, pretty); } Modified: stable/8/contrib/gdb/gdb/value.h ============================================================================== --- stable/8/contrib/gdb/gdb/value.h Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/value.h Tue Dec 11 12:57:08 2012 (r244118) @@ -523,6 +523,11 @@ extern int val_print (struct type * type int deref_ref, int recurse, enum val_prettyprint pretty); +extern int common_val_print (struct value *val, + struct ui_file *stream, int format, + int deref_ref, int recurse, + enum val_prettyprint pretty); + extern int val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream); extern void print_variable_value (struct symbol * var, Modified: stable/8/contrib/gdb/gdb/varobj.c ============================================================================== --- stable/8/contrib/gdb/gdb/varobj.c Tue Dec 11 12:40:54 2012 (r244117) +++ stable/8/contrib/gdb/gdb/varobj.c Tue Dec 11 12:57:08 2012 (r244118) @@ -2093,10 +2093,8 @@ c_value_of_variable (struct varobj *var) if (VALUE_LAZY (var->value)) gdb_value_fetch_lazy (var->value); - val_print (VALUE_TYPE (var->value), - VALUE_CONTENTS_RAW (var->value), 0, - VALUE_ADDRESS (var->value), stb, - format_code[(int) var->format], 1, 0, 0); + common_val_print (var->value, stb, + format_code[(int) var->format], 1, 0, 0); thevalue = ui_file_xstrdup (stb, &dummy); do_cleanups (old_chain); return thevalue; From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 12:58:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AC2DC27; Tue, 11 Dec 2012 12:58:28 +0000 (UTC) (envelope-from emaste@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 54A628FC13; Tue, 11 Dec 2012 12:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCwS2v096139; Tue, 11 Dec 2012 12:58:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCwSg3096138; Tue, 11 Dec 2012 12:58:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111258.qBBCwSg3096138@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:58:28 +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: r244119 - stable/8/contrib/gdb/gdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:58:28 -0000 Author: emaste Date: Tue Dec 11 12:58:27 2012 New Revision: 244119 URL: http://svnweb.freebsd.org/changeset/base/244119 Log: MFC r242943: Do not unwind past a zero PC frame. This improves GDB usability when debugging code compiled with optimization. Upstream GDB revision f0031b6d3ae9b164b3747986ab898190bd4dcf8c (prior to GDB's switch to GPLv3), with frame_debug_got_null_frame expanded inline. | 2004-12-12 Andrew Cagney | | * frame.c (get_prev_frame): When unwinding normal frames, check | that the PC isn't zero. Sponsored by: ADARA Networks Modified: stable/8/contrib/gdb/gdb/frame.c Directory Properties: stable/8/contrib/gdb/ (props changed) Modified: stable/8/contrib/gdb/gdb/frame.c ============================================================================== --- stable/8/contrib/gdb/gdb/frame.c Tue Dec 11 12:57:08 2012 (r244118) +++ stable/8/contrib/gdb/gdb/frame.c Tue Dec 11 12:58:27 2012 (r244119) @@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_ return NULL; } + /* Assume that the only way to get a zero PC is through something + like a SIGSEGV or a dummy frame, and hence that NORMAL frames + will never unwind a zero PC. */ + if (this_frame->level > 0 + && get_frame_type (this_frame) == NORMAL_FRAME + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { + if (frame_debug) + { + fprintf_unfiltered (gdb_stdlog, "-> "); + fprint_frame (gdb_stdlog, this_frame->prev); + fprintf_unfiltered (gdb_stdlog, " // zero PC \n"); + } + return NULL; + } + /* Only try to do the unwind once. */ if (this_frame->prev_p) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 13:03:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A1A0437; Tue, 11 Dec 2012 13:03:34 +0000 (UTC) (envelope-from emaste@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 F1B008FC16; Tue, 11 Dec 2012 13:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBD3X0O097352; Tue, 11 Dec 2012 13:03:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBD3XFO097351; Tue, 11 Dec 2012 13:03:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111303.qBBD3XFO097351@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 13:03:33 +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: r244120 - stable/8/gnu/usr.bin/gdb/kgdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 13:03:34 -0000 Author: emaste Date: Tue Dec 11 13:03:33 2012 New Revision: 244120 URL: http://svnweb.freebsd.org/changeset/base/244120 Log: MFC r217749: Use string literal format strings to quiet clang warnings. Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c Directory Properties: stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) Modified: stable/8/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/kgdb/main.c Tue Dec 11 12:58:27 2012 (r244119) +++ stable/8/gnu/usr.bin/gdb/kgdb/main.c Tue Dec 11 13:03:33 2012 (r244120) @@ -129,7 +129,7 @@ kernel_from_dumpnr(int nr) snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr); info = fopen(path, "r"); if (info == NULL) { - warn(path); + warn("%s", path); return; } while (fgets(path, sizeof(path), info) != NULL) { @@ -408,7 +408,7 @@ main(int argc, char *argv[]) if (dumpnr >= 0) { snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr); if (stat(path, &st) == -1) - err(1, path); + err(1, "%s", path); if (!S_ISREG(st.st_mode)) errx(1, "%s: not a regular file", path); vmcore = strdup(path); From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 13:35:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1E86150; Tue, 11 Dec 2012 13:35:39 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 692C78FC08; Tue, 11 Dec 2012 13:35:38 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 17E721512D7; Tue, 11 Dec 2012 15:35:25 +0200 (EET) Date: Tue, 11 Dec 2012 15:35:25 +0200 From: Jaakko Heinonen To: Greg Lehey Subject: Re: svn commit: r244075 - stable/9/bin/ls Message-ID: <20121211133525.GA43682@jh> References: <201212100311.qBA3BKL6004047@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201212100311.qBA3BKL6004047@svn.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-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 13:35:40 -0000 On 2012-12-10, Greg Lehey wrote: > MFC to r242840: I found confusing that this commit merges changes not mentioned in the commit message below. It make me while to notice "to" before the revision number. Also the commit didn't record mergeinfo. > Add y flag and environment variable LS_SAMESORT to specify the same > sorting order for time and name with the -t option. IEEE Std 1003.2 > (POSIX.2) mandates that the -t option sort in descending order, and > that if two files have the same timestamp, they should be sorted in > ascending order of their names. The -r flag reverses both of these > sort orders, so they're never the same. This creates significant > problems for sequentially named files stored on FAT file systems, > where it can be impossible to list them in the order in which they > were created. > > Add , (comma) option to print file sizes grouped and separated by > thousands using the non-monetary separator returned by localeconv(3), > typically a comma or period. > Modified: stable/9/bin/ls/cmp.c > ============================================================================== > --- stable/9/bin/ls/cmp.c Mon Dec 10 02:44:47 2012 (r244074) > +++ stable/9/bin/ls/cmp.c Mon Dec 10 03:11:19 2012 (r244075) > @@ -78,6 +78,9 @@ modcmp(const FTSENT *a, const FTSENT *b) > if (b->fts_statp->st_mtim.tv_nsec < > a->fts_statp->st_mtim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Wrong indentation. Merge error? > @@ -104,6 +107,9 @@ acccmp(const FTSENT *a, const FTSENT *b) > if (b->fts_statp->st_atim.tv_nsec < > a->fts_statp->st_atim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. > @@ -130,6 +136,9 @@ birthcmp(const FTSENT *a, const FTSENT * > if (b->fts_statp->st_birthtim.tv_nsec < > a->fts_statp->st_birthtim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. > @@ -156,6 +165,9 @@ statcmp(const FTSENT *a, const FTSENT *b > if (b->fts_statp->st_ctim.tv_nsec < > a->fts_statp->st_ctim.tv_nsec) > return (-1); > + if (f_samesort) > + return (strcoll(b->fts_name, a->fts_name)); > + else > return (strcoll(a->fts_name, b->fts_name)); > } Ditto. -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 18:39:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83096A5C; Tue, 11 Dec 2012 18:39:54 +0000 (UTC) (envelope-from eadler@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 4FB3A8FC12; Tue, 11 Dec 2012 18:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBIdsDg061807; Tue, 11 Dec 2012 18:39:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBIdsnR061806; Tue, 11 Dec 2012 18:39:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212111839.qBBIdsnR061806@svn.freebsd.org> From: Eitan Adler Date: Tue, 11 Dec 2012 18:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244122 - head/share/examples/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 18:39:54 -0000 Author: eadler Date: Tue Dec 11 18:39:53 2012 New Revision: 244122 URL: http://svnweb.freebsd.org/changeset/base/244122 Log: Remove 'dangerous' instructions from the example make.conf. Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Submitted by: amdmi3 Approved by: cperciva (implicit) MFC after: 2 weeks Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Tue Dec 11 13:51:05 2012 (r244121) +++ head/share/examples/etc/make.conf Tue Dec 11 18:39:53 2012 (r244122) @@ -57,21 +57,20 @@ # CFLAGS controls the compiler settings used when compiling C code. # Note that optimization settings other than -O and -O2 are not recommended # or supported for compiling the world or the kernel - please revert any -# nonstandard optimization settings to "-O" or "-O2 -fno-strict-aliasing" +# nonstandard optimization settings # before submitting bug reports without patches to the developers. # -# Compiling with -fstrict-aliasing optimization breaks some [notable] ports. -# GCC turns on -fstrict-aliasing optimization at all levels above -O[1], so -# explicitly turn it off when using compiling with the -O2 optimization level. -# -#CFLAGS= -O2 -fno-strict-aliasing -pipe -# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" # alone will remove the often needed contents of CFLAGS from CXXFLAGS. # -#CXXFLAGS+= -fconserve-space +# Additional compiler flags can be specified that extend or override +# default ones. However, neither the base system nor ports are guaranteed +# to build and function without problems with non-default settings. +# +# CFLAGS+= -msse3 +# CXXFLAGS+= -msse3 # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 19:54:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7154DB37; Tue, 11 Dec 2012 19:54:36 +0000 (UTC) (envelope-from pjd@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 558468FC1E; Tue, 11 Dec 2012 19:54:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBJsaI7076108; Tue, 11 Dec 2012 19:54:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBJsaAL076107; Tue, 11 Dec 2012 19:54:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212111954.qBBJsaAL076107@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 11 Dec 2012 19:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244123 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 19:54:36 -0000 Author: pjd Date: Tue Dec 11 19:54:35 2012 New Revision: 244123 URL: http://svnweb.freebsd.org/changeset/base/244123 Log: Similar to CTLFLAG_RDTUN, provide CTLFLAG_RWTUN that defines writable sysctl that can also be modified by loader tunable. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Dec 11 18:39:53 2012 (r244122) +++ head/sys/sys/sysctl.h Tue Dec 11 19:54:35 2012 (r244123) @@ -84,9 +84,10 @@ struct ctlname { #define CTLFLAG_SKIP 0x01000000 /* Skip this sysctl when listing */ #define CTLMASK_SECURE 0x00F00000 /* Secure level */ #define CTLFLAG_TUN 0x00080000 /* Tunable variable */ +#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) +#define CTLFLAG_RWTUN (CTLFLAG_RW|CTLFLAG_TUN) #define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ #define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ -#define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ #define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ #define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 19:54:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE66CCA4; Tue, 11 Dec 2012 19:54:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id BBD4E8FC14; Tue, 11 Dec 2012 19:54:50 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 3964ADA3; Tue, 11 Dec 2012 20:52:43 +0100 (CET) Date: Tue, 11 Dec 2012 20:56:19 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244106 - head/sbin/sysctl Message-ID: <20121211195618.GA1381@garage.freebsd.pl> References: <201212110128.qBB1S7rh061270@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <201212110128.qBB1S7rh061270@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 19:54:51 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 11, 2012 at 01:28:07AM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 01:28:06 2012 > New Revision: 244106 > URL: http://svnweb.freebsd.org/changeset/base/244106 >=20 > Log: > Allow sysctl to filter boot and runtime tunables. > =20 > Add the following flags to sysctl: > -W - show only writable sysctls > -T - show only tuneable sysctls [...] > +.It Fl T > +Display only variables that are setable via loader (CTLFLAG_TUN). To this point CTLFLAG_TUN was only important for read-only sysctls to give user a hint that the given sysctl can be changed via loader tunable on boot only (or on module load via kenv(1)). Your change makes it useful to also mark read-write sysctls as tunables and I suspect there is huge number of such sysctls that have no CTLFLAG_TUN flag. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDHj+IACgkQForvXbEpPzReCQCg73fsiVxfpf1HKyHC6dkBageP HWUAoJN4GNZ3Pm0DE+bnWZxZxB9Du7Qa =wEM+ -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7-- From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 20:08:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 205D368A; Tue, 11 Dec 2012 20:08:58 +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 067878FC14; Tue, 11 Dec 2012 20:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBK8vbf079522; Tue, 11 Dec 2012 20:08:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBK8vpD079521; Tue, 11 Dec 2012 20:08:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212112008.qBBK8vpD079521@svn.freebsd.org> From: Dimitry Andric Date: Tue, 11 Dec 2012 20:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244124 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 20:08:58 -0000 Author: dim Date: Tue Dec 11 20:08:57 2012 New Revision: 244124 URL: http://svnweb.freebsd.org/changeset/base/244124 Log: Cleanup a few duplicate llvm libs that snuck in with the recent update. Noticed by: rdivacky Modified: head/lib/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Tue Dec 11 19:54:35 2012 (r244123) +++ head/lib/clang/Makefile Tue Dec 11 20:08:57 2012 (r244124) @@ -71,15 +71,12 @@ SUBDIR= libclanganalysis \ libllvmx86utils .if ${MK_CLANG_EXTRAS} != "no" -SUBDIR+=libllvmarchive \ - libllvmdebuginfo \ +SUBDIR+=libllvmdebuginfo \ libllvmexecutionengine \ libllvminterpreter \ libllvmjit \ - libllvmlinker \ libllvmmcdisassembler \ libllvmmcjit \ - libllvmobject \ libllvmruntimedyld .endif .endif From owner-svn-src-all@FreeBSD.ORG Tue Dec 11 22:52:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83AD22F4; Tue, 11 Dec 2012 22:52:57 +0000 (UTC) (envelope-from jilles@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 678848FC08; Tue, 11 Dec 2012 22:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBMqvN9011179; Tue, 11 Dec 2012 22:52:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBMqvH9011176; Tue, 11 Dec 2012 22:52:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212112252.qBBMqvH9011176@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 11 Dec 2012 22:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244126 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 22:52:57 -0000 Author: jilles Date: Tue Dec 11 22:52:56 2012 New Revision: 244126 URL: http://svnweb.freebsd.org/changeset/base/244126 Log: libc: Make various internal file descriptors close-on-exec. These are obtained via fopen(). Modified: head/lib/libc/locale/collate.c head/lib/libc/locale/setrunelocale.c Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Tue Dec 11 20:38:53 2012 (r244125) +++ head/lib/libc/locale/collate.c Tue Dec 11 22:52:56 2012 (r244126) @@ -135,7 +135,7 @@ __collate_load_tables_l(const char *enco (void)strcat(buf, "/"); (void)strcat(buf, encoding); (void)strcat(buf, "/LC_COLLATE"); - if ((fp = fopen(buf, "r")) == NULL) + if ((fp = fopen(buf, "re")) == NULL) return (_LDP_ERROR); if (fread(strbuf, sizeof(strbuf), 1, fp) != 1) { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Tue Dec 11 20:38:53 2012 (r244125) +++ head/lib/libc/locale/setrunelocale.c Tue Dec 11 22:52:56 2012 (r244126) @@ -129,7 +129,7 @@ __setrunelocale(struct xlocale_ctype *l, (void) strcat(name, encoding); (void) strcat(name, "/LC_CTYPE"); - if ((fp = fopen(name, "r")) == NULL) + if ((fp = fopen(name, "re")) == NULL) return (errno == 0 ? ENOENT : errno); if ((rl = _Read_RuneMagi(fp)) == NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 00:39:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87E07B27; Wed, 12 Dec 2012 00:39:05 +0000 (UTC) (envelope-from jimharris@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 6AF478FC16; Wed, 12 Dec 2012 00:39:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC0d5xP026317; Wed, 12 Dec 2012 00:39:05 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC0d594026316; Wed, 12 Dec 2012 00:39:05 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212120039.qBC0d594026316@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 00:39: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: r244128 - stable/9/sys/dev/isci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 00:39:05 -0000 Author: jimharris Date: Wed Dec 12 00:39:04 2012 New Revision: 244128 URL: http://svnweb.freebsd.org/changeset/base/244128 Log: MFC r243904: Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing to map, and technically this isn't allowed. Functionally, it works OK (at least on x86) to call bus_dmamap_load with a NULL data pointer and zero length, so this is primarily for correctness and consistency with other drivers. While here, remove check in isci_io_request_construct for nseg==0. Previously, bus_dmamap_load would pass nseg==1, even for case where buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs to get processed. This check is not correct though, and needed to be removed both for the changes elsewhere in this patch, as well as jeff's preliminary bus_dmamap_load_ccb patch (which uncovered all of this in the first place). Modified: stable/9/sys/dev/isci/isci_io_request.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/9/sys/dev/isci/isci_io_request.c Tue Dec 11 23:59:14 2012 (r244127) +++ stable/9/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:04 2012 (r244128) @@ -670,8 +670,7 @@ isci_io_request_construct(void *arg, bus io_request->sge = seg; ccb = io_request->ccb; - /* XXX More cleanup is needed here */ - if ((nseg == 0) || (error != 0)) { + if (error != 0) { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); return; @@ -757,18 +756,21 @@ isci_io_request_execute_scsi_io(union cc panic("Unexpected CAM_DATA_PHYS flag! flags = 0x%x\n", ccb->ccb_h.flags); - error = bus_dmamap_load(io_request->parent.dma_tag, - io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, - isci_io_request_construct, io_request, 0x0); - - /* A resource shortage from BUSDMA will be automatically - * continued at a later point, pushing the CCB processing - * forward, which will in turn unfreeze the simq. - */ - if (error == EINPROGRESS) { - xpt_freeze_simq(controller->sim, 1); - ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; - } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + error = bus_dmamap_load(io_request->parent.dma_tag, + io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, + isci_io_request_construct, io_request, 0x0); + + /* A resource shortage from BUSDMA will be automatically + * continued at a later point, pushing the CCB processing + * forward, which will in turn unfreeze the simq. + */ + if (error == EINPROGRESS) { + xpt_freeze_simq(controller->sim, 1); + ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; + } + } else + isci_io_request_construct(io_request, NULL, 0, 0); } void From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 00:39:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61770C8F; Wed, 12 Dec 2012 00:39:33 +0000 (UTC) (envelope-from jimharris@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 452E08FC0C; Wed, 12 Dec 2012 00:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC0dXYc026401; Wed, 12 Dec 2012 00:39:33 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC0dX4I026400; Wed, 12 Dec 2012 00:39:33 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212120039.qBC0dX4I026400@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 00:39:33 +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: r244129 - stable/8/sys/dev/isci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 00:39:33 -0000 Author: jimharris Date: Wed Dec 12 00:39:32 2012 New Revision: 244129 URL: http://svnweb.freebsd.org/changeset/base/244129 Log: MFC r243904: Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing to map, and technically this isn't allowed. Functionally, it works OK (at least on x86) to call bus_dmamap_load with a NULL data pointer and zero length, so this is primarily for correctness and consistency with other drivers. While here, remove check in isci_io_request_construct for nseg==0. Previously, bus_dmamap_load would pass nseg==1, even for case where buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs to get processed. This check is not correct though, and needed to be removed both for the changes elsewhere in this patch, as well as jeff's preliminary bus_dmamap_load_ccb patch (which uncovered all of this in the first place). Modified: stable/8/sys/dev/isci/isci_io_request.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/isci/ (props changed) Modified: stable/8/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/8/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:04 2012 (r244128) +++ stable/8/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:32 2012 (r244129) @@ -670,8 +670,7 @@ isci_io_request_construct(void *arg, bus io_request->sge = seg; ccb = io_request->ccb; - /* XXX More cleanup is needed here */ - if ((nseg == 0) || (error != 0)) { + if (error != 0) { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); return; @@ -757,18 +756,21 @@ isci_io_request_execute_scsi_io(union cc panic("Unexpected CAM_DATA_PHYS flag! flags = 0x%x\n", ccb->ccb_h.flags); - error = bus_dmamap_load(io_request->parent.dma_tag, - io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, - isci_io_request_construct, io_request, 0x0); - - /* A resource shortage from BUSDMA will be automatically - * continued at a later point, pushing the CCB processing - * forward, which will in turn unfreeze the simq. - */ - if (error == EINPROGRESS) { - xpt_freeze_simq(controller->sim, 1); - ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; - } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + error = bus_dmamap_load(io_request->parent.dma_tag, + io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, + isci_io_request_construct, io_request, 0x0); + + /* A resource shortage from BUSDMA will be automatically + * continued at a later point, pushing the CCB processing + * forward, which will in turn unfreeze the simq. + */ + if (error == EINPROGRESS) { + xpt_freeze_simq(controller->sim, 1); + ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; + } + } else + isci_io_request_construct(io_request, NULL, 0, 0); } void From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 00:39:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D965FDF2; Wed, 12 Dec 2012 00:39:54 +0000 (UTC) (envelope-from jimharris@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 BC5148FC0C; Wed, 12 Dec 2012 00:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC0ds4U026471; Wed, 12 Dec 2012 00:39:54 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC0dsNf026470; Wed, 12 Dec 2012 00:39:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212120039.qBC0dsNf026470@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 00:39:54 +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: r244130 - stable/7/sys/dev/isci X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 00:39:54 -0000 Author: jimharris Date: Wed Dec 12 00:39:54 2012 New Revision: 244130 URL: http://svnweb.freebsd.org/changeset/base/244130 Log: MFC r243904: Don't call bus_dmamap_load in CAM_DIR_NONE case, since there is nothing to map, and technically this isn't allowed. Functionally, it works OK (at least on x86) to call bus_dmamap_load with a NULL data pointer and zero length, so this is primarily for correctness and consistency with other drivers. While here, remove check in isci_io_request_construct for nseg==0. Previously, bus_dmamap_load would pass nseg==1, even for case where buffer is NULL and length = 0, which allowed CAM_DIR_NONE CCBs to get processed. This check is not correct though, and needed to be removed both for the changes elsewhere in this patch, as well as jeff's preliminary bus_dmamap_load_ccb patch (which uncovered all of this in the first place). Modified: stable/7/sys/dev/isci/isci_io_request.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/isci_io_request.c ============================================================================== --- stable/7/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:32 2012 (r244129) +++ stable/7/sys/dev/isci/isci_io_request.c Wed Dec 12 00:39:54 2012 (r244130) @@ -670,8 +670,7 @@ isci_io_request_construct(void *arg, bus io_request->sge = seg; ccb = io_request->ccb; - /* XXX More cleanup is needed here */ - if ((nseg == 0) || (error != 0)) { + if (error != 0) { ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); return; @@ -757,18 +756,21 @@ isci_io_request_execute_scsi_io(union cc panic("Unexpected CAM_DATA_PHYS flag! flags = 0x%x\n", ccb->ccb_h.flags); - error = bus_dmamap_load(io_request->parent.dma_tag, - io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, - isci_io_request_construct, io_request, 0x0); - - /* A resource shortage from BUSDMA will be automatically - * continued at a later point, pushing the CCB processing - * forward, which will in turn unfreeze the simq. - */ - if (error == EINPROGRESS) { - xpt_freeze_simq(controller->sim, 1); - ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; - } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + error = bus_dmamap_load(io_request->parent.dma_tag, + io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len, + isci_io_request_construct, io_request, 0x0); + + /* A resource shortage from BUSDMA will be automatically + * continued at a later point, pushing the CCB processing + * forward, which will in turn unfreeze the simq. + */ + if (error == EINPROGRESS) { + xpt_freeze_simq(controller->sim, 1); + ccb->ccb_h.flags |= CAM_RELEASE_SIMQ; + } + } else + isci_io_request_construct(io_request, NULL, 0, 0); } void From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 01:05:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02885381; Wed, 12 Dec 2012 01:05:20 +0000 (UTC) (envelope-from gjb@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 DC1728FC08; Wed, 12 Dec 2012 01:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC15JOv030311; Wed, 12 Dec 2012 01:05:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC15JHS030310; Wed, 12 Dec 2012 01:05:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201212120105.qBC15JHS030310@svn.freebsd.org> From: Glen Barber Date: Wed, 12 Dec 2012 01:05:19 +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: r244131 - stable/9/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 01:05:20 -0000 Author: gjb (doc,ports committer) Date: Wed Dec 12 01:05:19 2012 New Revision: 244131 URL: http://svnweb.freebsd.org/changeset/base/244131 Log: MFC r244057, r244059: r244057: Get 'uname -r' earlier, so it can be used to determine what branch is being run to set BSDINSTALL_DISTSITE accordingly. This change allows non-RELEASE branches to use the FTP snapshots directory for bootonly.iso installations. r244059: Add missed BETA* to list. Modified: stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) stable/9/usr.sbin/bsdinstall/scripts/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Wed Dec 12 00:39:54 2012 (r244130) +++ stable/9/usr.sbin/bsdinstall/scripts/mirrorselect Wed Dec 12 01:05:19 2012 (r244131) @@ -192,7 +192,18 @@ MIRROR=`dialog --backtitle "FreeBSD Inst MIRROR_BUTTON=$? exec 3>&- -BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/releases/`uname -m`/`uname -p`/`uname -r`" +_UNAME_R=`uname -r` + +case ${_UNAME_R} in + *-CURRENT|*-STABLE|*-BETA*|*-PRERELEASE|*-RC*) + RELDIR="snapshots" + ;; + *) + RELDIR="releases" + ;; +esac + +BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}" case $MIRROR_BUTTON in $DIALOG_CANCEL) From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 01:50:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D11DE3E; Wed, 12 Dec 2012 01:50:59 +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 E65918FC08; Wed, 12 Dec 2012 01:50:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC1owhq036377; Wed, 12 Dec 2012 01:50:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC1owJt036375; Wed, 12 Dec 2012 01:50:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212120150.qBC1owJt036375@svn.freebsd.org> From: Xin LI Date: Wed, 12 Dec 2012 01:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244132 - head/usr.sbin/service X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 01:50:59 -0000 Author: delphij Date: Wed Dec 12 01:50:58 2012 New Revision: 244132 URL: http://svnweb.freebsd.org/changeset/base/244132 Log: Add -R, an option to restart all enabled "local" services. Discussed on: -rc@ (in September) MFC after: 2 months Modified: head/usr.sbin/service/service.8 head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.8 ============================================================================== --- head/usr.sbin/service/service.8 Wed Dec 12 01:05:19 2012 (r244131) +++ head/usr.sbin/service/service.8 Wed Dec 12 01:50:58 2012 (r244132) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2009 +.Dd December 11, 2012 .Dt SERVICE 8 .Os .Sh NAME @@ -34,6 +34,8 @@ .Nm .Fl e .Nm +.Fl R +.Nm .Op Fl v .Fl l | r .Nm @@ -62,6 +64,8 @@ then that list of scripts is checked for .Qq rcvar assignment. If present the script is checked to see if it is enabled. +.It Fl R +Restart all enabled local services. .It Fl l List all files in .Pa /etc/rc.d Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Wed Dec 12 01:05:19 2012 (r244131) +++ head/usr.sbin/service/service.sh Wed Dec 12 01:50:58 2012 (r244132) @@ -33,29 +33,58 @@ usage () { echo '' echo 'Usage:' echo "${0##*/} -e" + echo "${0##*/} -R" echo "${0##*/} [-v] -l | -r" echo "${0##*/} [-v] start|stop|etc." echo "${0##*/} -h" echo '' echo '-e Show services that are enabled' + echo "-R Stop and start enabled $local_startup services" echo "-l List all scripts in /etc/rc.d and $local_startup" echo '-r Show the results of boot time rcorder' echo '-v Verbose' echo '' } -while getopts 'ehlrv' COMMAND_LINE_ARGUMENT ; do +while getopts 'ehlrRv' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in e) ENABLED=eopt ;; h) usage ; exit 0 ;; l) LIST=lopt ;; r) RCORDER=ropt ;; + R) RESTART=Ropt ;; v) VERBOSE=vopt ;; *) usage ; exit 1 ;; esac done shift $(( $OPTIND - 1 )) +if [ -n "$RESTART" ]; then + skip="-s nostart" + if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then + skip="$skip -s nojail" + fi + [ -n "$local_startup" ] && find_local_scripts_new + files=`rcorder ${skip} ${local_rc} 2>/dev/null` + + for file in `reverse_list ${files}`; do + if grep -q ^rcvar $file; then + eval `grep ^name= $file` + eval `grep ^rcvar $file` + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop + fi + done + for file in $files; do + if grep -q ^rcvar $file; then + eval `grep ^name= $file` + eval `grep ^rcvar $file` + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start + fi + done + + exit 0 +fi + if [ -n "$ENABLED" -o -n "$RCORDER" ]; then # Copied from /etc/rc skip="-s nostart" From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 02:55:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EC9EDAB; Wed, 12 Dec 2012 02:55:41 +0000 (UTC) (envelope-from alfred@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 49B228FC0C; Wed, 12 Dec 2012 02:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC2tfrL045785; Wed, 12 Dec 2012 02:55:41 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC2tfj2045784; Wed, 12 Dec 2012 02:55:41 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212120255.qBC2tfj2045784@svn.freebsd.org> From: Alfred Perlstein Date: Wed, 12 Dec 2012 02:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244133 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 02:55:41 -0000 Author: alfred Date: Wed Dec 12 02:55:40 2012 New Revision: 244133 URL: http://svnweb.freebsd.org/changeset/base/244133 Log: Make Tflag and Wflag filters work for more sysctl options. To do this move the Tflag and Wflag checks earlier in show_var() so we bail earlier for variables not matching our query. Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Wed Dec 12 01:50:58 2012 (r244132) +++ head/sbin/sysctl/sysctl.c Wed Dec 12 02:55:40 2012 (r244133) @@ -539,7 +539,7 @@ static int show_var(int *oid, int nlen) { u_char buf[BUFSIZ], *val, *oval, *p; - char name[BUFSIZ], *fmt; + char name[BUFSIZ], fmt[BUFSIZ]; const char *sep, *sep1; int qoid[CTL_MAXNAME+2]; uintmax_t umv; @@ -554,6 +554,7 @@ show_var(int *oid, int nlen) umv = mv = intlen = 0; bzero(buf, BUFSIZ); + bzero(fmt, BUFSIZ); bzero(name, BUFSIZ); qoid[0] = 0; memcpy(qoid + 2, oid, nlen * sizeof(int)); @@ -564,6 +565,15 @@ show_var(int *oid, int nlen) if (i || !j) err(1, "sysctl name %d %zu %d", i, j, errno); + oidfmt(oid, nlen, fmt, &kind); + /* if Wflag then only list sysctls that are writeable and not stats. */ + if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) + return 1; + + /* if Tflag then only list sysctls that are tuneables. */ + if (Tflag && (kind & CTLFLAG_TUN) == 0) + return 1; + if (Nflag) { printf("%s", name); return (0); @@ -606,21 +616,11 @@ show_var(int *oid, int nlen) return (0); } val[len] = '\0'; - fmt = buf; - oidfmt(oid, nlen, fmt, &kind); p = val; ctltype = (kind & CTLTYPE); sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; - /* if Wflag then only list sysctls that are writeable and not stats. */ - if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) - return 1; - - /* if Tflag then only list sysctls that are tuneables. */ - if (Tflag && (kind & CTLFLAG_TUN) == 0) - return 1; - switch (ctltype) { case CTLTYPE_STRING: if (!nflag) From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 04:18:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60C06A97; Wed, 12 Dec 2012 04:18:26 +0000 (UTC) (envelope-from grog@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 450E78FC13; Wed, 12 Dec 2012 04:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC4IQ2h057873; Wed, 12 Dec 2012 04:18:26 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC4IQGu057871; Wed, 12 Dec 2012 04:18:26 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212120418.qBC4IQGu057871@svn.freebsd.org> From: Greg Lehey Date: Wed, 12 Dec 2012 04:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244134 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 04:18:26 -0000 Author: grog Date: Wed Dec 12 04:18:25 2012 New Revision: 244134 URL: http://svnweb.freebsd.org/changeset/base/244134 Log: Handle large negative block counts correctly. MFC after: 2 weeks Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Wed Dec 12 02:55:40 2012 (r244133) +++ head/bin/df/df.c Wed Dec 12 04:18:25 2012 (r244134) @@ -397,7 +397,7 @@ prthumanvalinode(int64_t bytes) static intmax_t fsbtoblk(int64_t num, uint64_t fsbs, u_long bs) { - return (num * (intmax_t) fsbs / bs); + return (num * (intmax_t) fsbs / (int64_t) bs); } /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 05:00:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A68E92D3; Wed, 12 Dec 2012 05:00:27 +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 8B1F48FC08; Wed, 12 Dec 2012 05:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC50R7j065073; Wed, 12 Dec 2012 05:00:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC50RLJ065072; Wed, 12 Dec 2012 05:00:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212120500.qBC50RLJ065072@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Dec 2012 05:00:27 +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: r244135 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 05:00:27 -0000 Author: kib Date: Wed Dec 12 05:00:26 2012 New Revision: 244135 URL: http://svnweb.freebsd.org/changeset/base/244135 Log: MFC r244053: Fix typo. 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 Dec 12 04:18:25 2012 (r244134) +++ stable/9/sys/kern/vfs_mount.c Wed Dec 12 05:00:26 2012 (r244135) @@ -709,7 +709,7 @@ sys_mount(td, uap) int error; /* - * Mount flags are now 64-bits. On 32-bit archtectures only + * Mount flags are now 64-bits. On 32-bit architectures only * 32-bits are passed in, but from here on everything handles * 64-bit flags correctly. */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 05:01:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7808434; Wed, 12 Dec 2012 05:01:01 +0000 (UTC) (envelope-from bryanv@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 AD9BB8FC0C; Wed, 12 Dec 2012 05:01:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC511mS065259; Wed, 12 Dec 2012 05:01:01 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC511rK065258; Wed, 12 Dec 2012 05:01:01 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201212120501.qBC511rK065258@svn.freebsd.org> From: Bryan Venteicher Date: Wed, 12 Dec 2012 05:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244136 - head/sys/dev/virtio/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 05:01:01 -0000 Author: bryanv Date: Wed Dec 12 05:01:01 2012 New Revision: 244136 URL: http://svnweb.freebsd.org/changeset/base/244136 Log: virtio_scsi: Remove duplicated lines These must have been accidently copied from the if statement a few lines later. Also remove parameter name from function prototype. Approved by: grehan (mentor) Modified: head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Wed Dec 12 05:00:26 2012 (r244135) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Wed Dec 12 05:01:01 2012 (r244136) @@ -129,7 +129,7 @@ static int vtscsi_execute_abort_task_cm static int vtscsi_execute_reset_dev_cmd(struct vtscsi_softc *, struct vtscsi_request *); -static void vtscsi_get_request_lun(uint8_t lun[], target_id_t *, lun_id_t *); +static void vtscsi_get_request_lun(uint8_t [], target_id_t *, lun_id_t *); static void vtscsi_set_request_lun(struct ccb_hdr *, uint8_t []); static void vtscsi_init_scsi_cmd_req(struct ccb_scsiio *, struct virtio_scsi_cmd_req *); @@ -1673,9 +1673,6 @@ vtscsi_announce(struct vtscsi_softc *sc, { struct cam_path *path; - xpt_async(ac_code, sc->vtscsi_path, NULL); - return; - /* Use the wildcard path from our softc for bus announcements. */ if (target_id == CAM_TARGET_WILDCARD && lun_id == CAM_LUN_WILDCARD) { xpt_async(ac_code, sc->vtscsi_path, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 05:02:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0C035A9; Wed, 12 Dec 2012 05:02:56 +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 D41B08FC0C; Wed, 12 Dec 2012 05:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC52upX065639; Wed, 12 Dec 2012 05:02:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC52uCo065637; Wed, 12 Dec 2012 05:02:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212120502.qBC52uCo065637@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Dec 2012 05:02: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: r244137 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 05:02:57 -0000 Author: kib Date: Wed Dec 12 05:02:56 2012 New Revision: 244137 URL: http://svnweb.freebsd.org/changeset/base/244137 Log: MFC r244054: Remove useless comment. 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 Dec 12 05:01:01 2012 (r244136) +++ stable/9/sys/kern/vfs_bio.c Wed Dec 12 05:02:56 2012 (r244137) @@ -2649,8 +2649,6 @@ loop: * If this check ever becomes a bottleneck it may be better to * move it into the else, when gbincore() fails. At the moment * it isn't a problem. - * - * XXX remove if 0 sections (clean this up after its proven) */ if (numfreebuffers == 0) { if (TD_IS_IDLETHREAD(curthread)) From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 07:19:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C30F6B07; Wed, 12 Dec 2012 07:19:15 +0000 (UTC) (envelope-from remko@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 8CF838FC08; Wed, 12 Dec 2012 07:19:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC7JFeN087074; Wed, 12 Dec 2012 07:19:15 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC7JFW1087073; Wed, 12 Dec 2012 07:19:15 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201212120719.qBC7JFW1087073@svn.freebsd.org> From: Remko Lodder Date: Wed, 12 Dec 2012 07:19: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: r244139 - stable/9/sys/dev/uart X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 07:19:15 -0000 Author: remko Date: Wed Dec 12 07:19:14 2012 New Revision: 244139 URL: http://svnweb.freebsd.org/changeset/base/244139 Log: Merge r232639 Original commit: Add support for the MosChip MCS9904 four serial ports controller. PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:25:17 2012 (r232638) +++ head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:42:21 2012 (r232639) @@ -126,6 +126,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; Modified: stable/9/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 12 05:21:04 2012 (r244138) +++ stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:19:14 2012 (r244139) @@ -127,6 +127,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 07:22:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 734F7E77; Wed, 12 Dec 2012 07:22:51 +0000 (UTC) (envelope-from remko@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 3E0E78FC08; Wed, 12 Dec 2012 07:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC7MpOU087696; Wed, 12 Dec 2012 07:22:51 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC7MpnD087695; Wed, 12 Dec 2012 07:22:51 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201212120722.qBC7MpnD087695@svn.freebsd.org> From: Remko Lodder Date: Wed, 12 Dec 2012 07:22:51 +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: r244140 - stable/8/sys/dev/uart X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 07:22:51 -0000 Author: remko Date: Wed Dec 12 07:22:50 2012 New Revision: 244140 URL: http://svnweb.freebsd.org/changeset/base/244140 Log: MFC r232639 Original commit: Add support for the MosChip MCS9904 four serial ports controller. PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:25:17 2012 (r232638) +++ head/sys/dev/uart/uart_bus_pci.c Wed Mar 7 06:42:21 2012 (r232639) @@ -126,6 +126,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; Modified: stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:19:14 2012 (r244139) +++ stable/8/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:22:50 2012 (r244140) @@ -123,6 +123,8 @@ static struct pci_id pci_ns8250_ids[] = "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 07:24:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04CFC11D; Wed, 12 Dec 2012 07:24:38 +0000 (UTC) (envelope-from remko@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 DB4138FC0C; Wed, 12 Dec 2012 07:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC7ObwY088028; Wed, 12 Dec 2012 07:24:37 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC7Obsj088027; Wed, 12 Dec 2012 07:24:37 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201212120724.qBC7Obsj088027@svn.freebsd.org> From: Remko Lodder Date: Wed, 12 Dec 2012 07:24:37 +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: r244141 - stable/7/sys/dev/uart X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 07:24:38 -0000 Author: remko Date: Wed Dec 12 07:24:37 2012 New Revision: 244141 URL: http://svnweb.freebsd.org/changeset/base/244141 Log: MFC r232639 Original commit: Add support for the MosChip MCS9904 four serial ports controller. PR: 165804 Submitted by: Eugene Grosbein MFC after: 1 week Modified: stable/7/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:22:50 2012 (r244140) +++ stable/7/sys/dev/uart/uart_bus_pci.c Wed Dec 12 07:24:37 2012 (r244141) @@ -114,6 +114,8 @@ static struct pci_id pci_ns8250_ids[] = { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, { 0x9710, 0x9901, 0xa000, 0x1000, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, +{ 0x9710, 0x9904, 0xa000, 0x1000, + "MosChip MCS9904 PCIe to Peripheral Controller", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 08:35:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A96A58B; Wed, 12 Dec 2012 08:35:33 +0000 (UTC) (envelope-from grehan@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 4F1B88FC0A; Wed, 12 Dec 2012 08:35:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBC8ZXD2000249; Wed, 12 Dec 2012 08:35:33 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBC8ZWeL000247; Wed, 12 Dec 2012 08:35:32 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201212120835.qBC8ZWeL000247@svn.freebsd.org> From: Peter Grehan Date: Wed, 12 Dec 2012 08:35:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244144 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 08:35:33 -0000 Author: grehan Date: Wed Dec 12 08:35:32 2012 New Revision: 244144 URL: http://svnweb.freebsd.org/changeset/base/244144 Log: Implement an API to allow a hypervisor to save/restore guest floating point state without having to know the size of floating-point state. Unstaticize fpurestore to allow the hypervisor to save/restore guest state using fpusave/fpurestore on the allocated FPU state area. Reviewed by: kib Obtained from: NetApp/bhyve MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/include/fpu.h Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Wed Dec 12 07:29:38 2012 (r244143) +++ head/sys/amd64/amd64/fpu.c Wed Dec 12 08:35:32 2012 (r244144) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -134,6 +135,7 @@ SYSCTL_INT(_hw, HW_FLOATINGPT, floatingp static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ +static uma_zone_t fpu_save_area_zone; static struct savefpu *fpu_initialstate; struct xsave_area_elm_descr { @@ -151,7 +153,7 @@ fpusave(void *addr) fxsave((char *)addr); } -static void +void fpurestore(void *addr) { @@ -312,6 +314,10 @@ fpuinitstate(void *arg __unused) } } + fpu_save_area_zone = uma_zcreate("FPU_save_area", + cpu_max_ext_state_size, NULL, NULL, NULL, NULL, + XSAVE_AREA_ALIGN - 1, 0); + start_emulating(); intr_restore(saveintr); } @@ -980,3 +986,27 @@ is_fpu_kern_thread(u_int flags) return (0); return ((curpcb->pcb_flags & PCB_KERNFPU) != 0); } + +/* + * FPU save area alloc/free/init utility routines + */ +struct savefpu * +fpu_save_area_alloc(void) +{ + + return (uma_zalloc(fpu_save_area_zone, 0)); +} + +void +fpu_save_area_free(struct savefpu *fsa) +{ + + uma_zfree(fpu_save_area_zone, fsa); +} + +void +fpu_save_area_reset(struct savefpu *fsa) +{ + + bcopy(fpu_initialstate, fsa, cpu_max_ext_state_size); +} Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Wed Dec 12 07:29:38 2012 (r244143) +++ head/sys/amd64/include/fpu.h Wed Dec 12 08:35:32 2012 (r244144) @@ -57,6 +57,7 @@ void fpuexit(struct thread *td); int fpuformat(void); int fpugetregs(struct thread *td); void fpuinit(void); +void fpurestore(void *addr); void fpusave(void *addr); int fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate, size_t xfpustate_size); @@ -73,6 +74,10 @@ int fpu_kern_leave(struct thread *td, st int fpu_kern_thread(u_int flags); int is_fpu_kern_thread(u_int flags); +struct savefpu *fpu_save_area_alloc(void); +void fpu_save_area_free(struct savefpu *fsa); +void fpu_save_area_reset(struct savefpu *fsa); + /* * Flags for fpu_kern_alloc_ctx(), fpu_kern_enter() and fpu_kern_thread(). */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 11:44:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 990AB305; Wed, 12 Dec 2012 11:44: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 7CDBB8FC14; Wed, 12 Dec 2012 11:44:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCBiL41036514; Wed, 12 Dec 2012 11:44:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCBiLt3036512; Wed, 12 Dec 2012 11:44:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212121144.qBCBiLt3036512@svn.freebsd.org> From: Alexander Motin Date: Wed, 12 Dec 2012 11:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244145 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 11:44:21 -0000 Author: mav Date: Wed Dec 12 11:44:20 2012 New Revision: 244145 URL: http://svnweb.freebsd.org/changeset/base/244145 Log: Add quirks for AD1984A codec and Lenovo X300 laptop. PR: kern/148741 MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Dec 12 08:35:32 2012 (r244144) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Dec 12 11:44:20 2012 (r244145) @@ -271,7 +271,17 @@ hdac_pin_patch(struct hdaa_widget *w) } /* New patches */ - if (id == HDA_CODEC_AD1986A && + if (id == HDA_CODEC_AD1984A && + subid == LENOVO_X300_SUBVENDOR) { + switch (nid) { + case 17: /* Headphones with redirection */ + patch = "as=1 seq=15"; + break; + case 20: /* Two mics together */ + patch = "as=2 seq=15"; + break; + } + } else if (id == HDA_CODEC_AD1986A && (subid == ASUS_M2NPVMX_SUBVENDOR || subid == ASUS_A8NVMCSM_SUBVENDOR || subid == ASUS_P5PL2_SUBVENDOR)) { @@ -372,6 +382,13 @@ hdaa_widget_patch(struct hdaa_widget *w) HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT; w->waspin = 1; } + /* + * Clear "digital" flag from digital mic input, as its signal then goes + * to "analog" mixer and this separation just limits functionaity. + */ + if (hdaa_codec_id(devinfo) == HDA_CODEC_AD1984A && + w->nid == 23) + w->param.widget_cap &= ~HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL_MASK; HDA_BOOTVERBOSE( if (w->param.widget_cap != orig) { device_printf(w->devinfo->dev, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Dec 12 08:35:32 2012 (r244144) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Dec 12 11:44:20 2012 (r244145) @@ -218,6 +218,7 @@ #define LENOVO_3KN200_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x384e) #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d) #define LENOVO_TCA55_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x1015) +#define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff) /* Samsung */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 11:53:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F73F5C3; Wed, 12 Dec 2012 11:53:16 +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 00FD58FC08; Wed, 12 Dec 2012 11:53:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCBrF43038129; Wed, 12 Dec 2012 11:53:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCBrFjI038125; Wed, 12 Dec 2012 11:53:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201212121153.qBCBrFjI038125@svn.freebsd.org> From: Alexander Motin Date: Wed, 12 Dec 2012 11:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244146 - in head/sys/dev: ahci ata ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 11:53:16 -0000 Author: mav Date: Wed Dec 12 11:53:15 2012 New Revision: 244146 URL: http://svnweb.freebsd.org/changeset/base/244146 Log: Add IDs for SATA controllers on AMD Hudson-2 series chipsets. I am not exactly sure about the naming due to lack of specs on AMD site, but it is better to have some identification then none at all. MFC after: 1 month Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-ati.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ahci/ahci.c Wed Dec 12 11:53:15 2012 (r244146) @@ -122,6 +122,11 @@ static struct { {0x43931002, 0x00, "ATI IXP700", 0}, {0x43941002, 0x00, "ATI IXP800", 0}, {0x43951002, 0x00, "ATI IXP800", 0}, + {0x78001022, 0x00, "AMD Hudson-2", 0}, + {0x78011022, 0x00, "AMD Hudson-2", 0}, + {0x78021022, 0x00, "AMD Hudson-2", 0}, + {0x78031022, 0x00, "AMD Hudson-2", 0}, + {0x78041022, 0x00, "AMD Hudson-2", 0}, {0x06121b21, 0x00, "ASMedia ASM1061", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ata/ata-pci.h Wed Dec 12 11:53:15 2012 (r244146) @@ -101,6 +101,12 @@ struct ata_pci_controller { #define ATA_AMD768 0x74411022 #define ATA_AMD8111 0x74691022 #define ATA_AMD5536 0x209a1022 +#define ATA_AMD_HUDSON2_S1 0x78001022 +#define ATA_AMD_HUDSON2_S2 0x78011022 +#define ATA_AMD_HUDSON2_S3 0x78021022 +#define ATA_AMD_HUDSON2_S4 0x78031022 +#define ATA_AMD_HUDSON2_S5 0x78041022 +#define ATA_AMD_HUDSON2 0x780c1022 #define ATA_ADAPTEC_ID 0x9005 #define ATA_ADAPTEC_1420 0x02419005 Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Wed Dec 12 11:44:20 2012 (r244145) +++ head/sys/dev/ata/chipsets/ata-ati.c Wed Dec 12 11:53:15 2012 (r244146) @@ -91,6 +91,12 @@ ata_ati_probe(device_t dev) { ATA_ATI_IXP700_S4, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" }, { ATA_ATI_IXP800_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" }, { ATA_ATI_IXP800_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" }, + { ATA_AMD_HUDSON2, 0x00, ATI_PATA, 0, ATA_UDMA6, "Hudson-2" }, + { ATA_AMD_HUDSON2_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S3, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S4, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, + { ATA_AMD_HUDSON2_S5, 0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" }, { 0, 0, 0, 0, 0, 0}}; if (pci_get_vendor(dev) != ATA_ATI_ID) From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 15:27:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58C6FDDD; Wed, 12 Dec 2012 15:27:34 +0000 (UTC) (envelope-from pjd@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 3C1AD8FC18; Wed, 12 Dec 2012 15:27:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCFRYmT083335; Wed, 12 Dec 2012 15:27:34 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCFRY2F083334; Wed, 12 Dec 2012 15:27:34 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212121527.qBCFRY2F083334@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 12 Dec 2012 15:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244153 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 15:27:34 -0000 Author: pjd Date: Wed Dec 12 15:27:33 2012 New Revision: 244153 URL: http://svnweb.freebsd.org/changeset/base/244153 Log: Eliminate redundant variable. Modified: head/lib/libc/gen/sysctlbyname.c Modified: head/lib/libc/gen/sysctlbyname.c ============================================================================== --- head/lib/libc/gen/sysctlbyname.c Wed Dec 12 13:33:11 2012 (r244152) +++ head/lib/libc/gen/sysctlbyname.c Wed Dec 12 15:27:33 2012 (r244153) @@ -19,13 +19,10 @@ sysctlbyname(const char *name, void *old const void *newp, size_t newlen) { int real_oid[CTL_MAXNAME+2]; - int error; size_t oidlen; oidlen = sizeof(real_oid) / sizeof(int); - error = sysctlnametomib(name, real_oid, &oidlen); - if (error < 0) - return (error); - error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen); - return (error); + if (sysctlnametomib(name, real_oid, &oidlen) < 0) + return (-1); + return (sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen)); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 15:45:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB4746BA; Wed, 12 Dec 2012 15:45:04 +0000 (UTC) (envelope-from pjd@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 85C468FC08; Wed, 12 Dec 2012 15:45:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCFj4hS086445; Wed, 12 Dec 2012 15:45:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCFj4Hl086444; Wed, 12 Dec 2012 15:45:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212121545.qBCFj4Hl086444@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 12 Dec 2012 15:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244154 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 15:45:04 -0000 Author: pjd Date: Wed Dec 12 15:45:03 2012 New Revision: 244154 URL: http://svnweb.freebsd.org/changeset/base/244154 Log: Use kern.max_pid sysctl to obtain maximum PID number instead of using local define. Reviewed by: jhb Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Wed Dec 12 15:27:33 2012 (r244153) +++ head/bin/ps/ps.c Wed Dec 12 15:45:03 2012 (r244154) @@ -109,6 +109,7 @@ static int needcomm; /* -o "command" */ static int needenv; /* -e */ static int needuser; /* -o "user" */ static int optfatal; /* Fatal error parsing some list-option. */ +static int pid_max; /* kern.max_pid */ static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; @@ -148,6 +149,7 @@ static int pscomp(const void *, const v static void saveuser(KINFO *); static void scanvars(void); static void sizevars(void); +static void pidmax_init(void); static void usage(void); static char dfmt[] = "pid,tt,state,time,command"; @@ -200,6 +202,8 @@ main(int argc, char *argv[]) if (argc > 1) argv[1] = kludge_oldps_options(PS_ARGS, argv[1], argv[2]); + pidmax_init(); + all = descendancy = _fmt = nselectors = optfatal = 0; prtheader = showthreads = wflag = xkeep_implied = 0; xkeep = -1; /* Neither -x nor -X. */ @@ -722,7 +726,6 @@ addelem_gid(struct listinfo *inf, const return (1); } -#define BSD_PID_MAX 99999 /* Copy of PID_MAX from sys/proc.h. */ static int addelem_pid(struct listinfo *inf, const char *elem) { @@ -740,7 +743,7 @@ addelem_pid(struct listinfo *inf, const if (*endp != '\0' || tempid < 0 || elem == endp) { warnx("Invalid %s: %s", inf->lname, elem); errno = ERANGE; - } else if (errno != 0 || tempid > BSD_PID_MAX) { + } else if (errno != 0 || tempid > pid_max) { warnx("%s too large: %s", inf->lname, elem); errno = ERANGE; } @@ -753,7 +756,6 @@ addelem_pid(struct listinfo *inf, const inf->l.pids[(inf->count)++] = tempid; return (1); } -#undef BSD_PID_MAX /*- * The user can specify a device via one of three formats: @@ -1352,6 +1354,18 @@ kludge_oldps_options(const char *optlist } static void +pidmax_init(void) +{ + size_t intsize; + + intsize = sizeof(pid_max); + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) { + warn("unable to read kern.pid_max"); + pid_max = 99999; + } +} + +static void usage(void) { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 15:51:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 174A19B1; Wed, 12 Dec 2012 15:51:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D55E68FC15; Wed, 12 Dec 2012 15:51:24 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49CCDB9A9; Wed, 12 Dec 2012 10:51:24 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r244105 - in head/sys: kern sys Date: Wed, 12 Dec 2012 10:42:50 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110123.qBB1NpOV060501@svn.freebsd.org> In-Reply-To: <201212110123.qBB1NpOV060501@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212121042.51362.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 10:51:24 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 15:51:25 -0000 On Monday, December 10, 2012 8:23:51 pm Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 01:23:50 2012 > New Revision: 244105 > URL: http://svnweb.freebsd.org/changeset/base/244105 > > Log: > Switch the hardwired WITNESS panics to kassert_panic. > > This is an ongoing effort to provide runtime debug information > useful in the field that does not panic existing installations. > > This gives us the flexibility needed when shipping images to a > potentially large audience with WITNESS enabled without worrying > about formerly non-fatal LORs hurting a release. > > Sponsored by: iXsystems Witness doesn't panic on LORs. These are all bigger violations for things like doing sx_sunlock() on a exclusively locked sx lock. That is not safe and is merely going to result in data corruption and other unpleasantness. This sounds like a very bad idea. Did you talk about this anywhere (I have not caught up on various lists yet, so apologies if this has been discussed.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 15:51:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECA56B14; Wed, 12 Dec 2012 15:51:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id BD9B78FC12; Wed, 12 Dec 2012 15:51:37 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0F39FB924; Wed, 12 Dec 2012 10:51:37 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Date: Wed, 12 Dec 2012 10:46:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> In-Reply-To: <201212110708.qBB78EWx025288@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201212121046.43706.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 10:51:37 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 15:51:38 -0000 On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: > Author: alfred > Date: Tue Dec 11 07:08:14 2012 > New Revision: 244112 > URL: http://svnweb.freebsd.org/changeset/base/244112 > > Log: > Cleanup more of the kassert_panic. > > fix compile warnings on !amd64 and NULL derefs that would happen > if kassert_panic() would return. This is one reason why having kassert not panic is such a bad idea. There are tons of places where the compiler knows that panic() is __dead2, and there is no cleanup code to handle what happens when an invariant is violated. This is not safe to run in the field unless your customers do not care about their data. If you are interested in doing regression tests, I am using a very different approach for some locking regression tests I am working on in p4 that allow you to use a wrapper around setjmp/longjmp to "catch" panics somewhat like exception handling in C++/Java (though much cruder). However, evne that is only intended for testing, not for production cases where production data is at stake. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 16:14:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3536471; Wed, 12 Dec 2012 16:14:15 +0000 (UTC) (envelope-from smh@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 ADDF28FC1A; Wed, 12 Dec 2012 16:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCGEFk5092340; Wed, 12 Dec 2012 16:14:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCGEELG092334; Wed, 12 Dec 2012 16:14:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212121614.qBCGEELG092334@svn.freebsd.org> From: Steven Hartland Date: Wed, 12 Dec 2012 16:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244155 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 16:14:15 -0000 Author: smh Date: Wed Dec 12 16:14:14 2012 New Revision: 244155 URL: http://svnweb.freebsd.org/changeset/base/244155 Log: Renamed zfs trim stats removing duplicate zio_trim identifier from the name Added description option to kstats. Added descriptions for zio_trim kstats PR: kern/173113 Submitted by: Steven Hartland Reviewed by: pjd Approved by: pjd MFC after: 2 weeks Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c head/sys/cddl/compat/opensolaris/sys/kstat.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Wed Dec 12 16:14:14 2012 (r244155) @@ -118,7 +118,7 @@ kstat_install(kstat_t *ksp) SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), - kstat_sysctl, "QU", ""); + kstat_sysctl, "QU", ksent->desc); } } Modified: head/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kstat.h Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/compat/opensolaris/sys/kstat.h Wed Dec 12 16:14:14 2012 (r244155) @@ -53,6 +53,8 @@ typedef struct kstat_named { #define KSTAT_DATA_INT64 3 #define KSTAT_DATA_UINT64 4 uchar_t data_type; +#define KSTAT_DESCLEN 128 + char desc[KSTAT_DESCLEN]; union { uint64_t ui64; } value; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Dec 12 16:14:14 2012 (r244155) @@ -372,23 +372,23 @@ typedef struct zio_trim_stats { /* * Number of bytes successfully TRIMmed. */ - kstat_named_t zio_trim_bytes; + kstat_named_t bytes; /* * Number of successful TRIM requests. */ - kstat_named_t zio_trim_success; + kstat_named_t success; /* * Number of TRIM requests that failed because TRIM is not * supported. */ - kstat_named_t zio_trim_unsupported; + kstat_named_t unsupported; /* * Number of TRIM requests that failed for other reasons. */ - kstat_named_t zio_trim_failed; + kstat_named_t failed; } zio_trim_stats_t; extern zio_trim_stats_t zio_trim_stats; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Dec 12 15:45:03 2012 (r244154) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Dec 12 16:14:14 2012 (r244155) @@ -48,14 +48,15 @@ TUNABLE_INT("vfs.zfs.zio.exclude_metadat SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, "Exclude metadata buffers from dumps as well"); -/* - * See zio.h for more information about these fields. - */ zio_trim_stats_t zio_trim_stats = { - { "zio_trim_bytes", KSTAT_DATA_UINT64 }, - { "zio_trim_success", KSTAT_DATA_UINT64 }, - { "zio_trim_unsupported", KSTAT_DATA_UINT64 }, - { "zio_trim_failed", KSTAT_DATA_UINT64 }, + { "bytes", KSTAT_DATA_UINT64, + "Number of bytes successfully TRIMmed" }, + { "success", KSTAT_DATA_UINT64, + "Number of successful TRIM requests" }, + { "unsupported", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed because TRIM is not supported" }, + { "failed", KSTAT_DATA_UINT64, + "Number of TRIM requests that failed for reasons other than not supported" }, }; static kstat_t *zio_trim_ksp; @@ -2660,14 +2661,14 @@ zio_vdev_io_assess(zio_t *zio) if (zio->io_type == ZIO_TYPE_IOCTL && zio->io_cmd == DKIOCTRIM) switch (zio->io_error) { case 0: - ZIO_TRIM_STAT_INCR(zio_trim_bytes, zio->io_size); - ZIO_TRIM_STAT_BUMP(zio_trim_success); + ZIO_TRIM_STAT_INCR(bytes, zio->io_size); + ZIO_TRIM_STAT_BUMP(success); break; case EOPNOTSUPP: - ZIO_TRIM_STAT_BUMP(zio_trim_unsupported); + ZIO_TRIM_STAT_BUMP(unsupported); break; default: - ZIO_TRIM_STAT_BUMP(zio_trim_failed); + ZIO_TRIM_STAT_BUMP(failed); break; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 16:37:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C064D67 for ; Wed, 12 Dec 2012 16:37:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABBA8FC18 for ; Wed, 12 Dec 2012 16:37:32 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so869426lbb.13 for ; Wed, 12 Dec 2012 08:37:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=a5pbNXR7ru8n1jQ+nKPJcuH14SZdn7PHtMD5frdtGZ8=; b=uael4KACIzpTUxl3LGE5WReOstV8iCVqDHpQ2v0P5wY+6SXMT6nt2Yqp//xS8pmvKG ADK/K9hlKsFL83mTTwAhf/JHZgieOJubTN5luEOVATjc1Y+MMBMEbMBA2/89ZNm44KNX 8TgMwm5xLIRbzB8AWOo+Xzm5d++K4HtalkhAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=a5pbNXR7ru8n1jQ+nKPJcuH14SZdn7PHtMD5frdtGZ8=; b=Plwh4NUNNl0aAYHcFeAehECJGU4fjO6/61MwsFPLOtxKan7P3zqu+0CD1j3MnCeeBH 08MgTahYBazbSHwrSUx8F8lfdIPSY3j15a2WWOsu6MKCbmQCxxoFda6U5bYYiidcK0cn VwzwPQu6rT7eBaz3t00GWwB7o+Of6D2OObd+As2TWyFDiiCQEWELiBnxBc8Juof0Nk3S Cu3H6UErDbQN5AkpiLO/FAfVAbapn6d7IC1iKzZDmd6qI0jDW97HFlUFdJ1ZDnwhenMV beG3rv0OnEj102cCHTxZvpgK80tlBqUPj+eUX2jsiweLpKum7vK6QmFp9CQcMhzvUzhp /8aA== Received: by 10.152.111.166 with SMTP id ij6mr1678126lab.47.1355330251738; Wed, 12 Dec 2012 08:37:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Wed, 12 Dec 2012 08:37:00 -0800 (PST) In-Reply-To: <201212121545.qBCFj4Hl086444@svn.freebsd.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> From: Eitan Adler Date: Wed, 12 Dec 2012 11:37:00 -0500 X-Google-Sender-Auth: 5W4TbFRrUr37T9YCQKiT9BaRPRM Message-ID: Subject: Re: svn commit: r244154 - head/bin/ps To: Pawel Jakub Dawidek Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQl/pAqcvF69oUhXLrXnyXU4cqdSUDtOr74iq+kFV54zEI9phAIPzAmBIeQsPjZQnakD4coC Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 16:37:33 -0000 On 12 December 2012 10:45, Pawel Jakub Dawidek wrote: > + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) { > + warn("unable to read kern.pid_max"); Silly question, when could this fail and not be fatal? > + pid_max = 99999; Why not use PID_MAX from sys/proc.h? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 16:42:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7690F9E; Wed, 12 Dec 2012 16:42:31 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C59E88FC17; Wed, 12 Dec 2012 16:42:30 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DAAEFC0; Wed, 12 Dec 2012 17:40:27 +0100 (CET) Date: Wed, 12 Dec 2012 17:44:04 +0100 From: Pawel Jakub Dawidek To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212164403.GE1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="84ND8YJRMFlzkrP4" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 16:42:31 -0000 --84ND8YJRMFlzkrP4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 11:37:00AM -0500, Eitan Adler wrote: > On 12 December 2012 10:45, Pawel Jakub Dawidek wrote: >=20 > > + if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) <= 0) { > > + warn("unable to read kern.pid_max"); >=20 > Silly question, when could this fail and not be fatal? It isn't fatal, we can easly make some assumptions instead of turning ps(1) unusable. Currently it will be hard to make it fail, which doesn't mean we shouldn't handle this case. Some day it might fail for some reason (someone changed sysctl name?). > > + pid_max =3D 99999; >=20 > Why not use PID_MAX from sys/proc.h? Because we are in userland and PID_MAX is only defined for the kernel. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --84ND8YJRMFlzkrP4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDItFMACgkQForvXbEpPzTPzQCgx1koy5dhIl3zhl6y6lfH7i5w Jt8AoOVpPZEYYTwn8bZKqTit8pv3F9jg =spSU -----END PGP SIGNATURE----- --84ND8YJRMFlzkrP4-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 16:59:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5389290E; Wed, 12 Dec 2012 16:59:08 +0000 (UTC) (envelope-from smh@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 382768FC15; Wed, 12 Dec 2012 16:59:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCGx8XL000364; Wed, 12 Dec 2012 16:59:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCGx8OF000363; Wed, 12 Dec 2012 16:59:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212121659.qBCGx8OF000363@svn.freebsd.org> From: Steven Hartland Date: Wed, 12 Dec 2012 16:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244156 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 16:59:08 -0000 Author: smh Date: Wed Dec 12 16:59:07 2012 New Revision: 244156 URL: http://svnweb.freebsd.org/changeset/base/244156 Log: Add myself as a new src committer Approved by: pjd (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 12 16:14:14 2012 (r244155) +++ head/share/misc/committers-src.dot Wed Dec 12 16:59:07 2012 (r244156) @@ -249,6 +249,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] +smh [label="Steven Hartland\smh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] sos [label="Soren Schmidt\nsos@FreeBSD.org\n????/??/??"] sson [label="Stacey Son\nsson@FreeBSD.org\n2008/07/08"] @@ -307,6 +308,7 @@ anholt -> jkim avg -> art avg -> pluknet +avg -> smh benno -> grehan @@ -555,6 +557,7 @@ philip -> uqs pjd -> kib pjd -> lulf +pjd -> smh pjd -> trociny rgrimes -> markm From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 17:06:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DA609E; Wed, 12 Dec 2012 17:06:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E84E08FC12; Wed, 12 Dec 2012 17:06:22 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so418831wey.13 for ; Wed, 12 Dec 2012 09:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DAhzWk/fjvbloefMjql2Ti8WiDIoJV+ieMomQOcBr8U=; b=Kd4gZT7TjTQ9641DmYl1uGs9N6cdKwP56bBjLw5uWuHxCkveZ3rEp7GI4BG/1JoEoG 5CE6QWW4WvYwzKbYQyMhj1xjrq+p8YIUnzoZYuGvKGOm+ly/eSAppB7rlXTDmCgQots9 vKwhJ2rNuvC6XmK0zsO2Ue+Jmbx9DxrTJvaIeXZAMVR1WBiYWyrg2aQPrI1YhD2u55UK ItxobgJJYgIhV9C4u+S2N1CgsqyTsvKb3a+3yWI1yFA3bufgnVIIGzzDdiodGAbQ+niD NOjOaGxtwFiZ4vEyQQfc37b0VO86VxnbvtXEeNjlUJxTOkt67KEbXRrT88HqF8hcKVTS WSyg== MIME-Version: 1.0 Received: by 10.180.104.69 with SMTP id gc5mr24094269wib.13.1355331982184; Wed, 12 Dec 2012 09:06:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 09:06:22 -0800 (PST) In-Reply-To: <201212121046.43706.jhb@freebsd.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> Date: Wed, 12 Dec 2012 09:06:22 -0800 X-Google-Sender-Auth: uJqPpGQklYocA9GEPmvBMd8ljMc Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 17:06:24 -0000 kassert()s are already optional. Ie, you can choose to not compile them in. So the __dead2() code path bit for doing KASSERT() -> kassert_panic() at compile time isn't a problem. The problem is where you do panic() -> kassert_panic() (eg in the Witness code) which is what Alfred discovered shortly after doing up his initial patch. Anything which is a KASSERT() can and should be treated as a run-time warning just as much as a run-time "crash here so I can figure out what broke." Having the warning in a production box is going to be helpful for developers. Adrian On 12 December 2012 07:46, John Baldwin wrote: > On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 07:08:14 2012 >> New Revision: 244112 >> URL: http://svnweb.freebsd.org/changeset/base/244112 >> >> Log: >> Cleanup more of the kassert_panic. >> >> fix compile warnings on !amd64 and NULL derefs that would happen >> if kassert_panic() would return. > > This is one reason why having kassert not panic is such a bad idea. There are > tons of places where the compiler knows that panic() is __dead2, and there is > no cleanup code to handle what happens when an invariant is violated. This is > not safe to run in the field unless your customers do not care about their > data. If you are interested in doing regression tests, I am using a very > different approach for some locking regression tests I am working on in p4 > that allow you to use a wrapper around setjmp/longjmp to "catch" panics > somewhat like exception handling in C++/Java (though much cruder). However, > evne that is only intended for testing, not for production cases where > production data is at stake. > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 17:41:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F616C9C; Wed, 12 Dec 2012 17:41:22 +0000 (UTC) (envelope-from glebius@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 7360A8FC13; Wed, 12 Dec 2012 17:41:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCHfM6N008490; Wed, 12 Dec 2012 17:41:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCHfM6Q008489; Wed, 12 Dec 2012 17:41:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212121741.qBCHfM6Q008489@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 12 Dec 2012 17:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244157 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 17:41:22 -0000 Author: glebius Date: Wed Dec 12 17:41:21 2012 New Revision: 244157 URL: http://svnweb.freebsd.org/changeset/base/244157 Log: Fix a crash in tcp_input(), that happens when mbuf has a fwd_tag on it, but later after processing and freeing the tag, we need to jump back again to the findpcb label. Since the fwd_tag pointer wasn't NULL we tried to process and free the tag for second time. Reported & tested by: Pawel Tyll MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Dec 12 16:59:07 2012 (r244156) +++ head/sys/netinet/tcp_input.c Wed Dec 12 17:41:21 2012 (r244157) @@ -810,6 +810,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, @@ -847,6 +848,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 17:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46942FFF; Wed, 12 Dec 2012 17:49:03 +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 26A028FC13; Wed, 12 Dec 2012 17:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCHn3nJ009920; Wed, 12 Dec 2012 17:49:03 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCHn24Y009912; Wed, 12 Dec 2012 17:49:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201212121749.qBCHn24Y009912@svn.freebsd.org> From: Devin Teske Date: Wed, 12 Dec 2012 17:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244158 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 17:49:03 -0000 Author: dteske Date: Wed Dec 12 17:49:01 2012 New Revision: 244158 URL: http://svnweb.freebsd.org/changeset/base/244158 Log: Fix a regression caused by SVN r222417. Prior to r222417, setting `password' in loader.conf(5) did not prevent boot but instead only prevented changes to boot options by prompting for password if autoboot failed or the user interrupted the countdown sequence. After r222417 the same machine with `password' set in loader.conf(5) would no longer boot without _always_ entering the password. This patch restores the old (8.x and older) functionality for password in loader.conf(5) while adding a new bootlock_password feature to replace the edge-case should anybody desire the regressed functionality (HINT: great for PXE servers and/or private distributions). loader.conf(5) was updated to be more clear with-respect to password setting (previous text was misleading). Documentation (loader.conf(5) and check-password.4th(8)) has been updated to include notes on the new bootlock_password setting. Special thanks to Alex Verbod for bringing this to my attention and helping to refine the loader.conf(5) text. PR: conf/170110 Submitted by: Vitaly Zakharov Reviewed by: Alexander Verbod Modified: head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/check-password.4th head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/loader.4th.8 head/sys/boot/forth/loader.conf.5 head/sys/boot/forth/menu.4th.8 Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/beastie.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -94,8 +94,9 @@ The variable can be configured in .Xr loader.conf 5 to the number of seconds you would like to delay loading the boot menu. -During the delay the user can press Ctrl-C to fall back to autoboot or ENTER -to proceed. +During the delay the user can press Ctrl-C to fall back to +.Ic autoboot +or ENTER to proceed. The default behavior is to not delay. .El .Pp Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/check-password.4th Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2012 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -74,7 +74,7 @@ variable readlen \ input length again ; -: read ( -- String prompt ) +: read ( String prompt -- ) 0 25 at-xy \ Move the cursor to the bottom-left dup 1+ read-start ! \ Store X offset after the prompt @@ -134,23 +134,37 @@ variable readlen \ input length : check-password ( -- ) - \ Exit if a password was not set - s" password" getenv dup -1 = if - drop exit + \ Do not allow the user to proceed beyond this point if a boot-lock + \ password has been set (preventing even boot from proceeding) + s" bootlock_password" getenv dup -1 <> if + begin + s" Boot Password: " read ( prompt -- ) + 2dup readval readlen @ compare 0<> + while + 3000 ms ." loader: incorrect password" 10 emit + repeat + 2drop ( c-addr/u ) + else + drop ( -1 ) \ getenv cruft then - begin \ Loop as long as it takes to get the right password + \ Exit if a password was not set + s" password" getenv -1 = if exit else drop then + + \ We should prevent the user from visiting the menu or dropping to the + \ interactive loader(8) prompt, but still allow the machine to boot... - s" Password: " \ Output a prompt for a password - read \ Read the user's input until Enter + 0 autoboot + \ Only reached if autoboot fails for any reason (including if/when + \ the user aborts/escapes the countdown sequence leading to boot). + + s" password" getenv + begin + s" Password: " read ( prompt -- ) 2dup readval readlen @ compare 0= if 2drop exit \ Correct password then - - \ Bad Password - 3000 ms - ." loader: incorrect password" 10 emit - - again \ Not the right password; repeat + 3000 ms ." loader: incorrect password" 10 emit + again ; Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/check-password.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2011 +.Dd December 10, 2012 .Dt CHECK-PASSWORD.4TH 8 .Os .Sh NAME @@ -33,7 +33,8 @@ .Sh DESCRIPTION The file that goes by the name of .Nm -is a set of commands designed to prevent booting without the proper password. +is a set of commands designed to either prevent booting or prevent modification +of boot options without an appropriately configured password. The commands of .Nm by themselves are not enough for most uses. @@ -57,30 +58,36 @@ The commands provided by it are: .Pp .Bl -tag -width disable-module_module -compact -offset indent .It Ic check-password -Once called, the user cannot continue until the correct password is entered. -If the user enters the correct password the function returns. +Dual-purpose function that can either protect the interactive boot menu or +prevent boot without password (separately). .Pp -The password that is required is configured by setting the -.Ic password -variable in -.Xr loader.conf 5 . -.Pp -Subsequent calls after a successful password -has been entered will not cause reprompting -\(em the function will silently return. +First checks +.Va bootlock_password +and if-set, the user cannot continue until the correct password is entered. +.Pp +Next checks +.Va password +and if-set, tries to +.Ic autoboot +and only prompts for password on failure or user-interrupt. +See +.Xr loader.conf 5 +for additional information. .El .Pp The environment variables that effect its behavior are: -.Bl -tag -width bootfile -offset indent +.Bl -tag -width bootlock_password -offset indent +.It Va bootlock_password +Sets the bootlock password (up to 16 characters long) that is required by +.Ic check-password +to be entered before the system is allowed to boot. .It Va password Sets the password (up to 16 characters long) that is required by .Ic check-password -to be entered before the system is allowed to boot. If unset (default) or NULL, -.Ic check-password -will silently abort. +before the user is allowed to visit the boot menu. .El .Sh FILES -.Bl -tag -width /boot/loader.4th -compact +.Bl -tag -width /boot/check-password.4th -compact .It Pa /boot/loader The .Xr loader 8 . @@ -101,11 +108,20 @@ check-password .Ed .Pp Set a password in -.Xr loader.conf 5 : +.Xr loader.conf 5 +to prevent modification of boot options: .Pp .Bd -literal -offset indent -compact password="abc123" .Ed +.Pp +Set a password in +.Xr loader.conf 5 +to prevent booting without password: +.Pp +.Bd -literal -offset indent -compact +bootlock_password="boot" +.Ed .Sh SEE ALSO .Xr loader.conf 5 , .Xr loader 8 , Modified: head/sys/boot/forth/loader.4th.8 ============================================================================== --- head/sys/boot/forth/loader.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/loader.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -99,7 +99,7 @@ This is the command used in the default .Pa /boot/loader.rc file, and it uses the -.Pa autoboot +.Ic autoboot command (see .Xr loader 8 ) , so it can be stopped for further interaction with Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/loader.conf.5 Wed Dec 12 17:49:01 2012 (r244158) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 20, 2011 +.Dd December 10, 2012 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -113,8 +113,23 @@ that contains a kernel. .It Ar kernel_options Flags to be passed to the kernel. .It Ar password +Protect boot menu with a password without interrupting +.Ic autoboot +process. +The password should be in clear text format. +If a password is set, boot menu will not appear until any key is pressed during +countdown period specified by +.Va autoboot_delay +variable or +.Ic autoboot +process fails. +In both cases user should provide specified password to be able to access boot +menu. +.It Ar bootlock_password Provides a password to be required by check-password before execution is allowed to continue. +The password should be in clear text format. +If a password is set, the user must provide specified password to boot. .It Ar verbose_loading If set to .Dq YES , Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Wed Dec 12 17:41:21 2012 (r244157) +++ head/sys/boot/forth/menu.4th.8 Wed Dec 12 17:49:01 2012 (r244158) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Devin Teske +.\" Copyright (c) 2011-2012 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -108,8 +108,9 @@ will wait for user input and never execu If set to .Dq Li -1 , .Ic menu-display -will boot immediately, preventing both interruption of the autoboot process and -escaping to the loader prompt. +will boot immediately, preventing both interruption of the +.Ic autoboot +process and escaping to the loader prompt. Default is .Dq Li 10 . See From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 18:47:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C949765A; Wed, 12 Dec 2012 18:47:25 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6AF8FC0A; Wed, 12 Dec 2012 18:47:25 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3EEF51A3CC0; Wed, 12 Dec 2012 10:47:25 -0800 (PST) Message-ID: <50C8D13C.6070107@mu.org> Date: Wed, 12 Dec 2012 10:47:24 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: <201212121046.43706.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 18:47:25 -0000 to all: I am trying to take this offline with John so that we can discuss the reasoning behind the change and come to an agreement on how it is implemented, or if not to remove it. -Alfred On 12/12/12 7:46 AM, John Baldwin wrote: > On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 07:08:14 2012 >> New Revision: 244112 >> URL: http://svnweb.freebsd.org/changeset/base/244112 >> >> Log: >> Cleanup more of the kassert_panic. >> >> fix compile warnings on !amd64 and NULL derefs that would happen >> if kassert_panic() would return. > This is one reason why having kassert not panic is such a bad idea. There are > tons of places where the compiler knows that panic() is __dead2, and there is > no cleanup code to handle what happens when an invariant is violated. This is > not safe to run in the field unless your customers do not care about their > data. If you are interested in doing regression tests, I am using a very > different approach for some locking regression tests I am working on in p4 > that allow you to use a wrapper around setjmp/longjmp to "catch" panics > somewhat like exception handling in C++/Java (though much cruder). However, > evne that is only intended for testing, not for production cases where > production data is at stake. > From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 21:07:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7693782E; Wed, 12 Dec 2012 21:07:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CEB198FC0C; Wed, 12 Dec 2012 21:07:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBCL6rsU047192; Wed, 12 Dec 2012 23:06:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBCL6rsU047192 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBCL6rKk047191; Wed, 12 Dec 2012 23:06:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 12 Dec 2012 23:06:52 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121212210652.GO3013@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2suWxhRNFFJI65F9" Content-Disposition: inline In-Reply-To: <201212121545.qBCFj4Hl086444@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 21:07:05 -0000 --2suWxhRNFFJI65F9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Wed Dec 12 15:45:03 2012 > New Revision: 244154 > URL: http://svnweb.freebsd.org/changeset/base/244154 >=20 > Log: > Use kern.max_pid sysctl to obtain maximum PID number instead of using l= ocal > define. It is pid_max, not max_pid. But the change is wrong. The kern.pid_max only limits newly allocated pids, it does not magically moves existing pids, which are out of range, to the limited region. See the corresponding commit log for the description. It was added to make it easier to run FreeBSD 1.x binaries on the modern kernels. --2suWxhRNFFJI65F9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQyPHsAAoJEJDCuSvBvK1B+UsP/1f1QyH8x9QbF4XiwZp5G1nh ftyQ98ufISWu9+oorG2eQvWKXh5nue19oOneNNcKmxEk28tdZBJ1PO79zstqmHBq 0byXnn+iVM98dQsWkem7YO4fVfROm3gHg/Mkf0tiKJQKJLJKyqW/mIY8k3G/WEcg D9ccDOhep++fdLbxY4EA0h6AasTa23iJ3XolKKr1QQ6a+NboRxQhePtg7y5rGbwe 5rxoU6u51h6TUHEzM3aafzlFhBE/iH8SB3wJCIL+s9RlibknM2LccknFYQrAS+Ib Jrgk7hh/FeEX53zWPp/xVZI8nta4NWqHbIYGx/L3uEcgJzF4dAtz5ho7x8Wd77QS y8uYLL9VeKnehGoMwNyZltfvUoHlDU7eCIz1bxHni7WutHJIVhm/y/Ifj+5BwDYX xxe4fm5l/5VgH3nIaVy3hQVUzD32XezzN1YEODkbq9LfLzP+PWzgEEM60kzvL9Fb Wj/SQO3ssGAcuBj1cqkYJijwC0U7aZqffpxg1c0SQLQ9UDRUBhkIiEvpGRh5Xn2/ G7YtqPKxRjjSI0N71p4vEhmWomc7xAqSRFthPLeCKWkr274HoyCFraYK8s5ikkm+ 95KsanLbIiul2zi3xnOk3AMHsmLAnHWWvbmxF62I/rQyUGdBAhBAQtXO6F/VKZpP x7uVF6Pw0PmM5BrZWhQd =zrG7 -----END PGP SIGNATURE----- --2suWxhRNFFJI65F9-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:01:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 645497A2; Wed, 12 Dec 2012 22:01:11 +0000 (UTC) (envelope-from jilles@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 436DC8FC14; Wed, 12 Dec 2012 22:01:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCM1Bi4059807; Wed, 12 Dec 2012 22:01:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCM1Aeh059801; Wed, 12 Dec 2012 22:01:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201212122201.qBCM1Aeh059801@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 12 Dec 2012 22:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244162 - in head: bin/sh tools/regression/bin/sh/errors X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:01:11 -0000 Author: jilles Date: Wed Dec 12 22:01:10 2012 New Revision: 244162 URL: http://svnweb.freebsd.org/changeset/base/244162 Log: sh: Detect and flag write errors on stdout in builtins. If there is a write error on stdout, a message will be printed (to stderr) and the exit status will be changed to 2 if it would have been 0 or 1. PR: bin/158206 Added: head/tools/regression/bin/sh/errors/write-error1.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/output.c head/bin/sh/output.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/eval.c Wed Dec 12 22:01:10 2012 (r244162) @@ -1070,6 +1070,7 @@ evalcommand(union node *cmd, int flags, } handler = &jmploc; redirect(cmd->ncmd.redirect, mode); + outclearerror(out1); /* * If there is no command word, redirection errors should * not be fatal but assignment errors should. @@ -1085,6 +1086,11 @@ evalcommand(union node *cmd, int flags, builtin_flags = flags; exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv); flushall(); + if (outiserror(out1)) { + warning("write error on stdout"); + if (exitstatus == 0 || exitstatus == 1) + exitstatus = 2; + } cmddone: if (argc > 0) bltinunsetlocale(); Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/output.c Wed Dec 12 22:01:10 2012 (r244162) @@ -239,6 +239,20 @@ freestdout(void) } +int +outiserror(struct output *file) +{ + return (file->flags & OUTPUT_ERR); +} + + +void +outclearerror(struct output *file) +{ + file->flags &= ~OUTPUT_ERR; +} + + void outfmt(struct output *file, const char *fmt, ...) { Modified: head/bin/sh/output.h ============================================================================== --- head/bin/sh/output.h Wed Dec 12 20:55:30 2012 (r244161) +++ head/bin/sh/output.h Wed Dec 12 22:01:10 2012 (r244162) @@ -66,6 +66,8 @@ void emptyoutbuf(struct output *); void flushall(void); void flushout(struct output *); void freestdout(void); +int outiserror(struct output *); +void outclearerror(struct output *); void outfmt(struct output *, const char *, ...) __printflike(2, 3); void out1fmt(const char *, ...) __printflike(1, 2); void out2fmt_flush(const char *, ...) __printflike(1, 2); Added: head/tools/regression/bin/sh/errors/write-error1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/errors/write-error1.0 Wed Dec 12 22:01:10 2012 (r244162) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! echo >&- 2>/dev/null From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:11:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3458ABF9; Wed, 12 Dec 2012 22:11:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 021088FC14; Wed, 12 Dec 2012 22:11:20 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 60E24B91E; Wed, 12 Dec 2012 17:11:19 -0500 (EST) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Date: Wed, 12 Dec 2012 16:58:48 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201212121658.49048.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Dec 2012 17:11:19 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:11:20 -0000 On Wednesday, December 12, 2012 12:06:22 pm Adrian Chadd wrote: > kassert()s are already optional. Ie, you can choose to not compile them in. > > So the __dead2() code path bit for doing KASSERT() -> kassert_panic() > at compile time isn't a problem. > > The problem is where you do panic() -> kassert_panic() (eg in the > Witness code) which is what Alfred discovered shortly after doing up > his initial patch. > > Anything which is a KASSERT() can and should be treated as a run-time > warning just as much as a run-time "crash here so I can figure out > what broke." Having the warning in a production box is going to be > helpful for developers. Hmmm, I'll have to chew on this. Adding lots of returns because panic's are now no longer dead2 was why I ended up backing the removal of the RESTARTABLE_PANICS option. I'm inclined to say that it's really bad to let a kernel known to be in a bad state continue, and that if someone has asked for the slowdown of all the extra checks INVARIANTS adds, they might as well minimize the chance for data corruption by having the kernel stop as soon as a problem is detected. (Note that the primary reason I know for people not running with INVARIANTS enabled is not that they don't want panics, but that they don't want the performance hit.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:15:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3700CF32; Wed, 12 Dec 2012 22:15:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C83198FC0A; Wed, 12 Dec 2012 22:15:24 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so567903wey.13 for ; Wed, 12 Dec 2012 14:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=yyijKWTqY9HV2HPXTuWRcDOzCeE5SiZxLBLqf52XBYs=; b=lY3jTF1QE86nEZunYmsRf0/evGIqJZo+XKbZlmuPG9zF+QVEfdnEMtgPSkvjpI1ibF nSXEyshFQ/haK9ltPwrw891RBCuqS45mPYexWGmjz0/PrmyKZVtmeZ6mYEtoVVzRzGtt SH0GX37SMgJ5p9kFrrI+CDijuW8n4OXaoWvW3EiNiaVKXhWVeZnH3WdKw3Yc1yS4xw4j MGdQ8Sk796ih1MCLEB7135O48ZabXGI68m4W1yjRhbuLd7Hbg7qbVwxhyrkxk11nwE9o F6ZtpTT8RaBz6/nohTy5kn6MwbntG6mtpDDJ185npirrqbAyoQfgUpPz9ydjwCv1wA/z Kkww== MIME-Version: 1.0 Received: by 10.180.24.4 with SMTP id q4mr25293854wif.19.1355350523804; Wed, 12 Dec 2012 14:15:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:15:23 -0800 (PST) In-Reply-To: <201212121658.49048.jhb@freebsd.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> Date: Wed, 12 Dec 2012 14:15:23 -0800 X-Google-Sender-Auth: 2JhGvDMng89EICCqRRmX8fv5n38 Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:15:26 -0000 On 12 December 2012 13:58, John Baldwin wrote: >> Anything which is a KASSERT() can and should be treated as a run-time >> warning just as much as a run-time "crash here so I can figure out >> what broke." Having the warning in a production box is going to be >> helpful for developers. > > Hmmm, I'll have to chew on this. Adding lots of returns because panic's are > now no longer dead2 was why I ended up backing the removal of the > RESTARTABLE_PANICS option. Yes, for panic() as it stands it should just do that - panic. We should likely go over the panic()s and replace them with kassert+handle gracefully wherever its appropriate (there are a few places in net80211 for example that I'd like to do this.) But you're right. For panic(), the rest of the code likely doesn't handle or continue gracefully, so we shouldn't automatically disable them. But this is about KASSERT(). Alfred mixed this in with witness "non panic" mode, which I think is what's confusing people. > I'm inclined to say that it's really bad to let a kernel known to be in a > bad state continue, and that if someone has asked for the slowdown of all > the extra checks INVARIANTS adds, they might as well minimize the chance for > data corruption by having the kernel stop as soon as a problem is detected. Right, but that should be an option. It'd be nice if we were able to dump out some system state when an invariant condition or witness issue was hit (like a mini scripted ddb dump - say, log things like the current lock state) but then continue. > (Note that the primary reason I know for people not running with INVARIANTS > enabled is not that they don't want panics, but that they don't want the > performance hit.) Well, it would be nice to be able to enable invariants on some shipping "debug" versions of images in order to gather more data without crashing the kernel. Adrian From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:25:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7406758E; Wed, 12 Dec 2012 22:25:32 +0000 (UTC) (envelope-from jimharris@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 56B0F8FC16; Wed, 12 Dec 2012 22:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBCMPWg5065218; Wed, 12 Dec 2012 22:25:32 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBCMPWwr065217; Wed, 12 Dec 2012 22:25:32 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212122225.qBCMPWwr065217@svn.freebsd.org> From: Jim Harris Date: Wed, 12 Dec 2012 22:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244163 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:25:32 -0000 Author: jimharris Date: Wed Dec 12 22:25:31 2012 New Revision: 244163 URL: http://svnweb.freebsd.org/changeset/base/244163 Log: Add my ex-mentors. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 12 22:01:10 2012 (r244162) +++ head/share/misc/committers-src.dot Wed Dec 12 22:25:31 2012 (r244163) @@ -241,6 +241,7 @@ rstone [label="Ryan Stone\nrstone@FreeBS ru [label="Ruslan Ermilov\nru@FreeBSD.org\n1999/05/27"] rwatson [label="Robert N. M. Watson\nrwatson@FreeBSD.org\n1999/12/16"] sam [label="Sam Leffler\nsam@FreeBSD.org\n2002/07/02"] +sbruno [label="Sean Bruno\nsbruno@FreeBSD.org\n????/??/??"] sanpei [label="MIHIRA Sanpei Yoshiro\nsanpei@FreeBSD.org\n2000/06/19"] scf [label="Sean C. Farley\nscf@FreeBSD.org\n2007/06/24"] schweikh [label="Jens Schweikhardt\nschweikh@FreeBSD.org\n2001/04/06"] @@ -602,8 +603,11 @@ sam -> andre sam -> benjsc sam -> sephe +sbruno -> jimharris + schweikh -> dds +scottl -> jimharris scottl -> pjd scottl -> sah scottl -> yongari From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:27:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EA2A7F1; Wed, 12 Dec 2012 22:27:05 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 392BC8FC0C; Wed, 12 Dec 2012 22:27:05 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id BB61B1A3C1B; Wed, 12 Dec 2012 14:27:04 -0800 (PST) Message-ID: <50C904B8.6000502@mu.org> Date: Wed, 12 Dec 2012 14:27:04 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:27:05 -0000 On 12/12/12 2:15 PM, Adrian Chadd wrote: > On 12 December 2012 13:58, John Baldwin wrote: > > >> (Note that the primary reason I know for people not running with INVARIANTS >> enabled is not that they don't want panics, but that they don't want the >> performance hit.) > Well, it would be nice to be able to enable invariants on some > shipping "debug" versions of images in order to gather more data > without crashing the kernel. Yes, two of my employers were more of "we want to get more debug metrics, we have the spare cycles, but we can't deal with superfluous panics". It also allows us "non-architects" to slip in a debug image when we have spare cpu without getting yelled at for "crashing the $foo". -Alfred From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:30:12 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 320BDA9E; Wed, 12 Dec 2012 22:30:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB908FC14; Wed, 12 Dec 2012 22:30:10 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07250; Thu, 13 Dec 2012 00:30:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TiuoT-000MQv-Sv; Thu, 13 Dec 2012 00:30:01 +0200 Message-ID: <50C90567.8080406@FreeBSD.org> Date: Thu, 13 Dec 2012 00:29:59 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin , Adrian Chadd , Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> In-Reply-To: <201212121658.49048.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:30:12 -0000 on 12/12/2012 23:58 John Baldwin said the following: > Hmmm, I'll have to chew on this. Adding lots of returns because panic's are > now no longer dead2 was why I ended up backing the removal of the > RESTARTABLE_PANICS option. > > I'm inclined to say that it's really bad to let a kernel known to be in a > bad state continue, and that if someone has asked for the slowdown of all > the extra checks INVARIANTS adds, they might as well minimize the chance for > data corruption by having the kernel stop as soon as a problem is detected. > > (Note that the primary reason I know for people not running with INVARIANTS > enabled is not that they don't want panics, but that they don't want the > performance hit.) Previously we had two alternatives: - use INVARIANTS and be sure that the kernel is in sane state, that any bugs are caught early, no corruptions / insanity is propagated to the point where valuable data can be hurt; the price is lower (possibly much lower) performance because of all other checks; - do not use INVARIANTS and risk that some error would not be caught early and would cause greater harm; the upside is better performance; So people used (use) INVARIANTS to extensively test any new code/environments, but then prefer to run production systems without INVARIANTS. Now we get a new middle-ground: get both worse performance (because KASSERTs are compiled in) and a risk of harming your data (because KASSERTs no longer panic). The upside: there is no panic! There's just a log message (or etc). and chance to get more log messages because the insanity propagates. And a chance to lose your data (your customer's) - but I've already mentioned this. I am not sure that I like this kind of middle-ground. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:33:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEC0BC60; Wed, 12 Dec 2012 22:33:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 48C6C8FC12; Wed, 12 Dec 2012 22:33:42 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07296; Thu, 13 Dec 2012 00:33:38 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tiury-000MRH-7Y; Thu, 13 Dec 2012 00:33:38 +0200 Message-ID: <50C90641.4030000@FreeBSD.org> Date: Thu, 13 Dec 2012 00:33:37 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> In-Reply-To: <50C904B8.6000502@mu.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:33:44 -0000 on 13/12/2012 00:27 Alfred Perlstein said the following: > On 12/12/12 2:15 PM, Adrian Chadd wrote: >> On 12 December 2012 13:58, John Baldwin wrote: >> >> >>> (Note that the primary reason I know for people not running with INVARIANTS >>> enabled is not that they don't want panics, but that they don't want the >>> performance hit.) >> Well, it would be nice to be able to enable invariants on some >> shipping "debug" versions of images in order to gather more data >> without crashing the kernel. > Yes, two of my employers were more of "we want to get more debug metrics, we > have the spare cycles, but we can't deal with superfluous panics". > > It also allows us "non-architects" to slip in a debug image when we have spare > cpu without getting yelled at for "crashing the $foo". There is clearly something wrong with this sort of mentality. If you find instances where a developer put panic(9) (or KASSERT or etc) to mean "maybe here is a bug, let's just panic", then let's get those things fixed. But most of assertions in our code that are know to me really mean that a real bug has already occurred, that portions of kernel state are corrupted and there is no going back to a sane state, only going forward to corrupting more and more. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:37:35 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F415E7D; Wed, 12 Dec 2012 22:37:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AE2408FC0A; Wed, 12 Dec 2012 22:37:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07324; Thu, 13 Dec 2012 00:37:32 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tiuvj-000MRZ-Ns; Thu, 13 Dec 2012 00:37:31 +0200 Message-ID: <50C9072A.6040605@FreeBSD.org> Date: Thu, 13 Dec 2012 00:37:30 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:37:35 -0000 on 12/12/2012 19:06 Adrian Chadd said the following: > kassert()s are already optional. Ie, you can choose to not compile them in. > > So the __dead2() code path bit for doing KASSERT() -> kassert_panic() > at compile time isn't a problem. > > The problem is where you do panic() -> kassert_panic() (eg in the > Witness code) which is what Alfred discovered shortly after doing up > his initial patch. > > Anything which is a KASSERT() can and should be treated as a run-time > warning just as much as a run-time "crash here so I can figure out > what broke." Having the warning in a production box is going to be > helpful for developers. I have a quite different view on purpose and costs of KASSERTs. Specifically referring to r243980 I do not think that "non-fatal asserts" should really exist (or do exist). I wish all this muddying of KASSERT meaning would get reverted. These quite sensitive changes were rushed in, IMO. > On 12 December 2012 07:46, John Baldwin wrote: >> On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >>> Author: alfred >>> Date: Tue Dec 11 07:08:14 2012 >>> New Revision: 244112 >>> URL: http://svnweb.freebsd.org/changeset/base/244112 >>> >>> Log: >>> Cleanup more of the kassert_panic. >>> >>> fix compile warnings on !amd64 and NULL derefs that would happen >>> if kassert_panic() would return. >> >> This is one reason why having kassert not panic is such a bad idea. There are >> tons of places where the compiler knows that panic() is __dead2, and there is >> no cleanup code to handle what happens when an invariant is violated. This is >> not safe to run in the field unless your customers do not care about their >> data. If you are interested in doing regression tests, I am using a very >> different approach for some locking regression tests I am working on in p4 >> that allow you to use a wrapper around setjmp/longjmp to "catch" panics >> somewhat like exception handling in C++/Java (though much cruder). However, >> evne that is only intended for testing, not for production cases where >> production data is at stake. >> >> -- >> John Baldwin -- Andriy Gapon -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:38:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19E5069; Wed, 12 Dec 2012 22:38:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mx1.freebsd.org (Postfix) with ESMTP id A6E488FC08; Wed, 12 Dec 2012 22:38:24 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hq7so3633813wib.1 for ; Wed, 12 Dec 2012 14:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=/MfOXlFcUv2fotprf/gWSXH9zuWKhhyH1ywbr+IQe/M=; b=lzppjTdzgSGZ5OXZlqPgMKDU82G8jUAjbAkjCAte2jluL7fAtW9VDqWZN8JlOUEFZ4 ehjT6guFs8yOAqZ4AH7tuH9XsviaLRuBz9zTN3i7kLlCkPIMLtCZ7fzRM2+gq3QiJ0il a4nYDp/lxWrQ693b4Gjl2T+ksVdRUex5mIGUFMnL5MmCL0BOMfOaWvNPCuzD0J1kDWfB iNTV+J8HNAv/xLhNvAuIc2A/EcGj/RUdN9GnKIfn1cje7naSgiJaI7fZWREMXmOJa4R2 pAMCfLXEuXPG4jx9pty0qUMDJHEobwIb4hoQE6htu2pItIQ9Jl+984PyIr1fFL3acaEB 7D8g== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4578225wjc.1.1355351903711; Wed, 12 Dec 2012 14:38:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:38:23 -0800 (PST) In-Reply-To: <50C90567.8080406@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> Date: Wed, 12 Dec 2012 14:38:23 -0800 X-Google-Sender-Auth: Rxvk9D1QatkccT8hXviMMQFbcgk Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:38:26 -0000 There are two parts to this; * don't compile in invariants. Panics panic. Invariant conditions aren't checked. You end up with data corruption still if there are bugs. * compile in invariants. Panics panic. Invariant conditions are checked and immediately panic. You can't run this in production to get debugging info because our debugging info is "create a crash dump and reboot." Now, the crash dump is great for us developers. But crap for say, a file server. If it's some very subtle issue that only occasionally pops up once a week and doesn't obviously screw with your data: * you can enable invariants and get a crash dump each time - then us developers get lots of information, but the user experiences outages once a week; * they just give the hell up, disable invariants in production and occasionally hit odd issues they can't explain. So now there's a third option: * enable invariants, get told when you hit that condition, and continue running. Now, we ship _right now_ generic with INVARIANTS disabled, because in theory the releases are supposed to be stable enough for us not to need the extra debugging information. That means that for those very occasional, very subtle bugs that invariants may catch, we don't have any way of getting told about them. Now, enabling some alternative to panic() is a different story and not what's being addressed here. HTH, Adrian From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:43:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA317447; Wed, 12 Dec 2012 22:43:13 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E015C8FC0C; Wed, 12 Dec 2012 22:43:11 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so578499wey.13 for ; Wed, 12 Dec 2012 14:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=i8/YdtaWV3nVoVYlmSxfzubqgWOsi68FmtFxykYi5Fg=; b=vjuTA8U9DX/9dpUkwFt1uzRGjC77TpqKr8pLrYCn3RnYxONXoHVK3yYOJ4fXkRw90i VZgmbhoHIBkVt9FwTGTwcJzWyU134pkJC+tYb6EkhpRseoohJh0q4BXDmg3CdqTfMWdN XhLIRsMi4MKoCUqhHbVNgeLN2kGvuX7G4KykbxnbcAUS1qIquFC/CSMWfzisuUnBKBSf aIYDLZkfgxjuRf89oV7E6ddWcHWGE1J8QxXgcEyty/iiqbQl5hPGWYOsyt+JZu9LVB6g rxH2QLK4TBOxS/zf+zLNygW7Opg2M/+dJrIKoRpeKAbtgby2wt0kC773HS7vyoMuJ/3M ZZcw== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4591109wjc.1.1355352191136; Wed, 12 Dec 2012 14:43:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 14:43:11 -0800 (PST) In-Reply-To: <50C90641.4030000@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> <50C90641.4030000@FreeBSD.org> Date: Wed, 12 Dec 2012 14:43:11 -0800 X-Google-Sender-Auth: 07h6SMbpxIUcj-Aiz7i3W_Pg7sE Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:43:13 -0000 On 12 December 2012 14:33, Andriy Gapon wrote: >> Yes, two of my employers were more of "we want to get more debug metrics, we >> have the spare cycles, but we can't deal with superfluous panics". >> >> It also allows us "non-architects" to slip in a debug image when we have spare >> cpu without getting yelled at for "crashing the $foo". > > There is clearly something wrong with this sort of mentality. > > If you find instances where a developer put panic(9) (or KASSERT or etc) to mean > "maybe here is a bug, let's just panic", then let's get those things fixed. > > But most of assertions in our code that are know to me really mean that a real > bug has already occurred, that portions of kernel state are corrupted and there > is no going back to a sane state, only going forward to corrupting more and more. Dude, if you're running -STABLE right now, you don't have invariants enabled and you aren't checking for them. So right now, as it stands, large swaths of our kernel code are falling afoul of what you're calling Alfred out on. Before you all reply, please review and understand the difference between "panic()" and "KASSERT()". panic() is not being changed here. KASSERT() is what's being changed here. panic() is not optional. KASSERT() is. With a non-INVARIANTS kernel, we _are not checking invariants_ and we are continuing to run _after_ said non-compiled-in invariants. With this in mind, please re-review this. :-) Adrian From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:48:30 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF450710; Wed, 12 Dec 2012 22:48:30 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id AAFC08FC0A; Wed, 12 Dec 2012 22:48:30 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id C863B1A3C33; Wed, 12 Dec 2012 14:48:29 -0800 (PST) Message-ID: <50C909BD.9090709@mu.org> Date: Wed, 12 Dec 2012 14:48:29 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: <50C90567.8080406@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:48:30 -0000 On 12/12/12 2:29 PM, Andriy Gapon wrote: > Now we get a new middle-ground: get both worse performance (because > KASSERTs are compiled in) and a risk of harming your data (because > KASSERTs no longer panic). The upside: there is no panic! There's just > a log message (or etc). and chance to get more log messages because > the insanity propagates. And a chance to lose your data (your > customer's) - but I've already mentioned this. I am not sure that I > like this kind of middle-ground. I have a number of points here: The most important one being: 1) without kassert you would still have the bug, just that it would be unreported. The upside: there is no panic! There's **NO** log message (or etc). and chance to get more log messages because the insanity propagates. Terrible! Let me explain that again: If you don't compile in KASSERT, then it's not like the condition is never going to happen. Instead it will just be unreported. So to put it in your own words, *without* KASSERT you get: The upside: there is no panic! There's **NO** log message (or etc). and chance to get more log messages because the insanity propagates. Now let's get to the other points: 2) Since this is not the default, then I do not understand why you are so concerned. 3) Can you explain to me why it is so upsetting to you that someone might be able to use this functionality? 4) *puts on flame retardant suit* ... Linux has had this for over a decade and it's allowed them to find bugs in different ways. Mind you, in Linux it was the default. 5) Adrian and I have both stated that we need this sort of functionality to avoid superfluous panics in our work environments while still getting bug feedback. Can we now please stop arguing over a non-default option that will help some vendors report bugs to the project? Thank you, -Alfred From owner-svn-src-all@FreeBSD.ORG Wed Dec 12 22:49:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A995C88D; Wed, 12 Dec 2012 22:49:44 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 81AD28FC0A; Wed, 12 Dec 2012 22:49:44 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 2F5E71A3C20; Wed, 12 Dec 2012 14:49:44 -0800 (PST) Message-ID: <50C90A07.5030501@mu.org> Date: Wed, 12 Dec 2012 14:49:43 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 22:49:44 -0000 On 12/12/12 2:38 PM, Adrian Chadd wrote: > There are two parts to this; > > * don't compile in invariants. Panics panic. Invariant conditions > aren't checked. You end up with data corruption still if there are > bugs. > * compile in invariants. Panics panic. Invariant conditions are > checked and immediately panic. You can't run this in production to get > debugging info because our debugging info is "create a crash dump and > reboot." > > Now, the crash dump is great for us developers. But crap for say, a > file server. If it's some very subtle issue that only occasionally > pops up once a week and doesn't obviously screw with your data: > > * you can enable invariants and get a crash dump each time - then us > developers get lots of information, but the user experiences outages > once a week; > * they just give the hell up, disable invariants in production and > occasionally hit odd issues they can't explain. > > So now there's a third option: > > * enable invariants, get told when you hit that condition, and continue running. > > Now, we ship _right now_ generic with INVARIANTS disabled, because in > theory the releases are supposed to be stable enough for us not to > need the extra debugging information. That means that for those very > occasional, very subtle bugs that invariants may catch, we don't have > any way of getting told about them. > > Now, enabling some alternative to panic() is a different story and not > what's being addressed here. > > HTH, > Yes. -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:03:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A794DEF; Thu, 13 Dec 2012 00:03:02 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECF88FC0C; Thu, 13 Dec 2012 00:03:01 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id wz12so956853pbc.13 for ; Wed, 12 Dec 2012 16:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=rUkkDS+u9T7qLpp5uJ5SoOT/90sisZr58CIKe88eUbw=; b=Hd3O7Psay78hbAr1h7RcqT/kDV4pQ3vzCp/C65onL3sGr99TZxc7rT8iQwhl0pxhkK ZiLL7lXY+bmT3zRr6OoNko76J74V3o/3Orhbjq20gF6h1KKpIelfyYiBFVYafrNiA566 y7vLqIoAZyjsc0m3PCeWkpcS5Upy45XOjy8NbLJvp5bAMfWgfXTiG50VGD+dZycqVny4 6nadsgp+bMKggdamZSrgixJGXbksHg333C6shIAx6h4/urzTv1KExmY93u9mLdqZ4DBT vRxjpgQbtTC3gEcxkqSnDnVQHgA9d9Cga+TacZHIJu9U990bdTEfCVvMxmqkPTad9ls2 dwNg== Received: by 10.66.82.230 with SMTP id l6mr1009565pay.12.1355356980857; Wed, 12 Dec 2012 16:03:00 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id l5sm102578paz.14.2012.12.12.16.02.59 (version=SSLv3 cipher=OTHER); Wed, 12 Dec 2012 16:03:00 -0800 (PST) Sender: Navdeep Parhar Message-ID: <50C91B32.4080904@FreeBSD.org> Date: Wed, 12 Dec 2012 16:02:58 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> In-Reply-To: <50C909BD.9090709@mu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:03:02 -0000 On 12/12/12 14:48, Alfred Perlstein wrote: > On 12/12/12 2:29 PM, Andriy Gapon wrote: >> Now we get a new middle-ground: get both worse performance (because >> KASSERTs are compiled in) and a risk of harming your data (because >> KASSERTs no longer panic). The upside: there is no panic! There's just >> a log message (or etc). and chance to get more log messages because >> the insanity propagates. And a chance to lose your data (your >> customer's) - but I've already mentioned this. I am not sure that I >> like this kind of middle-ground. > I have a number of points here: > > The most important one being: > 1) without kassert you would still have the bug, just that it would be > unreported. > The upside: there is no panic! There's **NO** log message (or etc). > and chance to get more log messages because the insanity propagates. > > Terrible! > > Let me explain that again: > If you don't compile in KASSERT, then it's not like the condition is > never going to happen. Instead it will just be unreported. A KASSERT() really is for a condition that should never happen. It is primarily useful during development and testing (and when the code is reworked or redesigned). I agree with Andriy here -- a non-fatal assert shouldn't really exist. Why not add a new facility (a "if (!foo) kdb_backtrace()" or similar), call it what you want to, enable it (or not) even in release builds if you want to, use it wherever you want to, but let KASSERT be just the way it is? Adding a global knob that changes the way KASSERT behaves risks tripping others up. Personally, in a debug kernel I _really_ want the kernel to stop right away if any KASSERT in my code goes off so that its state is as close as possible to what it was at the time the problem occurred. In a release kernel I _really_ do not want the overhead of the KASSERT at all. If it was a check for a condition I wasn't sure about then I wouldn't have written it as a KASSERT. That's my 2 cents in case you plan to revisit your changes and were looking around for inputs... ;-) Regards, Navdeep > > So to put it in your own words, *without* KASSERT you get: > > The upside: there is no panic! There's **NO** log message (or etc). > and chance to get more log messages because the insanity propagates. > > > > Now let's get to the other points: > > 2) Since this is not the default, then I do not understand why you are > so concerned. > > 3) Can you explain to me why it is so upsetting to you that someone > might be able to use this functionality? > > 4) *puts on flame retardant suit* ... Linux has had this for over a > decade and it's allowed them to find bugs in different ways. Mind you, > in Linux it was the default. > > 5) Adrian and I have both stated that we need this sort of functionality > to avoid superfluous panics in our work environments while still getting > bug feedback. > > Can we now please stop arguing over a non-default option that will help > some vendors report bugs to the project? > > Thank you, > -Alfred > From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:09:56 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49AF51C2; Thu, 13 Dec 2012 00:09:56 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 23EC28FC12; Thu, 13 Dec 2012 00:09:55 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 145931A3C33; Wed, 12 Dec 2012 16:09:55 -0800 (PST) Message-ID: <50C91CD3.7030900@mu.org> Date: Wed, 12 Dec 2012 16:09:55 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> In-Reply-To: <50C91B32.4080904@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:09:56 -0000 On 12/12/12 4:02 PM, Navdeep Parhar wrote: > On 12/12/12 14:48, Alfred Perlstein wrote: >> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>> Now we get a new middle-ground: get both worse performance (because >>> KASSERTs are compiled in) and a risk of harming your data (because >>> KASSERTs no longer panic). The upside: there is no panic! There's just >>> a log message (or etc). and chance to get more log messages because >>> the insanity propagates. And a chance to lose your data (your >>> customer's) - but I've already mentioned this. I am not sure that I >>> like this kind of middle-ground. >> I have a number of points here: >> >> The most important one being: >> 1) without kassert you would still have the bug, just that it would be >> unreported. >> The upside: there is no panic! There's **NO** log message (or etc). >> and chance to get more log messages because the insanity propagates. >> >> Terrible! >> >> Let me explain that again: >> If you don't compile in KASSERT, then it's not like the condition is >> never going to happen. Instead it will just be unreported. > A KASSERT() really is for a condition that should never happen. It is > primarily useful during development and testing (and when the code is > reworked or redesigned). I agree with Andriy here -- a non-fatal assert > shouldn't really exist. What do you think happens to a FreeBSD kernel when INVARIANTS is compiled in and it trips an assertion after my change? -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:25:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0184454F; Thu, 13 Dec 2012 00:25:19 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 947858FC0A; Thu, 13 Dec 2012 00:25:19 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so431529dad.13 for ; Wed, 12 Dec 2012 16:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=UHwUG6hI/dDfVeR49brYDFf/hLSpb0gLjQ42DJQNgKM=; b=b1/On5VBYpYZUSI7i4BdegJjySWGh44Wj2/pZ7o0/Fd35thpN70Csv/T1gVbyyzodM nyDe+TVMAFa/l4ux7XCEJG/xhe64gd9N1oSYQa/ijRv7hsx6XcQyKwWB2Vsl/fCENTZw suP2S3u/3yjHlg4b57WjUVPnNhhMTBmw3GUPZYgrGt/EDZfP2DM31+hvg/Rwyp1CRfsp yt//dMJsHhtj5cUeMWRPCQV8hq3XNUEhALyWYofDwVDpeIKqUfagGVcc/6WjdlBhw03P IQzzKkE+eHZMuRJ18l9cBsmf7HCHwieooc3iEHvkUdIRsXtqGo++wa8Ne/mzhbbBvKdD kY4w== Received: by 10.68.143.162 with SMTP id sf2mr7383810pbb.137.1355358318945; Wed, 12 Dec 2012 16:25:18 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPS id ol4sm7623276pbb.58.2012.12.12.16.25.17 (version=SSLv3 cipher=OTHER); Wed, 12 Dec 2012 16:25:18 -0800 (PST) Sender: Navdeep Parhar Message-ID: <50C9206D.6080502@FreeBSD.org> Date: Wed, 12 Dec 2012 16:25:17 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> In-Reply-To: <50C91CD3.7030900@mu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:25:20 -0000 On 12/12/12 16:09, Alfred Perlstein wrote: > On 12/12/12 4:02 PM, Navdeep Parhar wrote: >> On 12/12/12 14:48, Alfred Perlstein wrote: >>> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>>> Now we get a new middle-ground: get both worse performance (because >>>> KASSERTs are compiled in) and a risk of harming your data (because >>>> KASSERTs no longer panic). The upside: there is no panic! There's just >>>> a log message (or etc). and chance to get more log messages because >>>> the insanity propagates. And a chance to lose your data (your >>>> customer's) - but I've already mentioned this. I am not sure that I >>>> like this kind of middle-ground. >>> I have a number of points here: >>> >>> The most important one being: >>> 1) without kassert you would still have the bug, just that it would be >>> unreported. >>> The upside: there is no panic! There's **NO** log message (or etc). >>> and chance to get more log messages because the insanity propagates. >>> >>> Terrible! >>> >>> Let me explain that again: >>> If you don't compile in KASSERT, then it's not like the condition is >>> never going to happen. Instead it will just be unreported. >> A KASSERT() really is for a condition that should never happen. It is >> primarily useful during development and testing (and when the code is >> reworked or redesigned). I agree with Andriy here -- a non-fatal assert >> shouldn't really exist. > > > What do you think happens to a FreeBSD kernel when INVARIANTS is > compiled in and it trips an assertion after my change? I know the new knob has sane defaults. My point was that invariants should be considered inviolable. A knob that allows for it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their meaning, so it may have been better to introduce a new macro for the kind of tests you had in mind. I would use it too instead of the if (!foo) kdb_backtrace() that I often resort to for conditions that I'm not sure about. Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 915E8B45; Thu, 13 Dec 2012 00:41:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1508FC17; Thu, 13 Dec 2012 00:41:46 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so533717wgh.31 for ; Wed, 12 Dec 2012 16:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AZ/YW/+UjZp3ViFKgdNF+SIYj+q/r9pWnrDD0M3XbPk=; b=tMeKS/QvluaFhfW3EdfYCmckkV7Zl/VHq32ztd2kUZPyMjkeiQ9bfZJSOmGvy3cmac dnxLGteHdIi+gOxwGRb8T+TjTzBLZ6E7JATCxLR/CwHOZDxh+qgBuPAwVWQ4IN7t/VKp Al8ei325kPAAQLurDVVJ4QtlO7Aahm9mrOATFNA3r/jk42YvIGElc0w1Al2HwA6MgEgy biWAt4Ek0573Zq7zGHAKRyIC0hRsIqQ42vjhPDX7zWGhT5s4vfGZe1giqFaBzGSyCceL MP4fgFPVPYvKbOBGHBI6iBFJU0xEnV+ye7+pHSP5n6MU1oEJSS5snmRL/wqKiAe95nYw egAg== MIME-Version: 1.0 Received: by 10.194.179.34 with SMTP id dd2mr4921139wjc.1.1355359305931; Wed, 12 Dec 2012 16:41:45 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 16:41:45 -0800 (PST) In-Reply-To: <50C9206D.6080502@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> Date: Wed, 12 Dec 2012 16:41:45 -0800 X-Google-Sender-Auth: hLPb47fvav1DgOl_ldAplOB0I6o Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Navdeep Parhar Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:41:48 -0000 If a kassert is inviolable, then make it a panic() and include in the default kernel. Right now there's no distinction between "kassert for a condition that shouldn't happen, but we fail gracefully" and "kassert for a condition that shouldn't happen, and we don't handle at all." Ideally we'd create two separate macros to express that, t.hen we should make all kassert's that don't fail gracefully to fail gracefully. Anything left over should've been a panic() in the first place. Right now, with no INVARIANTS compiled in, we don't check KASSERT(). Again, the difference between panic and KASSERT. TL;DR - we're doing panic/assert sub-optimally; we don't have a consistent definition of what an invariant check is; Alfred's work doesn't change that. Adrian On 12 December 2012 16:25, Navdeep Parhar wrote: > On 12/12/12 16:09, Alfred Perlstein wrote: >> On 12/12/12 4:02 PM, Navdeep Parhar wrote: >>> On 12/12/12 14:48, Alfred Perlstein wrote: >>>> On 12/12/12 2:29 PM, Andriy Gapon wrote: >>>>> Now we get a new middle-ground: get both worse performance (because >>>>> KASSERTs are compiled in) and a risk of harming your data (because >>>>> KASSERTs no longer panic). The upside: there is no panic! There's just >>>>> a log message (or etc). and chance to get more log messages because >>>>> the insanity propagates. And a chance to lose your data (your >>>>> customer's) - but I've already mentioned this. I am not sure that I >>>>> like this kind of middle-ground. >>>> I have a number of points here: >>>> >>>> The most important one being: >>>> 1) without kassert you would still have the bug, just that it would be >>>> unreported. >>>> The upside: there is no panic! There's **NO** log message (or etc). >>>> and chance to get more log messages because the insanity propagates. >>>> >>>> Terrible! >>>> >>>> Let me explain that again: >>>> If you don't compile in KASSERT, then it's not like the condition is >>>> never going to happen. Instead it will just be unreported. >>> A KASSERT() really is for a condition that should never happen. It is >>> primarily useful during development and testing (and when the code is >>> reworked or redesigned). I agree with Andriy here -- a non-fatal assert >>> shouldn't really exist. >> >> >> What do you think happens to a FreeBSD kernel when INVARIANTS is >> compiled in and it trips an assertion after my change? > > I know the new knob has sane defaults. My point was that invariants > should be considered inviolable. A knob that allows for > it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their > meaning, so it may have been better to introduce a new macro for the > kind of tests you had in mind. I would use it too instead of the if > (!foo) kdb_backtrace() that I often resort to for conditions that I'm > not sure about. > > Regards, > Navdeep From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:44:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0F37CDE; Thu, 13 Dec 2012 00:44:24 +0000 (UTC) (envelope-from eadler@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 941688FC08; Thu, 13 Dec 2012 00:44:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD0iO3H094416; Thu, 13 Dec 2012 00:44:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD0iOTm094414; Thu, 13 Dec 2012 00:44:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212130044.qBD0iOTm094414@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Dec 2012 00:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244164 - head/share/syscons/keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:44:24 -0000 Author: eadler Date: Thu Dec 13 00:44:23 2012 New Revision: 244164 URL: http://svnweb.freebsd.org/changeset/base/244164 Log: Give credit where credit is due. Requested by: Ãlvaro Castillo Approved by: cperciva (implicit) Modified: head/share/syscons/keymaps/spanish.dvorak.kbd Modified: head/share/syscons/keymaps/spanish.dvorak.kbd ============================================================================== --- head/share/syscons/keymaps/spanish.dvorak.kbd Wed Dec 12 22:25:31 2012 (r244163) +++ head/share/syscons/keymaps/spanish.dvorak.kbd Thu Dec 13 00:44:23 2012 (r244164) @@ -1,4 +1,6 @@ # $FreeBSD$ +# +# Submitted by: Álvaro Castillo # alt # scan cntrl alt alt cntrl lock # code base shift cntrl shift alt shift cntrl shift state From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:53:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59F2F10F; Thu, 13 Dec 2012 00:53:49 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 32F848FC0C; Thu, 13 Dec 2012 00:53:49 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id B78A81A3C1B; Wed, 12 Dec 2012 16:53:48 -0800 (PST) Message-ID: <50C9271C.70803@mu.org> Date: Wed, 12 Dec 2012 16:53:48 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> In-Reply-To: <50C9206D.6080502@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:53:49 -0000 On 12/12/12 4:25 PM, Navdeep Parhar wrote: > On 12/12/12 16:09, Alfred Perlstein wrote: > >> What do you think happens to a FreeBSD kernel when INVARIANTS is >> compiled in and it trips an assertion after my change? > I know the new knob has sane defaults. My point was that invariants > should be considered inviolable. A knob that allows for > it's-really-not-supposed-to-fail-but-in-case-it-does... dilutes their > meaning, so it may have been better to introduce a new macro for the > kind of tests you had in mind. I would use it too instead of the if > (!foo) kdb_backtrace() that I often resort to for conditions that I'm > not sure about. > The problem again is that not all the KASSERTS are inviolable, if you want to do a project to split them, then please do, it would really be helpful, as for now, they are a mis-mash of death/warnings and there are at least three vendors who approve of this as well as 3 long term committers that approved my change (not including Adrian). I'll be completely honest, I struggled very much with this KASSERT problem at a previous employer, and the second that Adrian brought up the idea of "optional panic" I was kicking myself so hard because the solution to so many problems suddenly jumped out at me. I will assure you that taking a stand on this one issue has the following problems: 1) Makes it harder for at LEAST three vendors to shake out and report bugs back to the project. 2) Makes it more likely that someone who has useful (to some, but not all) patches to keep them private to avoid such arguments. Anyhow after all this back and forth on changes that really do not effect anyone, ie defaults stay the same, it really has me questioning the sanity of contributing and/or taking the time to give this sort of thing to the project. It really seems like people are getting very bent out of shape over minor enhancements that offer flexibility. Like what if I do gzipp'd kernel dumps next? (on my todo list) How many people will complain that "gzip is too dangerous in kernel context foo foo!!!!" Not sure, I guess I'll find out? -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 00:55:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 443E63D3; Thu, 13 Dec 2012 00:55:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx1.freebsd.org (Postfix) with ESMTP id D30168FC08; Thu, 13 Dec 2012 00:55:16 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id 12so537155wgh.31 for ; Wed, 12 Dec 2012 16:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=sbL7J0cFHJzOmW/Pg29iU7xObtpoSxglsqdoZNyjRio=; b=J45eW74/7lXeHj2hEmBn4ssBIzm3okRxxVyhJbcEVviVunO/HY9RA2NkvkbDqo2x0/ SG0HH6b9KXZ3ek2n5F4f67ttmopgwxutyoj5y9+6exIu3frkHUnLNEGql+BBFgv4xOnP VRM+2loIur9mmUHngQdNkskAMtNoJY1E2+fXDp+GqoSYPUYJ9hY2VB0i7MiG6DUvyn7e hKBVflAsPWm8E2iG3O8jVfAqWm5Kc8Nzq5b7lsQNTLBCtuUSFesf9BzmL8j5Ie8tIH7q p4gncqddsl+D42X/gsLZ7MO2Pxu1GGFfTYM34Bu/WudkZSqdUmDSEiz3EvuDX5vxvOAI RFlw== MIME-Version: 1.0 Received: by 10.180.97.137 with SMTP id ea9mr86005wib.13.1355360116117; Wed, 12 Dec 2012 16:55:16 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Wed, 12 Dec 2012 16:55:16 -0800 (PST) In-Reply-To: <50C9271C.70803@mu.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> Date: Wed, 12 Dec 2012 16:55:16 -0800 X-Google-Sender-Auth: U82LK1Ie-tgsoyN__g3rFVBSmZ8 Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 00:55:18 -0000 .. just make sure you've preallocated all the space needed by the gzip code when writing those dumps. :-) Adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 01:39:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C054A3CF; Thu, 13 Dec 2012 01:39:50 +0000 (UTC) (envelope-from alfred@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 8C1698FC0A; Thu, 13 Dec 2012 01:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD1dom4005842; Thu, 13 Dec 2012 01:39:50 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD1dooO005840; Thu, 13 Dec 2012 01:39:50 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201212130139.qBD1dooO005840@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 13 Dec 2012 01:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244165 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 01:39:50 -0000 Author: alfred Date: Thu Dec 13 01:39:49 2012 New Revision: 244165 URL: http://svnweb.freebsd.org/changeset/base/244165 Log: Change progress indicator for downloading patches. Use a percent style indicator instead of emitting one long line of patch numbers. Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 00:44:23 2012 (r244164) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 01:39:49 2012 (r244165) @@ -612,6 +612,28 @@ fetch_progress() { echo -n " " } +pct_fmt() +{ + printf " \r" + printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc` +} + +fetch_progress_percent() { + TOTAL=$1 + LNC=0 + pct_fmt $LNC $TOTAL + while read x; do + LNC=$(($LNC + 1)) + if [ $(($LNC % 100)) = 0 ]; then + pct_fmt $LNC $TOTAL + elif [ $(($LNC % 10)) = 0 ]; then + echo -n . + fi + done + pct_fmt $LNC $TOTAL + echo " done. " +} + # Sanity-check an index file fetch_index_sanity() { if grep -qvE "^[-_+./@0-9A-Za-z]+\|[0-9a-f]{64}$" INDEX.new || @@ -781,11 +803,13 @@ fetch_update() { echo " done." 1>${QUIETREDIR} # Attempt to fetch ports patches - echo -n "Fetching `wc -l < patchlist | tr -d ' '` " + patchcnt=`wc -l < patchlist | tr -d ' '` + echo -n "Fetching $patchcnt " echo ${NDEBUG} "patches.${DDSTATS}" + echo " " tr '|' '-' < patchlist | lam -s "bp/" - | xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ - 2>${STATSREDIR} | fetch_progress + 2>${STATSREDIR} | fetch_progress_percent $patchcnt echo "done." # Attempt to apply ports patches From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 01:41:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 438A9717; Thu, 13 Dec 2012 01:41:42 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E8AE08FC0C; Thu, 13 Dec 2012 01:41:41 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 708381A3CE9; Wed, 12 Dec 2012 17:41:41 -0800 (PST) Message-ID: <50C93255.5080607@mu.org> Date: Wed, 12 Dec 2012 17:41:41 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244165 - head/usr.sbin/portsnap/portsnap References: <201212130139.qBD1dooO005840@svn.freebsd.org> In-Reply-To: <201212130139.qBD1dooO005840@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 01:41:42 -0000 Reviewed by: eadler On 12/12/12 5:39 PM, Alfred Perlstein wrote: > Author: alfred > Date: Thu Dec 13 01:39:49 2012 > New Revision: 244165 > URL: http://svnweb.freebsd.org/changeset/base/244165 > > Log: > Change progress indicator for downloading patches. > > Use a percent style indicator instead of emitting one > long line of patch numbers. > > Modified: > head/usr.sbin/portsnap/portsnap/portsnap.sh > > Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh > ============================================================================== > --- head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 00:44:23 2012 (r244164) > +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Thu Dec 13 01:39:49 2012 (r244165) > @@ -612,6 +612,28 @@ fetch_progress() { > echo -n " " > } > > +pct_fmt() > +{ > + printf " \r" > + printf "($1/$2) %02.2f%% " `echo "scale=4;$LNC / $TOTAL * 100"|bc` > +} > + > +fetch_progress_percent() { > + TOTAL=$1 > + LNC=0 > + pct_fmt $LNC $TOTAL > + while read x; do > + LNC=$(($LNC + 1)) > + if [ $(($LNC % 100)) = 0 ]; then > + pct_fmt $LNC $TOTAL > + elif [ $(($LNC % 10)) = 0 ]; then > + echo -n . > + fi > + done > + pct_fmt $LNC $TOTAL > + echo " done. " > +} > + > # Sanity-check an index file > fetch_index_sanity() { > if grep -qvE "^[-_+./@0-9A-Za-z]+\|[0-9a-f]{64}$" INDEX.new || > @@ -781,11 +803,13 @@ fetch_update() { > echo " done." 1>${QUIETREDIR} > > # Attempt to fetch ports patches > - echo -n "Fetching `wc -l < patchlist | tr -d ' '` " > + patchcnt=`wc -l < patchlist | tr -d ' '` > + echo -n "Fetching $patchcnt " > echo ${NDEBUG} "patches.${DDSTATS}" > + echo " " > tr '|' '-' < patchlist | lam -s "bp/" - | > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > - 2>${STATSREDIR} | fetch_progress > + 2>${STATSREDIR} | fetch_progress_percent $patchcnt > echo "done." > > # Attempt to apply ports patches > From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 01:44:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AD838DB; Thu, 13 Dec 2012 01:44:59 +0000 (UTC) (envelope-from grog@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 6D5518FC08; Thu, 13 Dec 2012 01:44:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD1ixZJ006878; Thu, 13 Dec 2012 01:44:59 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD1ixxP006877; Thu, 13 Dec 2012 01:44:59 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212130144.qBD1ixxP006877@svn.freebsd.org> From: Greg Lehey Date: Thu, 13 Dec 2012 01:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244166 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 01:44:59 -0000 Author: grog Date: Thu Dec 13 01:44:58 2012 New Revision: 244166 URL: http://svnweb.freebsd.org/changeset/base/244166 Log: Reluctantly remove one of the most extraordinary numeric conversion routines I have ever seen and replace with something far more boring. Modified: head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Thu Dec 13 01:39:49 2012 (r244165) +++ head/usr.bin/calendar/parsedata.c Thu Dec 13 01:44:58 2012 (r244166) @@ -940,15 +940,13 @@ indextooffset(char *s) { int i; struct fixs *n; + char *es; if (s[0] == '+' || s[0] == '-') { - char ss[9]; - for (i = -100; i < 100; i++) { - sprintf(ss, "%s%d", (i > 0) ? "+" : "", i); - if (strcmp(ss, s) == 0) - return (i); - } - return (0); + i = strtod (s, &es); + if (*es != '\0') /* trailing junk */ + errx (1, "Invalid specifier format: %s\n", s); + return (i); } for (i = 0; i < 6; i++) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 02:21:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11555DB; Thu, 13 Dec 2012 02:21:06 +0000 (UTC) (envelope-from grog@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 E8C6B8FC0C; Thu, 13 Dec 2012 02:21:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD2L5RR014676; Thu, 13 Dec 2012 02:21:05 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD2L5wj014675; Thu, 13 Dec 2012 02:21:05 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201212130221.qBD2L5wj014675@svn.freebsd.org> From: Greg Lehey Date: Thu, 13 Dec 2012 02:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244168 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 02:21:06 -0000 Author: grog Date: Thu Dec 13 02:21:05 2012 New Revision: 244168 URL: http://svnweb.freebsd.org/changeset/base/244168 Log: Use even more conventional conversion routines. Reported by: peterj@ Modified: head/usr.bin/calendar/parsedata.c Modified: head/usr.bin/calendar/parsedata.c ============================================================================== --- head/usr.bin/calendar/parsedata.c Thu Dec 13 01:58:11 2012 (r244167) +++ head/usr.bin/calendar/parsedata.c Thu Dec 13 02:21:05 2012 (r244168) @@ -943,7 +943,7 @@ indextooffset(char *s) char *es; if (s[0] == '+' || s[0] == '-') { - i = strtod (s, &es); + i = strtol (s, &es, 10); if (*es != '\0') /* trailing junk */ errx (1, "Invalid specifier format: %s\n", s); return (i); From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 03:33:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54D3D9FD; Thu, 13 Dec 2012 03:33:02 +0000 (UTC) (envelope-from gonzo@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 382C28FC08; Thu, 13 Dec 2012 03:33:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3X2lJ028991; Thu, 13 Dec 2012 03:33:02 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3X25Y028990; Thu, 13 Dec 2012 03:33:02 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130333.qBD3X25Y028990@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244169 - head/sys/dev/smc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 03:33:02 -0000 Author: gonzo Date: Thu Dec 13 03:33:01 2012 New Revision: 244169 URL: http://svnweb.freebsd.org/changeset/base/244169 Log: Disable interrupts in filter in order to avoid interrupt storm and CPU starvation Modified: head/sys/dev/smc/if_smc.c Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Thu Dec 13 02:21:05 2012 (r244168) +++ head/sys/dev/smc/if_smc.c Thu Dec 13 03:33:01 2012 (r244169) @@ -807,6 +807,10 @@ smc_intr(void *context) struct smc_softc *sc; sc = (struct smc_softc *)context; + /* + * Block interrupts in order to let smc_task_intr to kick in + */ + smc_write_1(sc, MSK, 0); taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); return (FILTER_HANDLED); } @@ -827,13 +831,6 @@ smc_task_intr(void *context, int pending smc_select_bank(sc, 2); /* - * Get the current mask, and then block all interrupts while we're - * working. - */ - if ((ifp->if_capenable & IFCAP_POLLING) == 0) - smc_write_1(sc, MSK, 0); - - /* * Find out what interrupts are flagged. */ status = smc_read_1(sc, IST) & sc->smc_mask; From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 03:34:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94884B86; Thu, 13 Dec 2012 03:34:25 +0000 (UTC) (envelope-from gonzo@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 79C998FC0A; Thu, 13 Dec 2012 03:34:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3YPtD029181; Thu, 13 Dec 2012 03:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3YP2B029180; Thu, 13 Dec 2012 03:34:25 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130334.qBD3YP2B029180@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244170 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 03:34:25 -0000 Author: gonzo Date: Thu Dec 13 03:34:24 2012 New Revision: 244170 URL: http://svnweb.freebsd.org/changeset/base/244170 Log: Add memory barrier macros for ARM Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Dec 13 03:33:01 2012 (r244169) +++ head/sys/dev/sym/sym_hipd.c Thu Dec 13 03:34:24 2012 (r244170) @@ -135,6 +135,8 @@ typedef u_int32_t u32; #define MEMORY_BARRIER() __asm__ volatile("mf.a; mf" : : : "memory") #elif defined __sparc64__ #define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") +#elif defined __arm__ +#define MEMORY_BARRIER() __do_dmb() #else #error "Not supported platform" #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 03:35:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BCC2CD18; Thu, 13 Dec 2012 03:35:47 +0000 (UTC) (envelope-from gonzo@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 A0BB98FC12; Thu, 13 Dec 2012 03:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD3ZldS029566; Thu, 13 Dec 2012 03:35:47 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD3ZlUi029565; Thu, 13 Dec 2012 03:35:47 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212130335.qBD3ZlUi029565@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 03:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244171 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 03:35:47 -0000 Author: gonzo Date: Thu Dec 13 03:35:47 2012 New Revision: 244171 URL: http://svnweb.freebsd.org/changeset/base/244171 Log: Prevent possible usage of uninitialized pbase variable by checking return value of fdt_get_range Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Thu Dec 13 03:34:24 2012 (r244170) +++ head/sys/dev/uart/uart_bus_fdt.c Thu Dec 13 03:35:47 2012 (r244171) @@ -206,8 +206,10 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); + err = fdt_get_range(OF_parent(node), 0, &pbase, &psize); + if (err) + pbase = 0; - fdt_get_range(OF_parent(node), 0, &pbase, &psize); start += pbase; return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:17:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D5BC423; Thu, 13 Dec 2012 06:17:08 +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 3F3048FC0A; Thu, 13 Dec 2012 06:17:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6H8oo060892; Thu, 13 Dec 2012 06:17:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6H5SN060871; Thu, 13 Dec 2012 06:17:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130617.qBD6H5SN060871@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:17: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: r244172 - in stable/9/sys: bsm cddl/contrib/opensolaris/uts/common/sys compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:17:08 -0000 Author: kib Date: Thu Dec 13 06:17:05 2012 New Revision: 244172 URL: http://svnweb.freebsd.org/changeset/base/244172 Log: MFC r242958: Add the wait6(2) system call. It takes POSIX waitid()-like process designator to select a process which is waited for. The system call optionally returns siginfo_t which would be otherwise provided to SIGCHLD handler, as well as extended structure accounting for child and cumulative grandchild resource usage. Allow to get the current rusage information for non-exited processes as well, similar to Solaris. The explicit WEXITED flag is required to wait for exited processes, allowing for more fine-grained control of the events the waiter is interested in. Fix the handling of siginfo for WNOWAIT option for all wait*(2) family, by not removing the queued signal state. PR: standards/170346 MFC r243133: Style fixes for r242958. MFC r243134: Alphabetically reorder the forward-declarations of the structures. Add the declaration for enum idtype, to be used later. MFC r243135: Move the definition of the idtype_t from sys/types.h to sys/wait.h. Fix the bug, use #if __BSD_VISIBLE instead of #if defined(__BSD_VISIBLE), since __BSD_VISIBLE is always defined. Reformat the comments from the Solaris style to KNF. MFC r243136: Restore the proper handling of the pid 0 for waitpid(2). Fix the style around. Modified: stable/9/sys/bsm/audit_kevents.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h stable/9/sys/compat/freebsd32/freebsd32.h stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/kern_exit.c stable/9/sys/kern/sys_procdesc.c stable/9/sys/kern/syscalls.master stable/9/sys/sys/proc.h stable/9/sys/sys/resource.h stable/9/sys/sys/syscallsubr.h stable/9/sys/sys/wait.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/bsm/audit_kevents.h ============================================================================== --- stable/9/sys/bsm/audit_kevents.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/bsm/audit_kevents.h Thu Dec 13 06:17:05 2012 (r244172) @@ -602,6 +602,7 @@ #define AUE_PDKILL 43198 /* FreeBSD. */ #define AUE_PDGETPID 43199 /* FreeBSD. */ #define AUE_PDWAIT 43200 /* FreeBSD. */ +#define AUE_WAIT6 43201 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/procset.h Thu Dec 13 06:17:05 2012 (r244172) @@ -51,6 +51,7 @@ extern "C" { #define P_INITUID 0 #define P_INITPGID 0 +#ifndef _IDTYPE_T_DECLARED /* * The following defines the values for an identifier type. It @@ -81,6 +82,9 @@ typedef enum P_PSETID /* Processor set identifier */ } idtype_t; +#define _IDTYPE_T_DECLARED + +#endif /* * The following defines the operations which can be performed to Modified: stable/9/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/freebsd32.h Thu Dec 13 06:17:05 2012 (r244172) @@ -79,6 +79,11 @@ struct rusage32 { int32_t ru_nivcsw; }; +struct wrusage32 { + struct rusage32 wru_self; + struct rusage32 wru_children; +}; + struct itimerval32 { struct timeval32 it_interval; struct timeval32 it_value; Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Thu Dec 13 06:17:05 2012 (r244172) @@ -174,6 +174,42 @@ freebsd32_wait4(struct thread *td, struc return (error); } +int +freebsd32_wait6(struct thread *td, struct freebsd32_wait6_args *uap) +{ + struct wrusage32 wru32; + struct __wrusage wru, *wrup; + struct siginfo32 si32; + struct __siginfo si, *sip; + int error, status; + + if (uap->wrusage != NULL) + wrup = &wru; + else + wrup = NULL; + if (uap->info != NULL) { + sip = &si; + bzero(sip, sizeof(*sip)); + } else + sip = NULL; + error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options, + wrup, sip); + if (error != 0) + return (error); + if (uap->status != NULL) + error = copyout(&status, uap->status, sizeof(status)); + if (uap->wrusage != NULL && error == 0) { + freebsd32_rusage_out(&wru.wru_self, &wru32.wru_self); + freebsd32_rusage_out(&wru.wru_children, &wru32.wru_children); + error = copyout(&wru32, uap->wrusage, sizeof(wru32)); + } + if (uap->info != NULL && error == 0) { + siginfo_to_siginfo32 (&si, &si32); + error = copyout(&si32, uap->info, sizeof(si32)); + } + return (error); +} + #ifdef COMPAT_FREEBSD4 static void copy_statfs(struct statfs *in, struct statfs32 *out) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/compat/freebsd32/syscalls.master Thu Dec 13 06:17:05 2012 (r244172) @@ -997,3 +997,8 @@ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \ + int *status, int options, \ + struct wrusage32 *wrusage, \ + siginfo_t *info); } + Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/kern_exit.c Thu Dec 13 06:17:05 2012 (r244172) @@ -144,7 +144,7 @@ exit1(struct thread *td, int rv) * XXX in case we're rebooting we just let init die in order to * work around an unsolved stack overflow seen very late during * shutdown on sparc64 when the gmirror worker process exists. - */ + */ if (p == initproc && rebooting == 0) { printf("init died (signal %d, exit %d)\n", WTERMSIG(rv), WEXITSTATUS(rv)); @@ -612,7 +612,7 @@ sys_abort2(struct thread *td, struct abo sbuf_clear(sb); sbuf_printf(sb, "%s(pid %d uid %d) aborted: ", p->p_comm, p->p_pid, td->td_ucred->cr_uid); - /* + /* * Since we can't return from abort2(), send SIGKILL in cases, where * abort2() was called improperly */ @@ -684,7 +684,7 @@ owait(struct thread *td, struct owait_ar * The dirty work is handled by kern_wait(). */ int -sys_wait4(struct thread *td, struct wait_args *uap) +sys_wait4(struct thread *td, struct wait4_args *uap) { struct rusage ru, *rup; int error, status; @@ -701,14 +701,51 @@ sys_wait4(struct thread *td, struct wait return (error); } +int +sys_wait6(struct thread *td, struct wait6_args *uap) +{ + struct __wrusage wru, *wrup; + siginfo_t si, *sip; + idtype_t idtype; + id_t id; + int error, status; + + idtype = uap->idtype; + id = uap->id; + + if (uap->wrusage != NULL) + wrup = &wru; + else + wrup = NULL; + + if (uap->info != NULL) { + sip = &si; + bzero(sip, sizeof(*sip)); + } else + sip = NULL; + + /* + * We expect all callers of wait6() to know about WEXITED and + * WTRAPPED. + */ + error = kern_wait6(td, idtype, id, &status, uap->options, wrup, sip); + + if (uap->status != NULL && error == 0) + error = copyout(&status, uap->status, sizeof(status)); + if (uap->wrusage != NULL && error == 0) + error = copyout(&wru, uap->wrusage, sizeof(wru)); + if (uap->info != NULL && error == 0) + error = copyout(&si, uap->info, sizeof(si)); + return (error); +} + /* * Reap the remains of a zombie process and optionally return status and * rusage. Asserts and will release both the proctree_lock and the process * lock as part of its work. */ void -proc_reap(struct thread *td, struct proc *p, int *status, int options, - struct rusage *rusage) +proc_reap(struct thread *td, struct proc *p, int *status, int options) { struct proc *q, *t; @@ -718,10 +755,7 @@ proc_reap(struct thread *td, struct proc KASSERT(p->p_state == PRS_ZOMBIE, ("proc_reap: !PRS_ZOMBIE")); q = td->td_proc; - if (rusage) { - *rusage = p->p_ru; - calcru(p, &rusage->ru_utime, &rusage->ru_stime); - } + PROC_SUNLOCK(p); td->td_retval[0] = p->p_pid; if (status) @@ -834,24 +868,77 @@ proc_reap(struct thread *td, struct proc } static int -proc_to_reap(struct thread *td, struct proc *p, pid_t pid, int *status, - int options, struct rusage *rusage) +proc_to_reap(struct thread *td, struct proc *p, idtype_t idtype, id_t id, + int *status, int options, struct __wrusage *wrusage, siginfo_t *siginfo) { struct proc *q; + struct rusage *rup; sx_assert(&proctree_lock, SA_XLOCKED); q = td->td_proc; PROC_LOCK(p); - if (pid != WAIT_ANY && p->p_pid != pid && p->p_pgid != -pid) { + + switch (idtype) { + case P_ALL: + break; + case P_PID: + if (p->p_pid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_PGID: + if (p->p_pgid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_SID: + if (p->p_session->s_sid != (pid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_UID: + if (p->p_ucred->cr_uid != (uid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_GID: + if (p->p_ucred->cr_gid != (gid_t)id) { + PROC_UNLOCK(p); + return (0); + } + break; + case P_JAILID: + if (p->p_ucred->cr_prison == NULL || + (p->p_ucred->cr_prison->pr_id != (int)id)) { + PROC_UNLOCK(p); + return (0); + } + break; + /* + * It seems that the thread structures get zeroed out + * at process exit. This makes it impossible to + * support P_SETID, P_CID or P_CPUID. + */ + default: PROC_UNLOCK(p); return (0); } + if (p_canwait(td, p)) { PROC_UNLOCK(p); return (0); } + if (((options & WEXITED) == 0) && (p->p_state == PRS_ZOMBIE)) { + PROC_UNLOCK(p); + return (0); + } + /* * This special case handles a kthread spawned by linux_clone * (see linux_misc.c). The linux_wait4 and linux_waitpid @@ -867,8 +954,59 @@ proc_to_reap(struct thread *td, struct p } PROC_SLOCK(p); + + if (siginfo != NULL) { + bzero(siginfo, sizeof(*siginfo)); + siginfo->si_errno = 0; + + /* + * SUSv4 requires that the si_signo value is always + * SIGCHLD. Obey it despite the rfork(2) interface + * allows to request other signal for child exit + * notification. + */ + siginfo->si_signo = SIGCHLD; + + /* + * This is still a rough estimate. We will fix the + * cases TRAPPED, STOPPED, and CONTINUED later. + */ + if (WCOREDUMP(p->p_xstat)) + siginfo->si_code = CLD_DUMPED; + else if (WIFSIGNALED(p->p_xstat)) + siginfo->si_code = CLD_KILLED; + else + siginfo->si_code = CLD_EXITED; + + siginfo->si_pid = p->p_pid; + siginfo->si_uid = p->p_ucred->cr_uid; + siginfo->si_status = p->p_xstat; + + /* + * The si_addr field would be useful additional + * detail, but apparently the PC value may be lost + * when we reach this point. bzero() above sets + * siginfo->si_addr to NULL. + */ + } + + /* + * There should be no reason to limit resources usage info to + * exited processes only. A snapshot about any resources used + * by a stopped process may be exactly what is needed. + */ + if (wrusage != NULL) { + rup = &wrusage->wru_self; + *rup = p->p_ru; + calcru(p, &rup->ru_utime, &rup->ru_stime); + + rup = &wrusage->wru_children; + *rup = p->p_stats->p_cru; + calccru(p, &rup->ru_utime, &rup->ru_stime); + } + if (p->p_state == PRS_ZOMBIE) { - proc_reap(td, p, status, options, rusage); + proc_reap(td, p, status, options); return (-1); } PROC_SUNLOCK(p); @@ -880,21 +1018,75 @@ int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rusage) { + struct __wrusage wru, *wrup; + struct proc *q; + idtype_t idtype; + id_t id; + int ret; + + if (pid == WAIT_ANY) { + idtype = P_ALL; + id = 0; + } else if (pid == WAIT_MYPGRP) { + idtype = P_PGID; + q = td->td_proc; + PROC_LOCK(q); + id = (id_t)q->p_pgid; + PROC_UNLOCK(q); + } else if (pid < 0) { + idtype = P_PGID; + id = (id_t)-pid; + } else { + idtype = P_PID; + id = (id_t)pid; + } + if (rusage != NULL) + wrup = &wru; + else + wrup = NULL; + /* + * For backward compatibility we implicitly add flags WEXITED + * and WTRAPPED here. + */ + options |= WEXITED | WTRAPPED; + ret = kern_wait6(td, idtype, id, status, options, wrup, NULL); + if (rusage != NULL) + *rusage = wru.wru_self; + return (ret); +} + +int +kern_wait6(struct thread *td, idtype_t idtype, id_t id, int *status, + int options, struct __wrusage *wrusage, siginfo_t *siginfo) +{ struct proc *p, *q; int error, nfound, ret; - AUDIT_ARG_PID(pid); + AUDIT_ARG_VALUE((int)idtype); /* XXX - This is likely wrong! */ + AUDIT_ARG_PID((pid_t)id); /* XXX - This may be wrong! */ AUDIT_ARG_VALUE(options); q = td->td_proc; - if (pid == 0) { - PROC_LOCK(q); - pid = -q->p_pgid; - PROC_UNLOCK(q); + + if ((pid_t)id == WAIT_MYPGRP && (idtype == P_PID || idtype == P_PGID)) { + id = (id_t)q->p_pgid; + idtype = P_PGID; } + /* If we don't know the option, just return. */ - if (options & ~(WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) + if ((options & ~(WUNTRACED | WNOHANG | WCONTINUED | WNOWAIT | + WEXITED | WTRAPPED | WLINUXCLONE)) != 0) return (EINVAL); + if ((options & (WEXITED | WUNTRACED | WCONTINUED | WTRAPPED)) == 0) { + /* + * We will be unable to find any matching processes, + * because there are no known events to look for. + * Prefer to return error instead of blocking + * indefinitely. + */ + return (EINVAL); + } + loop: if (q->p_flag & P_STATCHILD) { PROC_LOCK(q); @@ -904,7 +1096,8 @@ loop: nfound = 0; sx_xlock(&proctree_lock); LIST_FOREACH(p, &q->p_children, p_sibling) { - ret = proc_to_reap(td, p, pid, status, options, rusage); + ret = proc_to_reap(td, p, idtype, id, status, options, + wrusage, siginfo); if (ret == 0) continue; else if (ret == 1) @@ -914,37 +1107,77 @@ loop: PROC_LOCK(p); PROC_SLOCK(p); - if ((p->p_flag & P_STOPPED_SIG) && + + if ((options & WTRAPPED) != 0 && + (p->p_flag & P_TRACED) != 0 && + (p->p_flag & (P_STOPPED_TRACE | P_STOPPED_SIG)) != 0 && (p->p_suspcount == p->p_numthreads) && - (p->p_flag & P_WAITED) == 0 && - (p->p_flag & P_TRACED || options & WUNTRACED)) { + ((p->p_flag & P_WAITED) == 0)) { PROC_SUNLOCK(p); - p->p_flag |= P_WAITED; + if ((options & WNOWAIT) == 0) + p->p_flag |= P_WAITED; sx_xunlock(&proctree_lock); td->td_retval[0] = p->p_pid; - if (status) + + if (status != NULL) *status = W_STOPCODE(p->p_xstat); + if (siginfo != NULL) { + siginfo->si_status = p->p_xstat; + siginfo->si_code = CLD_TRAPPED; + } + if ((options & WNOWAIT) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); PROC_UNLOCK(p); + return (0); + } + if ((options & WUNTRACED) != 0 && + (p->p_flag & P_STOPPED_SIG) != 0 && + (p->p_suspcount == p->p_numthreads) && + ((p->p_flag & P_WAITED) == 0)) { + PROC_SUNLOCK(p); + if ((options & WNOWAIT) == 0) + p->p_flag |= P_WAITED; + sx_xunlock(&proctree_lock); + td->td_retval[0] = p->p_pid; + + if (status != NULL) + *status = W_STOPCODE(p->p_xstat); + if (siginfo != NULL) { + siginfo->si_status = p->p_xstat; + siginfo->si_code = CLD_STOPPED; + } + if ((options & WNOWAIT) == 0) { + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } + PROC_UNLOCK(p); return (0); } PROC_SUNLOCK(p); - if (options & WCONTINUED && (p->p_flag & P_CONTINUED)) { + if ((options & WCONTINUED) != 0 && + (p->p_flag & P_CONTINUED) != 0) { sx_xunlock(&proctree_lock); td->td_retval[0] = p->p_pid; - p->p_flag &= ~P_CONTINUED; - - PROC_LOCK(q); - sigqueue_take(p->p_ksi); - PROC_UNLOCK(q); + if ((options & WNOWAIT) == 0) { + p->p_flag &= ~P_CONTINUED; + PROC_LOCK(q); + sigqueue_take(p->p_ksi); + PROC_UNLOCK(q); + } PROC_UNLOCK(p); - if (status) + if (status != NULL) *status = SIGCONT; + if (siginfo != NULL) { + siginfo->si_status = SIGCONT; + siginfo->si_code = CLD_CONTINUED; + } return (0); } PROC_UNLOCK(p); @@ -963,7 +1196,8 @@ loop: * to successfully wait until the child becomes a zombie. */ LIST_FOREACH(p, &q->p_orphans, p_orphan) { - ret = proc_to_reap(td, p, pid, status, options, rusage); + ret = proc_to_reap(td, p, idtype, id, status, options, + wrusage, siginfo); if (ret == 0) continue; else if (ret == 1) @@ -989,7 +1223,7 @@ loop: error = msleep(q, &q->p_mtx, PWAIT | PCATCH, "wait", 0); PROC_UNLOCK(q); if (error) - return (error); + return (error); goto loop; } Modified: stable/9/sys/kern/sys_procdesc.c ============================================================================== --- stable/9/sys/kern/sys_procdesc.c Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/sys_procdesc.c Thu Dec 13 06:17:05 2012 (r244172) @@ -367,7 +367,7 @@ procdesc_close(struct file *fp, struct t * procdesc_reap(). */ PROC_SLOCK(p); - proc_reap(curthread, p, NULL, 0, NULL); + proc_reap(curthread, p, NULL, 0); } else { /* * If the process is not yet dead, we need to kill it, but we Modified: stable/9/sys/kern/syscalls.master ============================================================================== --- stable/9/sys/kern/syscalls.master Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/kern/syscalls.master Thu Dec 13 06:17:05 2012 (r244172) @@ -71,8 +71,7 @@ ; XXX man page says `mode_t mode'. 6 AUE_CLOSE STD { int close(int fd); } 7 AUE_WAIT4 STD { int wait4(int pid, int *status, \ - int options, struct rusage *rusage); } \ - wait4 wait_args int + int options, struct rusage *rusage); } 8 AUE_CREAT COMPAT { int creat(char *path, int mode); } 9 AUE_LINK STD { int link(char *path, char *link); } 10 AUE_UNLINK STD { int unlink(char *path); } @@ -949,5 +948,9 @@ off_t offset, off_t len); } 531 AUE_NULL STD { int posix_fadvise(int fd, off_t offset, \ off_t len, int advice); } +532 AUE_WAIT6 STD { int wait6(int idtype, int id, \ + int *status, int options, \ + struct __wrusage *wrusage, \ + siginfo_t *info); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/proc.h Thu Dec 13 06:17:05 2012 (r244172) @@ -886,8 +886,7 @@ int proc_getenvv(struct thread *td, stru void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); -void proc_reap(struct thread *td, struct proc *p, int *status, int options, - struct rusage *rusage); +void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); Modified: stable/9/sys/sys/resource.h ============================================================================== --- stable/9/sys/sys/resource.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/resource.h Thu Dec 13 06:17:05 2012 (r244172) @@ -79,6 +79,13 @@ struct rusage { #define ru_last ru_nivcsw }; +#if __BSD_VISIBLE +struct __wrusage { + struct rusage wru_self; + struct rusage wru_children; +}; +#endif + /* * Resource limits */ Modified: stable/9/sys/sys/syscallsubr.h ============================================================================== --- stable/9/sys/sys/syscallsubr.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/syscallsubr.h Thu Dec 13 06:17:05 2012 (r244172) @@ -35,24 +35,26 @@ #include struct file; +enum idtype; struct itimerval; struct image_args; struct jail; +struct kevent; +struct kevent_copyops; +struct kld_file_stat; +struct ksiginfo; struct mbuf; struct msghdr; struct msqid_ds; +struct ogetdirentries_args; struct rlimit; struct rusage; union semun; +struct sendfile_args; struct sockaddr; struct stat; -struct kevent; -struct kevent_copyops; -struct kld_file_stat; -struct ksiginfo; -struct sendfile_args; struct thr_param; -struct ogetdirentries_args; +struct __wrusage; int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen); @@ -233,6 +235,8 @@ int kern_utimesat(struct thread *td, int enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); +int kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status, + int options, struct __wrusage *wrup, siginfo_t *sip); int kern_writev(struct thread *td, int fd, struct uio *auio); int kern_socketpair(struct thread *td, int domain, int type, int protocol, int *rsv); Modified: stable/9/sys/sys/wait.h ============================================================================== --- stable/9/sys/sys/wait.h Thu Dec 13 03:35:47 2012 (r244171) +++ stable/9/sys/sys/wait.h Thu Dec 13 06:17:05 2012 (r244172) @@ -80,13 +80,58 @@ #define WSTOPPED WUNTRACED /* SUS compatibility */ #define WCONTINUED 4 /* Report a job control continued process. */ #define WNOWAIT 8 /* Poll only. Don't delete the proc entry. */ +#define WEXITED 16 /* Wait for exited processes. */ +#define WTRAPPED 32 /* Wait for a process to hit a trap or + a breakpoint. */ #if __BSD_VISIBLE #define WLINUXCLONE 0x80000000 /* Wait for kthread spawned from linux_clone. */ #endif +#ifndef _IDTYPE_T_DECLARED +typedef enum +#if __BSD_VISIBLE + idtype /* pollutes XPG4.2 namespace */ +#endif + { + /* + * These names were mostly lifted from Solaris source code and + * still use Solaris style naming to avoid breaking any + * OpenSolaris code which has been ported to FreeBSD. There + * is no clear FreeBSD counterpart for all of the names, but + * some have a clear correspondence to FreeBSD entities. + * + * The numerical values are kept synchronized with the Solaris + * values. + */ + P_PID, /* A process identifier. */ + P_PPID, /* A parent process identifier. */ + P_PGID, /* A process group identifier. */ + P_SID, /* A session identifier. */ + P_CID, /* A scheduling class identifier. */ + P_UID, /* A user identifier. */ + P_GID, /* A group identifier. */ + P_ALL, /* All processes. */ + P_LWPID, /* An LWP identifier. */ + P_TASKID, /* A task identifier. */ + P_PROJID, /* A project identifier. */ + P_POOLID, /* A pool identifier. */ + P_JAILID, /* A zone identifier. */ + P_CTID, /* A (process) contract identifier. */ + P_CPUID, /* CPU identifier. */ + P_PSETID /* Processor set identifier. */ +} idtype_t; /* The type of id_t we are using. */ + +#if __BSD_VISIBLE +#define P_ZONEID P_JAILID +#endif +#define _IDTYPE_T_DECLARED +#endif + /* * Tokens for special values of the "pid" parameter to wait4. + * Extended struct __wrusage to collect rusage for both the target + * process and its children within one wait6() call. */ #if __BSD_VISIBLE #define WAIT_ANY (-1) /* any process */ @@ -97,12 +142,19 @@ #include __BEGIN_DECLS +struct __siginfo; pid_t wait(int *); pid_t waitpid(pid_t, int *, int); +#if __POSIX_VISIBLE >= 200112 +int waitid(idtype_t, id_t, struct __siginfo *, int); +#endif #if __BSD_VISIBLE struct rusage; +struct __wrusage; pid_t wait3(int *, int, struct rusage *); pid_t wait4(pid_t, int *, int, struct rusage *); +pid_t wait6(idtype_t, id_t, int *, int, struct __wrusage *, + struct __siginfo *); #endif __END_DECLS #endif /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:20:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E6D1767; Thu, 13 Dec 2012 06:20:04 +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 E6E3A8FC1D; Thu, 13 Dec 2012 06:20:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6K3Ya061555; Thu, 13 Dec 2012 06:20:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6K14v061538; Thu, 13 Dec 2012 06:20:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130620.qBD6K14v061538@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:20:01 +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: r244174 - in stable/9/sys: compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:20:04 -0000 Author: kib Date: Thu Dec 13 06:20:01 2012 New Revision: 244174 URL: http://svnweb.freebsd.org/changeset/base/244174 Log: Regenerate. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c stable/9/sys/kern/init_sysent.c stable/9/sys/kern/syscalls.c stable/9/sys/kern/systrace_args.c stable/9/sys/sys/syscall.h stable/9/sys/sys/syscall.mk stable/9/sys/sys/sysproto.h Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -588,6 +588,14 @@ struct freebsd32_posix_fadvise_args { char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; +struct freebsd32_wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -699,6 +707,7 @@ int freebsd32_shmctl(struct thread *, st int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); +int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); #ifdef COMPAT_43 @@ -1075,6 +1084,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -425,4 +425,5 @@ #define FREEBSD32_SYS_rctl_remove_rule 529 #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 -#define FREEBSD32_SYS_MAXSYSCALL 532 +#define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_MAXSYSCALL 533 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ const char *freebsd32_syscallnames[] = { @@ -555,4 +555,5 @@ const char *freebsd32_syscallnames[] = { "rctl_remove_rule", /* 529 = rctl_remove_rule */ "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ + "freebsd32_wait6", /* 532 = freebsd32_wait6 */ }; Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 239580 2012-08-22 19:43:46Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #include "opt_compat.h" @@ -592,4 +592,5 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ }; Modified: stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3046,6 +3046,18 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* freebsd32_wait6 */ + case 532: { + struct freebsd32_wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* int */ + uarg[2] = (intptr_t) p->status; /* int * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[5] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8130,6 +8142,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* freebsd32_wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "int *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "struct wrusage32 *"; + break; + case 5: + p = "siginfo_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/9/sys/kern/init_sysent.c ============================================================================== --- stable/9/sys/kern/init_sysent.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/init_sysent.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #include "opt_compat.h" @@ -41,7 +41,7 @@ struct sysent sysent[] = { { AS(write_args), (sy_call_t *)sys_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = write */ { AS(open_args), (sy_call_t *)sys_open, AUE_OPEN_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = open */ { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = close */ - { AS(wait_args), (sy_call_t *)sys_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ + { AS(wait4_args), (sy_call_t *)sys_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ { compat(AS(ocreat_args),creat), AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = old creat */ { AS(link_args), (sy_call_t *)sys_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */ { AS(unlink_args), (sy_call_t *)sys_unlink, AUE_UNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 10 = unlink */ @@ -566,4 +566,5 @@ struct sysent sysent[] = { { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ + { AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = wait6 */ }; Modified: stable/9/sys/kern/syscalls.c ============================================================================== --- stable/9/sys/kern/syscalls.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/syscalls.c Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ const char *syscallnames[] = { @@ -539,4 +539,5 @@ const char *syscallnames[] = { "rctl_remove_rule", /* 529 = rctl_remove_rule */ "posix_fallocate", /* 530 = posix_fallocate */ "posix_fadvise", /* 531 = posix_fadvise */ + "wait6", /* 532 = wait6 */ }; Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/kern/systrace_args.c Thu Dec 13 06:20:01 2012 (r244174) @@ -64,7 +64,7 @@ systrace_args(int sysnum, void *params, } /* wait4 */ case 7: { - struct wait_args *p = params; + struct wait4_args *p = params; iarg[0] = p->pid; /* int */ uarg[1] = (intptr_t) p->status; /* int * */ iarg[2] = p->options; /* int */ @@ -3244,6 +3244,18 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* wait6 */ + case 532: { + struct wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->id; /* int */ + uarg[2] = (intptr_t) p->status; /* int * */ + iarg[3] = p->options; /* int */ + uarg[4] = (intptr_t) p->wrusage; /* struct __wrusage * */ + uarg[5] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8632,6 +8644,31 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "int *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "struct __wrusage *"; + break; + case 5: + p = "siginfo_t *"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/9/sys/sys/syscall.h ============================================================================== --- stable/9/sys/sys/syscall.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/syscall.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #define SYS_syscall 0 @@ -447,4 +447,5 @@ #define SYS_rctl_remove_rule 529 #define SYS_posix_fallocate 530 #define SYS_posix_fadvise 531 -#define SYS_MAXSYSCALL 532 +#define SYS_wait6 532 +#define SYS_MAXSYSCALL 533 Modified: stable/9/sys/sys/syscall.mk ============================================================================== --- stable/9/sys/sys/syscall.mk Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/syscall.mk Thu Dec 13 06:20:01 2012 (r244174) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb +# created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib MIASM = \ syscall.o \ exit.o \ @@ -395,4 +395,5 @@ MIASM = \ rctl_add_rule.o \ rctl_remove_rule.o \ posix_fallocate.o \ - posix_fadvise.o + posix_fadvise.o \ + wait6.o Modified: stable/9/sys/sys/sysproto.h ============================================================================== --- stable/9/sys/sys/sysproto.h Thu Dec 13 06:17:05 2012 (r244173) +++ stable/9/sys/sys/sysproto.h Thu Dec 13 06:20:01 2012 (r244174) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 229723 2012-01-06 19:29:16Z jhb + * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -59,7 +59,7 @@ struct open_args { struct close_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; }; -struct wait_args { +struct wait4_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; @@ -1739,6 +1739,14 @@ struct posix_fadvise_args { char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)]; char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; +struct wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -1746,7 +1754,7 @@ int sys_read(struct thread *, struct rea int sys_write(struct thread *, struct write_args *); int sys_open(struct thread *, struct open_args *); int sys_close(struct thread *, struct close_args *); -int sys_wait4(struct thread *, struct wait_args *); +int sys_wait4(struct thread *, struct wait4_args *); int sys_link(struct thread *, struct link_args *); int sys_unlink(struct thread *, struct unlink_args *); int sys_chdir(struct thread *, struct chdir_args *); @@ -2116,6 +2124,7 @@ int sys_rctl_add_rule(struct thread *, s int sys_rctl_remove_rule(struct thread *, struct rctl_remove_rule_args *); int sys_posix_fallocate(struct thread *, struct posix_fallocate_args *); int sys_posix_fadvise(struct thread *, struct posix_fadvise_args *); +int sys_wait6(struct thread *, struct wait6_args *); #ifdef COMPAT_43 @@ -2807,6 +2816,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_rctl_remove_rule AUE_NULL #define SYS_AUE_posix_fallocate AUE_NULL #define SYS_AUE_posix_fadvise AUE_NULL +#define SYS_AUE_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:24:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41D33907; Thu, 13 Dec 2012 06:24:56 +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 261418FC08; Thu, 13 Dec 2012 06:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6Ou6L062481; Thu, 13 Dec 2012 06:24:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6OsEX062474; Thu, 13 Dec 2012 06:24:54 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130624.qBD6OsEX062474@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:24: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: r244175 - in stable/9/lib/libc: gen include sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:24:56 -0000 Author: kib Date: Thu Dec 13 06:24:54 2012 New Revision: 244175 URL: http://svnweb.freebsd.org/changeset/base/244175 Log: MFC r242960: Implement the waitid() SUSv4 function using wait6() system call. PR: standards/170346 Added: stable/9/lib/libc/gen/waitid.c - copied unchanged from r242960, head/lib/libc/gen/waitid.c Modified: stable/9/lib/libc/gen/Makefile.inc stable/9/lib/libc/gen/Symbol.map stable/9/lib/libc/include/namespace.h stable/9/lib/libc/include/un-namespace.h stable/9/lib/libc/sys/Symbol.map Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/gen/Makefile.inc ============================================================================== --- stable/9/lib/libc/gen/Makefile.inc Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/gen/Makefile.inc Thu Dec 13 06:24:54 2012 (r244175) @@ -34,7 +34,7 @@ SRCS+= __getosreldate.c __xuname.c \ syslog.c telldir.c termios.c time.c times.c timezone.c tls.c \ ttyname.c ttyslot.c ualarm.c ulimit.c uname.c unvis.c \ usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \ - wordexp.c + waitid.c wordexp.c CANCELPOINTS_SRCS=sem.c sem_new.c .for src in ${CANCELPOINTS_SRCS} Modified: stable/9/lib/libc/gen/Symbol.map ============================================================================== --- stable/9/lib/libc/gen/Symbol.map Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/gen/Symbol.map Thu Dec 13 06:24:54 2012 (r244175) @@ -384,6 +384,7 @@ FBSD_1.3 { fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; + waitid; }; FBSDprivate_1.0 { Copied: stable/9/lib/libc/gen/waitid.c (from r242960, head/lib/libc/gen/waitid.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/gen/waitid.c Thu Dec 13 06:24:54 2012 (r244175, copy of r242960, head/lib/libc/gen/waitid.c) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2012 Jukka A. Ukkonen + * All rights reserved. + * + * This software was developed by Jukka Ukkonen for FreeBSD. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +int +__waitid(idtype_t idtype, id_t id, siginfo_t *info, int flags) +{ + int status; + pid_t ret; + + ret = _wait6(idtype, id, &status, flags, NULL, info); + + /* + * According to SUSv4, waitid() shall not return a PID when a + * process is found, but only 0. If a process was actually + * found, siginfo_t fields si_signo and si_pid will be + * non-zero. In case WNOHANG was set in the flags and no + * process was found those fields are set to zero using + * memset() below. + */ + if (ret == 0 && info != NULL) + memset(info, 0, sizeof(*info)); + else if (ret > 0) + ret = 0; + return (ret); +} + +__weak_reference(__waitid, waitid); +__weak_reference(__waitid, _waitid); Modified: stable/9/lib/libc/include/namespace.h ============================================================================== --- stable/9/lib/libc/include/namespace.h Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/include/namespace.h Thu Dec 13 06:24:54 2012 (r244175) @@ -229,6 +229,7 @@ #define socketpair _socketpair #define usleep _usleep #define wait4 _wait4 +#define wait6 _wait6 #define waitpid _waitpid #define write _write #define writev _writev Modified: stable/9/lib/libc/include/un-namespace.h ============================================================================== --- stable/9/lib/libc/include/un-namespace.h Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/include/un-namespace.h Thu Dec 13 06:24:54 2012 (r244175) @@ -210,6 +210,7 @@ #undef socketpair #undef usleep #undef wait4 +#undef wait6 #undef waitpid #undef write #undef writev Modified: stable/9/lib/libc/sys/Symbol.map ============================================================================== --- stable/9/lib/libc/sys/Symbol.map Thu Dec 13 06:20:01 2012 (r244174) +++ stable/9/lib/libc/sys/Symbol.map Thu Dec 13 06:24:54 2012 (r244175) @@ -380,6 +380,7 @@ FBSD_1.2 { FBSD_1.3 { posix_fadvise; + wait6; }; FBSDprivate_1.0 { @@ -1013,6 +1014,8 @@ FBSDprivate_1.0 { __sys_vadvise; _wait4; __sys_wait4; + _wait6; + __sys_wait6; _write; __sys_write; _writev; From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:27:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D441A9F; Thu, 13 Dec 2012 06:27:59 +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 77E238FC0C; Thu, 13 Dec 2012 06:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6RxXv063094; Thu, 13 Dec 2012 06:27:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6RxvA063091; Thu, 13 Dec 2012 06:27:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212130627.qBD6RxvA063091@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 13 Dec 2012 06:27:59 +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: r244176 - stable/9/lib/libc/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:27:59 -0000 Author: kib Date: Thu Dec 13 06:27:58 2012 New Revision: 244176 URL: http://svnweb.freebsd.org/changeset/base/244176 Log: MFC r242961: Document wait6() and waitid(). PR: standards/170346 Modified: stable/9/lib/libc/sys/Makefile.inc stable/9/lib/libc/sys/wait.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/Makefile.inc ============================================================================== --- stable/9/lib/libc/sys/Makefile.inc Thu Dec 13 06:24:54 2012 (r244175) +++ stable/9/lib/libc/sys/Makefile.inc Thu Dec 13 06:27:58 2012 (r244176) @@ -214,5 +214,6 @@ MLINKS+=timer_settime.2 timer_getoverrun MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 MLINKS+=utimes.2 futimes.2 utimes.2 futimesat.2 utimes.2 lutimes.2 -MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 +MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 \ + wait.2 waitid.2 wait.2 wait6.2 MLINKS+=write.2 pwrite.2 write.2 pwritev.2 write.2 writev.2 Modified: stable/9/lib/libc/sys/wait.2 ============================================================================== --- stable/9/lib/libc/sys/wait.2 Thu Dec 13 06:24:54 2012 (r244175) +++ stable/9/lib/libc/sys/wait.2 Thu Dec 13 06:27:58 2012 (r244176) @@ -28,15 +28,17 @@ .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd November 12, 2005 +.Dd November 10, 2012 .Dt WAIT 2 .Os .Sh NAME .Nm wait , +.Nm waitid , .Nm waitpid , +.Nm wait3 , .Nm wait4 , -.Nm wait3 -.Nd wait for process termination +.Nm wait6 +.Nd wait for processes to change status .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,12 +48,17 @@ .Fn wait "int *status" .Ft pid_t .Fn waitpid "pid_t wpid" "int *status" "int options" +.In sys/signal.h +.Ft int +.Fn waitid "idtype_t idtype" "id_t id" "siginfo_t *info" "int options" .In sys/time.h .In sys/resource.h .Ft pid_t .Fn wait3 "int *status" "int options" "struct rusage *rusage" .Ft pid_t .Fn wait4 "pid_t wpid" "int *status" "int options" "struct rusage *rusage" +.Ft pid_t +.Fn wait6 "idtype_t idtype" "id_t id" "int *status" "int options" "struct __wrusage *wrusage" "siginfo_t *infop" .Sh DESCRIPTION The .Fn wait @@ -86,28 +93,172 @@ system call provides a more general inte that need to wait for certain child processes, that need resource utilization statistics accumulated by child processes, or that require options. -The other wait functions are implemented using -.Fn wait4 . .Pp -The +The broadest interface of all functions in this family is +.Fn wait6 +which is otherwise very much like +.Fn wait4 +but with a few very important distinctions. +To wait for exited processes, the option flag +.Dv WEXITED +need to be explicitly specified. +This allows for waiting for processes which have experienced other +status changes without having to handle also the exit status from +the terminated processes. +Instead of the traditional +.Dv rusage +argument, a pointer to a new structure +.Bd -literal +struct __wrusage { + struct rusage wru_self; + struct rusage wru_children; +}; +.Ed +can be passed. +This allows the calling process to collect resource usage statistics +from both its own child process as well as from its grand children. +When no resource usage statistics are needed this pointer can be +.Dv NULL . +The last argument +.Fa infop +must be either +.Dv NULL +or a pointer to a +.Fa siginfo_t +structure. +When specified, the structure is filled the same as for +.Dv SIGNCHLD +signal, delivered at the process state change. +.br +The process, which state is queried, is specified by two arguments +.Fa idtype +and +.Fa id . +The separate +.Fa idtype +and +.Fa id +arguments allows to support many other types of +IDs as well in addition to PID and PGID. +.Bl -bullet -offset indent +.It +If +.Fa idtype +is +.Dv P_PID , +.Fn waitid +and +.Fn wait6 +wait for the child process with a process ID equal to +.Dv (pid_t)id . +.It +If +.Fa idtype +is +.Dv P_PGID , +.Fn waitid +and +.Fn wait6 +wait for the child process with a process group ID equal to +.Dv (pid_t)id . +.It +If +.Fa idtype +is +.Dv P_ALL , +.Fn waitid +and +.Fn wait6 +wait for any child process and the +.Dv id +is ignored. +.It +If +.Fa idtype +is +.Dv P_PID +or +.Dv P_PGID +and the +.Dv id +is zero, +.Fn waitid +and +.Fn wait6 +wait for any child process in the same process group as the caller. +.El +.Pp +Non-standard specifiers for the process to wait for, supported by this +implementation of +.Fn waitid +and +.Fn wait6 , +are: +.Bl -bullet -offset indent +.It +The +.Fa idtype +value +.Dv P_UID +waits for processes which effective UID is equal to +.Dv (uid_t)id . +.It +The +.Fa idtype +value +.Dv P_GID +waits for processes which effective GID is equal to +.Dv (gid_t)id . +.It +The +.Fa idtype +value +.Dv P_SID +waits for processes which session ID is equal to +.Dv id . +In case the child process started its own new session, +SID will be the same as its own PID. +Otherwise the SID of a child process will match the caller's SID. +.It +The +.Fa idtype +value +.Dv P_JAILID +waits for processes within a jail which jail identifier is equal +to +.Dv id . +.El +.Pp +For +.Fn wait , +.Fn wait3 , +and +.Fn wait4 +functions, the single .Fa wpid argument specifies the set of child processes for which to wait. +.Bl -bullet -offset indent +.It If .Fa wpid is -1, the call waits for any child process. +.It If .Fa wpid is 0, the call waits for any child process in the process group of the caller. +.It If .Fa wpid is greater than zero, the call waits for the process with process id .Fa wpid . +.It If .Fa wpid is less than -1, the call waits for any process whose process group id equals the absolute value of .Fa wpid . +.El .Pp The .Fa status @@ -116,41 +267,102 @@ argument is defined below. The .Fa options argument contains the bitwise OR of any of the following options. -The -.Dv WCONTINUED -option indicates that children of the current process that +.Bl -tag -width Ds +.It Dv WCONTINUED +indicates that children of the current process that have continued from a job control stop, by receiving a .Dv SIGCONT signal, should also have their status reported. -The -.Dv WNOHANG -option -is used to indicate that the call should not block if -there are no processes that wish to report status. -If the -.Dv WUNTRACED -option is set, -children of the current process that are stopped +.It Dv WNOHANG +is used to indicate that the call should not block when +there are no processes wishing to report status. +.It Dv WUNTRACED +indicates that children of the current process which are stopped due to a .Dv SIGTTIN , SIGTTOU , SIGTSTP , or .Dv SIGSTOP -signal also have their status reported. -The -.Dv WSTOPPED -option is an alias for +signal shall have their status reported. +.It Dv WSTOPPED +is an alias for .Dv WUNTRACED . -The -.Dv WNOWAIT -option keeps the process whose status is returned in a waitable state. +.It Dv WTRAPPED +allows waiting for processes which have trapped or reached a breakpoint. +.It Dv WEXITED +indicates that the caller is wants to receive status reports from +terminated processes. +This flag is implicitly set for the functions +.Fn wait , +.Fn waitpid , +.Fn wait3 , +and +.Fn wait4 . +.br +For the +.Fn waitid +and +.Fn wait6 +functions, the flag has to be explicitly included in the +.Fa options , +if status reports from terminated processes are expected. +.It Dv WNOWAIT +keeps the process whose status is returned in a waitable state. The process may be waited for again after this call completes. +.El +.sp +For the +.Fn waitid +and +.Fn wait6 +functions, at least one of the options +.Dv WEXITED , +.Dv WUNTRACED , +.Dv WSTOPPED , +.Dv WTRAPPED , +or +.Dv WCONTINUED +must be specified. +Otherwise there will be no events for the call to report. +To avoid hanging indefinitely in such a case these functions +return -1 with +.Dv errno +set to +.Dv EINVAL . .Pp If .Fa rusage -is non-zero, a summary of the resources used by the terminated -process and all its -children is returned (this information is currently not available -for stopped or continued processes). +is non-NULL, a summary of the resources used by the terminated +process and all its children is returned. +.Pp +If +.Fa wrusage +argument is non-NULL, a resource usage statistics +from both its own child process as well as from its grand children +is returned. +.Pp +If +.Fa infop +is non-NULL, it must point to a +.Dv siginfo_t +structure which is filled on return such that the +.Dv si_signo +field is always +.Dv SIGCHLD +and the field +.Dv si_pid +if be non-zero, if there is a status change to report. +If there are no status changes to report and WNOHANG is applied, +both of these fields are returned zero. +When using the +.Fn waitid +function with the +.Dv WNOHANG +option set, checking these fields is the only way to know whether +there were any status changes to report, because the return value +from +.Fn waitid +is be zero as it is for any successful return from +.Fn waitid . .Pp When the .Dv WNOHANG @@ -175,6 +387,20 @@ call is the same as with a .Fa wpid value of -1. +The +.Fn wait6 +call, with the bits +.Dv WEXITED +and +.Dv WTRAPPED +set in the +.Fa options +and with +.Fa infop +set to +.Dv NULL , +is similar to +.Fn wait4 . .Pp The following macros may be used to test the manner of exit of the process. One of the first four macros will evaluate to a non-zero (true) value: @@ -284,6 +510,7 @@ is returned and is set to indicate the error. .Pp If +.Fn wait6 , .Fn wait4 , .Fn wait3 , or @@ -306,6 +533,18 @@ a value of -1 is returned and .Va errno is set to indicate the error. +.Pp +If +.Fn waitid +returns because one or more processes have a state change to report, +0 is returned. +To indicate an error, -1 will be returned and +.Dv errno +set to an appropriate value. +If +.Dv WNOHANG +was used, 0 can be returned indicating no error, but no processes +may have changed state either, if si_signo and/or si_pid are zero. .Sh ERRORS The .Fn wait @@ -335,6 +574,14 @@ The call was interrupted by a caught sig or the signal did not have the .Dv SA_RESTART flag set. +.It Bq Er EINVAL +An invalid value was specified for +.Fa options , +or +.Fa idtype +and +.Fa id +do not specify a valid set of processes. .El .Sh SEE ALSO .Xr _exit 2 , @@ -344,11 +591,13 @@ flag set. .Xr siginfo 3 .Sh STANDARDS The -.Fn wait +.Fn wait , +.Fn waitpid , and -.Fn waitpid +.Fn waitid functions are defined by POSIX; -.Fn wait4 +.Fn wait6 , +.Fn wait4 , and .Fn wait3 are not specified by POSIX. From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:42:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD4A5CC; Thu, 13 Dec 2012 06:42:45 +0000 (UTC) (envelope-from rpaulo@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 8A67F8FC12; Thu, 13 Dec 2012 06:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6gjVG065918; Thu, 13 Dec 2012 06:42:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6gjdP065917; Thu, 13 Dec 2012 06:42:45 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201212130642.qBD6gjdP065917@svn.freebsd.org> From: Rui Paulo Date: Thu, 13 Dec 2012 06:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244179 - head/sys/powerpc/wii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:42:45 -0000 Author: rpaulo Date: Thu Dec 13 06:42:44 2012 New Revision: 244179 URL: http://svnweb.freebsd.org/changeset/base/244179 Log: Add the common FreeBSD SVN properties. Modified: Directory Properties: head/sys/powerpc/wii/locore.S (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:45:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87A6D25A; Thu, 13 Dec 2012 06:45:46 +0000 (UTC) (envelope-from rpaulo@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 6C6EB8FC17; Thu, 13 Dec 2012 06:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD6jk85066528; Thu, 13 Dec 2012 06:45:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD6jkeE066527; Thu, 13 Dec 2012 06:45:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201212130645.qBD6jkeE066527@svn.freebsd.org> From: Rui Paulo Date: Thu, 13 Dec 2012 06:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244180 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:45:46 -0000 Author: rpaulo Date: Thu Dec 13 06:45:45 2012 New Revision: 244180 URL: http://svnweb.freebsd.org/changeset/base/244180 Log: Bump MAX_COLS to 512 to take advantage of wider terminals. Modified: head/contrib/top/top.h Modified: head/contrib/top/top.h ============================================================================== --- head/contrib/top/top.h Thu Dec 13 06:42:44 2012 (r244179) +++ head/contrib/top/top.h Thu Dec 13 06:45:45 2012 (r244180) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 128 +#define MAX_COLS 512 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:47:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E98084BB; Thu, 13 Dec 2012 06:47:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 319D58FC08; Thu, 13 Dec 2012 06:47:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA11155; Thu, 13 Dec 2012 08:47:48 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2aC-000MmZ-3L; Thu, 13 Dec 2012 08:47:48 +0200 Message-ID: <50C97A11.10409@FreeBSD.org> Date: Thu, 13 Dec 2012 08:47:45 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:47:52 -0000 on 13/12/2012 00:38 Adrian Chadd said the following: > There are two parts to this; > > * don't compile in invariants. Panics panic. Invariant conditions > aren't checked. You end up with data corruption still if there are > bugs. > * compile in invariants. Panics panic. Invariant conditions are > checked and immediately panic. You can't run this in production to get > debugging info because our debugging info is "create a crash dump and > reboot." > > Now, the crash dump is great for us developers. But crap for say, a > file server. If it's some very subtle issue that only occasionally > pops up once a week and doesn't obviously screw with your data: > > * you can enable invariants and get a crash dump each time - then us > developers get lots of information, but the user experiences outages > once a week; > * they just give the hell up, disable invariants in production and > occasionally hit odd issues they can't explain. > > So now there's a third option: > > * enable invariants, get told when you hit that condition, and continue running. > > Now, we ship _right now_ generic with INVARIANTS disabled, because in > theory the releases are supposed to be stable enough for us not to > need the extra debugging information. That means that for those very > occasional, very subtle bugs that invariants may catch, we don't have > any way of getting told about them. > > Now, enabling some alternative to panic() is a different story and not > what's being addressed here. > > HTH, Let me see if it does... So basically a violated assertion means that something has already gone wrong. With assertions you catch that sooner and get full debug information and can fix it. Without assertions you crash anyway (in 99% cases), but later and get much less useful information. Now you have an option to crash later while having the worse performance and the only benefit is a log message which may or may not be useful for debugging. No, this doesn't help. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:49:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FA2C641; Thu, 13 Dec 2012 06:49:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 621B08FC08; Thu, 13 Dec 2012 06:49:45 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so1829197vcb.13 for ; Wed, 12 Dec 2012 22:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=dmdJYeoFONc4VB/XnGu8f1Hk7OT8TZZQUC7maqPyins=; b=mqvZyNgYee6B/UF3y3b8R7pG1bP12esCUY92O9dmStFSI2EeVgRvRhRvWxU8Z/vv5Y usUE3zX7mJjlZ6ZJm+SnfWQqKW5SCw9qIeNpTLZj+WDDZK/m69+snUpZw78sw7pCH8S9 Vwaf633t2yNuWHFFGgE5MqrgXYdcp4Hnm1qWxxH6KYOQyaferaLmhX0q/cWAyEk+KoNn kGIz5j8siRlcWohPX//4EcN7VrwcjH5USQxbQYbFilTgOaKZzYJaIupWWKXPuJYXZ2iD J4448hEQEsEbscvidjR4Sx8882JRoylSFJCQcNQMWxrPKCgPoZExBCD2aNKZBlOmK/3X CriQ== MIME-Version: 1.0 Received: by 10.58.137.7 with SMTP id qe7mr1447440veb.23.1355381384499; Wed, 12 Dec 2012 22:49:44 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 22:49:44 -0800 (PST) In-Reply-To: <50C97A11.10409@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> Date: Wed, 12 Dec 2012 22:49:44 -0800 X-Google-Sender-Auth: OQN6cNSMm9onv_qMTruGyumRgts Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:49:46 -0000 Let me restate it again. We can ship a STABLE kernel with INVARIANTS enabled, and it not be any less stable than the STABLE kernel is today. Adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 06:51:25 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80A247C5; Thu, 13 Dec 2012 06:51:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 986C88FC0A; Thu, 13 Dec 2012 06:51:23 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA11190; Thu, 13 Dec 2012 08:51:21 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2dd-000Mmz-6U; Thu, 13 Dec 2012 08:51:21 +0200 Message-ID: <50C97AE8.1040806@FreeBSD.org> Date: Thu, 13 Dec 2012 08:51:20 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C904B8.6000502@mu.org> <50C90641.4030000@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 06:51:25 -0000 on 13/12/2012 00:43 Adrian Chadd said the following: > On 12 December 2012 14:33, Andriy Gapon wrote: > >>> Yes, two of my employers were more of "we want to get more debug metrics, we >>> have the spare cycles, but we can't deal with superfluous panics". >>> >>> It also allows us "non-architects" to slip in a debug image when we have spare >>> cpu without getting yelled at for "crashing the $foo". >> >> There is clearly something wrong with this sort of mentality. >> >> If you find instances where a developer put panic(9) (or KASSERT or etc) to mean >> "maybe here is a bug, let's just panic", then let's get those things fixed. >> >> But most of assertions in our code that are know to me really mean that a real >> bug has already occurred, that portions of kernel state are corrupted and there >> is no going back to a sane state, only going forward to corrupting more and more. > > Dude, if you're running -STABLE right now, you don't have invariants > enabled and you aren't checking for them. > So right now, as it stands, large swaths of our kernel code are > falling afoul of what you're calling Alfred out on. Pal, it's because there are people who thoroughly and regularly test code with INVARIANTS that the code with or without INVARIANTS does not crash as often as it could. When I tested the code with INVARIANTS I trust it to run without those and if a user get a mystery panic one of the first things to advise is to enable various debugging options. > Before you all reply, please review and understand the difference > between "panic()" and "KASSERT()". panic() is not being changed here. > KASSERT() is what's being changed here. panic() is not optional. > KASSERT() is. With a non-INVARIANTS kernel, we _are not checking > invariants_ and we are continuing to run _after_ said non-compiled-in > invariants. With this in mind, please re-review this. :-) KASSERT is not optional contrary to your opinion. We elect to not compile it in for performance reasons, but it is not optional when it is compiled in. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:02:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D8DDDD9; Thu, 13 Dec 2012 07:02:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BD6878FC0C; Thu, 13 Dec 2012 07:02:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA11240; Thu, 13 Dec 2012 09:02:46 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2of-000MnT-UA; Thu, 13 Dec 2012 09:02:46 +0200 Message-ID: <50C97D94.1090603@FreeBSD.org> Date: Thu, 13 Dec 2012 09:02:44 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> In-Reply-To: <50C909BD.9090709@mu.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:02:51 -0000 on 13/12/2012 00:48 Alfred Perlstein said the following: > On 12/12/12 2:29 PM, Andriy Gapon wrote: >> Now we get a new middle-ground: get both worse performance (because KASSERTs >> are compiled in) and a risk of harming your data (because KASSERTs no longer >> panic). The upside: there is no panic! There's just a log message (or etc). >> and chance to get more log messages because the insanity propagates. And a >> chance to lose your data (your customer's) - but I've already mentioned this. >> I am not sure that I like this kind of middle-ground. > I have a number of points here: > > The most important one being: > 1) without kassert you would still have the bug, just that it would be unreported. > The upside: there is no panic! There's **NO** log message (or etc). and chance > to get more log messages because the insanity propagates. > > Terrible! > > Let me explain that again: > If you don't compile in KASSERT, then it's not like the condition is never going > to happen. Instead it will just be unreported. > > So to put it in your own words, *without* KASSERT you get: > > The upside: there is no panic! There's **NO** log message (or etc). and chance > to get more log messages because the insanity propagates. I disagree with your base premise. I think that the issue will get reported anyway. If the code has gone insane you will get a crash, it just would be much harder to debug. > Now let's get to the other points: > > 2) Since this is not the default, then I do not understand why you are so > concerned. I am concerned about the code becoming less clear and thus harder to maintain. I am also concerned about code with INVARIANTS becoming even more slow. > 3) Can you explain to me why it is so upsetting to you that someone might be > able to use this functionality? That is not upsetting to me at all. 'Someone' could develop the code in his branch / repo. Someone can provide the code for testing and review to his customers and other interested users. Someone may evaluate practical usefulness of the code and only then commit it to the tree. As far as I can see, no one had a chance yet to see how this code is really useful in practice. Yet the code is already in the tree. > 4) *puts on flame retardant suit* ... Linux has had this for over a decade and > it's allowed them to find bugs in different ways. Mind you, in Linux it was the > default. Can't comment. But if you wanted to add some equivalent of WARN_ON, then I would have zero objection to that. I want to have a clear distinction between "this can't happen" and "it's weird that this happened". KASSERT is not for error checking or for spotting funny situations. It's for asserting sanity in the code as its name implies. > 5) Adrian and I have both stated that we need this sort of functionality to > avoid superfluous panics in our work environments while still getting bug feedback. Good. Please use this code. > Can we now please stop arguing over a non-default option that will help some > vendors report bugs to the project? Please do use this code, please do report the bugs. Please postpone putting this code into the tree until its benefits are seen. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:08:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A3781F0; Thu, 13 Dec 2012 07:08:05 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 55E728FC08; Thu, 13 Dec 2012 07:08:04 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1808054vba.13 for ; Wed, 12 Dec 2012 23:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OnXCzZC2B8QhuWFn/HMJKmbxAoeQiNIHesT5wmfFH3E=; b=KAK/53K7YdflLAvccDXJcp8xz/bK21TLRIE/pLo6NrGNU4x0avj5ngBgP5CBQD0eA9 EGrjIqrooMmLffSfjLx804Qz4fLxvGHGuGuRPFT72IwvHd/VrlDiI9kaXM3tZvOfQh/l zJnzevitLrmuPbM7Wnet8cm0G5/JKmnTt2nJdO5f0PLZqdUU9eDPvKSaQtu6thbPEp02 hYn6ijzhZe8ZE/Fr+JlFA1QuTyITNOczWWF8DwjElX5/NyaUkKinYoNDXehdhak4NWEE qieS/y6UlMK5MCDoi23wbGXxMIqzXOkBLDKNLPzNRyye1sV4LLdgLZvAkU8qMrjTslDm eV9w== MIME-Version: 1.0 Received: by 10.52.97.230 with SMTP id ed6mr1247623vdb.90.1355382478581; Wed, 12 Dec 2012 23:07:58 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:07:58 -0800 (PST) In-Reply-To: <50C97D94.1090603@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> Date: Wed, 12 Dec 2012 23:07:58 -0800 X-Google-Sender-Auth: LWROwOTi2LNmd3SRAFZ7VisolLs Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:08:05 -0000 Andriy, If you are willing to enable INVARIANTS by default in GENERIC, right now, then I think we should remove Alfred's work. Adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:09:11 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 884C5376; Thu, 13 Dec 2012 07:09:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C75778FC0C; Thu, 13 Dec 2012 07:09:09 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA11293; Thu, 13 Dec 2012 09:09:08 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2up-000Mnw-JK; Thu, 13 Dec 2012 09:09:07 +0200 Message-ID: <50C97F12.9070905@FreeBSD.org> Date: Thu, 13 Dec 2012 09:09:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:09:11 -0000 on 13/12/2012 08:49 Adrian Chadd said the following: > Let me restate it again. > > We can ship a STABLE kernel with INVARIANTS enabled, and it not be any > less stable than the STABLE kernel is today. STABLE != stable, of course. And it will be much much slower, so no one (of the regular users) would use it. It seems like you are missing a point of KASSERT a little bit, the part why it is a compile-time option and not a run-time thing. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:11:14 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D773504; Thu, 13 Dec 2012 07:11:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 474F48FC08; Thu, 13 Dec 2012 07:11:11 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA11321; Thu, 13 Dec 2012 09:11:10 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tj2wo-000MoA-FK; Thu, 13 Dec 2012 09:11:10 +0200 Message-ID: <50C97F8D.6010504@FreeBSD.org> Date: Thu, 13 Dec 2012 09:11:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:11:14 -0000 on 13/12/2012 09:07 Adrian Chadd said the following: > Andriy, > > If you are willing to enable INVARIANTS by default in GENERIC, right > now, then I think we should remove Alfred's work. I do not see any connection. INVARIANTS in !CURRENT will not be enabled in GENERIC regardless of Alfred'd work. INVARIANTS in CURRENT are and will be enabled in GENERIC regardless of Alfred'd work. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:16:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 706076D5; Thu, 13 Dec 2012 07:16:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD798FC12; Thu, 13 Dec 2012 07:16:44 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1815088vba.13 for ; Wed, 12 Dec 2012 23:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LNkcb8lnXomVOh0Gdf7xAg0L4z9CvO0oOWkHh5I+QXk=; b=ipak5/qjmWMDXrhg7cZ9xvCUP5WFRySfsMjEo+RKZ8sZ8yAH3DPk5tM+XyvAPGNBhX Ehc7pR5TMI3YlTEa4bY7/VeOmbHUA8mz6bs5m/cFH1kctaTpY2n87r7KFy5eheyj8T59 lvCHM6F1ZOlBDA0wPPuTaU8Nf6LLB4C/nOVFaUWj9AbfpriPe4VyRQ5wcoxpZMRqpKaT A8MyBCUGHSBgJR9x0rbtLCDhlwDQdup6GEZGqwcmo+wzkLYX1kA/ttTP8JvP51LfEYMI NdEkizyBe+K9UAwIDIFGgJVdYBrVaHRGmk+O2J3aSg2cHyjSUdOdnsIC6g1S1Z6Xkb1x NFxQ== MIME-Version: 1.0 Received: by 10.220.240.141 with SMTP id la13mr1432406vcb.39.1355383003960; Wed, 12 Dec 2012 23:16:43 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:16:43 -0800 (PST) In-Reply-To: <50C97F8D.6010504@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> Date: Wed, 12 Dec 2012 23:16:43 -0800 X-Google-Sender-Auth: Vayzg2eoYuN5MSuygQWldQG7xkw Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:16:45 -0000 Hi, I think the fundamental problem here is we have some pretty different ideas of what KASSERT should be, versus what it actually is in various parts of the code. Since we're lost in semantics, we're not going to get any further on this discussion just for now, so let's take a break and think about other things for now. adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:19:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9701876; Thu, 13 Dec 2012 07:19:47 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 47FAB8FC0A; Thu, 13 Dec 2012 07:19:46 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so1220999pad.13 for ; Wed, 12 Dec 2012 23:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=0Hcy4RyoG7WmTFcwxOtiV1uKhUEa8fEfowbDKKgArRs=; b=MMgExAhiDEPTbmghsN3dc3Lfyi79E4I3pINOFyz0TWlz7zEvDH7nnOV8oys9KAsPBO kDyS6A1vXPii0+nLqINM7dhvFvfTxhu1iBO83fqfI6o1cXD3VHARNvW4Q7co7eEUY6Rt 4lNxcGzsCK4FFDLJkc+rakZtBSB6LaVAAA7NylkgeCx/u9/5TRJfx1Sw27l5j/LJ5eLC HXTrCNRnd1FhadCoSiBNII/LcsimmQMDQ58CNB9QhSOc22eCgvnIZiNf3PziwGInK5mI AL0o5i2L9n01hDBycCY38mv9iZ+eJ2IaX7wpXp2nt0fmeOO3TWT7OuCqaMSC1QIDgvmF f8Bg== Received: by 10.66.79.166 with SMTP id k6mr3830480pax.25.1355383185821; Wed, 12 Dec 2012 23:19:45 -0800 (PST) Received: from itx (c-24-6-45-85.hsd1.ca.comcast.net. [24.6.45.85]) by mx.google.com with ESMTPS id gv9sm549628pbc.21.2012.12.12.23.19.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 23:19:45 -0800 (PST) Date: Wed, 12 Dec 2012 23:19:38 -0800 From: Navdeep Parhar To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213071938.GA2074@itx> Mail-Followup-To: Adrian Chadd , Andriy Gapon , Alfred Perlstein , John Baldwin , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:19:47 -0000 On Wed, Dec 12, 2012 at 11:07:58PM -0800, Adrian Chadd wrote: > Andriy, > > If you are willing to enable INVARIANTS by default in GENERIC, right > now, then I think we should remove Alfred's work. It's already enabled by default in GENERIC in the development branch (aka head), which is exactly the right thing to do. Surely, you're not advocating we enable it by default in any release branch? Regards, Navdeep From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 07:22:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94A5F9FB; Thu, 13 Dec 2012 07:22:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 621148FC08; Thu, 13 Dec 2012 07:22:51 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so1855751vcb.13 for ; Wed, 12 Dec 2012 23:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=uatyFkQAN5gTwi+upmX3Fk3S7alT6uXgsqsNr8/2VEE=; b=m0JHvp+FVOgkVSoEWbFaZQwr6V/EDuIFWk+XJ/0EVzmgBzGilsziJcFztyn7D5IMKz nDU6PKXjW0QgQZhxoMlJDYyARqRL7Z5x1ewOOZbtx8KtmYKDIu/RVqamhVyyJ9OcyJMV rYcZQcslBw1YIXp5HOm6D1rekTc1hcX6pCaDQ5xbBDd3+S4pm9EaiTx996s2I5K5QoZl rOdSBa8aNZp2vSi1IQ+jseCLu+cIqazeQDnekkgqccAoJb/iYvCe0H8w5vQnjz7XqgPx /IISWkryz/U8zjUlJY9QQhr5BJz6LhowIrBFWJXKO2q6nheWAJdnO2ayukX8Ol7B0hPW FBMw== MIME-Version: 1.0 Received: by 10.52.67.133 with SMTP id n5mr1351397vdt.24.1355383370875; Wed, 12 Dec 2012 23:22:50 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.58.201.202 with HTTP; Wed, 12 Dec 2012 23:22:50 -0800 (PST) In-Reply-To: <20121213071938.GA2074@itx> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <20121213071938.GA2074@itx> Date: Wed, 12 Dec 2012 23:22:50 -0800 X-Google-Sender-Auth: v6d_jHq8RFZLF1fkCgG92hS7r4A Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: Adrian Chadd To: Adrian Chadd , Andriy Gapon , Alfred Perlstein , John Baldwin , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 07:22:52 -0000 On 12 December 2012 23:19, Navdeep Parhar wrote: > On Wed, Dec 12, 2012 at 11:07:58PM -0800, Adrian Chadd wrote: >> Andriy, >> >> If you are willing to enable INVARIANTS by default in GENERIC, right >> now, then I think we should remove Alfred's work. > > It's already enabled by default in GENERIC in the development branch > (aka head), which is exactly the right thing to do. Surely, you're not > advocating we enable it by default in any release branch? I'm sure at least one vendor out there would love to ship GENERIC + INVARIANTS minus the panic bit, so they get all of the invariants reporting and checking, but none of the panicing (which wouldn't occur if INVARIANTS wasn't compiled in.) WITNESS is still slow, but after I fixed a rather hilarious strlen() abuse in it, it actually started to be more useful to enable at runtime on my test equipment by default. Before I fixed that strlen() issue, I couldn't get anywhere near line rate ethernet/wifi throughput, so I didn't want to leave it on. Adrian From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 08:58:46 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2368742; Thu, 13 Dec 2012 08:58:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id A19E78FC1F; Thu, 13 Dec 2012 08:58:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD8wbpc009053; Thu, 13 Dec 2012 12:58:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD8wb8S009052; Thu, 13 Dec 2012 12:58:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 12:58:37 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213085837.GO97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C97A11.10409@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 08:58:46 -0000 On Wed, Dec 12, 2012 at 10:49:44PM -0800, Adrian Chadd wrote: A> Let me restate it again. A> A> We can ship a STABLE kernel with INVARIANTS enabled, and it not be any A> less stable than the STABLE kernel is today. It will be less stable, at least due to thrashing memory on free(9). Accessing memory after free(9) is a quite a common bug. However, with current semantics of KASSERT it will panic with good diagnostics and early, on malloc(9). With perverted semantics that Alfred suggests and you advocate it won't panic on malloc(9), but will panic later (no doubt that it will, if a thrashed pointer is dereferenced) with much more obscure diagnostics. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:02:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0DE0924; Thu, 13 Dec 2012 09:02:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 15A6E8FC15; Thu, 13 Dec 2012 09:02:21 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD92GoQ009087; Thu, 13 Dec 2012 13:02:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD92F3N009086; Thu, 13 Dec 2012 13:02:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 13:02:15 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213090215.GP97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50C9271C.70803@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:02:22 -0000 On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The problem again is that not all the KASSERTS are inviolable, if you A> want to do a project to split them, then please do, it would really be A> helpful, as for now, they are a mis-mash of death/warnings and there are A> at least three vendors who approve of this as well as 3 long term A> committers that approved my change (not including Adrian). Can you show examples of not inviolable KASSERTs? -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:05:59 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DDA0C5A; Thu, 13 Dec 2012 09:05:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 84F418FC12; Thu, 13 Dec 2012 09:05:57 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBD95sOQ009111; Thu, 13 Dec 2012 13:05:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBD95st1009110; Thu, 13 Dec 2012 13:05:54 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Dec 2012 13:05:54 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121213090554.GQ97487@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:05:59 -0000 On Wed, Dec 12, 2012 at 11:16:43PM -0800, Adrian Chadd wrote: A> I think the fundamental problem here is we have some pretty different A> ideas of what KASSERT should be, versus what it actually is in various A> parts of the code. Yep, under "we" you probably meant you and Alfred. What both of you mean is something that might be named KWARN() or KWARNING(). You are welcome to introduce it and put them into kernel code whereever you want. All current assertions (okay, not all, but vast majority of them) are assertions, not warnings. Their semantics can't be changed to warnings. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:29:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F67B247; Thu, 13 Dec 2012 09:29:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6728FC0C; Thu, 13 Dec 2012 09:29:18 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA12912; Thu, 13 Dec 2012 11:29:16 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C99FEB.6050500@FreeBSD.org> Date: Thu, 13 Dec 2012 11:29:15 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:29:20 -0000 on 13/12/2012 09:16 Adrian Chadd said the following: > Hi, > > I think the fundamental problem here is we have some pretty different > ideas of what KASSERT should be, versus what it actually is in various > parts of the code. > > Since we're lost in semantics, we're not going to get any further on > this discussion just for now, so let's take a break and think about > other things for now. +1 :) -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:41:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5539B6B9; Thu, 13 Dec 2012 09:41:33 +0000 (UTC) (envelope-from pjd@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 3A11E8FC13; Thu, 13 Dec 2012 09:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD9fXnQ000670; Thu, 13 Dec 2012 09:41:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD9fX64000669; Thu, 13 Dec 2012 09:41:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212130941.qBD9fX64000669@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 13 Dec 2012 09:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244181 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:41:33 -0000 Author: pjd Date: Thu Dec 13 09:41:32 2012 New Revision: 244181 URL: http://svnweb.freebsd.org/changeset/base/244181 Log: Fix the location of auditdistd configuration file. Reported by: Johan Hendriks Modified: head/etc/rc.d/auditdistd Modified: head/etc/rc.d/auditdistd ============================================================================== --- head/etc/rc.d/auditdistd Thu Dec 13 06:45:45 2012 (r244180) +++ head/etc/rc.d/auditdistd Thu Dec 13 09:41:32 2012 (r244181) @@ -14,7 +14,7 @@ name="auditdistd" rcvar="${name}_enable" pidfile="/var/run/${name}.pid" command="/usr/sbin/${name}" -required_files="/etc/${name}.conf" +required_files="/etc/security/${name}.conf" extra_commands="reload" load_rc_config $name From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:43:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9267853; Thu, 13 Dec 2012 09:43:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 130598FC08; Thu, 13 Dec 2012 09:42:58 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA13059; Thu, 13 Dec 2012 11:42:57 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9A321.5060407@FreeBSD.org> Date: Thu, 13 Dec 2012 11:42:57 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:43:00 -0000 on 13/12/2012 09:16 Adrian Chadd said the following: > Hi, > > I think the fundamental problem here is we have some pretty different > ideas of what KASSERT should be, versus what it actually is in various > parts of the code. Oh, and another part of the problem is that the discussion is opinion based. But it didn't have to be. Compare this: We think that feature F is a very good idea, we think that it will be used by many people and it will provide a lot of benefits. So here you are - the code is in the tree. To this: We have been using feature F, it has proved to be a very good idea as it provided these benefits and spared us from these problems. So here you are - the code is in the tree. If I have a differing opinion in the first case I usually state it (and can be pulled into an argument about it). If I have a different opinion in the second case, I try to adjust my opinion to the stated reality. > Since we're lost in semantics, we're not going to get any further on > this discussion just for now, so let's take a break and think about > other things for now. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 09:55:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 812AAEFB; Thu, 13 Dec 2012 09:55:27 +0000 (UTC) (envelope-from smh@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 66BBF8FC08; Thu, 13 Dec 2012 09:55:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBD9tRXN002902; Thu, 13 Dec 2012 09:55:27 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBD9tRWu002901; Thu, 13 Dec 2012 09:55:27 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212130955.qBD9tRWu002901@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 09:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244182 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 09:55:27 -0000 Author: smh Date: Thu Dec 13 09:55:26 2012 New Revision: 244182 URL: http://svnweb.freebsd.org/changeset/base/244182 Log: Fixed missing 'n' of \n for my committers line Approved by: avg (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Dec 13 09:41:32 2012 (r244181) +++ head/share/misc/committers-src.dot Thu Dec 13 09:55:26 2012 (r244182) @@ -250,7 +250,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] -smh [label="Steven Hartland\smh@FreeBSD.org\n2012/11/12"] +smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] sos [label="Soren Schmidt\nsos@FreeBSD.org\n????/??/??"] sson [label="Stacey Son\nsson@FreeBSD.org\n2008/07/08"] From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 10:59:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89FABAF9; Thu, 13 Dec 2012 10:59:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3D68D8FC0A; Thu, 13 Dec 2012 10:59:50 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA14153; Thu, 13 Dec 2012 12:59:49 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9B525.2060503@FreeBSD.org> Date: Thu, 13 Dec 2012 12:59:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r243515 - head/sys/kern References: <201211251422.qAPEM8BV074656@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 10:59:52 -0000 on 09/12/2012 19:27 Attilio Rao said the following: > On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: >> Author: avg >> Date: Sun Nov 25 14:22:08 2012 >> New Revision: 243515 >> URL: http://svnweb.freebsd.org/changeset/base/243515 >> >> Log: >> remove stop_scheduler_on_panic knob >> >> There has not been any complaints about the default behavior, so there >> is no need to keep a knob that enables the worse alternative. >> >> Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu >> spinlock-like logic can be dropped, because only a single CPU is >> supposed to win stop_cpus_hard(other_cpus) race and proceed past that >> call. > > While this is true for the sane case, for the case report by Ryan this > still breaks. Yes. I haven't got around to start fixing the Ryan's problem yet. But this commit should reduce number of places where changes have to be made. In fact, I think that only stop_cpus_X would have to be fixed now. > Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 > wins and then sets stopping_cpu. When the deadlock happens in the > spinning loop, because of generic_stop_cpus() logic CPU0 won't > deadlock and will correctly continue, but the problem is that it sets > back stopping_cpu to NOCPU, letting CPU1 continuing too and then > deadlocking. > > At the minimum, what I think that should happen is to have the check > in panic() as prior this change but with the add I outlined (thus we > need to generalize cpustop_handler()). However, it seems to me that > generic_stop_cpus() may still be broken by this and we eventually need > to fix it. > > I would then revert this part of the patch and fix it appropriately. > Later we can better discuss the generic_stop_cpus() similar race. I actually see this change and the Ryan's problem as orthogonal issues. My opinion is let's just fix generic_stop_cpus(). -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 11:00:30 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F183D05; Thu, 13 Dec 2012 11:00:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C6D608FC13; Thu, 13 Dec 2012 11:00:28 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA14185; Thu, 13 Dec 2012 13:00:27 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50C9B54B.1080302@FreeBSD.org> Date: Thu, 13 Dec 2012 13:00:27 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r243764 - head/sys/x86/x86 References: <201212011816.qB1IGE2Y064317@svn.freebsd.org> <201212061540.42393.jhb@freebsd.org> In-Reply-To: <201212061540.42393.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 11:00:30 -0000 on 06/12/2012 22:40 John Baldwin said the following: > On Saturday, December 01, 2012 1:16:14 pm Andriy Gapon wrote: >> Author: avg >> Date: Sat Dec 1 18:16:14 2012 >> New Revision: 243764 >> URL: http://svnweb.freebsd.org/changeset/base/243764 >> >> Log: >> ioapic_program_intpin: program high bits before low bits >> >> Programming the low bits has a side-effect if unmasking the pin if it is >> not disabled. So if an interrupt was pending then it would be delivered >> with the correct new vector but to the incorrect old LAPIC. >> >> This fix could be made clearer by preserving the mask bit while >> programming the low bits and then explicitly resetting the mask bit >> after all the programming is done. >> >> Probability to trip over the fixed bug could be increased by bootverbose >> because printing of the interrupt information in ioapic_assign_cpu >> lengthened the time window during which an interrupt could arrive while >> a pin is masked. > > Can you expand the comment to say that you write 'low' second since it may > clear the masked bit? > Will do. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 11:11:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1028D119; Thu, 13 Dec 2012 11:11:13 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id C002D8FC0A; Thu, 13 Dec 2012 11:11:12 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DC8C632A; Thu, 13 Dec 2012 12:09:08 +0100 (CET) Date: Thu, 13 Dec 2012 12:12:44 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213111240.GB1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Content-Disposition: inline In-Reply-To: <20121212210652.GO3013@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 11:11:13 -0000 --jho1yZJdad60DJr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Wed Dec 12 15:45:03 2012 > > New Revision: 244154 > > URL: http://svnweb.freebsd.org/changeset/base/244154 > >=20 > > Log: > > Use kern.max_pid sysctl to obtain maximum PID number instead of using= local > > define. > It is pid_max, not max_pid. >=20 > But the change is wrong. The kern.pid_max only limits newly allocated pid= s, > it does not magically moves existing pids, which are out of range, to the > limited region. See the corresponding commit log for the description. > It was added to make it easier to run FreeBSD 1.x binaries on the modern > kernels. I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... How about defining BSD_PID_MAX in sys/proc.h, which would be visible by userland as well and setting PID_MAX to BSD_PID_MAX? This would also help bsnmpd. http://people.freebsd.org/~pjd/patches/PID_MAX.patch --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jho1yZJdad60DJr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDJuCgACgkQForvXbEpPzRgjwCg5aK3VpBBR4HjVyIAa37Pbu0C F3YAoKEH8BTD4QmtCIMn7J22qBqhQF8/ =uiYE -----END PGP SIGNATURE----- --jho1yZJdad60DJr+-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 11:11:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B13AA11E; Thu, 13 Dec 2012 11:11:16 +0000 (UTC) (envelope-from glebius@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 7C7058FC12; Thu, 13 Dec 2012 11:11:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDBBGi2017299; Thu, 13 Dec 2012 11:11:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDBBFrk017294; Thu, 13 Dec 2012 11:11:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131111.qBDBBFrk017294@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 11:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244183 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 11:11:16 -0000 Author: glebius Date: Thu Dec 13 11:11:15 2012 New Revision: 244183 URL: http://svnweb.freebsd.org/changeset/base/244183 Log: Fix problem in r238990. The LLE_LINKED flag should be tested prior to entering llentry_free(), and in case if we lose the race, we should simply perform LLE_FREE_LOCKED(). Otherwise, if the race is lost by the thread performing arptimer(), it will remove two references from the lle instead of one. Reported by: Ian FREISLICH Modified: head/sys/net/if_llatbl.c head/sys/netinet/if_ether.c head/sys/netinet6/nd6.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/net/if_llatbl.c Thu Dec 13 11:11:15 2012 (r244183) @@ -109,12 +109,6 @@ llentry_free(struct llentry *lle) IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp); LLE_WLOCK_ASSERT(lle); - /* XXX: guard against race with other llentry_free(). */ - if (!(lle->la_flags & LLE_LINKED)) { - LLE_FREE_LOCKED(lle); - return (0); - } - LIST_REMOVE(lle, lle_next); lle->la_flags &= ~(LLE_VALID | LLE_LINKED); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/netinet/if_ether.c Thu Dec 13 11:11:15 2012 (r244183) @@ -165,7 +165,6 @@ arptimer(void *arg) { struct llentry *lle = (struct llentry *)arg; struct ifnet *ifp; - size_t pkts_dropped; if (lle->la_flags & LLE_STATIC) { LLE_WUNLOCK(lle); @@ -192,11 +191,20 @@ arptimer(void *arg) IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - LLE_REMREF(lle); - pkts_dropped = llentry_free(lle); + /* Guard against race with other llentry_free(). */ + if (lle->la_flags & LLE_LINKED) { + size_t pkts_dropped; + + LLE_REMREF(lle); + pkts_dropped = llentry_free(lle); + ARPSTAT_ADD(dropped, pkts_dropped); + } else + LLE_FREE_LOCKED(lle); + IF_AFDATA_UNLOCK(ifp); - ARPSTAT_ADD(dropped, pkts_dropped); + ARPSTAT_INC(timeouts); + CURVNET_RESTORE(); } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Dec 13 09:55:26 2012 (r244182) +++ head/sys/netinet6/nd6.c Thu Dec 13 11:11:15 2012 (r244183) @@ -1108,8 +1108,14 @@ nd6_free(struct llentry *ln, int gc) LLE_WUNLOCK(ln); IF_AFDATA_LOCK(ifp); LLE_WLOCK(ln); - LLE_REMREF(ln); - llentry_free(ln); + + /* Guard against race with other llentry_free(). */ + if (ln->la_flags & LLE_LINKED) { + LLE_REMREF(ln); + llentry_free(ln); + } else + LLE_FREE_LOCKED(ln); + IF_AFDATA_UNLOCK(ifp); return (next); From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 12:48:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56A48511; Thu, 13 Dec 2012 12:48:58 +0000 (UTC) (envelope-from glebius@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 397F28FC14; Thu, 13 Dec 2012 12:48:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDCmwe1034918; Thu, 13 Dec 2012 12:48:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDCmw26034917; Thu, 13 Dec 2012 12:48:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131248.qBDCmw26034917@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 12:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244184 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 12:48:58 -0000 Author: glebius Date: Thu Dec 13 12:48:57 2012 New Revision: 244184 URL: http://svnweb.freebsd.org/changeset/base/244184 Log: Initialize state id prior to attaching state to key hash. Otherwise a race can happen, when pf_find_state() finds state via key hash, and locks id hash slot 0 instead of appropriate to state id slot. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Dec 13 11:11:15 2012 (r244183) +++ head/sys/netpfil/pf/pf.c Thu Dec 13 12:48:57 2012 (r244184) @@ -1080,9 +1080,6 @@ pf_state_insert(struct pfi_kif *kif, str s->kif = kif; - if (pf_state_key_attach(skw, sks, s)) - return (-1); - if (s->id == 0 && s->creatorid == 0) { /* XXX: should be atomic, but probability of collision low */ if ((s->id = V_pf_stateid[curcpu]++) == PFID_MAXID) @@ -1092,6 +1089,9 @@ pf_state_insert(struct pfi_kif *kif, str s->creatorid = V_pf_status.hostid; } + if (pf_state_key_attach(skw, sks, s)) + return (-1); + ih = &V_pf_idhash[PF_IDHASH(s)]; PF_HASHROW_LOCK(ih); LIST_FOREACH(cur, &ih->states, entry) From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 12:51:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67891772; Thu, 13 Dec 2012 12:51:23 +0000 (UTC) (envelope-from glebius@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 34A598FC0A; Thu, 13 Dec 2012 12:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDCpN6q035427; Thu, 13 Dec 2012 12:51:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDCpNfg035426; Thu, 13 Dec 2012 12:51:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212131251.qBDCpNfg035426@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Dec 2012 12:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244185 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 12:51:23 -0000 Author: glebius Date: Thu Dec 13 12:51:22 2012 New Revision: 244185 URL: http://svnweb.freebsd.org/changeset/base/244185 Log: Merge rev. 1.119 from OpenBSD: date: 2009/03/31 01:21:29; author: dlg; state: Exp; lines: +9 -16 ... this also firms up some of the input parsing so it handles short frames a bit better. This actually fixes reading beyond mbuf data area in pfsync_input(), that may happen at certain pfsync datagrams. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Thu Dec 13 12:48:57 2012 (r244184) +++ head/sys/netpfil/pf/if_pfsync.c Thu Dec 13 12:51:22 2012 (r244185) @@ -44,6 +44,7 @@ /* * Revisions picked from OpenBSD after revision 1.110 import: + * 1.119 - don't m_copydata() beyond the len of mbuf in pfsync_input() * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions @@ -566,7 +567,7 @@ pfsync_input(struct mbuf *m, __unused in struct pfsync_header *ph; struct pfsync_subheader subh; - int offset; + int offset, len; int rv; uint16_t count; @@ -612,6 +613,12 @@ pfsync_input(struct mbuf *m, __unused in goto done; } + len = ntohs(ph->len) + offset; + if (m->m_pkthdr.len < len) { + pfsyncstats.pfsyncs_badlen++; + goto done; + } + /* Cheaper to grab this now than having to mess with mbufs later */ pkt.ip = ip; pkt.src = ip->ip_src; @@ -626,7 +633,7 @@ pfsync_input(struct mbuf *m, __unused in pkt.flags |= PFSYNC_SI_CKSUM; offset += sizeof(*ph); - for (;;) { + while (offset <= len - sizeof(subh)) { m_copydata(m, offset, sizeof(subh), (caddr_t)&subh); offset += sizeof(subh); @@ -1222,8 +1229,8 @@ static int pfsync_in_eof(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) { /* check if we are at the right place in the packet */ - if (offset != m->m_pkthdr.len - sizeof(struct pfsync_eof)) - V_pfsyncstats.pfsyncs_badact++; + if (offset != m->m_pkthdr.len) + V_pfsyncstats.pfsyncs_badlen++; /* we're done. free and let the caller return */ m_freem(m); @@ -1592,8 +1599,6 @@ pfsync_sendout(int schedswi) subh->count = htons(1); V_pfsyncstats.pfsyncs_oacts[PFSYNC_ACT_EOF]++; - /* XXX write checksum in EOF here */ - /* we're done, let's put it on the wire */ if (ifp->if_bpf) { m->m_data += sizeof(*ip); From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 16:12:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 604A73BD; Thu, 13 Dec 2012 16:12:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B7E998FC08; Thu, 13 Dec 2012 16:12:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBDGChaQ042136; Thu, 13 Dec 2012 18:12:43 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBDGChaQ042136 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBDGChB2042135; Thu, 13 Dec 2012 18:12:43 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 13 Dec 2012 18:12:42 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213161242.GE71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zjcmjzIkjQU2rmur" Content-Disposition: inline In-Reply-To: <20121213111240.GB1381@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 16:12:50 -0000 --zjcmjzIkjQU2rmur Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Wed Dec 12 15:45:03 2012 > > > New Revision: 244154 > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > >=20 > > > Log: > > > Use kern.max_pid sysctl to obtain maximum PID number instead of usi= ng local > > > define. > > It is pid_max, not max_pid. > >=20 > > But the change is wrong. The kern.pid_max only limits newly allocated p= ids, > > it does not magically moves existing pids, which are out of range, to t= he > > limited region. See the corresponding commit log for the description. > > It was added to make it easier to run FreeBSD 1.x binaries on the modern > > kernels. >=20 > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > userland as well and setting PID_MAX to BSD_PID_MAX? >=20 > This would also help bsnmpd. >=20 > http://people.freebsd.org/~pjd/patches/PID_MAX.patch Do you know why PID_MAX is under _KERNEL ? If there is no real reason, it would be better to move it outside kernel-only section. sys/proc.h is not in POSIX anyway. --zjcmjzIkjQU2rmur Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDJ/noACgkQC3+MBN1Mb4j2ZgCeO92KcVRMVW2xcqobnFmWXwcN q2IAoM1XvZJdiTEAm9JwjQWk3epumwre =gZLA -----END PGP SIGNATURE----- --zjcmjzIkjQU2rmur-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 16:54:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BD31DE3; Thu, 13 Dec 2012 16:54:07 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 45A148FC0C; Thu, 13 Dec 2012 16:54:06 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id A04AB466; Thu, 13 Dec 2012 17:52:02 +0100 (CET) Date: Thu, 13 Dec 2012 17:55:41 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213165541.GD1381@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7DO5AaGCk89r4vaK" Content-Disposition: inline In-Reply-To: <20121213161242.GE71906@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jhb@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 16:54:07 -0000 --7DO5AaGCk89r4vaK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > > userland as well and setting PID_MAX to BSD_PID_MAX? > >=20 > > This would also help bsnmpd. > >=20 > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > it would be better to move it outside kernel-only section. sys/proc.h > is not in POSIX anyway. I assumed it will break some ports that may define it themselves. I wonder if we could do a test ports build to see what's the impact. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --7DO5AaGCk89r4vaK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKCI0ACgkQForvXbEpPzQhBACeKtkeqZsdANgj63pYD1KFmWVD aAUAoMiFuZCGgUJkd+4iXP27Tw2oRqKi =blyC -----END PGP SIGNATURE----- --7DO5AaGCk89r4vaK-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 17:06:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D80D253A; Thu, 13 Dec 2012 17:06:39 +0000 (UTC) (envelope-from smh@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 BC8E18FC16; Thu, 13 Dec 2012 17:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDH6djW078586; Thu, 13 Dec 2012 17:06:39 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDH6dDU078584; Thu, 13 Dec 2012 17:06:39 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212131706.qBDH6dDU078584@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 17:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244187 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 17:06:39 -0000 Author: smh Date: Thu Dec 13 17:06:38 2012 New Revision: 244187 URL: http://svnweb.freebsd.org/changeset/base/244187 Log: Upgrades trim free request sizes before inserting them into to free map, making range consolidation much more effective particularly for small deletes. This reduces memory used by the free map as well as reducing the number of bio requests down to geom required to process all deletes. In tests this achieved a factor of 10 reduction of trim ranges / geom call downs. While I'm here correct the description of zio_vdev_io_start. PR: kern/173254 Submitted by: Steven Hartland Approved by: pjd (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Dec 13 15:19:37 2012 (r244186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Thu Dec 13 17:06:38 2012 (r244187) @@ -28,6 +28,17 @@ #include #include +/* + * Calculate the zio end, upgrading based on ashift which would be + * done by zio_vdev_io_start. + * + * This makes free range consolidation much more effective + * than it would otherwise be as well as ensuring that entire + * blocks are invalidated by writes. + */ +#define TRIM_ZIO_END(zio) ((zio)->io_offset + \ + P2ROUNDUP((zio)->io_size, 1ULL << (zio)->io_vd->vdev_top->vdev_ashift)) + typedef struct trim_map { list_t tm_head; /* List of segments sorted by txg. */ avl_tree_t tm_queued_frees; /* AVL tree of segments waiting for TRIM. */ @@ -270,7 +281,7 @@ trim_map_free(zio_t *zio) return; mutex_enter(&tm->tm_lock); - trim_map_free_locked(tm, zio->io_offset, zio->io_offset + zio->io_size, + trim_map_free_locked(tm, zio->io_offset, TRIM_ZIO_END(zio), vd->vdev_spa->spa_syncing_txg); mutex_exit(&tm->tm_lock); } @@ -288,7 +299,7 @@ trim_map_write_start(zio_t *zio) return (B_TRUE); start = zio->io_offset; - end = start + zio->io_size; + end = TRIM_ZIO_END(zio); tsearch.ts_start = start; tsearch.ts_end = end; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 13 15:19:37 2012 (r244186) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Dec 13 17:06:38 2012 (r244187) @@ -2448,7 +2448,7 @@ zio_free_zil(spa_t *spa, uint64_t txg, b /* * ========================================================================== - * Read and write to physical devices + * Read, write and delete to physical devices * ========================================================================== */ static int From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 17:09:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCE9773A; Thu, 13 Dec 2012 17:09:43 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 438028FC17; Thu, 13 Dec 2012 17:09:43 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so1584617pad.13 for ; Thu, 13 Dec 2012 09:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CG4lmcxxdcC8yNwuB3ibHhPRGlCNCqQL6Ydy375+a7U=; b=HMOD1TRLAySxtgxo6Y5EIvs5XFknFZRAzBwN2h5KxsKpH7+ervW5mOE7y/oalMMDmw GA/qP3FlarcckS5Q6ji8FH9nR3DO5x04VS6GDgqTvbK7XEh0rrR24KPPLKxdrYGDuNoz IW+Evwmb7dcsXj13sFdXfzKA94rXw0R/wiqb4B4kyVUYoJ+gbXff+AqwJfIpGVlma/3r l3YT/XsRDcZ0J+BDa8T3j9B3n/bWqmohy1VKsdByj2qbVcXmRskZjjVvvn0Krt4nNEXw l+6JTBtsgvOkWVgFe405xl//4IQwM547JDeuoGCjvH098u6makny2ukikLiAZhiBdqBF 4MjA== MIME-Version: 1.0 Received: by 10.68.192.70 with SMTP id he6mr7188640pbc.142.1355418085617; Thu, 13 Dec 2012 09:01:25 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.55.166 with HTTP; Thu, 13 Dec 2012 09:01:25 -0800 (PST) In-Reply-To: <50C9A321.5060407@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> <50C9A321.5060407@FreeBSD.org> Date: Thu, 13 Dec 2012 09:01:25 -0800 X-Google-Sender-Auth: 4TjBm-A58eBfQas6qmryVhHqCGs Message-ID: Subject: Re: svn commit: r244112 - head/sys/kern From: mdf@FreeBSD.org To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 17:09:44 -0000 On Thu, Dec 13, 2012 at 1:42 AM, Andriy Gapon wrote: > on 13/12/2012 09:16 Adrian Chadd said the following: >> Hi, >> >> I think the fundamental problem here is we have some pretty different >> ideas of what KASSERT should be, versus what it actually is in various >> parts of the code. > > Oh, and another part of the problem is that the discussion is opinion based. > But it didn't have to be. > > Compare this: > We think that feature F is a very good idea, we think that it will be used by many > people and it will provide a lot of benefits. So here you are - the code is in > the tree. > > To this: > We have been using feature F, it has proved to be a very good idea as it provided > these benefits and spared us from these problems. So here you are - the code is > in the tree. > > If I have a differing opinion in the first case I usually state it (and can be > pulled into an argument about it). If I have a different opinion in the second > case, I try to adjust my opinion to the stated reality. > >> Since we're lost in semantics, we're not going to get any further on >> this discussion just for now, so let's take a break and think about >> other things for now. Tools, not policy. A non-panic-ing KASSERT is a tool, not enabled by default. You don't need to use it. Someone does, so why can't we provide the tool? Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 17:39:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADC69C09; Thu, 13 Dec 2012 17:39:08 +0000 (UTC) (envelope-from smh@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 78A128FC08; Thu, 13 Dec 2012 17:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDHd86Z083617; Thu, 13 Dec 2012 17:39:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDHd8RR083616; Thu, 13 Dec 2012 17:39:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212131739.qBDHd8RR083616@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 17:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 17:39:08 -0000 Author: smh Date: Thu Dec 13 17:39:07 2012 New Revision: 244188 URL: http://svnweb.freebsd.org/changeset/base/244188 Log: Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on initialisation to be enabled (1) / disabled (0) defaults to enabled. This is useful for devices which have a slow trim speed and are either new or have otherwise already been wiped e.g. secure erase. PR: kern/173116 Submitted by: Steven Hartland Approved by: pjd (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu Dec 13 17:06:38 2012 (r244187) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu Dec 13 17:39:07 2012 (r244188) @@ -148,6 +148,11 @@ #include #include +static boolean_t vdev_trim_on_init = B_TRUE; +SYSCTL_DECL(_vfs_zfs_vdev); +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisation"); + /* * Basic routines to read and write from a vdev label. * Used throughout the rest of this file. @@ -724,7 +729,7 @@ vdev_label_init(vdev_t *vd, uint64_t crt * Don't TRIM if removing so that we don't interfere with zpool * disaster recovery. */ - if (!zfs_notrim && (reason == VDEV_LABEL_CREATE || + if (!zfs_notrim && vdev_trim_on_init && (reason == VDEV_LABEL_CREATE || reason == VDEV_LABEL_SPARE || reason == VDEV_LABEL_L2CACHE)) zio_wait(zio_trim(NULL, spa, vd, 0, vd->vdev_psize)); From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 18:16:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4CF56BFB; Thu, 13 Dec 2012 18:16:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id A577B8FC0C; Thu, 13 Dec 2012 18:16:28 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBDIGMK1054305; Thu, 13 Dec 2012 20:16:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qBDIGMK1054305 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBDIGLTV054304; Thu, 13 Dec 2012 20:16:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 13 Dec 2012 20:16:21 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213181621.GG71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2E/hm+v6kSLEYT3h" Content-Disposition: inline In-Reply-To: <20121213165541.GD1381@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 18:16:29 -0000 --2E/hm+v6kSLEYT3h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: > On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible = by > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > >=20 > > > This would also help bsnmpd. > > >=20 > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > > it would be better to move it outside kernel-only section. sys/proc.h > > is not in POSIX anyway. >=20 > I assumed it will break some ports that may define it themselves. > I wonder if we could do a test ports build to see what's the impact. Sure. On the other hand, sys/proc.h is mostly useless for the application code as it is now. Might be, use #ifndef PID_MAX braces ? --2E/hm+v6kSLEYT3h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKG3UACgkQC3+MBN1Mb4jX+QCeLESwLmPE929To8ZKX83rHd2j OTUAnj0dpzbcbD3jaepjoVnX2LPRSuLa =Xfwg -----END PGP SIGNATURE----- --2E/hm+v6kSLEYT3h-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 20:17:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC081EC9; Thu, 13 Dec 2012 20:17:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAA258FC12; Thu, 13 Dec 2012 20:17:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so2146630lah.13 for ; Thu, 13 Dec 2012 12:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=iJwjKdiqmyEuRW1ZnoLgBapsq1AFCQV1RIlxsHUzrV0=; b=sok/XZC9xSoqlm7ETsxNBs6t/EBFubp1/ucFAMqrUPB3LJgU+TiolcoAECNgoRihgR S4LZ00NR3mJmp+9l0TPzGYo9u63KxMXi0CQTA+mhAyfACZvSfozTW1OcGcOa0TCb1AhA SA9UShX1UggwrN3TUE0rpktW6IzliZU4MAvrzl2Qj8CaA0XGVcTqBe9a5NabkvP3z2A6 /F0gAgOmoutRKuuZKaOom1K7xDuZjiNksf1rwu+b266F2JDbghXmmU5YdhvJMUH3IeU5 5ZnKPZTvoS4bXU0skjFUJaD30qAtWEA2YJorq+9S29WWI8Aj8UDt58wsMUg3gUasZN/k CMwQ== MIME-Version: 1.0 Received: by 10.112.46.66 with SMTP id t2mr1373631lbm.115.1355429851465; Thu, 13 Dec 2012 12:17:31 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.84.193 with HTTP; Thu, 13 Dec 2012 12:17:31 -0800 (PST) In-Reply-To: <50C9B525.2060503@FreeBSD.org> References: <201211251422.qAPEM8BV074656@svn.freebsd.org> <50C9B525.2060503@FreeBSD.org> Date: Thu, 13 Dec 2012 20:17:31 +0000 X-Google-Sender-Auth: L3QhmG8CWU7eVOLN0L-HJxIGJnI Message-ID: Subject: Re: svn commit: r243515 - head/sys/kern From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 20:17:35 -0000 On Thu, Dec 13, 2012 at 10:59 AM, Andriy Gapon wrote: > on 09/12/2012 19:27 Attilio Rao said the following: >> On Sun, Nov 25, 2012 at 2:22 PM, Andriy Gapon wrote: >>> Author: avg >>> Date: Sun Nov 25 14:22:08 2012 >>> New Revision: 243515 >>> URL: http://svnweb.freebsd.org/changeset/base/243515 >>> >>> Log: >>> remove stop_scheduler_on_panic knob >>> >>> There has not been any complaints about the default behavior, so there >>> is no need to keep a knob that enables the worse alternative. >>> >>> Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu >>> spinlock-like logic can be dropped, because only a single CPU is >>> supposed to win stop_cpus_hard(other_cpus) race and proceed past that >>> call. >> >> While this is true for the sane case, for the case report by Ryan this >> still breaks. > > Yes. I haven't got around to start fixing the Ryan's problem yet. > But this commit should reduce number of places where changes have to be made. > In fact, I think that only stop_cpus_X would have to be fixed now. > >> Infact, immagine CPU0 (winner) and CPU1 (looser) both panic'ing. CPU0 >> wins and then sets stopping_cpu. When the deadlock happens in the >> spinning loop, because of generic_stop_cpus() logic CPU0 won't >> deadlock and will correctly continue, but the problem is that it sets >> back stopping_cpu to NOCPU, letting CPU1 continuing too and then >> deadlocking. >> >> At the minimum, what I think that should happen is to have the check >> in panic() as prior this change but with the add I outlined (thus we >> need to generalize cpustop_handler()). However, it seems to me that >> generic_stop_cpus() may still be broken by this and we eventually need >> to fix it. >> >> I would then revert this part of the patch and fix it appropriately. >> Later we can better discuss the generic_stop_cpus() similar race. > > I actually see this change and the Ryan's problem as orthogonal issues. > My opinion is let's just fix generic_stop_cpus(). Right, but as I said, for the time being we can at least have a correct panic() semantic and take the right time to fix the generic_stop_cpus() and then absorb also the panic() fix into it. Right now the mechanism is still broken in panic and it can be fixed with a very easy fix, so we should just do it. This will also help vendors like Sandvine which may have hit just this bug too. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 21:27:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51E827D1; Thu, 13 Dec 2012 21:27:21 +0000 (UTC) (envelope-from jimharris@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 364C28FC15; Thu, 13 Dec 2012 21:27:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDLRLbC017781; Thu, 13 Dec 2012 21:27:21 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDLRKo9017777; Thu, 13 Dec 2012 21:27:20 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212132127.qBDLRKo9017777@svn.freebsd.org> From: Jim Harris Date: Thu, 13 Dec 2012 21:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244191 - in head/sys: amd64/include i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 21:27:21 -0000 Author: jimharris Date: Thu Dec 13 21:27:20 2012 New Revision: 244191 URL: http://svnweb.freebsd.org/changeset/base/244191 Log: Revert r243960 based on feedback regarding keeping x86 headers unified (mdf@, tijl@) and use of KASSERT/systm.h in bus.h (zeising@, bde@). Alternate implementation will be made in a separate commit. Modified: head/sys/amd64/include/bus.h head/sys/i386/include/bus.h head/sys/x86/include/bus.h Modified: head/sys/amd64/include/bus.h ============================================================================== --- head/sys/amd64/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/amd64/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -1,153 +1,6 @@ /*- - * Copyright (c) 2012 Intel Corporation - * Copyright (c) 2009 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - -#include #include - -#define KASSERT_BUS_SPACE_MEM_ONLY(tag) \ - KASSERT((tag) == X86_BUS_SPACE_MEM, \ - ("%s: can only handle mem space", __func__)) - -static __inline uint64_t -bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - return (*(volatile uint64_t *)(bsh + ofs)); -} - -static __inline void -bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - *(volatile uint64_t *)(bsh + ofs) = val; -} - -static __inline void -bus_space_read_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t *bufp, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bufp++ = *bsp++; -} - -static __inline void -bus_space_write_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t const *bufp, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bsp++ = *bufp++; -} - -static __inline void -bus_space_set_region_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val, size_t count) -{ - volatile uint64_t *bsp; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - bsp = (void *)(bsh + ofs); - while (count-- > 0) - *bsp++ = val; -} - -static __inline void -bus_space_copy_region_8(bus_space_tag_t tag, bus_space_handle_t sbsh, - bus_size_t sofs, bus_space_handle_t dbsh, bus_size_t dofs, size_t count) -{ - volatile uint64_t *dst, *src; - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - src = (void *)(sbsh + sofs); - dst = (void *)(dbsh + dofs); - if (src < dst) { - src += count - 1; - dst += count - 1; - while (count-- > 0) - *dst-- = *src--; - } else { - while (count-- > 0) - *dst++ = *src++; - } -} - -static __inline void -bus_space_read_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t *bufp, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *bufp++ = *(volatile uint64_t *)(bsh + ofs); -} - -static __inline void -bus_space_write_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t const *bufp, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *(volatile uint64_t *)(bsh + ofs) = *bufp++; -} - -static __inline void -bus_space_set_multi_8(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t ofs, uint64_t val, size_t count) -{ - - KASSERT_BUS_SPACE_MEM_ONLY(tag); - - while (count-- > 0) - *(volatile uint64_t *)(bsh + ofs) = val; -} - -#endif /*_MACHINE_BUS_H_*/ Modified: head/sys/i386/include/bus.h ============================================================================== --- head/sys/i386/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/i386/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -3,26 +3,4 @@ */ /* $FreeBSD$ */ -#ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ - #include - -/* - * The functions: - * bus_space_read_8 - * bus_space_read_region_8 - * bus_space_write_8 - * bus_space_write_multi_8 - * bus_space_write_region_8 - * bus_space_set_multi_8 - * bus_space_set_region_8 - * bus_space_copy_region_8 - * bus_space_read_multi_8 - * are unimplemented for i386 because there is no way to do a 64-bit move in - * this architecture. It is possible to do two 32-bit moves, but this is - * not atomic and may have hardware dependencies that should be fully - * understood. - */ - -#endif /*_MACHINE_BUS_H_*/ Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Thu Dec 13 20:07:11 2012 (r244190) +++ head/sys/x86/include/bus.h Thu Dec 13 21:27:20 2012 (r244191) @@ -251,6 +251,10 @@ bus_space_read_4(bus_space_tag_t tag, bu return (*(volatile u_int32_t *)(handle + offset)); } +#if 0 /* Cause a link error for bus_space_read_8 */ +#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! +#endif + /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle/offset and copy into buffer provided. @@ -333,6 +337,10 @@ bus_space_read_multi_4(bus_space_tag_t t } } +#if 0 /* Cause a link error for bus_space_read_multi_8 */ +#define bus_space_read_multi_8 !!! bus_space_read_multi_8 unimplemented !!! +#endif + /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle and starting at `offset' and copy into @@ -450,6 +458,10 @@ bus_space_read_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_read_region_8 */ +#define bus_space_read_region_8 !!! bus_space_read_region_8 unimplemented !!! +#endif + /* * Write the 1, 2, 4, or 8 byte value `value' to bus space * described by tag/handle/offset. @@ -500,6 +512,10 @@ bus_space_write_4(bus_space_tag_t tag, b *(volatile u_int32_t *)(bsh + offset) = value; } +#if 0 /* Cause a link error for bus_space_write_8 */ +#define bus_space_write_8 !!! bus_space_write_8 not implemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer * provided to bus space described by tag/handle/offset. @@ -585,6 +601,11 @@ bus_space_write_multi_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_write_multi_8 */ +#define bus_space_write_multi_8(t, h, o, a, c) \ + !!! bus_space_write_multi_8 unimplemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided * to bus space described by tag/handle starting at `offset'. @@ -702,6 +723,11 @@ bus_space_write_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_write_region_8 */ +#define bus_space_write_region_8 \ + !!! bus_space_write_region_8 unimplemented !!! +#endif + /* * Write the 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle/offset `count' times. @@ -762,6 +788,10 @@ bus_space_set_multi_4(bus_space_tag_t ta *(volatile u_int32_t *)(addr) = value; } +#if 0 /* Cause a link error for bus_space_set_multi_8 */ +#define bus_space_set_multi_8 !!! bus_space_set_multi_8 unimplemented !!! +#endif + /* * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described * by tag/handle starting at `offset'. @@ -822,6 +852,10 @@ bus_space_set_region_4(bus_space_tag_t t *(volatile u_int32_t *)(addr) = value; } +#if 0 /* Cause a link error for bus_space_set_region_8 */ +#define bus_space_set_region_8 !!! bus_space_set_region_8 unimplemented !!! +#endif + /* * Copy `count' 1, 2, 4, or 8 byte values from bus space starting * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. @@ -950,6 +984,10 @@ bus_space_copy_region_4(bus_space_tag_t } } +#if 0 /* Cause a link error for bus_space_copy_8 */ +#define bus_space_copy_region_8 !!! bus_space_copy_region_8 unimplemented !!! +#endif + /* * Bus read/write barrier methods. * From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 21:30:11 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B705F97D; Thu, 13 Dec 2012 21:30:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 700928FC14; Thu, 13 Dec 2012 21:30:10 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1F021514; Thu, 13 Dec 2012 22:28:07 +0100 (CET) Date: Thu, 13 Dec 2012 22:31:47 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121213213147.GA1401@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <20121213181621.GG71906@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 21:30:11 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 08:16:21PM +0200, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: > > On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: > > > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: > > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visibl= e by > > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > > >=20 > > > > This would also help bsnmpd. > > > >=20 > > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > > > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, > > > it would be better to move it outside kernel-only section. sys/proc.h > > > is not in POSIX anyway. > >=20 > > I assumed it will break some ports that may define it themselves. > > I wonder if we could do a test ports build to see what's the impact. >=20 > Sure. >=20 > On the other hand, sys/proc.h is mostly useless for the application code > as it is now. Might be, use > #ifndef PID_MAX > braces ? This can be done of course, but it won't help cases where PID_MAX is defined after sys/proc.h is included. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDKSUMACgkQForvXbEpPzRu4wCffzwr68b3FD1J5XNwJVeklX3M Cp0AoI77Uc00qIo84676rt1Fq/viIpEe =EYUL -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 21:40:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FC0EDBA; Thu, 13 Dec 2012 21:40:12 +0000 (UTC) (envelope-from jimharris@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 04FCD8FC14; Thu, 13 Dec 2012 21:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDLeBdk019752; Thu, 13 Dec 2012 21:40:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDLeBhd019751; Thu, 13 Dec 2012 21:40:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201212132140.qBDLeBhd019751@svn.freebsd.org> From: Jim Harris Date: Thu, 13 Dec 2012 21:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244193 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 21:40:12 -0000 Author: jimharris Date: Thu Dec 13 21:40:11 2012 New Revision: 244193 URL: http://svnweb.freebsd.org/changeset/base/244193 Log: Add bus_space_read_8 and bus_space_write_8 for amd64. Rather than trying to KASSERT for callers that invoke this on IO tags, either do nothing (for write_8) or return ~0 (for read_8). Using KASSERT here just makes bus.h too messy from both polluting bus.h with systm.h (for any number of drivers that include bus.h without first including systm.h) or ports that use bus.h directly (i.e. libpciaccess) as reported by zeising@. Also don't try to implement all of the other bus_space functions for 8 byte access since realistically only these two are needed for some devices that expose 64-bit memory-mapped registers. Put the amd64-specific functions here rather than sys/amd64/include/bus.h so that we can keep this header unified for x86, as requested by mdf@ and tijl@. Submitted by: Carl Delsey MFC after: 3 days Modified: head/sys/x86/include/bus.h Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) @@ -130,6 +130,7 @@ #define BUS_SPACE_MAXADDR 0xFFFFFFFF #endif +#define BUS_SPACE_INVALID_DATA (~0) #define BUS_SPACE_UNRESTRICTED (~0) /* @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read bus_space_handle_t handle, bus_size_t offset); +#ifdef __amd64__ +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, + bus_space_handle_t handle, + bus_size_t offset); +#endif + static __inline u_int8_t bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu return (*(volatile u_int32_t *)(handle + offset)); } -#if 0 /* Cause a link error for bus_space_read_8 */ -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! +#ifdef __amd64__ +static __inline uint64_t +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t offset) +{ + + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ + return (BUS_SPACE_INVALID_DATA); + return (*(volatile uint64_t *)(handle + offset)); +} #endif /* @@ -479,6 +494,12 @@ static __inline void bus_space_write_4(b bus_space_handle_t bsh, bus_size_t offset, u_int32_t value); +#ifdef __amd64__ +static __inline void bus_space_write_8(bus_space_tag_t tag, + bus_space_handle_t bsh, + bus_size_t offset, uint64_t value); +#endif + static __inline void bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t value) @@ -512,8 +533,17 @@ bus_space_write_4(bus_space_tag_t tag, b *(volatile u_int32_t *)(bsh + offset) = value; } -#if 0 /* Cause a link error for bus_space_write_8 */ -#define bus_space_write_8 !!! bus_space_write_8 not implemented !!! +#ifdef __amd64__ +static __inline void +bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh, + bus_size_t offset, uint64_t value) +{ + + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ + return; + else + *(volatile uint64_t *)(bsh + offset) = value; +} #endif /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 22:03:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41E267E6; Thu, 13 Dec 2012 22:03:08 +0000 (UTC) (envelope-from smh@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 272148FC0A; Thu, 13 Dec 2012 22:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDM382V022847; Thu, 13 Dec 2012 22:03:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDM38R3022846; Thu, 13 Dec 2012 22:03:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201212132203.qBDM38R3022846@svn.freebsd.org> From: Steven Hartland Date: Thu, 13 Dec 2012 22:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244194 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 22:03:08 -0000 Author: smh Date: Thu Dec 13 22:03:07 2012 New Revision: 244194 URL: http://svnweb.freebsd.org/changeset/base/244194 Log: Fixes zfs receive errors caused by snapshot replication being processed in a random order instead of creation order. Eliminates needless filesystem renames caused by removed parent snapshots which subsequently causes many more errors. PR: kern/172259 Submitted by: Steven Hartland Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Dec 13 21:40:11 2012 (r244193) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Dec 13 22:03:07 2012 (r244194) @@ -727,7 +727,7 @@ send_iterate_fs(zfs_handle_t *zhp, void sd->parent_fromsnap_guid = 0; VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0)); VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0)); - (void) zfs_iter_snapshots(zhp, B_FALSE, send_iterate_snap, sd); + (void) zfs_iter_snapshots_sorted(zhp, send_iterate_snap, sd); VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps)); VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops)); nvlist_free(sd->parent_snaps); @@ -1945,11 +1945,12 @@ recv_incremental_replication(libzfs_hand recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl, nvlist_t *renamed) { - nvlist_t *local_nv; + nvlist_t *local_nv, *deleted = NULL; avl_tree_t *local_avl; nvpair_t *fselem, *nextfselem; char *fromsnap; char newname[ZFS_MAXNAMELEN]; + char guidname[32]; int error; boolean_t needagain, progress, recursive; char *s1, *s2; @@ -1965,6 +1966,8 @@ recv_incremental_replication(libzfs_hand again: needagain = progress = B_FALSE; + VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0)); + if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL, recursive, &local_nv, &local_avl)) != 0) return (error); @@ -2079,6 +2082,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", thisguid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2134,6 +2139,8 @@ again: needagain = B_TRUE; else progress = B_TRUE; + sprintf(guidname, "%lu", parent_fromsnap_guid); + nvlist_add_boolean(deleted, guidname); continue; } @@ -2156,6 +2163,24 @@ again: s2 = strrchr(stream_fsname, '/'); /* + * Check if we're going to rename based on parent guid change + * and the current parent guid was also deleted. If it was then + * rename will fail and is likely unneeded, so avoid this and + * force an early retry to determine the new + * parent_fromsnap_guid. + */ + if (stream_parent_fromsnap_guid != 0 && + parent_fromsnap_guid != 0 && + stream_parent_fromsnap_guid != parent_fromsnap_guid) { + sprintf(guidname, "%lu", parent_fromsnap_guid); + if (nvlist_exists(deleted, guidname)) { + progress = B_TRUE; + needagain = B_TRUE; + goto doagain; + } + } + + /* * Check for rename. If the exact receive path is specified, it * does not count as a rename, but we still need to check the * datasets beneath it. @@ -2209,8 +2234,10 @@ again: } } +doagain: fsavl_destroy(local_avl); nvlist_free(local_nv); + nvlist_free(deleted); if (needagain && progress) { /* do another pass to fix up temporary names */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 23:03:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21354720; Thu, 13 Dec 2012 23:03:38 +0000 (UTC) (envelope-from gonzo@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 06FAF8FC13; Thu, 13 Dec 2012 23:03:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDN3bpA032295; Thu, 13 Dec 2012 23:03:37 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDN3bKf032293; Thu, 13 Dec 2012 23:03:37 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212132303.qBDN3bKf032293@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 23:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244195 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 23:03:38 -0000 Author: gonzo Date: Thu Dec 13 23:03:37 2012 New Revision: 244195 URL: http://svnweb.freebsd.org/changeset/base/244195 Log: Add driver for PrimeCell Vectored Interrupt Controller (PL190) Added: head/sys/arm/arm/pl190.c (contents, props changed) Modified: head/sys/conf/files.arm Added: head/sys/arm/arm/pl190.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/pl190.c Thu Dec 13 23:03:37 2012 (r244195) @@ -0,0 +1,187 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef DEBUG +#define dprintf(fmt, args...) printf(fmt, ##args) +#else +#define dprintf(fmt, args...) +#endif + +#define VICIRQSTATUS 0x000 +#define VICFIQSTATUS 0x004 +#define VICRAWINTR 0x008 +#define VICINTSELECT 0x00C +#define VICINTENABLE 0x010 +#define VICINTENCLEAR 0x014 +#define VICSOFTINT 0x018 +#define VICSOFTINTCLEAR 0x01C +#define VICPROTECTION 0x020 +#define VICPERIPHID 0xFE0 +#define VICPRIMECELLID 0xFF0 + +#define VIC_NIRQS 32 + +struct pl190_intc_softc { + device_t sc_dev; + struct resource * intc_res; +}; + +static struct pl190_intc_softc *pl190_intc_sc = NULL; + +#define intc_vic_read_4(reg) \ + bus_read_4(pl190_intc_sc->intc_res, (reg)) +#define intc_vic_write_4(reg, val) \ + bus_write_4(pl190_intc_sc->intc_res, (reg), (val)) + +static int +pl190_intc_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "arm,versatile-vic")) + return (ENXIO); + device_set_desc(dev, "ARM PL190 VIC"); + return (BUS_PROBE_DEFAULT); +} + +static int +pl190_intc_attach(device_t dev) +{ + struct pl190_intc_softc *sc = device_get_softc(dev); + uint32_t id; + int i, rid; + + sc->sc_dev = dev; + + if (pl190_intc_sc) + return (ENXIO); + + /* Request memory resources */ + rid = 0; + sc->intc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->intc_res == NULL) { + device_printf(dev, "Error: could not allocate memory resources\n"); + return (ENXIO); + } + + pl190_intc_sc = sc; + /* + * All interrupts should use IRQ line + */ + intc_vic_write_4(VICINTSELECT, 0x00000000); + /* Disable all interrupts */ + intc_vic_write_4(VICINTENCLEAR, 0xffffffff); + /* Enable INT31, SIC IRQ */ + intc_vic_write_4(VICINTENABLE, (1 << 31)); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (intc_vic_read_4(VICPERIPHID + i*4) & 0xff); + } + + device_printf(dev, "Peripheral ID: %08x\n", id); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (intc_vic_read_4(VICPRIMECELLID + i*4) & 0xff); + } + + device_printf(dev, "PrimeCell ID: %08x\n", id); + + return (0); +} + +static device_method_t pl190_intc_methods[] = { + DEVMETHOD(device_probe, pl190_intc_probe), + DEVMETHOD(device_attach, pl190_intc_attach), + { 0, 0 } +}; + +static driver_t pl190_intc_driver = { + "intc", + pl190_intc_methods, + sizeof(struct pl190_intc_softc), +}; + +static devclass_t pl190_intc_devclass; + +DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass, 0, 0); + +int +arm_get_next_irq(int last_irq) +{ + uint32_t pending; + int32_t irq = last_irq + 1; + + /* Sanity check */ + if (irq < 0) + irq = 0; + + pending = intc_vic_read_4(VICIRQSTATUS); + while (irq < VIC_NIRQS) { + if (pending & (1 << irq)) + return (irq); + irq++; + } + + return (-1); +} + +void +arm_mask_irq(uintptr_t nb) +{ + + dprintf("%s: %d\n", __func__, nb); + intc_vic_write_4(VICINTENCLEAR, (1 << nb)); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + + dprintf("%s: %d\n", __func__, nb); + intc_vic_write_4(VICINTENABLE, (1 << nb)); +} Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Dec 13 22:03:07 2012 (r244194) +++ head/sys/conf/files.arm Thu Dec 13 23:03:37 2012 (r244195) @@ -32,6 +32,7 @@ arm/arm/mem.c optional mem arm/arm/minidump_machdep.c optional mem arm/arm/mp_machdep.c optional smp arm/arm/nexus.c standard +arm/arm/pl190.c optional pl190 arm/arm/pl310.c optional pl310 arm/arm/pmap.c optional cpu_arm9 | cpu_arm9e | cpu_fa526 | cpu_sa1100 | cpu_sa1110 | cpu_xscale_80219 | cpu_xscale_80321 | cpu_xscale_81342 | cpu_xscale_ixp425 | cpu_xscale_ixp435 | cpu_xscale_pxa2x0 arm/arm/pmap-v6.c optional cpu_arm11 | cpu_cortexa | cpu_mv_pj4b From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 23:19:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04A6617F; Thu, 13 Dec 2012 23:19:15 +0000 (UTC) (envelope-from gonzo@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 DBC3A8FC12; Thu, 13 Dec 2012 23:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDNJEXj035263; Thu, 13 Dec 2012 23:19:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDNJDv1035251; Thu, 13 Dec 2012 23:19:13 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201212132319.qBDNJDv1035251@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 13 Dec 2012 23:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244197 - in head/sys: arm/conf arm/versatile boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 23:19:15 -0000 Author: gonzo Date: Thu Dec 13 23:19:13 2012 New Revision: 244197 URL: http://svnweb.freebsd.org/changeset/base/244197 Log: Add support for QEMU's version of Versatile Platform Board Added: head/sys/arm/conf/VERSATILEPB (contents, props changed) head/sys/arm/versatile/ head/sys/arm/versatile/bus_space.c (contents, props changed) head/sys/arm/versatile/common.c (contents, props changed) head/sys/arm/versatile/files.versatile (contents, props changed) head/sys/arm/versatile/if_smc_fdt.c (contents, props changed) head/sys/arm/versatile/pl050.c (contents, props changed) head/sys/arm/versatile/sp804.c (contents, props changed) head/sys/arm/versatile/versatile_clcd.c (contents, props changed) head/sys/arm/versatile/versatile_machdep.c (contents, props changed) head/sys/arm/versatile/versatile_pci.c (contents, props changed) head/sys/arm/versatile/versatile_pci_bus_space.c (contents, props changed) head/sys/arm/versatile/versatile_pci_bus_space.h (contents, props changed) head/sys/arm/versatile/versatile_sic.c (contents, props changed) head/sys/arm/versatile/versatile_timer.c (contents, props changed) head/sys/boot/fdt/dts/versatilepb.dts (contents, props changed) Added: head/sys/arm/conf/VERSATILEPB ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/VERSATILEPB Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,101 @@ +# RPI-B -- Custom configuration for the Raspberry Pi +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident VERSATILEPB +machine arm armv6 +cpu CPU_ARM11 + +files "../versatile/files.versatile" +makeoptions MODULES_OVERRIDE="" + +options KERNVIRTADDR=0xc0100000 +makeoptions KERNVIRTADDR=0xc0100000 +options KERNPHYSADDR=0x00100000 +makeoptions KERNPHYSADDR=0x00100000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x01000000 +options FREEBSD_BOOT_LOADER +options LINUX_BOOT_ABI + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options HZ=100 + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +device snp + +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options ROOTDEVNAME=\"ufs:da0s2a\" + +options PREEMPTION + +device bpf +device loop +device mii +device mii_bitbang +device smc +device smcphy +device ether +device uart +device pl011 +device pl190 + +device pty + +device pci + +# SCSI Controllers +device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D + +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) + +# NOTE: serial console is disabled if syscons enabled +# Comment following lines for headless setup +device sc +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 + +options KDB +options DDB #Enable the kernel debugger +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS + +device md +device random # Entropy device + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=versatilepb.dts Added: head/sys/arm/versatile/bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/bus_space.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,113 @@ +/*- + * Copyright (C) 2012 FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +/* Prototypes for all the bus_space structure functions */ +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space _base_tag = { + /* cookie */ + .bs_cookie = (void *) 0, + + /* mapping/unmapping */ + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, + + /* allocation/deallocation */ + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, + + /* barrier */ + .bs_barrier = generic_bs_barrier, + + /* read (single) */ + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_armv4_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = NULL, + + /* read multiple */ + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_armv4_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = NULL, + + /* read region */ + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_armv4_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = NULL, + + /* write (single) */ + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_armv4_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = NULL, + + /* write multiple */ + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_armv4_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = NULL, + + /* write region */ + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_armv4_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = NULL, + + /* set multiple */ + /* XXX not implemented */ + + /* set region */ + .bs_sr_1 = NULL, + .bs_sr_2 = generic_armv4_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = NULL, + + /* copy */ + .bs_c_1 = NULL, + .bs_c_2 = generic_armv4_bs_c_2, + .bs_c_4 = NULL, + .bs_c_8 = NULL, +}; + +bus_space_tag_t fdtbus_bs_tag = &_base_tag; Added: head/sys/arm/versatile/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/common.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,75 @@ +/*- + * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_global.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "arm,versatile-vic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_intc_decode_ic, + NULL +}; Added: head/sys/arm/versatile/files.versatile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/files.versatile Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_armv6.S standard +arm/arm/irq_dispatch.S standard + +arm/versatile/bus_space.c standard +arm/versatile/common.c standard +arm/versatile/pl050.c optional sc +arm/versatile/sp804.c standard +arm/versatile/versatile_machdep.c standard +arm/versatile/versatile_clcd.c optional sc +arm/versatile/versatile_pci.c optional pci +arm/versatile/versatile_pci_bus_space.c optional pci +arm/versatile/versatile_sic.c standard +arm/versatile/versatile_timer.c standard +arm/versatile/if_smc_fdt.c optional smc + +kern/kern_clocksource.c standard Added: head/sys/arm/versatile/if_smc_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/if_smc_fdt.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2008 Benno Rice + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include "miibus_if.h" + +static int smc_fdt_probe(device_t); +static int smc_fdt_attach(device_t); +static int smc_fdt_detach(device_t); + +static int +smc_fdt_probe(device_t dev) +{ + struct smc_softc *sc; + + if (ofw_bus_is_compatible(dev, "smsc,lan91c111")) { + sc = device_get_softc(dev); + sc->smc_usemem = 1; + + if (smc_probe(dev) != 0) { + return (ENXIO); + } + + return (0); + } + + return (ENXIO); +} + +static int +smc_fdt_attach(device_t dev) +{ + int err; + struct smc_softc *sc; + + sc = device_get_softc(dev); + + err = smc_attach(dev); + if (err) { + return (err); + } + + return (0); +} + +static int +smc_fdt_detach(device_t dev) +{ + + smc_detach(dev); + + return (0); +} + +static device_method_t smc_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, smc_fdt_probe), + DEVMETHOD(device_attach, smc_fdt_attach), + DEVMETHOD(device_detach, smc_fdt_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, smc_miibus_readreg), + DEVMETHOD(miibus_writereg, smc_miibus_writereg), + DEVMETHOD(miibus_statchg, smc_miibus_statchg), + + { 0, 0 } +}; + +static driver_t smc_fdt_driver = { + "smc", + smc_fdt_methods, + sizeof(struct smc_softc), +}; + +extern devclass_t smc_devclass; + +DRIVER_MODULE(smc, simplebus, smc_fdt_driver, smc_devclass, 0, 0); +DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); +MODULE_DEPEND(smc, fdt, 1, 1, 1); +MODULE_DEPEND(smc, ether, 1, 1, 1); +MODULE_DEPEND(smc, miibus, 1, 1, 1); Added: head/sys/arm/versatile/pl050.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/pl050.c Thu Dec 13 23:19:13 2012 (r244197) @@ -0,0 +1,713 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Based on dev/usb/input/ukbd.c + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#define KMI_LOCK() mtx_lock(&Giant) +#define KMI_UNLOCK() mtx_unlock(&Giant) + +#ifdef INVARIANTS +/* + * Assert that the lock is held in all contexts + * where the code can be executed. + */ +#define KMI_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) +/* + * Assert that the lock is held in the contexts + * where it really has to be so. + */ +#define KMI_CTX_LOCK_ASSERT() \ + do { \ + if (!kdb_active && panicstr == NULL) \ + mtx_assert(&Giant, MA_OWNED); \ + } while (0) +#else +#define KMI_LOCK_ASSERT() (void)0 +#define KMI_CTX_LOCK_ASSERT() (void)0 +#endif + +#define KMICR 0x00 +#define KMICR_TYPE_NONPS2 (1 << 5) +#define KMICR_RXINTREN (1 << 4) +#define KMICR_TXINTREN (1 << 3) +#define KMICR_EN (1 << 2) +#define KMICR_FKMID (1 << 1) +#define KMICR_FKMIC (1 << 0) +#define KMISTAT 0x04 +#define KMISTAT_TXEMPTY (1 << 6) +#define KMISTAT_TXBUSY (1 << 5) +#define KMISTAT_RXFULL (1 << 4) +#define KMISTAT_RXBUSY (1 << 3) +#define KMISTAT_RXPARITY (1 << 2) +#define KMISTAT_KMIC (1 << 1) +#define KMISTAT_KMID (1 << 0) +#define KMIDATA 0x08 +#define KMICLKDIV 0x0C +#define KMIIR 0x10 +#define KMIIR_TXINTR (1 << 1) +#define KMIIR_RXINTR (1 << 0) + +#define KMI_DRIVER_NAME "kmi" +#define KMI_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */ + +struct kmi_softc { + keyboard_t sc_kbd; + keymap_t sc_keymap; + accentmap_t sc_accmap; + fkeytab_t sc_fkeymap[KMI_NFKEY]; + + struct resource* sc_mem_res; + struct resource* sc_irq_res; + void* sc_intr_hl; + + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + uint32_t sc_flags; /* flags */ +#define KMI_FLAG_COMPOSE 0x00000001 +#define KMI_FLAG_POLLING 0x00000002 + + struct thread *sc_poll_thread; +}; + +/* Read/Write macros for Timer used as timecounter */ +#define pl050_kmi_read_4(sc, reg) \ + bus_read_4((sc)->sc_mem_res, (reg)) + +#define pl050_kmi_write_4(sc, reg, val) \ + bus_write_4((sc)->sc_mem_res, (reg), (val)) + +/* prototypes */ +static void kmi_set_leds(struct kmi_softc *, uint8_t); +static int kmi_set_typematic(keyboard_t *, int); +static uint32_t kmi_read_char(keyboard_t *, int); +static void kmi_clear_state(keyboard_t *); +static int kmi_ioctl(keyboard_t *, u_long, caddr_t); +static int kmi_enable(keyboard_t *); +static int kmi_disable(keyboard_t *); + +/* early keyboard probe, not supported */ +static int +kmi_configure(int flags) +{ + return (0); +} + +/* detect a keyboard, not used */ +static int +kmi_probe(int unit, void *arg, int flags) +{ + return (ENXIO); +} + +/* reset and initialize the device, not used */ +static int +kmi_init(int unit, keyboard_t **kbdp, void *arg, int flags) +{ + return (ENXIO); +} + +/* test the interface to the device, not used */ +static int +kmi_test_if(keyboard_t *kbd) +{ + return (0); +} + +/* finish using this keyboard, not used */ +static int +kmi_term(keyboard_t *kbd) +{ + return (ENXIO); +} + +/* keyboard interrupt routine, not used */ +static int +kmi_intr(keyboard_t *kbd, void *arg) +{ + + return (0); +} + +/* lock the access to the keyboard, not used */ +static int +kmi_lock(keyboard_t *kbd, int lock) +{ + return (1); +} + +/* + * Enable the access to the device; until this function is called, + * the client cannot read from the keyboard. + */ +static int +kmi_enable(keyboard_t *kbd) +{ + + KMI_LOCK(); + KBD_ACTIVATE(kbd); + KMI_UNLOCK(); + + return (0); +} + +/* disallow the access to the device */ +static int +kmi_disable(keyboard_t *kbd) +{ + + KMI_LOCK(); + KBD_DEACTIVATE(kbd); + KMI_UNLOCK(); + + return (0); +} + +/* check if data is waiting */ +static int +kmi_check(keyboard_t *kbd) +{ + struct kmi_softc *sc = kbd->kb_data; + uint32_t reg; + + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + reg = pl050_kmi_read_4(sc, KMIIR); + return (reg & KMIIR_RXINTR); +} + +/* check if char is waiting */ +static int +kmi_check_char_locked(keyboard_t *kbd) +{ + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + return (kmi_check(kbd)); +} + +static int +kmi_check_char(keyboard_t *kbd) +{ + int result; + + KMI_LOCK(); + result = kmi_check_char_locked(kbd); + KMI_UNLOCK(); + + return (result); +} + +/* read one byte from the keyboard if it's allowed */ +/* Currently unused. */ +static int +kmi_read(keyboard_t *kbd, int wait) +{ + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (-1); + + ++(kbd->kb_count); + printf("Implement ME: %s\n", __func__); + return (0); +} + +/* read char from the keyboard */ +static uint32_t +kmi_read_char_locked(keyboard_t *kbd, int wait) +{ + struct kmi_softc *sc = kbd->kb_data; + uint32_t reg, data; + + KMI_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (NOKEY); + + reg = pl050_kmi_read_4(sc, KMIIR); + if (reg & KMIIR_RXINTR) { + data = pl050_kmi_read_4(sc, KMIDATA); + return (data); + } + + ++kbd->kb_count; + return (NOKEY); +} + +/* Currently wait is always false. */ +static uint32_t +kmi_read_char(keyboard_t *kbd, int wait) +{ + uint32_t keycode; + + KMI_LOCK(); + keycode = kmi_read_char_locked(kbd, wait); + KMI_UNLOCK(); + + return (keycode); +} + +/* some useful control functions */ +static int +kmi_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + struct kmi_softc *sc = kbd->kb_data; + int i; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + int ival; + +#endif + + KMI_LOCK_ASSERT(); + + switch (cmd) { + case KDGKBMODE: /* get keyboard mode */ + *(int *)arg = sc->sc_mode; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 7): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBMODE: /* set keyboard mode */ + switch (*(int *)arg) { + case K_XLATE: + if (sc->sc_mode != K_XLATE) { + /* make lock key state and LED state match */ + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= KBD_LED_VAL(kbd); + } + /* FALLTHROUGH */ + case K_RAW: + case K_CODE: + if (sc->sc_mode != *(int *)arg) { + if ((sc->sc_flags & KMI_FLAG_POLLING) == 0) + kmi_clear_state(kbd); + sc->sc_mode = *(int *)arg; + } + break; + default: + return (EINVAL); + } + break; + + case KDGETLED: /* get keyboard LED */ + *(int *)arg = KBD_LED_VAL(kbd); + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 66): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETLED: /* set keyboard LED */ + /* NOTE: lock key state in "sc_state" won't be changed */ + if (*(int *)arg & ~LOCK_MASK) + return (EINVAL); + + i = *(int *)arg; + + /* replace CAPS LED with ALTGR LED for ALTGR keyboards */ + if (sc->sc_mode == K_XLATE && + kbd->kb_keymap->n_keys > ALTGR_OFFSET) { + if (i & ALKED) + i |= CLKED; + else + i &= ~CLKED; + } + if (KBD_HAS_DEVICE(kbd)) + kmi_set_leds(sc, i); + + KBD_LED_VAL(kbd) = *(int *)arg; + break; + case KDGKBSTATE: /* get lock key state */ + *(int *)arg = sc->sc_state & LOCK_MASK; + break; +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 20): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSKBSTATE: /* set lock key state */ + if (*(int *)arg & ~LOCK_MASK) { + return (EINVAL); + } + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= *(int *)arg; + + /* set LEDs and quit */ + return (kmi_ioctl(kbd, KDSETLED, arg)); + + case KDSETREPEAT: /* set keyboard repeat rate (new + * interface) */ + if (!KBD_HAS_DEVICE(kbd)) { + return (0); + } + if (((int *)arg)[1] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 200) /* fastest possible value */ + kbd->kb_delay1 = 200; + else + kbd->kb_delay1 = ((int *)arg)[0]; + kbd->kb_delay2 = ((int *)arg)[1]; + return (0); + +#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IO('K', 67): + ival = IOCPARM_IVAL(arg); + arg = (caddr_t)&ival; + /* FALLTHROUGH */ +#endif + case KDSETRAD: /* set keyboard repeat rate (old + * interface) */ + return (kmi_set_typematic(kbd, *(int *)arg)); + + case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case PIO_KEYMAPENT: /* set keyboard translation table + * entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ + sc->sc_accents = 0; + /* FALLTHROUGH */ + default: + return (genkbd_commonioctl(kbd, cmd, arg)); + } + + return (0); +} + +static int +kmi_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + int result; + + /* + * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any + * context where printf(9) can be called, which among other things + * includes interrupt filters and threads with any kinds of locks + * already held. For this reason it would be dangerous to acquire + * the Giant here unconditionally. On the other hand we have to + * have it to handle the ioctl. + * So we make our best effort to auto-detect whether we can grab + * the Giant or not. Blame syscons(4) for this. + */ + switch (cmd) { + case KDGKBSTATE: + case KDSKBSTATE: + case KDSETLED: + if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED()) + return (EDEADLK); /* best I could come up with */ + /* FALLTHROUGH */ + default: + KMI_LOCK(); + result = kmi_ioctl_locked(kbd, cmd, arg); + KMI_UNLOCK(); + return (result); + } +} + + +/* clear the internal state of the keyboard */ +static void +kmi_clear_state(keyboard_t *kbd) +{ + struct kmi_softc *sc = kbd->kb_data; + + KMI_CTX_LOCK_ASSERT(); + + sc->sc_flags &= ~(KMI_FLAG_COMPOSE | KMI_FLAG_POLLING); + sc->sc_state &= LOCK_MASK; /* preserve locking key state */ + sc->sc_accents = 0; +} + +/* save the internal state, not used */ +static int +kmi_get_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (len == 0) ? 1 : -1; +} + +/* set the internal state, not used */ +static int +kmi_set_state(keyboard_t *kbd, void *buf, size_t len) +{ + return (EINVAL); +} + +static int +kmi_poll(keyboard_t *kbd, int on) +{ + struct kmi_softc *sc = kbd->kb_data; + + KMI_LOCK(); + if (on) { + sc->sc_flags |= KMI_FLAG_POLLING; + sc->sc_poll_thread = curthread; + } else { + sc->sc_flags &= ~KMI_FLAG_POLLING; + } + KMI_UNLOCK(); + + return (0); +} + +/* local functions */ + +static void +kmi_set_leds(struct kmi_softc *sc, uint8_t leds) +{ + + KMI_LOCK_ASSERT(); + + /* start transfer, if not already started */ + printf("Implement me: %s\n", __func__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 13 23:32:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C560052B; Thu, 13 Dec 2012 23:32:48 +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 9DC898FC0C; Thu, 13 Dec 2012 23:32:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBDNWm19037507; Thu, 13 Dec 2012 23:32:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBDNWmK4037503; Thu, 13 Dec 2012 23:32:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201212132332.qBDNWmK4037503@svn.freebsd.org> From: Xin LI Date: Thu, 13 Dec 2012 23:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244198 - in head: etc/rc.d sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 23:32:48 -0000 Author: delphij Date: Thu Dec 13 23:32:47 2012 New Revision: 244198 URL: http://svnweb.freebsd.org/changeset/base/244198 Log: Teach sysctl(8) about parsing a file (while I'm there also give it capability of parsing both = and : formats). Submitted by: hrs (initial version, bugs are mine) MFC after: 3 months Modified: head/etc/rc.d/sysctl head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/etc/rc.d/sysctl ============================================================================== --- head/etc/rc.d/sysctl Thu Dec 13 23:19:13 2012 (r244197) +++ head/etc/rc.d/sysctl Thu Dec 13 23:32:47 2012 (r244198) @@ -8,51 +8,27 @@ . /etc/rc.subr name="sysctl" +command="/sbin/sysctl" stop_cmd=":" start_cmd="sysctl_start" reload_cmd="sysctl_start" lastload_cmd="sysctl_start last" extra_commands="reload lastload" -# -# Read in a file containing sysctl settings and set things accordingly. -# -parse_file() -{ - if [ -f $1 ]; then - while read var comments - do - case ${var} in - \#*|'') - ;; - *) - mib=${var%=*} - val=${var#*=} - - if current_value=`${SYSCTL} -n ${mib} 2>/dev/null`; then - case ${current_value} in - ${val}) - ;; - *) - if ! sysctl "${var}" >/dev/null 2>&1; then - warn "unable to set ${var}" - fi - ;; - esac - elif [ "$2" = "last" ]; then - warn "sysctl ${mib} does not exist." - fi - ;; - esac - done < $1 - fi -} - sysctl_start() { - - parse_file /etc/sysctl.conf $1 - parse_file /etc/sysctl.conf.local $1 + case $1 in + last) + command_args="-i -f" + ;; + *) + command_args="-f" + ;; + esac + + for _f in /etc/sysctl.conf /etc/sysctl.conf.local; do + [ -r ${_f} ] && ${command} ${command_args} ${_f} > /dev/null + done } load_rc_config $name Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Thu Dec 13 23:19:13 2012 (r244197) +++ head/sbin/sysctl/sysctl.8 Thu Dec 13 23:32:47 2012 (r244198) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 17, 2011 +.Dd December 13, 2012 .Dt SYSCTL 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl bdehiNnoRTqx +.Op Fl f Ar filename .Ar name Ns Op = Ns Ar value .Ar ... .Nm @@ -80,6 +81,11 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl f Ar filename +Specify a file which contains a pair of name and value in each line. +.Nm +reads and processes the specified file first and then processes the name +and value pairs in the command line argument. .It Fl h Format output for human, rather than machine, readability. .It Fl i Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Dec 13 23:19:13 2012 (r244197) +++ head/sbin/sysctl/sysctl.c Thu Dec 13 23:32:47 2012 (r244198) @@ -56,13 +56,17 @@ static const char rcsid[] = #include #include #include +#include #include +static const char *conffile; + static int aflag, bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag, warncount; +static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; static int oidfmt(int *, int, char *, u_int *); -static void parse(const char *); +static int parsefile(const char *); +static int parse(const char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(char *, int *); @@ -74,7 +78,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTWx] name[=value] ...", + "usage: sysctl [-bdehiNnoqTWx] [-f filename] name[=value] ...", " sysctl [-bdehNnoqTWx] -a"); exit(1); } @@ -83,12 +87,13 @@ int main(int argc, char **argv) { int ch; + int warncount = 0; setlocale(LC_NUMERIC, ""); setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehiNnoqTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "Aabdef:hiNnoqTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -106,6 +111,9 @@ main(int argc, char **argv) case 'e': eflag = 1; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -152,13 +160,17 @@ main(int argc, char **argv) usage(); if (aflag && argc == 0) exit(sysctl_all(0, 0)); - if (argc == 0) + if (argc == 0 && conffile == NULL) usage(); warncount = 0; + if (conffile != NULL) + warncount += parsefile(conffile); + while (argc-- > 0) - parse(*argv++); - exit(warncount); + warncount += parse(*argv++, 0); + + return (warncount); } /* @@ -166,8 +178,8 @@ main(int argc, char **argv) * Lookup and print out the MIB entry if it exists. * Set a new value if requested. */ -static void -parse(const char *string) +static int +parse(const char *string, int lineno) { int len, i, j; void *newval = 0; @@ -179,13 +191,20 @@ parse(const char *string) int64_t i64val; uint64_t u64val; int mib[CTL_MAXNAME]; - char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ]; + char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ], line[BUFSIZ]; u_int kind; + if (lineno) + snprintf(line, sizeof(line), " at line %d", lineno); + else + line[0] = '\0'; + cp = buf; - if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) - errx(1, "oid too long: '%s'", string); - bufp = strsep(&cp, "="); + if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) { + warn("oid too long: '%s'%s", string, line); + return (1); + } + bufp = strsep(&cp, "=:"); if (cp != NULL) { /* Tflag just lists tunables, do not allow assignment */ if (Tflag || Wflag) { @@ -194,6 +213,14 @@ parse(const char *string) } while (isspace(*cp)) cp++; + /* Strip a pair of " or ' if any. */ + switch (*cp) { + case '\"': + case '\'': + if (cp[strlen(cp) - 1] == *cp) + cp[strlen(cp) - 1] = '\0'; + cp++; + } newval = cp; newsize = strlen(cp); } @@ -201,15 +228,22 @@ parse(const char *string) if (len < 0) { if (iflag) - return; + return (0); if (qflag) - exit(1); - else - errx(1, "unknown oid '%s'", bufp); + return (1); + else { + warn("unknown oid '%s'%s", bufp, line); + return (1); + } } - if (oidfmt(mib, len, fmt, &kind)) - err(1, "couldn't find format of oid '%s'", bufp); + if (oidfmt(mib, len, fmt, &kind)) { + warn("couldn't find format of oid '%s'%s", bufp, line); + if (iflag) + return (1); + else + exit(1); + } if (newval == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { @@ -225,16 +259,18 @@ parse(const char *string) putchar('\n'); } } else { - if ((kind & CTLTYPE) == CTLTYPE_NODE) - errx(1, "oid '%s' isn't a leaf node", bufp); + if ((kind & CTLTYPE) == CTLTYPE_NODE) { + warn("oid '%s' isn't a leaf node%s", bufp, line); + return (1); + } if (!(kind & CTLFLAG_WR)) { if (kind & CTLFLAG_TUN) { - warnx("oid '%s' is a read only tunable", bufp); - errx(1, "Tunable values are set in /boot/loader.conf"); - } else { - errx(1, "oid '%s' is read only", bufp); - } + warnx("oid '%s' is a read only tunable%p", bufp, line); + warnx("Tunable values are set in /boot/loader.conf"); + } else + warnx("oid '%s' is read only%s", bufp, line); + return (1); } if ((kind & CTLTYPE) == CTLTYPE_INT || @@ -243,47 +279,59 @@ parse(const char *string) (kind & CTLTYPE) == CTLTYPE_ULONG || (kind & CTLTYPE) == CTLTYPE_S64 || (kind & CTLTYPE) == CTLTYPE_U64) { - if (strlen(newval) == 0) - errx(1, "empty numeric value"); + if (strlen(newval) == 0) { + warnx("empty numeric value"); + return (1); + } } switch (kind & CTLTYPE) { case CTLTYPE_INT: if (strcmp(fmt, "IK") == 0) { - if (!set_IK(newval, &intval)) - errx(1, "invalid value '%s'", - (char *)newval); + if (!set_IK(newval, &intval)) { + warnx("invalid value '%s'%s", + (char *)newval, line); + return (1); + } } else { intval = (int)strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid integer '%s'%s", + (char *)newval, line); + return (1); + } } newval = &intval; newsize = sizeof(intval); break; case CTLTYPE_UINT: uintval = (int) strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid unsigned integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid unsigned integer '%s'%s", + (char *)newval, line); + return (1); + } newval = &uintval; newsize = sizeof(uintval); break; case CTLTYPE_LONG: longval = strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid long integer '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid long integer '%s'%s", + (char *)newval, line); + return (1); + } newval = &longval; newsize = sizeof(longval); break; case CTLTYPE_ULONG: ulongval = strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid unsigned long integer" - " '%s'", (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid unsigned long integer" + " '%s'%s", (char *)newval, line); + return (1); + } newval = &ulongval; newsize = sizeof(ulongval); break; @@ -291,26 +339,31 @@ parse(const char *string) break; case CTLTYPE_S64: i64val = strtoimax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid int64_t '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid int64_t '%s'%s", + (char *)newval, line); + return (1); + } newval = &i64val; newsize = sizeof(i64val); break; case CTLTYPE_U64: u64val = strtoumax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') - errx(1, "invalid uint64_t '%s'", - (char *)newval); + if (endptr == newval || *endptr != '\0') { + warnx("invalid uint64_t '%s'%s", + (char *)newval, line); + return (1); + } newval = &u64val; newsize = sizeof(u64val); break; case CTLTYPE_OPAQUE: /* FALLTHROUGH */ default: - errx(1, "oid '%s' is type %d," - " cannot set that", bufp, - kind & CTLTYPE); + warnx("oid '%s' is type %d," + " cannot set that%s", bufp, + kind & CTLTYPE, line); + return (1); } i = show_var(mib, len); @@ -319,18 +372,20 @@ parse(const char *string) putchar('\n'); switch (errno) { case EOPNOTSUPP: - errx(1, "%s: value is not available", - string); + warnx("%s: value is not available%s", + string, line); + return (1); case ENOTDIR: - errx(1, "%s: specification is incomplete", - string); + warnx("%s: specification is incomplete%s", + string, line); + return (1); case ENOMEM: - errx(1, "%s: type is unknown to this program", - string); + warnx("%s: type is unknown to this program%s", + string, line); + return (1); default: - warn("%s", string); - warncount++; - return; + warn("%s%s", string, line); + return (1); } } if (!bflag) @@ -342,6 +397,58 @@ parse(const char *string) putchar('\n'); nflag = i; } + + return (0); +} + +static int +parsefile(const char *filename) +{ + FILE *file; + char line[BUFSIZ], *p, *pq, *pdq; + int warncount = 0, lineno = 0; + + file = fopen(filename, "r"); + if (file == NULL) + err(EX_NOINPUT, "%s", filename); + while (fgets(line, sizeof(line), file) != NULL) { + lineno++; + p = line; + pq = strchr(line, '\''); + pdq = strchr(line, '\"'); + /* Replace the first # with \0. */ + while((p = strchr(p, '#')) != NULL) { + if (pq != NULL && p > pq) { + if ((p = strchr(pq+1, '\'')) != NULL) + *(++p) = '\0'; + break; + } else if (pdq != NULL && p > pdq) { + if ((p = strchr(pdq+1, '\"')) != NULL) + *(++p) = '\0'; + break; + } else if (p == line || *(p-1) != '\\') { + *p = '\0'; + break; + } + p++; + } + /* Trim spaces */ + p = line + strlen(line) - 1; + while (p >= line && isspace((int)*p)) { + *p = '\0'; + p--; + } + p = line; + while (isspace((int)*p)) + p++; + if (*p == '\0') + continue; + else + warncount += parse(p, lineno); + } + fclose(file); + + return (warncount); } /* These functions will dump out various interesting structures. */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 04:18:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE15C8CD; Fri, 14 Dec 2012 04:18:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 490068FC08; Fri, 14 Dec 2012 04:18:09 +0000 (UTC) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4I8m0012042; Fri, 14 Dec 2012 15:18:09 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4HsTW027059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 15:17:57 +1100 Date: Fri, 14 Dec 2012 15:17:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps In-Reply-To: <20121213213147.GA1401@garage.freebsd.pl> Message-ID: <20121214151047.X973@besplex.bde.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> <20121213213147.GA1401@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BrrFWvr5 c=1 sm=1 a=WqmuCUZ0mQMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=URALeSCvvZIA:10 a=6I5d2MoRAAAA:8 a=uS_ZUP-777TR7mEKaZ4A:9 a=CjuIK1q_8ugA:10 a=2ekcOSppvVBNGPxY:21 a=QDnF1dTDgF_j9QlS:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 04:18:10 -0000 On Thu, 13 Dec 2012, Pawel Jakub Dawidek wrote: > On Thu, Dec 13, 2012 at 08:16:21PM +0200, Konstantin Belousov wrote: >> On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >>> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >>>> On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >>>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>>> >>>>> This would also help bsnmpd. >>>>> >>>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>>> Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >>>> it would be better to move it outside kernel-only section. sys/proc.h >>>> is not in POSIX anyway. I don't really know, but POSIX says that {PID_MAX} is intentionally left out of POSIX because pids_t might be cookies in a very large address space so that there is no useful use of {PID_MAX}. (POSIX doesn't say exactly this. It says "arrays of values of this type [uid_t, gid_t or pid_t] are unlikely to be fully portable".) >>> I assumed it will break some ports that may define it themselves. >>> I wonder if we could do a test ports build to see what's the impact. >> >> Sure. >> >> On the other hand, sys/proc.h is mostly useless for the application code >> as it is now. Might be, use >> #ifndef PID_MAX >> braces ? Ugh. If there is any useful use of {PID_MAX}, then this just breaks detection of using the wrong value. > This can be done of course, but it won't help cases where PID_MAX is > defined after sys/proc.h is included. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 04:31:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F41BB40 for ; Fri, 14 Dec 2012 04:31:03 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0C7BF8FC14 for ; Fri, 14 Dec 2012 04:31:02 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so2407594lah.13 for ; Thu, 13 Dec 2012 20:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=640rnusHD/pw2rtGMTBfIN+9YVYgLQgT8luyfD89wek=; b=qytBxeiCONRJqAd/hl06FnH3vifTv3vHarYdx3RR/Iv05IlYNor77eyXXUi+TAukQq Znv1BB6omL+IlZx0Hw+VS1DUjo7Xkl8o/7WGBHpUCJFdl02jdEPkd/ipEeYqO6oRUNxj wtoBTEDFK4/gqASNT67CejY7MpjvT1Fj4WuCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=640rnusHD/pw2rtGMTBfIN+9YVYgLQgT8luyfD89wek=; b=jijmv1yQ3aS+GAeszoCLoaQRTbSJBYcren02Br7mKuiiHTilV45P/th6v3k2GJLVb2 Uf6vh2HO05eYXdOxYc5s2G3zIIkI/f9cEU+QTBvj19uAx6/C0ZnxRqTk8mnniOaHpcuc A2OyHyFIWNak2SvHPPGaU84ZiulXH/zCmrARlHebGmP+1ZWBSWxCQaOCqOUdP2I1tAw5 BoeCZ2fx4BHEVKAqnypOaAfdyObkui8R4/SGEqm4z0XdvaTzdyjeCRTD/XnOnSu7VeGn FCIbVt5cNxI9a20nb8G4Ycrv59MFtqEpdWjP6p9MQ+KpgiBnXIqvWxvAwkbKyEZDTB3x O4gA== Received: by 10.112.13.133 with SMTP id h5mr1717366lbc.99.1355459461590; Thu, 13 Dec 2012 20:31:01 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Thu, 13 Dec 2012 20:30:31 -0800 (PST) In-Reply-To: <20121213181621.GG71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> From: Eitan Adler Date: Thu, 13 Dec 2012 23:30:31 -0500 X-Google-Sender-Auth: 95dwn3CxHqyZmJklhWGjDCUkogM Message-ID: Subject: Re: svn commit: r244154 - head/bin/ps To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnoHGaf8vekbk0v3RyQE/0rZ2RZTiuQUZpBaYGD0+1aRl0c07bi0HDaemIfgeY4ARI5kOA6 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , jhb@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 04:31:03 -0000 On 13 December 2012 13:16, Konstantin Belousov wrote: > On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >> > On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >> > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >> > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >> > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >> > > userland as well and setting PID_MAX to BSD_PID_MAX? >> > > >> > > This would also help bsnmpd. >> > > >> > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch >> > Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >> > it would be better to move it outside kernel-only section. sys/proc.h >> > is not in POSIX anyway. >> >> I assumed it will break some ports that may define it themselves. >> I wonder if we could do a test ports build to see what's the impact. > > Sure. > > On the other hand, sys/proc.h is mostly useless for the application code > as it is now. Might be, use > #ifndef PID_MAX > braces ? I think it makes more sense to unconditionally define it. A file including sys/proc.h almost certainly wants the real PID_MAX. It would be better to cause a pre-process time failure than to have it silently hide the problem. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 04:44:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17943D35; Fri, 14 Dec 2012 04:44:17 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B51308FC08; Fri, 14 Dec 2012 04:44:16 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 537D21A3C1B; Thu, 13 Dec 2012 20:44:15 -0800 (PST) Message-ID: <50CAAE9F.7030708@mu.org> Date: Thu, 13 Dec 2012 20:44:15 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r244154 - head/bin/ps References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <20121213161242.GE71906@kib.kiev.ua> <20121213165541.GD1381@garage.freebsd.pl> <20121213181621.GG71906@kib.kiev.ua> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , jhb@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 04:44:17 -0000 On 12/13/12 8:30 PM, Eitan Adler wrote: > On 13 December 2012 13:16, Konstantin Belousov wrote: >> On Thu, Dec 13, 2012 at 05:55:41PM +0100, Pawel Jakub Dawidek wrote: >>> On Thu, Dec 13, 2012 at 06:12:42PM +0200, Konstantin Belousov wrote: >>>> On Thu, Dec 13, 2012 at 12:12:44PM +0100, Pawel Jakub Dawidek wrote: >>>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>>> >>>>> This would also help bsnmpd. >>>>> >>>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>>> Do you know why PID_MAX is under _KERNEL ? If there is no real reason, >>>> it would be better to move it outside kernel-only section. sys/proc.h >>>> is not in POSIX anyway. >>> I assumed it will break some ports that may define it themselves. >>> I wonder if we could do a test ports build to see what's the impact. >> Sure. >> >> On the other hand, sys/proc.h is mostly useless for the application code >> as it is now. Might be, use >> #ifndef PID_MAX >> braces ? > I think it makes more sense to unconditionally define it. A file > including sys/proc.h almost certainly wants the real PID_MAX. It > would be better to cause a pre-process time failure than to have it > silently hide the problem. > > > I'm thinking it's much better to make it a sysctl readonly (kern.pidmax), not a compile time thing. think about page_size and other things that can change. by making it dynamic you force better programming style at the slight expense of a few cycles of compile time optimization. -Alfred From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 04:49:47 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23C56C9; Fri, 14 Dec 2012 04:49:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id A69AA8FC08; Fri, 14 Dec 2012 04:49:46 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4njAY015689; Fri, 14 Dec 2012 15:49:45 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBE4nZEB020208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 15:49:37 +1100 Date: Fri, 14 Dec 2012 15:49:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jim Harris Subject: Re: svn commit: r244193 - head/sys/x86/include In-Reply-To: <201212132140.qBDLeBhd019751@svn.freebsd.org> Message-ID: <20121214154930.D973@besplex.bde.org> References: <201212132140.qBDLeBhd019751@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=CJhyxmXD c=1 sm=1 a=L6I1Zbe1xPYA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=RQfEP2Kgk-UA:10 a=DA7H5E3C-HH1s4Do58cA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 04:49:47 -0000 On Thu, 13 Dec 2012, Jim Harris wrote: > Log: > Add bus_space_read_8 and bus_space_write_8 for amd64. > > Rather than trying to KASSERT for callers that invoke this on > IO tags, either do nothing (for write_8) or return ~0 (for read_8). read_8 returns a uint64_t, so it cannot return the signed integer ~0. It actually returns this signed integer converted to uint64_t. On amd64, this is the 32 bit value 0xffffffff. The 64-bit value 0xffffffffffffffff should be returned. > Using KASSERT here just makes bus.h too messy from both > polluting bus.h with systm.h (for any number of drivers that include > bus.h without first including systm.h) or ports that use bus.h > directly (i.e. libpciaccess) as reported by zeising@. > > Also don't try to implement all of the other bus_space functions for > 8 byte access since realistically only these two are needed for some > devices that expose 64-bit memory-mapped registers. Good. > Put the amd64-specific functions here rather than sys/amd64/include/bus.h > so that we can keep this header unified for x86, as requested by mdf@ > and tijl@. Not so good. I don't really like any of the unified headers. > Modified: head/sys/x86/include/bus.h > ============================================================================== > --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) > +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) > @@ -130,6 +130,7 @@ > #define BUS_SPACE_MAXADDR 0xFFFFFFFF > #endif This file spells the F in hex constants in upper case. In the above definition and in previous ones, it is careful to spell out the constants and not depend on sign extension. So it is also a style bug to use ~0. Style bug visible in the above: space instead of tab after #define. This style bugs is in all #define's near here, including the new one. Type error in #define's just before the above: the above BUS_SPACE_MAXADDR is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course 64 bits, but the ifdef tangle for it is not tangled enough to be correct: BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is only unsigned long long on i386-PAE. > > +#define BUS_SPACE_INVALID_DATA (~0) > #define BUS_SPACE_UNRESTRICTED (~0) > > /* > @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read > bus_space_handle_t handle, > bus_size_t offset); > > +#ifdef __amd64__ > +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, > + bus_space_handle_t handle, > + bus_size_t offset); > +#endif > + This is style-bug for bug compatible with the existing forward declarations. Forward declarations of inline functions are nonsense. They are from NetBSD, for K&R support. But FreeBSD never supported K&R in bus-space headers, and the forward declarations never even compiled with K&R, since they never used __P(()). Almost 1/3 of the x86 bus.h consists of these negatively useful forward declarations. Some of them are almost as large as the full functions, since they are misformatted worse, with parameters starting at about column 40 instead of about column 20, so so that many lines are needed just for the parameters (to line them up in perfectly non-KNF gnu style). > ... > @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu > return (*(volatile u_int32_t *)(handle + offset)); > } > > -#if 0 /* Cause a link error for bus_space_read_8 */ > -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! > +#ifdef __amd64__ > +static __inline uint64_t > +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, > + bus_size_t offset) > +{ > + > + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ The comment is not indented, and should probably not be placed to the right of the code. This file mostly doesn't place comments there, and when it does it doesn't capitalize them. One that does also spells IO as i/o. > + return (BUS_SPACE_INVALID_DATA); > + return (*(volatile uint64_t *)(handle + offset)); > +} > #endif Bruce From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 05:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E39D59A; Fri, 14 Dec 2012 05:27:58 +0000 (UTC) (envelope-from bryanv@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 E5DAB8FC08; Fri, 14 Dec 2012 05:27:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE5RvW0097155; Fri, 14 Dec 2012 05:27:57 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE5Rvue097151; Fri, 14 Dec 2012 05:27:57 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201212140527.qBE5Rvue097151@svn.freebsd.org> From: Bryan Venteicher Date: Fri, 14 Dec 2012 05:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244200 - in head/sys/dev/virtio: block network scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 05:27:58 -0000 Author: bryanv Date: Fri Dec 14 05:27:56 2012 New Revision: 244200 URL: http://svnweb.freebsd.org/changeset/base/244200 Log: virtio: Start taskqueues threads after attach cannot fail If virtio_setup_intr() failed during boot, we would hang in taskqueue_free() -> taskqueue_terminate() for all the taskq threads to terminate. This will never happen since the scheduler is not running by this point. Reported by: neel, grehan Approved by: grehan (mentor) Modified: head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 05:27:56 2012 (r244200) @@ -338,8 +338,6 @@ vtblk_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { @@ -347,6 +345,9 @@ vtblk_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 05:27:56 2012 (r244200) @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) ether_ifdetach(ifp); goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; ether_ifdetach(ifp); goto fail; } + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); + /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 00:13:29 2012 (r244199) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 05:27:56 2012 (r244200) @@ -347,12 +347,6 @@ vtscsi_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - error = taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); - if (error) { - device_printf(dev, "cannot start taskqueue threads\n"); - goto fail; - } error = virtio_setup_intr(dev, INTR_TYPE_CAM); if (error) { @@ -360,6 +354,9 @@ vtscsi_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtscsi_enable_vqs_intr(sc); /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 05:33:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B7577DC; Fri, 14 Dec 2012 05:33:51 +0000 (UTC) (envelope-from mr.kodiak@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A48978FC0A; Fri, 14 Dec 2012 05:33:50 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so1309004wey.13 for ; Thu, 13 Dec 2012 21:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=GknoNeoDucPP1gQVz/bbZdbDEvmcVrjB6uEf7xkr6Mw=; b=c6psycvTUFi9cSopUZCKI/oVfiRW58zI9Uh7Ltb9Ru2gl1gxGgLyq3Mu7H2NadvYip 8CpHtDsp9TaoJPzt9jZf3LL5N7uozyo7+YAeG3a0WHDp5q1C4MnsBEYm2wQX7KqprxN3 SGoJ3eN03jS6g6jQbqSG83Ymjnjw7REqQ3Y4xc9OZcAWqRD7G8lmTfny7R/92csd7TQG qgLY7D2Hu0l6npk8/gbceS0Q6L30N6h3zyBUy+AYOUYrZxoPm7UYyKouzUMU/r07I0JG h68ePzbRgtuIufnjLGXgYuW7WxjaeMphl65dWwZiTS+Cr09oof36ZSojBBO1isDaxs8e CctA== Received: by 10.194.88.98 with SMTP id bf2mr1488675wjb.49.1355463229183; Thu, 13 Dec 2012 21:33:49 -0800 (PST) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.216.108.130 with HTTP; Thu, 13 Dec 2012 21:33:19 -0800 (PST) In-Reply-To: <201212140527.qBE5Rvue097151@svn.freebsd.org> References: <201212140527.qBE5Rvue097151@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 13 Dec 2012 23:33:19 -0600 X-Google-Sender-Auth: L5gQUPylGIlWVr2Z_w7nnzUHC-Q Message-ID: Subject: Re: svn commit: r244200 - in head/sys/dev/virtio: block network scsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 05:33:51 -0000 On Thu, Dec 13, 2012 at 11:27 PM, Bryan Venteicher wrote: > > Author: bryanv > Date: Fri Dec 14 05:27:56 2012 > New Revision: 244200 > URL: http://svnweb.freebsd.org/changeset/base/244200 > > Log: > virtio: Start taskqueues threads after attach cannot fail > > If virtio_setup_intr() failed during boot, we would hang in > taskqueue_free() -> taskqueue_terminate() for all the taskq > threads to terminate. This will never happen since the > scheduler is not running by this point. > FWIW, this seems to be a pretty common bug across dozen of drivers. bus_setup_intr() is not very likely to fail though. For VirtIO, it is somewhat a moot point because the taskqueues are about to be removed and replaced with ithreads as I should have done in the beginning. > Reported by: neel, grehan > Approved by: grehan (mentor) > > Modified: > head/sys/dev/virtio/block/virtio_blk.c > head/sys/dev/virtio/network/if_vtnet.c > head/sys/dev/virtio/scsi/virtio_scsi.c > > Modified: head/sys/dev/virtio/block/virtio_blk.c > > ============================================================================== > --- head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/block/virtio_blk.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -338,8 +338,6 @@ vtblk_attach(device_t dev) > device_printf(dev, "cannot allocate taskqueue\n"); > goto fail; > } > - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", > - device_get_nameunit(dev)); > > error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); > if (error) { > @@ -347,6 +345,9 @@ vtblk_attach(device_t dev) > goto fail; > } > > + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", > + device_get_nameunit(dev)); > + > vtblk_create_disk(sc); > > virtqueue_enable_intr(sc->vtblk_vq); > > Modified: head/sys/dev/virtio/network/if_vtnet.c > > ============================================================================== > --- head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/network/if_vtnet.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) > ether_ifdetach(ifp); > goto fail; > } > - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", > - device_get_nameunit(dev)); > > error = virtio_setup_intr(dev, INTR_TYPE_NET); > if (error) { > device_printf(dev, "cannot setup virtqueue interrupts\n"); > - taskqueue_free(sc->vtnet_tq); > - sc->vtnet_tq = NULL; > ether_ifdetach(ifp); > goto fail; > } > > + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", > + device_get_nameunit(dev)); > + > /* > * Device defaults to promiscuous mode for backwards > * compatibility. Turn it off if possible. > > Modified: head/sys/dev/virtio/scsi/virtio_scsi.c > > ============================================================================== > --- head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 00:13:29 2012 > (r244199) > +++ head/sys/dev/virtio/scsi/virtio_scsi.c Fri Dec 14 05:27:56 2012 > (r244200) > @@ -347,12 +347,6 @@ vtscsi_attach(device_t dev) > device_printf(dev, "cannot allocate taskqueue\n"); > goto fail; > } > - error = taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s > taskq", > - device_get_nameunit(dev)); > - if (error) { > - device_printf(dev, "cannot start taskqueue threads\n"); > - goto fail; > - } > > error = virtio_setup_intr(dev, INTR_TYPE_CAM); > if (error) { > @@ -360,6 +354,9 @@ vtscsi_attach(device_t dev) > goto fail; > } > > + taskqueue_start_threads(&sc->vtscsi_tq, 1, PI_DISK, "%s taskq", > + device_get_nameunit(dev)); > + > vtscsi_enable_vqs_intr(sc); > > /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 08:02:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1ACC82F7; Fri, 14 Dec 2012 08:02:36 +0000 (UTC) (envelope-from glebius@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 F14198FC14; Fri, 14 Dec 2012 08:02:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE82Z8v018914; Fri, 14 Dec 2012 08:02:35 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE82ZdY018913; Fri, 14 Dec 2012 08:02:35 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212140802.qBE82ZdY018913@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Dec 2012 08:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244202 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:02:36 -0000 Author: glebius Date: Fri Dec 14 08:02:35 2012 New Revision: 244202 URL: http://svnweb.freebsd.org/changeset/base/244202 Log: Fix VIMAGE build broken in r244185. Submitted by: Nikolai Lifanov Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 14 07:48:03 2012 (r244201) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 14 08:02:35 2012 (r244202) @@ -615,7 +615,7 @@ pfsync_input(struct mbuf *m, __unused in len = ntohs(ph->len) + offset; if (m->m_pkthdr.len < len) { - pfsyncstats.pfsyncs_badlen++; + V_pfsyncstats.pfsyncs_badlen++; goto done; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 08:52:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B8C9FD; Fri, 14 Dec 2012 08:52:09 +0000 (UTC) (envelope-from bapt@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 F28148FC0A; Fri, 14 Dec 2012 08:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE8q8xn026818; Fri, 14 Dec 2012 08:52:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE8q837026817; Fri, 14 Dec 2012 08:52:08 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140852.qBE8q837026817@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 08:52:08 +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: r244204 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:52:09 -0000 Author: bapt Date: Fri Dec 14 08:52:08 2012 New Revision: 244204 URL: http://svnweb.freebsd.org/changeset/base/244204 Log: MFC r243021: return ERANGE if the buffer is too small to contain the login as documented in the manpage Reviewed by: cognet, kib Modified: stable/9/sys/kern/kern_prot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_prot.c ============================================================================== --- stable/9/sys/kern/kern_prot.c Fri Dec 14 08:07:37 2012 (r244203) +++ stable/9/sys/kern/kern_prot.c Fri Dec 14 08:52:08 2012 (r244204) @@ -2084,6 +2084,8 @@ sys_getlogin(struct thread *td, struct g bcopy(p->p_session->s_login, login, uap->namelen); SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); + if (strlen(login) + 1 > uap->namelen) + return (ERANGE); error = copyout(login, uap->namebuf, uap->namelen); return (error); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 08:53:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2D88304; Fri, 14 Dec 2012 08:53:25 +0000 (UTC) (envelope-from bapt@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 983878FC12; Fri, 14 Dec 2012 08:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE8rPAE027017; Fri, 14 Dec 2012 08:53:25 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE8rPHm027016; Fri, 14 Dec 2012 08:53:25 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140853.qBE8rPHm027016@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 08:53: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: r244205 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:53:25 -0000 Author: bapt Date: Fri Dec 14 08:53:25 2012 New Revision: 244205 URL: http://svnweb.freebsd.org/changeset/base/244205 Log: MRC r243021: return ERANGE if the buffer is too small to contain the login as documented in the manpage Reviewed by: cognet, kib Modified: stable/8/sys/kern/kern_prot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_prot.c ============================================================================== --- stable/8/sys/kern/kern_prot.c Fri Dec 14 08:52:08 2012 (r244204) +++ stable/8/sys/kern/kern_prot.c Fri Dec 14 08:53:25 2012 (r244205) @@ -2065,6 +2065,8 @@ getlogin(struct thread *td, struct getlo bcopy(p->p_session->s_login, login, uap->namelen); SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); + if (strlen(login) + 1 > uap->namelen) + return (ERANGE); error = copyout(login, uap->namebuf, uap->namelen); return (error); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 08:54:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83D6D471; Fri, 14 Dec 2012 08:54:53 +0000 (UTC) (envelope-from bapt@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 683868FC0A; Fri, 14 Dec 2012 08:54:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE8srDv027384; Fri, 14 Dec 2012 08:54:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE8srbu027383; Fri, 14 Dec 2012 08:54:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140854.qBE8srbu027383@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 08:54:53 +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: r244206 - stable/7/sys/kern X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:54:53 -0000 Author: bapt Date: Fri Dec 14 08:54:52 2012 New Revision: 244206 URL: http://svnweb.freebsd.org/changeset/base/244206 Log: MFC r243021: return ERANGE if the buffer is too small to contain the login as documented in the manpage Reviewed by: cognet, kib Modified: stable/7/sys/kern/kern_prot.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/kern/kern_prot.c ============================================================================== --- stable/7/sys/kern/kern_prot.c Fri Dec 14 08:53:25 2012 (r244205) +++ stable/7/sys/kern/kern_prot.c Fri Dec 14 08:54:52 2012 (r244206) @@ -1937,6 +1937,8 @@ getlogin(struct thread *td, struct getlo bcopy(p->p_session->s_login, login, uap->namelen); SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); + if (strlen(login) + 1 > uap->namelen) + return (ERANGE); error = copyout(login, uap->namebuf, uap->namelen); return (error); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 09:00:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6780C735; Fri, 14 Dec 2012 09:00:19 +0000 (UTC) (envelope-from bapt@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 4C3378FC0A; Fri, 14 Dec 2012 09:00:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE90Jap028534; Fri, 14 Dec 2012 09:00:19 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE90JQj028533; Fri, 14 Dec 2012 09:00:19 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140900.qBE90JQj028533@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 09:00:19 +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: r244207 - stable/9/sys/dev/agp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 09:00:19 -0000 Author: bapt Date: Fri Dec 14 09:00:18 2012 New Revision: 244207 URL: http://svnweb.freebsd.org/changeset/base/244207 Log: Add pci id for the xeon hd4000 (IvyBridge server GT2) Submitted by: François Tigeot Obtained from: dragonfly Modified: stable/9/sys/dev/agp/agp_i810.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/agp/agp_i810.c ============================================================================== --- stable/9/sys/dev/agp/agp_i810.c Fri Dec 14 08:54:52 2012 (r244206) +++ stable/9/sys/dev/agp/agp_i810.c Fri Dec 14 09:00:18 2012 (r244207) @@ -731,6 +731,11 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x016a8086, + .name = "IvyBridge server GT2 IG", + .driver = &agp_i810_sb_driver + }, + { .devid = 0, } }; From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 11:38:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AE23BD8; Fri, 14 Dec 2012 11:38:16 +0000 (UTC) (envelope-from jh@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 0D23F8FC0A; Fri, 14 Dec 2012 11:38:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEBcFem051539; Fri, 14 Dec 2012 11:38:15 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEBcFTJ051537; Fri, 14 Dec 2012 11:38:15 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201212141138.qBEBcFTJ051537@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 14 Dec 2012 11:38: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: r244208 - stable/9/lib/libgeom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 11:38:16 -0000 Author: jh Date: Fri Dec 14 11:38:15 2012 New Revision: 244208 URL: http://svnweb.freebsd.org/changeset/base/244208 Log: MFC r242130: Improve libgeom XML parsing error handling. - Abort parsing and return an error if we run out of memory. - Return EILSEQ from geom_xml2tree() for XML syntax errors. Modified: stable/9/lib/libgeom/geom_xml2tree.c Directory Properties: stable/9/lib/libgeom/ (props changed) Modified: stable/9/lib/libgeom/geom_xml2tree.c ============================================================================== --- stable/9/lib/libgeom/geom_xml2tree.c Fri Dec 14 09:00:18 2012 (r244207) +++ stable/9/lib/libgeom/geom_xml2tree.c Fri Dec 14 11:38:15 2012 (r244208) @@ -56,6 +56,8 @@ struct mystate { struct sbuf *sbuf[20]; struct gconf *config; int nident; + XML_Parser parser; + int error; }; static void @@ -85,6 +87,8 @@ StartElement(void *userData, const char if (!strcmp(name, "class") && mt->class == NULL) { mt->class = calloc(1, sizeof *mt->class); if (mt->class == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -98,6 +102,8 @@ StartElement(void *userData, const char if (!strcmp(name, "geom") && mt->geom == NULL) { mt->geom = calloc(1, sizeof *mt->geom); if (mt->geom == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -116,6 +122,8 @@ StartElement(void *userData, const char if (!strcmp(name, "consumer") && mt->consumer == NULL) { mt->consumer = calloc(1, sizeof *mt->consumer); if (mt->consumer == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -137,6 +145,8 @@ StartElement(void *userData, const char if (!strcmp(name, "provider") && mt->provider == NULL) { mt->provider = calloc(1, sizeof *mt->provider); if (mt->provider == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -180,16 +190,19 @@ EndElement(void *userData, const char *n char *p; mt = userData; - sbuf_finish(mt->sbuf[mt->level]); - p = strdup(sbuf_data(mt->sbuf[mt->level])); + p = NULL; + if (sbuf_finish(mt->sbuf[mt->level]) == 0) + p = strdup(sbuf_data(mt->sbuf[mt->level])); + sbuf_delete(mt->sbuf[mt->level]); + mt->sbuf[mt->level] = NULL; + mt->level--; if (p == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; } - sbuf_delete(mt->sbuf[mt->level]); - mt->sbuf[mt->level] = NULL; - mt->level--; if (strlen(p) == 0) { free(p); p = NULL; @@ -249,12 +262,16 @@ EndElement(void *userData, const char *n if (mt->config != NULL) { gc = calloc(1, sizeof *gc); if (gc == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; } gc->lg_name = strdup(name); if (gc->lg_name == NULL) { + mt->error = errno; + XML_StopParser(mt->parser, 0); warn("Cannot allocate memory during processing of '%s' " "element", name); return; @@ -334,7 +351,7 @@ geom_xml2tree(struct gmesh *gmp, char *p struct ggeom *ge; struct gprovider *pr; struct gconsumer *co; - int i; + int error, i; memset(gmp, 0, sizeof *gmp); LIST_INIT(&gmp->lg_class); @@ -347,14 +364,22 @@ geom_xml2tree(struct gmesh *gmp, char *p return (ENOMEM); } mt->mesh = gmp; + mt->parser = parser; + error = 0; XML_SetUserData(parser, mt); XML_SetElementHandler(parser, StartElement, EndElement); XML_SetCharacterDataHandler(parser, CharData); i = XML_Parse(parser, p, strlen(p), 1); + if (mt->error != 0) + error = mt->error; + else if (i != 1) { + error = XML_GetErrorCode(parser) == XML_ERROR_NO_MEMORY ? + ENOMEM : EILSEQ; + } XML_ParserFree(parser); - if (i != 1) { + if (error != 0) { free(mt); - return (-1); + return (error); } gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1); free(mt); From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 12:37:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01C6F914; Fri, 14 Dec 2012 12:37:36 +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 DBD2C8FC0C; Fri, 14 Dec 2012 12:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBECbZ21060198; Fri, 14 Dec 2012 12:37:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBECbZbM060197; Fri, 14 Dec 2012 12:37:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201212141237.qBECbZbM060197@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 14 Dec 2012 12:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244209 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 12:37:36 -0000 Author: ae Date: Fri Dec 14 12:37:35 2012 New Revision: 244209 URL: http://svnweb.freebsd.org/changeset/base/244209 Log: Add an #include guard to the sys/fnv_hash.h. MFC after: 3 days Modified: head/sys/sys/fnv_hash.h Modified: head/sys/sys/fnv_hash.h ============================================================================== --- head/sys/sys/fnv_hash.h Fri Dec 14 11:38:15 2012 (r244208) +++ head/sys/sys/fnv_hash.h Fri Dec 14 12:37:35 2012 (r244209) @@ -7,6 +7,8 @@ * * $FreeBSD$ */ +#ifndef _SYS_FNV_HASH_H_ +#define _SYS_FNV_HASH_H_ typedef u_int32_t Fnv32_t; typedef u_int64_t Fnv64_t; @@ -66,3 +68,4 @@ fnv_64_str(const char *str, Fnv64_t hval } return hval; } +#endif /* _SYS_FNV_HASH_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 13:01:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 629B213D; Fri, 14 Dec 2012 13:01:17 +0000 (UTC) (envelope-from glebius@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 46C368FC1C; Fri, 14 Dec 2012 13:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBED1HnL063872; Fri, 14 Dec 2012 13:01:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBED1H0I063871; Fri, 14 Dec 2012 13:01:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212141301.qBED1H0I063871@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Dec 2012 13:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244210 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 13:01:17 -0000 Author: glebius Date: Fri Dec 14 13:01:16 2012 New Revision: 244210 URL: http://svnweb.freebsd.org/changeset/base/244210 Log: Fix error in r235991. No-sleep version of IFNET_RLOCK() should be used here, since we may hold the main pf rulesets rwlock. Reported by: Fleuriot Damien Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Fri Dec 14 12:37:35 2012 (r244209) +++ head/sys/netpfil/pf/pf_if.c Fri Dec 14 13:01:16 2012 (r244210) @@ -478,10 +478,10 @@ pfi_table_update(struct pfr_ktable *kt, if (kif->pfik_ifp != NULL) pfi_instance_add(kif->pfik_ifp, net, flags); else if (kif->pfik_group != NULL) { - IFNET_RLOCK(); + IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, ifgm_next) pfi_instance_add(ifgm->ifgm_ifp, net, flags); - IFNET_RUNLOCK(); + IFNET_RUNLOCK_NOSLEEP(); } if ((e = pfr_set_addrs(&kt->pfrkt_t, V_pfi_buffer, V_pfi_buffer_cnt, &size2, From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 15:01:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE5C7714; Fri, 14 Dec 2012 15:01:23 +0000 (UTC) (envelope-from pjd@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 B947B8FC0A; Fri, 14 Dec 2012 15:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF1NiO082472; Fri, 14 Dec 2012 15:01:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF1Nj5082470; Fri, 14 Dec 2012 15:01:23 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141501.qBEF1Nj5082470@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244215 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 15:01:24 -0000 Author: pjd Date: Fri Dec 14 15:01:23 2012 New Revision: 244215 URL: http://svnweb.freebsd.org/changeset/base/244215 Log: Whitespace cleanups. Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 14:59:35 2012 (r244214) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:01:23 2012 (r244215) @@ -194,7 +194,7 @@ check_space(const char *savedir, off_t d syslog(LOG_ERR, "%s: %m", savedir); exit(1); } - spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; + spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024; (void)snprintf(path, sizeof(path), "%s/minfree", savedir); @@ -209,7 +209,7 @@ check_space(const char *savedir, off_t d } needed = dumpsize / 1024 + 2; /* 2 for info file */ - if (((minfree > 0) ? spacefree : totfree) - needed < minfree) { + if (((minfree > 0) ? spacefree : totfree) - needed < minfree) { syslog(LOG_WARNING, "no dump, not enough free space on device (%lld available, need %lld)", (long long)(minfree > 0 ? spacefree : totfree), @@ -262,7 +262,7 @@ DoRegularFile(int fd, off_t dumpsize, ch if (he >= hs + BLOCKSIZE) break; } - + /* back down to a block boundary */ he &= BLOCKMASK; @@ -433,7 +433,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; @@ -444,7 +444,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; @@ -472,7 +472,7 @@ DoFile(const char *savedir, const char * syslog(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); - + status = STATUS_BAD; if (force == 0) goto closefd; From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 15:03:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 344E4895; Fri, 14 Dec 2012 15:03:13 +0000 (UTC) (envelope-from pjd@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 18AAE8FC08; Fri, 14 Dec 2012 15:03:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF3C8B082820; Fri, 14 Dec 2012 15:03:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF3C1k082819; Fri, 14 Dec 2012 15:03:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141503.qBEF3C1k082819@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244216 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 15:03:13 -0000 Author: pjd Date: Fri Dec 14 15:03:12 2012 New Revision: 244216 URL: http://svnweb.freebsd.org/changeset/base/244216 Log: If we are not going to clear the dump (we are either just checking if the dump exists or we want to keep it), open device read-only. Obtained from: WHEEL Systems Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:01:23 2012 (r244215) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:03:12 2012 (r244216) @@ -394,7 +394,7 @@ DoFile(const char *savedir, const char * if (verbose) printf("checking for kernel dump on device %s\n", device); - fd = open(device, O_RDWR); + fd = open(device, (checkfor || keep) ? O_RDONLY : O_RDWR); if (fd < 0) { syslog(LOG_ERR, "%s: %m", device); return; @@ -612,7 +612,7 @@ DoFile(const char *savedir, const char * printf("dump saved\n"); nuke: - if (clear || !keep) { + if (!keep) { if (verbose) printf("clearing dump header\n"); memcpy(kdhl.magic, KERNELDUMPMAGIC_CLEARED, sizeof kdhl.magic); From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 15:04:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EA89A15; Fri, 14 Dec 2012 15:04:40 +0000 (UTC) (envelope-from pjd@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 22B688FC08; Fri, 14 Dec 2012 15:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEF4eL5083104; Fri, 14 Dec 2012 15:04:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEF4dop083103; Fri, 14 Dec 2012 15:04:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141504.qBEF4dop083103@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244217 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 15:04:40 -0000 Author: pjd Date: Fri Dec 14 15:04:39 2012 New Revision: 244217 URL: http://svnweb.freebsd.org/changeset/base/244217 Log: The clear option (-c) is not compatible with keep (-k) and compress (-z) options. Obtained from: WHEEL Systems Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:03:12 2012 (r244216) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:04:39 2012 (r244217) @@ -681,6 +681,8 @@ main(int argc, char **argv) } if (checkfor && (clear || force || keep)) usage(); + if (clear && (compress || keep)) + usage(); argc -= optind; argv += optind; if (argc >= 1) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 15:12:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC6FC14A; Fri, 14 Dec 2012 15:12:09 +0000 (UTC) (envelope-from pjd@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 970398FC12; Fri, 14 Dec 2012 15:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEFC94H084519; Fri, 14 Dec 2012 15:12:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEFC9Ck084515; Fri, 14 Dec 2012 15:12:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212141512.qBEFC9Ck084515@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 14 Dec 2012 15:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244218 - in head: etc/rc.d sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 15:12:09 -0000 Author: pjd Date: Fri Dec 14 15:12:08 2012 New Revision: 244218 URL: http://svnweb.freebsd.org/changeset/base/244218 Log: - When checking if a dump exists on the given device there is no need to provide dump directory. Eliminate this redundant argument. This changes the usage, but the only risk here is that a warning will be printed about directory given as device. - Update usage of -C option. - When clearing dump header from the given device there is also no need to provide dump directory, although additional arguments for -c were not documented. - Document that -v can be used with -c and that list of devices can be given. Obtained from: WHEEL Systems Modified: head/etc/rc.d/savecore head/sbin/savecore/savecore.8 head/sbin/savecore/savecore.c Modified: head/etc/rc.d/savecore ============================================================================== --- head/etc/rc.d/savecore Fri Dec 14 15:04:39 2012 (r244217) +++ head/etc/rc.d/savecore Fri Dec 14 15:12:08 2012 (r244218) @@ -62,7 +62,7 @@ savecore_start() ;; esac - if savecore -C "${dumpdir}" "${dev}" >/dev/null; then + if savecore -C "${dev}" >/dev/null; then savecore ${savecore_flags} ${dumpdir} ${dumpdev} if checkyesno crashinfo_enable; then ${crashinfo_program} -d ${dumpdir} Modified: head/sbin/savecore/savecore.8 ============================================================================== --- head/sbin/savecore/savecore.8 Fri Dec 14 15:04:39 2012 (r244217) +++ head/sbin/savecore/savecore.8 Fri Dec 14 15:12:08 2012 (r244218) @@ -28,7 +28,7 @@ .\" From: @(#)savecore.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 24, 2008 +.Dd December 14, 2012 .Dt SAVECORE 8 .Os .Sh NAME @@ -37,10 +37,12 @@ .Sh SYNOPSIS .Nm .Fl c +.Op Fl v +.Op Ar device ... .Nm .Fl C .Op Fl v -.Op Ar directory device +.Op Ar device ... .Nm .Op Fl fkvz .Op Ar directory Op Ar device ... Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Dec 14 15:04:39 2012 (r244217) +++ head/sbin/savecore/savecore.c Fri Dec 14 15:12:08 2012 (r244218) @@ -636,8 +636,8 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n", - "usage: savecore -c", - " savecore -C [-v] [directory device]", + "usage: savecore -c [-v] [device ...]", + " savecore -C [-v] [device ...]", " savecore [-fkvz] [directory [device ...]]"); exit (1); } @@ -685,7 +685,7 @@ main(int argc, char **argv) usage(); argc -= optind; argv += optind; - if (argc >= 1) { + if (argc >= 1 && !checkfor && !clear) { error = chdir(argv[0]); if (error) { syslog(LOG_ERR, "chdir(%s): %m", argv[0]); From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 17:09:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DD1715B; Fri, 14 Dec 2012 17:09:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DF33A8FC13; Fri, 14 Dec 2012 17:09:32 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2D7BDB96E; Fri, 14 Dec 2012 12:09:32 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern Date: Fri, 14 Dec 2012 11:49:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> In-Reply-To: <20121213090215.GP97487@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201212141149.07671.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 14 Dec 2012 12:09:32 -0500 (EST) Cc: Adrian Chadd , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , src-committers@freebsd.org, Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 17:09:33 -0000 On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: > A> The problem again is that not all the KASSERTS are inviolable, if you > A> want to do a project to split them, then please do, it would really be > A> helpful, as for now, they are a mis-mash of death/warnings and there are > A> at least three vendors who approve of this as well as 3 long term > A> committers that approved my change (not including Adrian). > > Can you show examples of not inviolable KASSERTs? There are none. They are all assertions for a reason. However, in my experience at several large consumers of FreeBSD, no one wants to run with INVARIANTS in production. Not because we don't want panics (believe me, Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the performance overhead, and redefining INVARIANTS into printf doesn't address that at all. Also, in regards to "if you think an a condition should be inviolable, make it a panic". I _did_ do that in WITNESS and you just reverted them! In all the cases of things like mismatching slock -> xlock you are about to corrupt WITNESS' internal state (leading to false positives or missed warnings) as well as the state of the locks themselves resulting in either hangs or random data corruption. Also, if you don't have a console wired up on all your machines (which not everyone does these days) a hang is _far_ worse than a crashdump, as when the machine hangs, you have to power cycle it, and you won't find the messages in /var/log/messages. With a straight-up panic if someone wants to run with INVARIANTS enabled they would instead have a nice crashdump that could be examined after the machine comes back up that points to the offending location. So in general, I will never use this and find it doesn't add any benefit whatsoever. OTOH, if it is not invasive (e.g. your original commit), then I think it might be ok if there are some folks who might actually find it useful. That said, I think direct use of kassert_panic() such as your changes to WITNESS is wrong. If you are going to change explicit panics, make them into a KASSERT() instead of changing a panic into a kassert_panic(). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 17:09:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8361E280; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 51CA68FC1B; Fri, 14 Dec 2012 17:09:41 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C6B71B9A8; Fri, 14 Dec 2012 12:09:40 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Date: Fri, 14 Dec 2012 11:52:15 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> In-Reply-To: <20121213111240.GB1381@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201212141152.15567.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 14 Dec 2012 12:09:40 -0500 (EST) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 17:09:41 -0000 On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Wed Dec 12 15:45:03 2012 > > > New Revision: 244154 > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > > > > Log: > > > Use kern.max_pid sysctl to obtain maximum PID number instead of using local > > > define. > > It is pid_max, not max_pid. > > > > But the change is wrong. The kern.pid_max only limits newly allocated pids, > > it does not magically moves existing pids, which are out of range, to the > > limited region. See the corresponding commit log for the description. > > It was added to make it easier to run FreeBSD 1.x binaries on the modern > > kernels. > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > userland as well and setting PID_MAX to BSD_PID_MAX? > > This would also help bsnmpd. > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch This doesn't help your actual use case though where you want to boot a kernel with a different PID_MAX. I would much rather our tools learn such constants from the kernel via sysctl than have them compiled in. So, I would add a new sysctl which exports the true PID_MAX constant (and is read-only and never changes) and use that in ps, etc. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 17:19:33 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61A69683; Fri, 14 Dec 2012 17:19:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1ACFC8FC12; Fri, 14 Dec 2012 17:19:31 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA29617; Fri, 14 Dec 2012 19:19:30 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50CB5FA2.6050104@FreeBSD.org> Date: Fri, 14 Dec 2012 19:19:30 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: mdf@FreeBSD.org Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C97D94.1090603@FreeBSD.org> <50C97F8D.6010504@FreeBSD.org> <50C9A321.5060407@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 17:19:33 -0000 on 13/12/2012 19:01 mdf@FreeBSD.org said the following: > Tools, not policy. > > A non-panic-ing KASSERT is a tool, not enabled by default. You don't > need to use it. Someone does, so why can't we provide the tool? So if some code is a tool and it is disabled by default and someone believes that they will use it, then the code is acceptable to include into the tree no questions asked? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 18:30:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B354CE24; Fri, 14 Dec 2012 18:30:02 +0000 (UTC) (envelope-from emaste@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 7EEB18FC19; Fri, 14 Dec 2012 18:30:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEIU2PE025336; Fri, 14 Dec 2012 18:30:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEIU2Qq025332; Fri, 14 Dec 2012 18:30:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212141830.qBEIU2Qq025332@svn.freebsd.org> From: Ed Maste Date: Fri, 14 Dec 2012 18:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244224 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 18:30:02 -0000 Author: emaste Date: Fri Dec 14 18:30:01 2012 New Revision: 244224 URL: http://svnweb.freebsd.org/changeset/base/244224 Log: Minor refactoring prior to .symbols file changes - Combine .if x and .if !x using .else - Separate out beforelinking dependency - Add comments to clarify .if nesting Sponsored by: ADARA Networks Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Dec 14 16:28:10 2012 (r244223) +++ head/share/mk/bsd.lib.mk Fri Dec 14 18:30:01 2012 (r244224) @@ -39,9 +39,7 @@ CFLAGS+= ${DEBUG_FLAGS} .if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif -.endif - -.if !defined(DEBUG_FLAGS) +.else STRIP?= -s .endif @@ -173,10 +171,9 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .endif .if target(beforelinking) -${SHLIB_NAME}: ${SOBJS} beforelinking -.else -${SHLIB_NAME}: ${SOBJS} +${SHLIB_NAME}: beforelinking .endif +${SHLIB_NAME}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${.TARGET} ${SHLIB_LINK} .if defined(SHLIB_LINK) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Dec 14 16:28:10 2012 (r244223) +++ head/share/mk/bsd.prog.mk Fri Dec 14 18:30:01 2012 (r244224) @@ -46,10 +46,9 @@ PROG= ${PROG_CXX} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,10 +75,9 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: ${OBJS} beforelinking -.else -${PROG}: ${OBJS} +${PROG}: beforelinking .endif +${PROG}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -90,7 +88,7 @@ ${PROG}: ${OBJS} .endif .endif -.endif +.endif # !defined(SRCS) .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ @@ -100,7 +98,7 @@ ${PROG}: ${OBJS} MAN= ${PROG}.1 MAN1= ${MAN} .endif -.endif +.endif # defined(PROG) all: objwarn ${PROG} ${SCRIPTS} .if ${MK_MAN} != "no" From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 20:24:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1DF314EB; Fri, 14 Dec 2012 20:24:52 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9736E8FC13; Fri, 14 Dec 2012 20:24:52 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id BE0401A3C1B; Fri, 14 Dec 2012 12:24:44 -0800 (PST) Message-ID: <50CB8B0C.2060908@mu.org> Date: Fri, 14 Dec 2012 12:24:44 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> In-Reply-To: <201212141149.07671.jhb@freebsd.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 20:24:53 -0000 On 12/14/12 8:49 AM, John Baldwin wrote: > On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> A> The problem again is that not all the KASSERTS are inviolable, if you >> A> want to do a project to split them, then please do, it would really be >> A> helpful, as for now, they are a mis-mash of death/warnings and there are >> A> at least three vendors who approve of this as well as 3 long term >> A> committers that approved my change (not including Adrian). >> >> Can you show examples of not inviolable KASSERTs? > There are none. > They are all assertions for a reason. However, in my > experience at several large consumers of FreeBSD, no one wants to run with > INVARIANTS in production. Not because we don't want panics (believe me, > Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the > performance overhead, and redefining INVARIANTS into printf doesn't address > that at all. > > Also, in regards to "if you think an a condition should be inviolable, make it > a panic". I _did_ do that in WITNESS and you just reverted them! In all the > cases of things like mismatching slock -> xlock you are about to corrupt > WITNESS' internal state (leading to false positives or missed warnings) as > well as the state of the locks themselves resulting in either hangs or random > data corruption. > > Also, if you don't have a console wired up on all your machines (which not > everyone does these days) a hang is _far_ worse than a crashdump, as when the > machine hangs, you have to power cycle it, and you won't find the messages in > /var/log/messages. With a straight-up panic if someone wants to run with > INVARIANTS enabled they would instead have a nice crashdump that could be > examined after the machine comes back up that points to the offending > location. > > So in general, I will never use this and find it doesn't add any benefit > whatsoever. OTOH, if it is not invasive (e.g. your original commit), then I > think it might be ok if there are some folks who might actually find it > useful. That said, I think direct use of kassert_panic() such as your changes > to WITNESS is wrong. If you are going to change explicit panics, make them > into a KASSERT() instead of changing a panic into a kassert_panic(). > Would that not break WITNESS without INVARIANTS. I can get a kernel to compile with a functional WITNESS without INVARIANTS, however with this proposed change, then WITNESS wouldn't do anything (not even log) without INVARIANTS. We can probably cobble up a WITNESS_ASSERT for witness if you'd like that does the right thing based on ifdef INVARIANTS. Let me know what you think of that. I've also given you my personal phone number so we can hash this out over the phone, but you have not called nor responded to that email. Don't call now, I'm taking a few hours off to rest, but please let's set up a time to discuss this contentious issue. -Alfred From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 21:41:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E238F57; Fri, 14 Dec 2012 21:41:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 2806C8FC0C; Fri, 14 Dec 2012 21:41:09 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 051BA8AE; Fri, 14 Dec 2012 22:39:04 +0100 (CET) Date: Fri, 14 Dec 2012 22:42:47 +0100 From: Pawel Jakub Dawidek To: John Baldwin Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121214214246.GB1411@garage.freebsd.pl> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <201212141152.15567.jhb@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 21:41:09 -0000 --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: > On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > > Author: pjd > > > > Date: Wed Dec 12 15:45:03 2012 > > > > New Revision: 244154 > > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > >=20 > > > > Log: > > > > Use kern.max_pid sysctl to obtain maximum PID number instead of u= sing local > > > > define. > > > It is pid_max, not max_pid. > > >=20 > > > But the change is wrong. The kern.pid_max only limits newly allocated= pids, > > > it does not magically moves existing pids, which are out of range, to= the > > > limited region. See the corresponding commit log for the description. > > > It was added to make it easier to run FreeBSD 1.x binaries on the mod= ern > > > kernels. > >=20 > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible by > > userland as well and setting PID_MAX to BSD_PID_MAX? > >=20 > > This would also help bsnmpd. > >=20 > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch >=20 > This doesn't help your actual use case though where you want to boot a ke= rnel > with a different PID_MAX. I would much rather our tools learn such const= ants > from the kernel via sysctl than have them compiled in. So, I would add a= new > sysctl which exports the true PID_MAX constant (and is read-only and never > changes) and use that in ps, etc. In that case I'd prefer to make existing kern.pid_max sysctl read-only and make it loader tunable. I don't expect there are many users of this sysctl... --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDLnVYACgkQForvXbEpPzSTAwCg96tGrW/MyHpz59C7IQNwGwWj FYcAoOkeZJH+iA/7ol/2zM1xxn5bU7hU =tITq -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 21:49:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 438321387; Fri, 14 Dec 2012 21:49:07 +0000 (UTC) (envelope-from rmacklem@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 28EC68FC0C; Fri, 14 Dec 2012 21:49:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBELn7Ka054301; Fri, 14 Dec 2012 21:49:07 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBELn7YY054300; Fri, 14 Dec 2012 21:49:07 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201212142149.qBELn7YY054300@svn.freebsd.org> From: Rick Macklem Date: Fri, 14 Dec 2012 21:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244226 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 21:49:07 -0000 Author: rmacklem Date: Fri Dec 14 21:49:06 2012 New Revision: 244226 URL: http://svnweb.freebsd.org/changeset/base/244226 Log: The group list for a non-default export entry (a host/subnet one) was being copied from the wrong place. This patch fixes that. This could cause access failures for mapped users, when the group permissions were needed. PR: 147998 Submitted by: Christopher Key (cjk32 at cam.ac.uk) MFC after: 2 weeks Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Fri Dec 14 21:22:23 2012 (r244225) +++ head/sys/kern/vfs_export.c Fri Dec 14 21:49:06 2012 (r244226) @@ -208,7 +208,7 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon = crget(); np->netc_anon->cr_uid = argp->ex_anon.cr_uid; crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, - np->netc_anon->cr_groups); + argp->ex_anon.cr_groups); np->netc_anon->cr_prison = &prison0; prison_hold(np->netc_anon->cr_prison); np->netc_numsecflavors = argp->ex_numsecflavors; From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 22:04:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F03901CD9; Fri, 14 Dec 2012 22:04:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AB95B8FC0A; Fri, 14 Dec 2012 22:04:09 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4B2558BF; Fri, 14 Dec 2012 23:02:05 +0100 (CET) Date: Fri, 14 Dec 2012 23:05:47 +0100 From: Pawel Jakub Dawidek To: Steven Hartland Subject: Re: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20121214220547.GC1411@garage.freebsd.pl> References: <201212131739.qBDHd8RR083616@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R+My9LyyhiUvIEro" Content-Disposition: inline In-Reply-To: <201212131739.qBDHd8RR083616@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 22:04:10 -0000 --R+My9LyyhiUvIEro Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 13, 2012 at 05:39:08PM +0000, Steven Hartland wrote: > Author: smh > Date: Thu Dec 13 17:39:07 2012 > New Revision: 244188 > URL: http://svnweb.freebsd.org/changeset/base/244188 >=20 > Log: > Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on > initialisation to be enabled (1) / disabled (0) defaults to enabled. > =20 > This is useful for devices which have a slow trim speed and are either > new or have otherwise already been wiped e.g. secure erase. > =20 > PR: kern/173116 > Submitted by: Steven Hartland > Approved by: pjd (mentor) >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu = Dec 13 17:06:38 2012 (r244187) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Thu = Dec 13 17:39:07 2012 (r244188) > @@ -148,6 +148,11 @@ > #include > #include > =20 > +static boolean_t vdev_trim_on_init =3D B_TRUE; > +SYSCTL_DECL(_vfs_zfs_vdev); > +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, > + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisat= ion"); I'd also make it loader tunable. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --R+My9LyyhiUvIEro Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDLorsACgkQForvXbEpPzSHdwCgvaY38hjAT2deQrwWQ3zpJr8P 9o8AoOBnBpVSuh7muBuwGO0TOvaD4exI =aoAV -----END PGP SIGNATURE----- --R+My9LyyhiUvIEro-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 22:45:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D226650D; Fri, 14 Dec 2012 22:45:04 +0000 (UTC) (envelope-from brooks@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 AB1028FC1A; Fri, 14 Dec 2012 22:45:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEMj4IN066980; Fri, 14 Dec 2012 22:45:04 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEMj3xi066972; Fri, 14 Dec 2012 22:45:03 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212142245.qBEMj3xi066972@svn.freebsd.org> From: Brooks Davis Date: Fri, 14 Dec 2012 22:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244230 - vendor/NetBSD/libc-vis/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 22:45:04 -0000 Author: brooks Date: Fri Dec 14 22:45:03 2012 New Revision: 244230 URL: http://svnweb.freebsd.org/changeset/base/244230 Log: Vendor import of NetBSD's (un)vis(3) at 2012-12-14 Modified: vendor/NetBSD/libc-vis/dist/unvis.c vendor/NetBSD/libc-vis/dist/vis.3 vendor/NetBSD/libc-vis/dist/vis.c vendor/NetBSD/libc-vis/dist/vis.h Modified: vendor/NetBSD/libc-vis/dist/unvis.c ============================================================================== --- vendor/NetBSD/libc-vis/dist/unvis.c Fri Dec 14 22:23:36 2012 (r244229) +++ vendor/NetBSD/libc-vis/dist/unvis.c Fri Dec 14 22:45:03 2012 (r244230) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.39 2012/03/13 21:13:37 christos Exp $ */ +/* $NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.39 2012/03/13 21:13:37 christos Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -81,7 +81,7 @@ __weak_alias(strnunvisx,_strnunvisx) * RFC 1866 */ static const struct nv { - const char *name; + const char name[7]; uint8_t value; } nv[] = { { "AElig", 198 }, /* capital AE diphthong (ligature) */ Modified: vendor/NetBSD/libc-vis/dist/vis.3 ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.3 Fri Dec 14 22:23:36 2012 (r244229) +++ vendor/NetBSD/libc-vis/dist/vis.3 Fri Dec 14 22:45:03 2012 (r244230) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.27 2011/05/17 07:10:39 joerg Exp $ +.\" $NetBSD: vis.3,v 1.28 2012/12/14 21:38:18 christos Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)vis.3 8.1 (Berkeley) 6/9/93 .\" -.Dd March 12, 2011 +.Dd December 14, 2012 .Dt VIS 3 .Os .Sh NAME @@ -219,6 +219,15 @@ except space, tab, and newline are encod The following flags alter this: .Bl -tag -width VIS_WHITEX ++.It Dv VIS_GLOB +Also encode magic characters +.Ql ( * , +.Ql \&? , +.Ql \&[ +and +.Ql # ) +recognized by +.Xr glob 3 . .It Dv VIS_SP Also encode space. .It Dv VIS_TAB @@ -408,6 +417,7 @@ The destination buffer size is not large .Sh SEE ALSO .Xr unvis 1 , .Xr vis 1 , +.Xr glob 3 , .Xr unvis 3 .Rs .%A T. Berners-Lee Modified: vendor/NetBSD/libc-vis/dist/vis.c ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.c Fri Dec 14 22:23:36 2012 (r244229) +++ vendor/NetBSD/libc-vis/dist/vis.c Fri Dec 14 22:45:03 2012 (r244230) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $ */ +/* $NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -89,7 +89,7 @@ static char *do_svis(char *, size_t *, i #define xtoa(c) "0123456789abcdef"[c] #define XTOA(c) "0123456789ABCDEF"[c] -#define MAXEXTRAS 5 +#define MAXEXTRAS 9 #define MAKEEXTRALIST(flag, extra, orig_str) \ do { \ @@ -103,6 +103,12 @@ do { \ for (o = orig, e = extra; (*e++ = *o++) != '\0';) \ continue; \ e--; \ + if (flag & VIS_GLOB) { \ + *e++ = '*'; \ + *e++ = '?'; \ + *e++ = '['; \ + *e++ = '#'; \ + } \ if (flag & VIS_SP) *e++ = ' '; \ if (flag & VIS_TAB) *e++ = '\t'; \ if (flag & VIS_NL) *e++ = '\n'; \ Modified: vendor/NetBSD/libc-vis/dist/vis.h ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.h Fri Dec 14 22:23:36 2012 (r244229) +++ vendor/NetBSD/libc-vis/dist/vis.h Fri Dec 14 22:45:03 2012 (r244230) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.19 2011/03/12 19:52:45 christos Exp $ */ +/* $NetBSD: vis.h,v 1.20 2012/12/14 21:36:59 christos Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -39,29 +39,30 @@ /* * to select alternate encoding format */ -#define VIS_OCTAL 0x001 /* use octal \ddd format */ -#define VIS_CSTYLE 0x002 /* use \[nrft0..] where appropiate */ +#define VIS_OCTAL 0x0001 /* use octal \ddd format */ +#define VIS_CSTYLE 0x0002 /* use \[nrft0..] where appropiate */ /* * to alter set of characters encoded (default is to encode all * non-graphic except space, tab, and newline). */ -#define VIS_SP 0x004 /* also encode space */ -#define VIS_TAB 0x008 /* also encode tab */ -#define VIS_NL 0x010 /* also encode newline */ +#define VIS_SP 0x0004 /* also encode space */ +#define VIS_TAB 0x0008 /* also encode tab */ +#define VIS_NL 0x0010 /* also encode newline */ #define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL) -#define VIS_SAFE 0x020 /* only encode "unsafe" characters */ +#define VIS_SAFE 0x0020 /* only encode "unsafe" characters */ /* * other */ -#define VIS_NOSLASH 0x040 /* inhibit printing '\' */ -#define VIS_HTTP1808 0x080 /* http-style escape % hex hex */ -#define VIS_HTTPSTYLE 0x080 /* http-style escape % hex hex */ -#define VIS_MIMESTYLE 0x100 /* mime-style escape = HEX HEX */ -#define VIS_HTTP1866 0x200 /* http-style &#num; or &string; */ -#define VIS_NOESCAPE 0x400 /* don't decode `\' */ -#define _VIS_END 0x800 /* for unvis */ +#define VIS_NOSLASH 0x0040 /* inhibit printing '\' */ +#define VIS_HTTP1808 0x0080 /* http-style escape % hex hex */ +#define VIS_HTTPSTYLE 0x0080 /* http-style escape % hex hex */ +#define VIS_MIMESTYLE 0x0100 /* mime-style escape = HEX HEX */ +#define VIS_HTTP1866 0x0200 /* http-style &#num; or &string; */ +#define VIS_NOESCAPE 0x0400 /* don't decode `\' */ +#define _VIS_END 0x0800 /* for unvis */ +#define VIS_GLOB 0x1000 /* encode glob(3) magic characters */ /* * unvis return codes From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 22:47:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 556F472C; Fri, 14 Dec 2012 22:47:10 +0000 (UTC) (envelope-from brooks@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 1FC928FC18; Fri, 14 Dec 2012 22:47:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEMl9Ds067466; Fri, 14 Dec 2012 22:47:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEMl9vl067465; Fri, 14 Dec 2012 22:47:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212142247.qBEMl9vl067465@svn.freebsd.org> From: Brooks Davis Date: Fri, 14 Dec 2012 22:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244231 - vendor/NetBSD/libc-vis/20121412 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 22:47:10 -0000 Author: brooks Date: Fri Dec 14 22:47:09 2012 New Revision: 244231 URL: http://svnweb.freebsd.org/changeset/base/244231 Log: Tag 2012-12-14 import of NetBSD's (un)vis(3) Added: vendor/NetBSD/libc-vis/20121412/ - copied from r244230, vendor/NetBSD/libc-vis/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 22:50:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 268AD995; Fri, 14 Dec 2012 22:50:05 +0000 (UTC) (envelope-from carl.r.delsey@intel.com) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by mx1.freebsd.org (Postfix) with ESMTP id BE3058FC14; Fri, 14 Dec 2012 22:50:04 +0000 (UTC) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 14 Dec 2012 14:49:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,284,1355126400"; d="scan'208";a="181102956" Received: from crdelsey-fbsd.ch.intel.com (HELO [10.2.105.127]) ([10.2.105.127]) by AZSMGA002.ch.intel.com with ESMTP; 14 Dec 2012 14:49:50 -0800 Message-ID: <50CBAD0E.5050907@intel.com> Date: Fri, 14 Dec 2012 15:49:50 -0700 From: Carl Delsey User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120724 Thunderbird/13.0.1 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r244193 - head/sys/x86/include References: <201212132140.qBDLeBhd019751@svn.freebsd.org> <20121214154930.D973@besplex.bde.org> In-Reply-To: <20121214154930.D973@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 22:50:05 -0000 On 12/13/12 21:49, Bruce Evans wrote: > On Thu, 13 Dec 2012, Jim Harris wrote: > >> Log: >> Add bus_space_read_8 and bus_space_write_8 for amd64. >> >> Rather than trying to KASSERT for callers that invoke this on >> IO tags, either do nothing (for write_8) or return ~0 (for read_8). > > read_8 returns a uint64_t, so it cannot return the signed integer ~0. > It actually returns this signed integer converted to uint64_t. On > amd64, this is the 32 bit value 0xffffffff. The 64-bit value > 0xffffffffffffffff should be returned. I double checked and 0xffffffffffffffff is being returned when compiled by both clang and gcc. > >> Using KASSERT here just makes bus.h too messy from both >> polluting bus.h with systm.h (for any number of drivers that include >> bus.h without first including systm.h) or ports that use bus.h >> directly (i.e. libpciaccess) as reported by zeising@. >> >> Also don't try to implement all of the other bus_space functions for >> 8 byte access since realistically only these two are needed for some >> devices that expose 64-bit memory-mapped registers. > > Good. > >> Put the amd64-specific functions here rather than >> sys/amd64/include/bus.h >> so that we can keep this header unified for x86, as requested by mdf@ >> and tijl@. > > Not so good. I don't really like any of the unified headers. Me neither, but it sounds like there is a good reason for it, which I'll admit I don't fully understand. Sounds like it has something to do with cross-compiling. > >> Modified: head/sys/x86/include/bus.h >> ============================================================================== >> >> --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) >> +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) >> @@ -130,6 +130,7 @@ >> #define BUS_SPACE_MAXADDR 0xFFFFFFFF >> #endif > > This file spells the F in hex constants in upper case. > > In the above definition and in previous ones, it is careful to spell out > the constants and not depend on sign extension. So it is also a style > bug to use ~0. Are you saying it is a style bug to not match the style used above, regardless of whether that style is right or wrong, or are you saying (~0) is always a style bug? > > Style bug visible in the above: space instead of tab after #define. This > style bugs is in all #define's near here, including the new one. > > Type error in #define's just before the above: the above > BUS_SPACE_MAXADDR > is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course > 64 bits, but the ifdef tangle for it is not tangled enough to be correct: > BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is > only > unsigned long long on i386-PAE. I think this should be a separate patch though, since it is unrelated to this change. > >> >> +#define BUS_SPACE_INVALID_DATA (~0) >> #define BUS_SPACE_UNRESTRICTED (~0) >> >> /* >> @@ -221,6 +222,12 @@ static __inline u_int32_t bus_space_read >> bus_space_handle_t handle, >> bus_size_t offset); >> >> +#ifdef __amd64__ >> +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, >> + bus_space_handle_t handle, >> + bus_size_t offset); >> +#endif >> + > > This is style-bug for bug compatible with the existing forward > declarations. Forward declarations of inline functions are nonsense. > They are from NetBSD, for K&R support. But FreeBSD never supported > K&R in bus-space headers, and the forward declarations never even > compiled with K&R, since they never used __P(()). Almost 1/3 of the > x86 bus.h consists of these negatively useful forward declarations. > Some of them are almost as large as the full functions, since they are > misformatted worse, with parameters starting at about column 40 instead > of about column 20, so so that many lines are needed just for the > parameters (to line them up in perfectly non-KNF gnu style). Same with this - separate patch > >> ... >> @@ -251,8 +258,16 @@ bus_space_read_4(bus_space_tag_t tag, bu >> return (*(volatile u_int32_t *)(handle + offset)); >> } >> >> -#if 0 /* Cause a link error for bus_space_read_8 */ >> -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 >> unimplemented !!! >> +#ifdef __amd64__ >> +static __inline uint64_t >> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, >> + bus_size_t offset) >> +{ >> + >> + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ > > The comment is not indented, and should probably not be placed to the > right of the code. This file mostly doesn't place comments there, and > when it does it doesn't capitalize them. One that does also spells IO > as i/o. All the #if 0 lines also start with an end of line comment, and they are all capitalized. By "not indented" are you saying that all end of line comments must be preceded by a tab? > >> + return (BUS_SPACE_INVALID_DATA); >> + return (*(volatile uint64_t *)(handle + offset)); >> +} >> #endif > > Bruce > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 23:04:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 528E2EBD; Fri, 14 Dec 2012 23:04:57 +0000 (UTC) (envelope-from brooks@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 37AC68FC19; Fri, 14 Dec 2012 23:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEN4vFt072228; Fri, 14 Dec 2012 23:04:57 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEN4vPE072227; Fri, 14 Dec 2012 23:04:57 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212142304.qBEN4vPE072227@svn.freebsd.org> From: Brooks Davis Date: Fri, 14 Dec 2012 23:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244232 - vendor/NetBSD/libc-vis/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 23:04:57 -0000 Author: brooks Date: Fri Dec 14 23:04:56 2012 New Revision: 244232 URL: http://svnweb.freebsd.org/changeset/base/244232 Log: Vendor import of NetBSD's (un)vis(3) at 2012-12-14 (2nd one) Modified: vendor/NetBSD/libc-vis/dist/vis.3 Modified: vendor/NetBSD/libc-vis/dist/vis.3 ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.3 Fri Dec 14 22:47:09 2012 (r244231) +++ vendor/NetBSD/libc-vis/dist/vis.3 Fri Dec 14 23:04:56 2012 (r244232) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.28 2012/12/14 21:38:18 christos Exp $ +.\" $NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -219,7 +219,7 @@ except space, tab, and newline are encod The following flags alter this: .Bl -tag -width VIS_WHITEX -+.It Dv VIS_GLOB +.It Dv VIS_GLOB Also encode magic characters .Ql ( * , .Ql \&? , From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 23:06:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3CCED0; Fri, 14 Dec 2012 23:06:31 +0000 (UTC) (envelope-from brooks@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 9EBEB8FC19; Fri, 14 Dec 2012 23:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEN6VmS072648; Fri, 14 Dec 2012 23:06:31 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEN6V73072647; Fri, 14 Dec 2012 23:06:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212142306.qBEN6V73072647@svn.freebsd.org> From: Brooks Davis Date: Fri, 14 Dec 2012 23:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244233 - vendor/NetBSD/libc-vis/20121412a X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 23:06:31 -0000 Author: brooks Date: Fri Dec 14 23:06:31 2012 New Revision: 244233 URL: http://svnweb.freebsd.org/changeset/base/244233 Log: Tag 2nd 2012-12-14 import of NetBSD's (un)vis(3) Added: vendor/NetBSD/libc-vis/20121412a/ - copied from r244232, vendor/NetBSD/libc-vis/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 23:07:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49969274; Fri, 14 Dec 2012 23:07:26 +0000 (UTC) (envelope-from brooks@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 2D10E8FC16; Fri, 14 Dec 2012 23:07:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBEN7QIB072901; Fri, 14 Dec 2012 23:07:26 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBEN7Q1s072899; Fri, 14 Dec 2012 23:07:26 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201212142307.qBEN7Q1s072899@svn.freebsd.org> From: Brooks Davis Date: Fri, 14 Dec 2012 23:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244234 - vendor/NetBSD/libc-vis X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 23:07:26 -0000 Author: brooks Date: Fri Dec 14 23:07:25 2012 New Revision: 244234 URL: http://svnweb.freebsd.org/changeset/base/244234 Log: Add a guide to upgrading (un)vis(3) imports. Added: vendor/NetBSD/libc-vis/FreeBSD-Upgrade Added: vendor/NetBSD/libc-vis/FreeBSD-Upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/libc-vis/FreeBSD-Upgrade Fri Dec 14 23:07:25 2012 (r244234) @@ -0,0 +1,27 @@ +Instructions for updating unvis(3) and vis(3). + +1) checkout the head of the vendor branch: + + REPO=svn+ssh://svn.freebsd.org/ + svn co $REPO/base/vendor/NetBSD/libc-vis/dist + +2) Update (un)vis.[3ch]: + + rm dist/unvis.* dist/vis.* + export CVSROOT=anoncvs@anoncvs.NetBSD.org:/cvsroot + cvs export -r HEAD -d dist src/lib/libc/gen/unvis.3 + cvs export -r HEAD -d dist src/lib/libc/gen/unvis.c + cvs export -r HEAD -d dist src/lib/libc/gen/vis.3 + cvs export -r HEAD -d dist src/lib/libc/gen/vis.c + cvs export -r HEAD -d dist src/include/vis.h + +3) Commit the new versions: + + svn commit -m "Vendor import of NetBSD's (un)vis(3) at `date +%F`" dist + svn cp -m "Tag `date +%F` import of NetBSD's (un)vis(3)" \ + $REPO/base/vendor/NetBSD/libc-vis/dist \ + $REPO/base/vendor/NetBSD/libc-vis/`date +%Y%d%m` + +4) Update the files in src/contrib/libc-pwcache: + + From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 00:03:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31FD0BF2; Sat, 15 Dec 2012 00:03:36 +0000 (UTC) (envelope-from emaste@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 F1B098FC12; Sat, 15 Dec 2012 00:03:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF03ZfH085868; Sat, 15 Dec 2012 00:03:35 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF03Zr0085865; Sat, 15 Dec 2012 00:03:35 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212150003.qBF03Zr0085865@svn.freebsd.org> From: Ed Maste Date: Sat, 15 Dec 2012 00:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244236 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 00:03:36 -0000 Author: emaste Date: Sat Dec 15 00:03:35 2012 New Revision: 244236 URL: http://svnweb.freebsd.org/changeset/base/244236 Log: Put shared library debug info into separate .symbols file Sponsored by: ADARA Networks Modified: head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Dec 14 23:13:06 2012 (r244235) +++ head/share/mk/bsd.lib.mk Sat Dec 15 00:03:35 2012 (r244236) @@ -173,11 +173,15 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .if target(beforelinking) ${SHLIB_NAME}: beforelinking .endif +.if defined(DEBUG_FLAGS) +${SHLIB_NAME}.debug: ${SOBJS} +.else ${SHLIB_NAME}: ${SOBJS} +.endif @${ECHO} building shared library ${SHLIB_NAME} - @rm -f ${.TARGET} ${SHLIB_LINK} + @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) - @ln -fs ${.TARGET} ${SHLIB_LINK} + @ln -fs ${SHLIB_NAME} ${SHLIB_LINK} .endif .if !defined(NM) @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -191,6 +195,15 @@ ${SHLIB_NAME}: ${SOBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif + +.if defined(DEBUG_FLAGS) +${SHLIB_NAME}: ${SHLIB_NAME}.debug ${SHLIB_NAME}.symbols + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \ + ${SHLIB_NAME}.debug ${.TARGET} + +${SHLIB_NAME}.symbols: ${SHLIB_NAME}.debug + ${OBJCOPY} --only-keep-debug ${SHLIB_NAME}.debug ${.TARGET} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" @@ -267,6 +280,11 @@ _libinstall: ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} +.if defined(DEBUG_FLAGS) + ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ + ${SHLIB_NAME}.symbols ${DESTDIR}${SHLIBDIR} +.endif .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 14 23:13:06 2012 (r244235) +++ head/share/mk/sys.mk Sat Dec 15 00:03:35 2012 (r244236) @@ -134,6 +134,8 @@ NM ?= nm OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import +OBJCOPY ?= objcopy + PC ?= pc PFLAGS ?= From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 00:13:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E84C5F34; Sat, 15 Dec 2012 00:13:18 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7C08F8FC19; Sat, 15 Dec 2012 00:13:18 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so4199582oag.13 for ; Fri, 14 Dec 2012 16:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DyRItChpziaIfYYTDnX0QOZIZ6mO0hTJx7q/OaAF6y4=; b=GDYRdT2DAjlbmYMdgZ9SlKas7VFLC7mXfMRXuLIZrXFF77JEm0rsHauRuGXql7mrz8 WCUyc6bJDw/wdQQaJBIK6/j5QdmbAFpZfHcWawHwaf/7PvTLTmhrbUmN6LV3FQhFTFoS PNjG+OGtAXEUgPjcYV8pSFfyiTvkxhSDu3WrIR37N2BJ+oPiRDx7b0uh2xcxdacBL8tX p2tTf5VjqMF2NZg278lV3qwph8JtmB32lSXG68ocu08DOO7rmrEAXsEtlhiWgcDnXcIm 8hte6kdvU7kXXHxyJjA7ohf/WT998xSQhnvdNpc0A+hkqkWMPTdIC/uTACo9f/C5IhVX PKOQ== MIME-Version: 1.0 Received: by 10.182.2.169 with SMTP id 9mr6152277obv.66.1355530397622; Fri, 14 Dec 2012 16:13:17 -0800 (PST) Received: by 10.76.143.33 with HTTP; Fri, 14 Dec 2012 16:13:17 -0800 (PST) In-Reply-To: <201212150003.qBF03Zr0085865@svn.freebsd.org> References: <201212150003.qBF03Zr0085865@svn.freebsd.org> Date: Fri, 14 Dec 2012 16:13:17 -0800 Message-ID: Subject: Re: svn commit: r244236 - head/share/mk From: Garrett Cooper To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 00:13:19 -0000 On Fri, Dec 14, 2012 at 4:03 PM, Ed Maste wrote: > Author: emaste > Date: Sat Dec 15 00:03:35 2012 > New Revision: 244236 > URL: http://svnweb.freebsd.org/changeset/base/244236 ... > Modified: head/share/mk/sys.mk > ============================================================================== > --- head/share/mk/sys.mk Fri Dec 14 23:13:06 2012 (r244235) > +++ head/share/mk/sys.mk Sat Dec 15 00:03:35 2012 (r244236) > @@ -134,6 +134,8 @@ NM ?= nm > OBJC ?= cc > OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import > > +OBJCOPY ?= objcopy > + > PC ?= pc > PFLAGS ?= This shouldn't be defined when !defined(%POSIX) is true. The .endif should be pulled down to just above SHELL?= according to what I'm reading in http://pubs.opengroup.org/onlinepubs/009695399/utilities/make.html . Other spots in the tree where OBJCOPY?= is noted can be probably start to be reaped (thinking about sys/boot/, etc in particular). I have a PR open for some work Warner started with an initial patch that I've kind of been keeping up to date in git, but it needs to be updated now per this change (and also because I didn't notice that these variables weren't supposed to be defined when POSIX mode was on). Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 00:14:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E041413A; Sat, 15 Dec 2012 00:14:38 +0000 (UTC) (envelope-from smh@freebsd.org) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id D0DC28FC0A; Sat, 15 Dec 2012 00:14:37 +0000 (UTC) X-Spam-Processed: mail1.multiplay.co.uk, Sat, 15 Dec 2012 00:14:35 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50001358603.msg; Sat, 15 Dec 2012 00:14:35 +0000 X-MDRemoteIP: 188.220.16.49 X-Return-Path: smh@freebsd.org X-Envelope-From: smh@freebsd.org Message-ID: <2684CC03E9F64F72B9F723411F32DF68@multiplay.co.uk> From: "Steven Hartland" To: "Pawel Jakub Dawidek" References: <201212131739.qBDHd8RR083616@svn.freebsd.org> <20121214220547.GC1411@garage.freebsd.pl> Subject: Re: svn commit: r244188 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Sat, 15 Dec 2012 00:14:28 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 00:14:39 -0000 ----- Original Message ----- From: "Pawel Jakub Dawidek" On Thu, Dec 13, 2012 at 05:39:08PM +0000, Steven Hartland wrote: >> Author: smh >> Date: Thu Dec 13 17:39:07 2012 >> New Revision: 244188 >> URL: http://svnweb.freebsd.org/changeset/base/244188 >> >> Log: >> Added vfs.zfs.vdev.trim_on_init sysctl which allows full vdev trim on >> initialisation to be enabled (1) / disabled (0) defaults to enabled. >> >> This is useful for devices which have a slow trim speed and are either >> new or have otherwise already been wiped e.g. secure erase. >> ... >> +static boolean_t vdev_trim_on_init = B_TRUE; >> +SYSCTL_DECL(_vfs_zfs_vdev);> >> +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, trim_on_init, CTLFLAG_RW, >> + &vdev_trim_on_init, 0, "Enable/disable full vdev trim on initialisation"); > > I'd also make it loader tunable. Will look into that, worth doing the other SYSCTL only ones at the same time? Regards Steve From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 00:12:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6711AE04; Sat, 15 Dec 2012 00:12:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 338C08FC17; Sat, 15 Dec 2012 00:12:32 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D33E546B06; Fri, 14 Dec 2012 19:12:31 -0500 (EST) Date: Sat, 15 Dec 2012 00:12:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin Subject: Re: svn commit: r244112 - head/sys/kern In-Reply-To: <201212141149.07671.jhb@freebsd.org> Message-ID: References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Sat, 15 Dec 2012 00:16:11 +0000 Cc: Adrian Chadd , Alfred Perlstein , src-committers@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 00:12:32 -0000 On Fri, 14 Dec 2012, John Baldwin wrote: > On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The >> problem again is that not all the KASSERTS are inviolable, if you A> want >> to do a project to split them, then please do, it would really be A> >> helpful, as for now, they are a mis-mash of death/warnings and there are A> >> at least three vendors who approve of this as well as 3 long term A> >> committers that approved my change (not including Adrian). >> >> Can you show examples of not inviolable KASSERTs? > > There are none. They are all assertions for a reason. However, in my > experience at several large consumers of FreeBSD, no one wants to run with > INVARIANTS in production. Not because we don't want panics (believe me, > Yahoo! gets plenty of panics even with INVARIANTS disabled), but because the > performance overhead, and redefining INVARIANTS into printf doesn't address > that at all. In the past, FYI, the two major INVARIANTS hits were un-inlining of locking, and UMA using additional global locking to perform heavier-weight sanity checking. For me, at least, the former wasn't such a problem, but the latter was extremely measurable. I have occasionally wondered if we should have another option name for heavier-duty sanity checking, as is the case with WITNESS, SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made tolerable for more real-world installations. As you observe, our invariants tests are generally things where you catch critical problems in much more debuggable states, rather than sources of additional fragility, and it would be great if we could leave more in so that bug reports were able to contain more information. Robert From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 01:13:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54DA4BDE; Sat, 15 Dec 2012 01:13:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id C33608FC12; Sat, 15 Dec 2012 01:13:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qBF1D04C074042; Sat, 15 Dec 2012 03:13:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.3 kib.kiev.ua qBF1D04C074042 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qBF1D0pJ074041; Sat, 15 Dec 2012 03:13:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 15 Dec 2012 03:13:00 +0200 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r244154 - head/bin/ps Message-ID: <20121215011300.GN71906@kib.kiev.ua> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> <20121214214246.GB1411@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gWRamliw218YCZO9" Content-Disposition: inline In-Reply-To: <20121214214246.GB1411@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 01:13:05 -0000 --gWRamliw218YCZO9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 14, 2012 at 10:42:47PM +0100, Pawel Jakub Dawidek wrote: > On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: > > On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: > > > On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: > > > > On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: > > > > > Author: pjd > > > > > Date: Wed Dec 12 15:45:03 2012 > > > > > New Revision: 244154 > > > > > URL: http://svnweb.freebsd.org/changeset/base/244154 > > > > >=20 > > > > > Log: > > > > > Use kern.max_pid sysctl to obtain maximum PID number instead of= using local > > > > > define. > > > > It is pid_max, not max_pid. > > > >=20 > > > > But the change is wrong. The kern.pid_max only limits newly allocat= ed pids, > > > > it does not magically moves existing pids, which are out of range, = to the > > > > limited region. See the corresponding commit log for the descriptio= n. > > > > It was added to make it easier to run FreeBSD 1.x binaries on the m= odern > > > > kernels. > > >=20 > > > I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... > > > How about defining BSD_PID_MAX in sys/proc.h, which would be visible = by > > > userland as well and setting PID_MAX to BSD_PID_MAX? > > >=20 > > > This would also help bsnmpd. > > >=20 > > > http://people.freebsd.org/~pjd/patches/PID_MAX.patch > >=20 > > This doesn't help your actual use case though where you want to boot a = kernel > > with a different PID_MAX. I would much rather our tools learn such con= stants > > from the kernel via sysctl than have them compiled in. So, I would add= a new > > sysctl which exports the true PID_MAX constant (and is read-only and ne= ver > > changes) and use that in ps, etc. >=20 > In that case I'd prefer to make existing kern.pid_max sysctl read-only > and make it loader tunable. I don't expect there are many users of this > sysctl... >=20 No, I described you the purpose of the sysctl. Requiring reboot just for running the old binaries is not useful. Please do not break it. --gWRamliw218YCZO9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQy86bAAoJEJDCuSvBvK1B1UYQAJGxn1OlblMAxtkeUdIBTPNi WHqYuZpFYF/niLn0JJb1Xxw6CGb6mO+ECsI32QT7fZ7vzL9jMIlZk4n+cbnJLvLY +EeTThtHwRWAKIZodRV31GmDS0j8+HNqHhKrsVmskr+MRyOSu1zWSsim++gRjx3c ZlYc85D1yyfjQKTxDM/TepEBUUDPkTxZZTs75vsA6lWQnL572uTg5nIHJeyVekpj hkzZSGYa2fYmk7V+XYyRVxWGdDu9mkpJk77I07GScL0G4caSI5DsobB6i4VaWq3o 6LWMf+JzpUpqHVhz+63K5P19Fj9sqOHVVwr5Px8jPge7L8XE7oG6U6QXNr+W4Aip zOB5CaAMfTgL9LByeXuQJ3Is0GAJaiXH8PukGMrMvi9pP/EwZTPkM8ItlBunvOvH u9d7xclHuYTqtT1MJ16AJporwy9QbwCKiszHU1aOTAIJH7Yaou9GzRLLz8Q6aET/ vdytZ4IE7JuMOTKUVZnQIAgnwQglL0pOEl9IB2ATpp2knQVxeuyzd8uBPAD5pW6h pZ5UGtcJpGM809aFrpe54LWb36O+injXtk14n5GzZUiQeVT7miL4fdy1bWmfhXNA XiZ7YgGJ9X0aTZcfidupgJLH1WiOvsJT9QrJzHJMAANKBEwpNngxqg7N9o5O5QXh uAMHUBrk43hNH3Y0CUM/ =8Y1r -----END PGP SIGNATURE----- --gWRamliw218YCZO9-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 02:02:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1658852C; Sat, 15 Dec 2012 02:02:12 +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 F05E08FC0C; Sat, 15 Dec 2012 02:02:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF22Bvw013555; Sat, 15 Dec 2012 02:02:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF22BZt013554; Sat, 15 Dec 2012 02:02:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150202.qBF22BZt013554@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244237 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 02:02:12 -0000 Author: kib Date: Sat Dec 15 02:02:11 2012 New Revision: 244237 URL: http://svnweb.freebsd.org/changeset/base/244237 Log: Remove a special case for XEN, which is erronous and makes vfork(2) behaviour to differ from the documented, only on XEN. If there are any issues with XEN pmap left, they should be fixed in pmap. MFC after: 2 weeks Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat Dec 15 00:03:35 2012 (r244236) +++ head/sys/kern/kern_fork.c Sat Dec 15 02:02:11 2012 (r244237) @@ -150,11 +150,7 @@ sys_vfork(struct thread *td, struct vfor int error, flags; struct proc *p2; -#ifdef XEN - flags = RFFDG | RFPROC; /* validate that this is still an issue */ -#else flags = RFFDG | RFPROC | RFPPWAIT | RFMEM; -#endif error = fork1(td, flags, 0, &p2, NULL, 0); if (error == 0) { td->td_retval[0] = p2->p_pid; From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 02:03:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97D916A6; Sat, 15 Dec 2012 02:03:07 +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 7CAB98FC12; Sat, 15 Dec 2012 02:03:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF237wi013827; Sat, 15 Dec 2012 02:03:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF237KO013825; Sat, 15 Dec 2012 02:03:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150203.qBF237KO013825@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244238 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 02:03:07 -0000 Author: kib Date: Sat Dec 15 02:03:06 2012 New Revision: 244238 URL: http://svnweb.freebsd.org/changeset/base/244238 Log: Line up the continuation backslashes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Dec 15 02:02:11 2012 (r244237) +++ head/sys/sys/mount.h Sat Dec 15 02:03:06 2012 (r244238) @@ -199,8 +199,8 @@ struct vnode *__mnt_vnode_next_all(struc struct vnode *__mnt_vnode_first_all(struct vnode **mvp, struct mount *mp); void __mnt_vnode_markerfree_all(struct vnode **mvp, struct mount *mp); -#define MNT_VNODE_FOREACH_ALL(vp, mp, mvp) \ - for (vp = __mnt_vnode_first_all(&(mvp), (mp)); \ +#define MNT_VNODE_FOREACH_ALL(vp, mp, mvp) \ + for (vp = __mnt_vnode_first_all(&(mvp), (mp)); \ (vp) != NULL; vp = __mnt_vnode_next_all(&(mvp), (mp))) #define MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp) \ From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 02:04:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33294827; Sat, 15 Dec 2012 02:04:00 +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 17F9A8FC16; Sat, 15 Dec 2012 02:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF23xcf014078; Sat, 15 Dec 2012 02:03:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF23xOh014077; Sat, 15 Dec 2012 02:03:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150203.qBF23xOh014077@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244239 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 02:04:00 -0000 Author: kib Date: Sat Dec 15 02:03:59 2012 New Revision: 244239 URL: http://svnweb.freebsd.org/changeset/base/244239 Log: Fix a typo, resulting in the NULL pointer dereference. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Sat Dec 15 02:03:06 2012 (r244238) +++ head/sys/ufs/ufs/ufs_quota.c Sat Dec 15 02:03:59 2012 (r244239) @@ -1044,7 +1044,7 @@ again: error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td); if (error) { if (error == ENOENT) { - MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp); + MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp); goto again; } continue; From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 02:04:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BC0C98E; Sat, 15 Dec 2012 02:04:47 +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 7FF328FC0A; Sat, 15 Dec 2012 02:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF24luu014328; Sat, 15 Dec 2012 02:04:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF24lZd014326; Sat, 15 Dec 2012 02:04:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201212150204.qBF24lZd014326@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Dec 2012 02:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244240 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 02:04:47 -0000 Author: kib Date: Sat Dec 15 02:04:46 2012 New Revision: 244240 URL: http://svnweb.freebsd.org/changeset/base/244240 Log: When mnt_vnode_next_active iterator cannot lock the next vnode and yields, specify the user priority for the yield. Otherwise, a higher-priority (kernel) thread could fall into the priority-inversion with the thread owning the mutex lock. On single-processor machines or UP kernels, do not loop adaptively when the next vnode cannot be locked, instead yield unconditionally. Restructure the iteration initializer and the iterator to remove code duplication. Put the code to fetch and lock a vnode next to the current marker, into the mnt_vnode_next_active() function, and use it instead of repeating the loop. Reported by: hrs, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Dec 15 02:03:59 2012 (r244239) +++ head/sys/kern/vfs_subr.c Sat Dec 15 02:04:46 2012 (r244240) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -4710,32 +4711,54 @@ __mnt_vnode_markerfree_all(struct vnode * These are helper functions for filesystems to traverse their * active vnodes. See MNT_VNODE_FOREACH_ACTIVE() in sys/mount.h */ -struct vnode * -__mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) +static void +mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *mp) +{ + + KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); + + MNT_ILOCK(mp); + MNT_REL(mp); + MNT_IUNLOCK(mp); + free(*mvp, M_VNODE_MARKER); + *mvp = NULL; +} + +#ifdef SMP +#define ALWAYS_YIELD (mp_ncpus == 1) +#else +#define ALWAYS_YIELD 1 +#endif + +static struct vnode * +mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) { struct vnode *vp, *nvp; - if (should_yield()) - kern_yield(PRI_UNCHANGED); - mtx_lock(&vnode_free_list_mtx); -restart: + mtx_assert(&vnode_free_list_mtx, MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); +restart: vp = TAILQ_NEXT(*mvp, v_actfreelist); + TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); while (vp != NULL) { if (vp->v_type == VMARKER) { vp = TAILQ_NEXT(vp, v_actfreelist); continue; } if (!VI_TRYLOCK(vp)) { - if (should_yield()) { + if (ALWAYS_YIELD || should_yield()) { + TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); + kern_yield(PRI_USER); mtx_lock(&vnode_free_list_mtx); + goto restart; } - goto restart; + continue; } - if (vp->v_mount == mp && vp->v_type != VMARKER && - (vp->v_iflag & VI_DOOMED) == 0) + KASSERT(vp->v_type != VMARKER, ("locked marker %p", vp)); + KASSERT(vp->v_mount == mp || vp->v_mount == NULL, + ("alien vnode on the active list %p %p", vp, mp)); + if (vp->v_mount == mp && (vp->v_iflag & VI_DOOMED) == 0) break; nvp = TAILQ_NEXT(vp, v_actfreelist); VI_UNLOCK(vp); @@ -4745,22 +4768,31 @@ restart: /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); - __mnt_vnode_markerfree_active(mvp, mp); - mtx_assert(MNT_MTX(mp), MA_NOTOWNED); + mnt_vnode_markerfree_active(mvp, mp); return (NULL); } - TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); ASSERT_VI_LOCKED(vp, "active iter"); KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); return (vp); } +#undef ALWAYS_YIELD + +struct vnode * +__mnt_vnode_next_active(struct vnode **mvp, struct mount *mp) +{ + + if (should_yield()) + kern_yield(PRI_UNCHANGED); + mtx_lock(&vnode_free_list_mtx); + return (mnt_vnode_next_active(mvp, mp)); +} struct vnode * __mnt_vnode_first_active(struct vnode **mvp, struct mount *mp) { - struct vnode *vp, *nvp; + struct vnode *vp; *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); MNT_ILOCK(mp); @@ -4770,44 +4802,14 @@ __mnt_vnode_first_active(struct vnode ** (*mvp)->v_mount = mp; mtx_lock(&vnode_free_list_mtx); -restart: vp = TAILQ_FIRST(&mp->mnt_activevnodelist); - while (vp != NULL) { - if (vp->v_type == VMARKER) { - vp = TAILQ_NEXT(vp, v_actfreelist); - continue; - } - if (!VI_TRYLOCK(vp)) { - if (should_yield()) { - mtx_unlock(&vnode_free_list_mtx); - kern_yield(PRI_UNCHANGED); - mtx_lock(&vnode_free_list_mtx); - } - goto restart; - } - if (vp->v_mount == mp && vp->v_type != VMARKER && - (vp->v_iflag & VI_DOOMED) == 0) - break; - nvp = TAILQ_NEXT(vp, v_actfreelist); - VI_UNLOCK(vp); - vp = nvp; - } - - /* Check if we are done */ if (vp == NULL) { mtx_unlock(&vnode_free_list_mtx); - MNT_ILOCK(mp); - MNT_REL(mp); - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - *mvp = NULL; + mnt_vnode_markerfree_active(mvp, mp); return (NULL); } - TAILQ_INSERT_AFTER(&mp->mnt_activevnodelist, vp, *mvp, v_actfreelist); - mtx_unlock(&vnode_free_list_mtx); - ASSERT_VI_LOCKED(vp, "active iter first"); - KASSERT((vp->v_iflag & VI_ACTIVE) != 0, ("Non-active vp %p", vp)); - return (vp); + TAILQ_INSERT_BEFORE(vp, *mvp, v_actfreelist); + return (mnt_vnode_next_active(mvp, mp)); } void @@ -4817,14 +4819,8 @@ __mnt_vnode_markerfree_active(struct vno if (*mvp == NULL) return; - KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - mtx_lock(&vnode_free_list_mtx); TAILQ_REMOVE(&mp->mnt_activevnodelist, *mvp, v_actfreelist); mtx_unlock(&vnode_free_list_mtx); - MNT_ILOCK(mp); - MNT_REL(mp); - MNT_IUNLOCK(mp); - free(*mvp, M_VNODE_MARKER); - *mvp = NULL; + mnt_vnode_markerfree_active(mvp, mp); } Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Dec 15 02:03:59 2012 (r244239) +++ head/sys/sys/mount.h Sat Dec 15 02:04:46 2012 (r244240) @@ -218,17 +218,12 @@ struct vnode *__mnt_vnode_next_active(st struct vnode *__mnt_vnode_first_active(struct vnode **mvp, struct mount *mp); void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *); -#define MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) \ - for (vp = __mnt_vnode_first_active(&(mvp), (mp)); \ +#define MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) \ + for (vp = __mnt_vnode_first_active(&(mvp), (mp)); \ (vp) != NULL; vp = __mnt_vnode_next_active(&(mvp), (mp))) #define MNT_VNODE_FOREACH_ACTIVE_ABORT(mp, mvp) \ - do { \ - MNT_ILOCK(mp); \ - __mnt_vnode_markerfree_active(&(mvp), (mp)); \ - /* MNT_IUNLOCK(mp); -- done in above function */ \ - mtx_assert(MNT_MTX(mp), MA_NOTOWNED); \ - } while (0) + __mnt_vnode_markerfree_active(&(mvp), (mp)) /* * Definitions for MNT_VNODE_FOREACH. From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 00:21:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC9B8365; Sat, 15 Dec 2012 00:21:26 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8AA8FC16; Sat, 15 Dec 2012 00:21:26 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id B5D041A3CE3; Fri, 14 Dec 2012 16:21:25 -0800 (PST) Message-ID: <50CBC285.7060307@mu.org> Date: Fri, 14 Dec 2012 16:21:25 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Robert Watson Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 15 Dec 2012 02:50:41 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 00:21:26 -0000 On 12/14/12 4:12 PM, Robert Watson wrote: > On Fri, 14 Dec 2012, John Baldwin wrote: > >> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> >>> The problem again is that not all the KASSERTS are inviolable, if >>> you A> want to do a project to split them, then please do, it would >>> really be A> helpful, as for now, they are a mis-mash of >>> death/warnings and there are A> at least three vendors who approve >>> of this as well as 3 long term A> committers that approved my change >>> (not including Adrian). >>> >>> Can you show examples of not inviolable KASSERTs? >> >> There are none. They are all assertions for a reason. However, in >> my experience at several large consumers of FreeBSD, no one wants to >> run with INVARIANTS in production. Not because we don't want panics >> (believe me, Yahoo! gets plenty of panics even with INVARIANTS >> disabled), but because the performance overhead, and redefining >> INVARIANTS into printf doesn't address that at all. > > In the past, FYI, the two major INVARIANTS hits were un-inlining of > locking, and UMA using additional global locking to perform > heavier-weight sanity checking. For me, at least, the former wasn't > such a problem, but the latter was extremely measurable. I have > occasionally wondered if we should have another option name for > heavier-duty sanity checking, as is the case with WITNESS, > SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made tolerable > for more real-world installations. As you observe, our invariants > tests are generally things where you catch critical problems in much > more debuggable states, rather than sources of additional fragility, > and it would be great if we could leave more in so that bug reports > were able to contain more information. > > Robert > Yes. The KTR system offers an interesting reference for a model that allows us to make a compile time decision about which areas to trace. There used to be a DIAGNOSTIC option for the more heavy checks, this is either removed or just not used these days. Again, using a mask like KTR might be a win if we bring back the equivalent of heavy weight DIAGNOSTIC option. Often I've been guilty of putting KASSERT(ptr != NULL) checks into the code too. Those are really just to make it less painful when hitting that bug, so instead of having to do a lot of homework to figure out the fault address and line number, I can just get a pretty printed message under INVARIANTS. Maybe those "pretty null checks" need to go under another option, perhaps DIAGNOSTIC, or another .. ??PRETTY_PANIC. Anyhow, I've always been a huge fan of FreeBSD due the additional debugging checks it offered. I was the one that suggested splassert() back in the day when we would continually find issues with spl calls. Additionally I found doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD than under Darwin which at the time did not have such a feature. One of my great joys in developing FreeBSD is the flexibility and power it offers us as developers by giving us a huge library of debugging tools. -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 07:05:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B09ECB22; Sat, 15 Dec 2012 07:05:14 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4F78FC15; Sat, 15 Dec 2012 07:05:14 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:5d89:5f66:6445:4383] (unknown [IPv6:2601:9:4d00:85:5d89:5f66:6445:4383]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id BD8913981E; Fri, 14 Dec 2012 23:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1355555114; bh=OfkUvTb1inY76Yf8Rzr75bjDrQijg+aMe/1RcY1mFYo=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=dbmdvrXhCvY1BNDSWVAYgVwlxri8lwVwLaU4B0RarNpxbWhkSAcwNy80FSdWJK0H5 hP9gqeSXfzsVXyd3AUHrL8bdZ3VKRAJnVnuQ8AxgEmavOzgs88p9jUtb824rlBC9QV ZBA3AxHlOHxRFwwSPae6jACBU0JFupDgvd4AwN/o= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r244105 - in head/sys: kern sys From: Rui Paulo In-Reply-To: <201212121042.51362.jhb@freebsd.org> Date: Fri, 14 Dec 2012 23:05:12 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212110123.qBB1NpOV060501@svn.freebsd.org> <201212121042.51362.jhb@freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 07:05:14 -0000 On 12 Dec 2012, at 07:42, John Baldwin wrote: > On Monday, December 10, 2012 8:23:51 pm Alfred Perlstein wrote: >> Author: alfred >> Date: Tue Dec 11 01:23:50 2012 >> New Revision: 244105 >> URL: http://svnweb.freebsd.org/changeset/base/244105 >>=20 >> Log: >> Switch the hardwired WITNESS panics to kassert_panic. >>=20 >> This is an ongoing effort to provide runtime debug information >> useful in the field that does not panic existing installations. >>=20 >> This gives us the flexibility needed when shipping images to a >> potentially large audience with WITNESS enabled without worrying >> about formerly non-fatal LORs hurting a release. >>=20 >> Sponsored by: iXsystems >=20 > Witness doesn't panic on LORs. These are all bigger violations for = things=20 > like doing sx_sunlock() on a exclusively locked sx lock. That is not = safe and=20 > is merely going to result in data corruption and other unpleasantness. = This=20 > sounds like a very bad idea. Did you talk about this anywhere (I have = not=20 > caught up on various lists yet, so apologies if this has been = discussed.) Eww. This is indeed pretty bad. I would like to see this commit = reverted. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 07:28:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1EDF161; Sat, 15 Dec 2012 07:28:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 631AD8FC14; Sat, 15 Dec 2012 07:28:20 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF7SEJ1024938; Sat, 15 Dec 2012 18:28:14 +1100 Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF7S4lJ030730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 18:28:05 +1100 Date: Sat, 15 Dec 2012 18:28:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r244154 - head/bin/ps In-Reply-To: <20121215011300.GN71906@kib.kiev.ua> Message-ID: <20121215171150.U1295@besplex.bde.org> References: <201212121545.qBCFj4Hl086444@svn.freebsd.org> <20121212210652.GO3013@kib.kiev.ua> <20121213111240.GB1381@garage.freebsd.pl> <201212141152.15567.jhb@freebsd.org> <20121214214246.GB1411@garage.freebsd.pl> <20121215011300.GN71906@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=EvuKNlgA c=1 sm=1 a=WqmuCUZ0mQMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=URALeSCvvZIA:10 a=6I5d2MoRAAAA:8 a=fh21wHrgMG6X0cUbLUoA:9 a=CjuIK1q_8ugA:10 a=cjgbkX1-xgueN3aY:21 a=Y5Lm4oOzTTMIlLbC:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 07:28:22 -0000 On Sat, 15 Dec 2012, Konstantin Belousov wrote: > On Fri, Dec 14, 2012 at 10:42:47PM +0100, Pawel Jakub Dawidek wrote: >> On Fri, Dec 14, 2012 at 11:52:15AM -0500, John Baldwin wrote: >>> On Thursday, December 13, 2012 6:12:44 am Pawel Jakub Dawidek wrote: >>>> On Wed, Dec 12, 2012 at 11:06:52PM +0200, Konstantin Belousov wrote: >>>>> On Wed, Dec 12, 2012 at 03:45:04PM +0000, Pawel Jakub Dawidek wrote: >>>>>> Author: pjd >>>>>> Date: Wed Dec 12 15:45:03 2012 >>>>>> New Revision: 244154 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/244154 >>>>>> >>>>>> Log: >>>>>> Use kern.max_pid sysctl to obtain maximum PID number instead of using local >>>>>> define. >>>>> It is pid_max, not max_pid. >>>>> >>>>> But the change is wrong. The kern.pid_max only limits newly allocated pids, >>>>> it does not magically moves existing pids, which are out of range, to the >>>>> limited region. See the corresponding commit log for the description. >>>>> It was added to make it easier to run FreeBSD 1.x binaries on the modern >>>>> kernels. >>>> >>>> I saw CTLFLAG_TUN on the sysctl and assumed it is read-only... >>>> How about defining BSD_PID_MAX in sys/proc.h, which would be visible by >>>> userland as well and setting PID_MAX to BSD_PID_MAX? >>>> >>>> This would also help bsnmpd. >>>> >>>> http://people.freebsd.org/~pjd/patches/PID_MAX.patch >>> >>> This doesn't help your actual use case though where you want to boot a kernel >>> with a different PID_MAX. I would much rather our tools learn such constants >>> from the kernel via sysctl than have them compiled in. So, I would add a new >>> sysctl which exports the true PID_MAX constant (and is read-only and never >>> changes) and use that in ps, etc. >> >> In that case I'd prefer to make existing kern.pid_max sysctl read-only >> and make it loader tunable. I don't expect there are many users of this >> sysctl... >> > No, I described you the purpose of the sysctl. Requiring reboot just for > running the old binaries is not useful. Please do not break it. ps doesn't make any useful use of either its BSD_PID_MAX or the kernel's PID_MAX anyway. Its only use is to break cases where these BSD_PID_MAX is smaller than the largest active pid. There are some useful uses of a limit: - to "optimize" the parsing function by not supporting pids larger than necessary - for formatting pids. The 99999 limit is useful for restricting the width of pid fields. With a dynamic limit, you need complications for dynamic widths. With a larger fixed limit, you need complications for dyamic widths anyway, since after expanding the pid fields there is no longer enough space for fixed widths in other fields. BTW, someone broke the formatting for ruptime(1) in -current. It now uses a fixed and _far too large_ width for the host name, so that most lines have length precisely 80 and get double-spaced by auto=linefeed on 80-column terminals. "ps l" still uses < 80 columns, with 2 5-digit fields for pids. Wide fields still eat into the field width for the COMMAND field. Interestingly, someone improved the formatting for the UID field -- it now seems to be dynamic and usually takes 3-4 columns, where it used to have the fixed width 5. ps of course doesn't use the limit for these useful uses: % #define BSD_PID_MAX 99999 /* Copy of PID_MAX from sys/proc.h. */ % static int % addelem_pid(struct listinfo *inf, const char *elem) % { % char *endp; % long tempid; % % if (*elem == '\0') { % warnx("Invalid (zero-length) process id"); % optfatal = 1; % return (0); /* Do not add this value. */ % } % % errno = 0; % tempid = strtol(elem, &endp, 10); Here ps assumes that the limit is < LONG_MAX. A reasonable assumption. % if (*endp != '\0' || tempid < 0 || elem == endp) { % warnx("Invalid %s: %s", inf->lname, elem); % errno = ERANGE; % } else if (errno != 0 || tempid > BSD_PID_MAX) { % warnx("%s too large: %s", inf->lname, elem); % errno = ERANGE; % } All ps does with BSD_PID_MAX is to give an up-front error for values that are so large that they can't match any pids. It would be harmless for it to simply accept all representable values and let them not match any actual pid later. Example uses: - ps -p 0,745,756: all 3 pids are accepted - ps -p -1: -1 is rejected because it gives tempid < -1 - ps -p 99999: 99999 is accepted because it is at the limit - ps -p 999999: 999999 is rejected because it is above the limit % if (errno == ERANGE) { % optfatal = 1; % return (0); % } % if (inf->count >= inf->maxcount) % expand_list(inf); % inf->l.pids[(inf->count)++] = tempid; l.pids[N] has type pid_t. We assume that the long tempid is representable as a pid. This is a valid assumption due to our earlier checks. 99999 is smaller than 2**31, so it fits in pid_t because pid_t happens to be int32_t. This would not necessarily be true of the limit were dynamic. The kern.pid_max sysctl actually returns an int. It makes sort of the opposite assumption -- that the max pid (which could reasonably be the max value representable by pid_t) in an int, instead of that the max value that we allow fits in a pid_t. Everything more or less assumes 32 bit ints and pid_t's. Anyway, a better value for BSD_PID_MAX is the maximum value representable by a pid_t. This has little to do with PID_MAX. We should use it just to ensure that tempid is representable in l.pids[]. % return (1); % } % #undef BSD_PID_MAX ps has not-quite-similar checks for UID_MAX and GID_MAX. I happen to have grepped ~100 utilities recently for their uid/gid parsing. I didn't find a single case of fully correct id parsing, but found many variations in the bugs. Their parsing in ps is better than in most places. UID_MAX and GID_MAX are now on the full max's for the types, so using them corresponds to the representability checks that I suggested above. Except UID_MAX and GID_MAX are not documented in any man page, so they shouldn't be assumed to have these values. And since uid_t and gid_t are unsigned types, it is very easy to spell their values portably as ((uid_t)-1) and ((gid_t)-1), respectively, so there is even less need for UID_MAX and GID_MAX than for PID_MAX. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 07:50:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16B4C626; Sat, 15 Dec 2012 07:50:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id B5DB28FC0A; Sat, 15 Dec 2012 07:50:53 +0000 (UTC) Received: from JRE-MBP-2.local (ppp121-45-232-233.lns20.per1.internode.on.net [121.45.232.233]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id qBF7omXh007186 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 14 Dec 2012 23:50:50 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <50CC2BD2.9010601@freebsd.org> Date: Sat, 15 Dec 2012 15:50:42 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <50C9072A.6040605@FreeBSD.org> In-Reply-To: <50C9072A.6040605@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 07:50:54 -0000 On 12/13/12 6:37 AM, Andriy Gapon wrote: > on 12/12/2012 19:06 Adrian Chadd said the following: >> kassert()s are already optional. Ie, you can choose to not compile them in. >> >> So the __dead2() code path bit for doing KASSERT() -> kassert_panic() >> at compile time isn't a problem. >> >> The problem is where you do panic() -> kassert_panic() (eg in the >> Witness code) which is what Alfred discovered shortly after doing up >> his initial patch. >> >> Anything which is a KASSERT() can and should be treated as a run-time >> warning just as much as a run-time "crash here so I can figure out >> what broke." Having the warning in a production box is going to be >> helpful for developers. > I have a quite different view on purpose and costs of KASSERTs. > Specifically referring to r243980 I do not think that "non-fatal asserts" should > really exist (or do exist). I wish all this muddying of KASSERT meaning > would get reverted. > > These quite sensitive changes were rushed in, IMO. having worked in a place where asserts were by default NON fatal, I can say that it is a REALLY BAD IDEA. it never did anything but cost us time and effort.. one reason it was there was the lack of a debugger in Linux at the time but all ports had top pay the price... (new linux does have one at last) > > >> On 12 December 2012 07:46, John Baldwin wrote: >>> On Tuesday, December 11, 2012 2:08:14 am Alfred Perlstein wrote: >>>> Author: alfred >>>> Date: Tue Dec 11 07:08:14 2012 >>>> New Revision: 244112 >>>> URL: http://svnweb.freebsd.org/changeset/base/244112 >>>> >>>> Log: >>>> Cleanup more of the kassert_panic. >>>> >>>> fix compile warnings on !amd64 and NULL derefs that would happen >>>> if kassert_panic() would return. >>> This is one reason why having kassert not panic is such a bad idea. There are >>> tons of places where the compiler knows that panic() is __dead2, and there is >>> no cleanup code to handle what happens when an invariant is violated. This is >>> not safe to run in the field unless your customers do not care about their >>> data. If you are interested in doing regression tests, I am using a very >>> different approach for some locking regression tests I am working on in p4 >>> that allow you to use a wrapper around setjmp/longjmp to "catch" panics >>> somewhat like exception handling in C++/Java (though much cruder). However, >>> evne that is only intended for testing, not for production cases where >>> production data is at stake. >>> >>> -- >>> John Baldwin > From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 08:29:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B86FEE4; Sat, 15 Dec 2012 08:29:23 +0000 (UTC) (envelope-from glebius@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 4C4528FC12; Sat, 15 Dec 2012 08:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF8TNmu005633; Sat, 15 Dec 2012 08:29:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF8TNbs005632; Sat, 15 Dec 2012 08:29:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212150829.qBF8TNbs005632@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 15 Dec 2012 08:29: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: r244242 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 08:29:23 -0000 Author: glebius Date: Sat Dec 15 08:29:22 2012 New Revision: 244242 URL: http://svnweb.freebsd.org/changeset/base/244242 Log: Merge from head r244157: Fix a crash in tcp_input(), that happens when mbuf has a fwd_tag on it, but later after processing and freeing the tag, we need to jump back again to the findpcb label. Since the fwd_tag pointer wasn't NULL we tried to process and free the tag for second time. Reported & tested by: Pawel Tyll Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sat Dec 15 07:11:16 2012 (r244241) +++ stable/9/sys/netinet/tcp_input.c Sat Dec 15 08:29:22 2012 (r244242) @@ -822,6 +822,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, @@ -859,6 +860,7 @@ findpcb: /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; + fwd_tag = NULL; } else inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 08:53:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 145C73AA; Sat, 15 Dec 2012 08:53:59 +0000 (UTC) (envelope-from trasz@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 ED3D68FC13; Sat, 15 Dec 2012 08:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF8rwtG011024; Sat, 15 Dec 2012 08:53:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF8rwQa011023; Sat, 15 Dec 2012 08:53:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201212150853.qBF8rwQa011023@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 15 Dec 2012 08:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244243 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 08:53:59 -0000 Author: trasz Date: Sat Dec 15 08:53:58 2012 New Revision: 244243 URL: http://svnweb.freebsd.org/changeset/base/244243 Log: Fix extending filesystems of weird size by making sure the actual size is always multiple of fragment size. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sat Dec 15 08:29:22 2012 (r244242) +++ head/sbin/growfs/growfs.c Sat Dec 15 08:53:58 2012 (r244243) @@ -1487,6 +1487,12 @@ main(int argc, char **argv) } } + /* + * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend + * only supports fragment-aligned IO requests. + */ + size -= size % osblock.fs_fsize; + if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) { humanize_number(oldsizebuf, sizeof(oldsizebuf), osblock.fs_size * osblock.fs_fsize, From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 09:50:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9EE029C; Sat, 15 Dec 2012 09:50:32 +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 6B1A58FC1A; Sat, 15 Dec 2012 09:50:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBF9oWMe025247; Sat, 15 Dec 2012 09:50:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBF9oW9q025246; Sat, 15 Dec 2012 09:50:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212150950.qBF9oW9q025246@svn.freebsd.org> From: Martin Matuska Date: Sat, 15 Dec 2012 09:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244245 - vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 09:50:32 -0000 Author: mm Date: Sat Dec 15 09:50:31 2012 New Revision: 244245 URL: http://svnweb.freebsd.org/changeset/base/244245 Log: Push vendor/illumos/dist to illumos-gate 13894:f4af77f6bbd2 (illumos zfs issues #3397 #3398) Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Sat Dec 15 09:24:17 2012 (r244244) +++ vendor/illumos/dist/cmd/zdb/zdb.c Sat Dec 15 09:50:31 2012 (r244245) @@ -62,14 +62,16 @@ #undef verify #include -#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ - zio_compress_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ - zio_checksum_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ - dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") -#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) +#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ + zio_compress_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ + zio_checksum_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") +#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : \ + (((idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA) ? \ + DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint extern int zfs_recover; @@ -3271,7 +3273,13 @@ main(int argc, char **argv) argv[i], strerror(errno)); } } - (os != NULL) ? dump_dir(os) : dump_zpool(spa); + if (os != NULL) { + dump_dir(os); + } else if (zopt_objects > 0 && !dump_opt['m']) { + dump_dir(spa->spa_meta_objset); + } else { + dump_zpool(spa); + } } else { flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR; flagbits['c'] = ZDB_FLAG_CHECKSUM; From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 10:02:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4752A521; Sat, 15 Dec 2012 10:02: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 123338FC0C; Sat, 15 Dec 2012 10:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFA2Bhb028179; Sat, 15 Dec 2012 10:02:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFA2BUr028178; Sat, 15 Dec 2012 10:02:11 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201212151002.qBFA2BUr028178@svn.freebsd.org> From: Martin Matuska Date: Sat, 15 Dec 2012 10:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244246 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:02:12 -0000 Author: mm Date: Sat Dec 15 10:02:11 2012 New Revision: 244246 URL: http://svnweb.freebsd.org/changeset/base/244246 Log: MFV r244245: Merge two zdb bugfixes from vendor (illumos) illumos-gate 13894:f4af77f6bbd2 3397 zdb output is too verbose 3398 zdb can't dump feature flags zap objects References: https://www.illumos.org/issues/3397 https://www.illumos.org/issues/3398 MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Dec 15 09:50:31 2012 (r244245) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Dec 15 10:02:11 2012 (r244246) @@ -61,14 +61,16 @@ #undef verify #include -#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ - zio_compress_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ - zio_checksum_table[(idx)].ci_name : "UNKNOWN") -#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ - dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ - dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") -#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) +#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ + zio_compress_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ + zio_checksum_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ + dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ? \ + dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN") +#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : \ + (((idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA) ? \ + DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES)) #ifndef lint extern int zfs_recover; @@ -3194,7 +3196,13 @@ main(int argc, char **argv) argv[i], strerror(errno)); } } - (os != NULL) ? dump_dir(os) : dump_zpool(spa); + if (os != NULL) { + dump_dir(os); + } else if (zopt_objects > 0 && !dump_opt['m']) { + dump_dir(spa->spa_meta_objset); + } else { + dump_zpool(spa); + } } else { flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR; flagbits['c'] = ZDB_FLAG_CHECKSUM; From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 10:27:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0B87A29; Sat, 15 Dec 2012 10:27:07 +0000 (UTC) (envelope-from hselasky@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 D3E448FC12; Sat, 15 Dec 2012 10:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFAR7EY034361; Sat, 15 Dec 2012 10:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFAR75k034360; Sat, 15 Dec 2012 10:27:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212151027.qBFAR75k034360@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Dec 2012 10:27:07 +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: r244247 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:27:08 -0000 Author: hselasky Date: Sat Dec 15 10:27:07 2012 New Revision: 244247 URL: http://svnweb.freebsd.org/changeset/base/244247 Log: MFC r244027: Add support for various Yamaha keyboards. MFC after: 1 week PR: usb/174254 Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:02:11 2012 (r244246) +++ stable/9/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:27:07 2012 (r244247) @@ -641,6 +641,115 @@ static driver_t uaudio_driver = { .size = sizeof(struct uaudio_softc), }; +/* The following table is derived from Linux's quirks-table.h */ +static const STRUCT_USB_HOST_ID uaudio_vendor_midi[] = { + { USB_VPI(USB_VENDOR_YAMAHA, 0x1000, 0) }, /* UX256 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1001, 0) }, /* MU1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1002, 0) }, /* MU2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1003, 0) }, /* MU500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1004, 3) }, /* UW500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1005, 0) }, /* MOTIF6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1006, 0) }, /* MOTIF7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1007, 0) }, /* MOTIF8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1008, 0) }, /* UX96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1009, 0) }, /* UX16 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100a, 3) }, /* EOS BX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100c, 0) }, /* UC-MX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100d, 0) }, /* UC-KX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100e, 0) }, /* S08 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100f, 0) }, /* CLP-150 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1010, 0) }, /* CLP-170 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1011, 0) }, /* P-250 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1012, 0) }, /* TYROS */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1013, 0) }, /* PF-500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1014, 0) }, /* S90 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1015, 0) }, /* MOTIF-R */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1016, 0) }, /* MDP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1017, 0) }, /* CVP-204 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1018, 0) }, /* CVP-206 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1019, 0) }, /* CVP-208 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101a, 0) }, /* CVP-210 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101b, 0) }, /* PSR-1100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101c, 0) }, /* PSR-2100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101d, 0) }, /* CLP-175 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101e, 0) }, /* PSR-K1 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101f, 0) }, /* EZ-J24 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1020, 0) }, /* EZ-250i */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1021, 0) }, /* MOTIF ES 6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1022, 0) }, /* MOTIF ES 7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1023, 0) }, /* MOTIF ES 8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1024, 0) }, /* CVP-301 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1025, 0) }, /* CVP-303 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1026, 0) }, /* CVP-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1027, 0) }, /* CVP-307 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1028, 0) }, /* CVP-309 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1029, 0) }, /* CVP-309GP */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102a, 0) }, /* PSR-1500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102b, 0) }, /* PSR-3000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102e, 0) }, /* ELS-01/01C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1030, 0) }, /* PSR-295/293 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1031, 0) }, /* DGX-205/203 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1032, 0) }, /* DGX-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1033, 0) }, /* DGX-505 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1034, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1035, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1036, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1037, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1038, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1039, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1040, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1041, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1042, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1043, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1044, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1045, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1050, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1051, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1052, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1053, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1054, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1055, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1056, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1057, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1058, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1059, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1503, 3) }, /* MOX6/MOX8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2000, 0) }, /* DGP-7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2001, 0) }, /* DGP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2002, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2003, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5000, 0) }, /* CS1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5001, 0) }, /* DSP1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5002, 0) }, /* DME32 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5003, 0) }, /* DM2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5004, 0) }, /* 02R96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5005, 0) }, /* ACU16-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5006, 0) }, /* NHB32-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5007, 0) }, /* DM1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5008, 0) }, /* 01V96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5009, 0) }, /* SPX2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500a, 0) }, /* PM5D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500b, 0) }, /* DME64N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500c, 0) }, /* DME24N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7000, 0) }, /* DTX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7010, 0) }, /* UB99 */ +}; + static const STRUCT_USB_HOST_ID __used uaudio_devs[] = { /* Generic USB audio class match */ {USB_IFACE_CLASS(UICLASS_AUDIO), @@ -658,7 +767,12 @@ uaudio_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - /* lookup non-standard device */ + /* lookup non-standard device(s) */ + + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + return (BUS_PROBE_SPECIFIC); + } if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { if (uaa->info.bInterfaceClass != UICLASS_VENDOR || @@ -763,6 +877,16 @@ uaudio_attach(device_t dev) device_printf(dev, "No recording.\n"); } + if (sc->sc_midi_chan.valid == 0) { + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + sc->sc_midi_chan.iface_index = + (uint8_t)uaa->driver_info; + sc->sc_midi_chan.iface_alt_index = 0; + sc->sc_midi_chan.valid = 1; + } + } + if (sc->sc_midi_chan.valid) { if (umidi_probe(dev)) { From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 10:30:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54F66BAC; Sat, 15 Dec 2012 10:30:07 +0000 (UTC) (envelope-from hselasky@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 37EE18FC12; Sat, 15 Dec 2012 10:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFAU7Ak035144; Sat, 15 Dec 2012 10:30:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFAU7SB035143; Sat, 15 Dec 2012 10:30:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212151030.qBFAU7SB035143@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Dec 2012 10:30:07 +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: r244248 - stable/8/sys/dev/sound/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:30:07 -0000 Author: hselasky Date: Sat Dec 15 10:30:06 2012 New Revision: 244248 URL: http://svnweb.freebsd.org/changeset/base/244248 Log: MFC r244027: Add support for various Yamaha keyboards. MFC after: 1 week PR: usb/174254 Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/usb/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:27:07 2012 (r244247) +++ stable/8/sys/dev/sound/usb/uaudio.c Sat Dec 15 10:30:06 2012 (r244248) @@ -641,6 +641,115 @@ static driver_t uaudio_driver = { .size = sizeof(struct uaudio_softc), }; +/* The following table is derived from Linux's quirks-table.h */ +static const STRUCT_USB_HOST_ID uaudio_vendor_midi[] = { + { USB_VPI(USB_VENDOR_YAMAHA, 0x1000, 0) }, /* UX256 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1001, 0) }, /* MU1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1002, 0) }, /* MU2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1003, 0) }, /* MU500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1004, 3) }, /* UW500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1005, 0) }, /* MOTIF6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1006, 0) }, /* MOTIF7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1007, 0) }, /* MOTIF8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1008, 0) }, /* UX96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1009, 0) }, /* UX16 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100a, 3) }, /* EOS BX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100c, 0) }, /* UC-MX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100d, 0) }, /* UC-KX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100e, 0) }, /* S08 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x100f, 0) }, /* CLP-150 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1010, 0) }, /* CLP-170 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1011, 0) }, /* P-250 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1012, 0) }, /* TYROS */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1013, 0) }, /* PF-500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1014, 0) }, /* S90 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1015, 0) }, /* MOTIF-R */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1016, 0) }, /* MDP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1017, 0) }, /* CVP-204 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1018, 0) }, /* CVP-206 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1019, 0) }, /* CVP-208 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101a, 0) }, /* CVP-210 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101b, 0) }, /* PSR-1100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101c, 0) }, /* PSR-2100 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101d, 0) }, /* CLP-175 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101e, 0) }, /* PSR-K1 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x101f, 0) }, /* EZ-J24 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1020, 0) }, /* EZ-250i */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1021, 0) }, /* MOTIF ES 6 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1022, 0) }, /* MOTIF ES 7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1023, 0) }, /* MOTIF ES 8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1024, 0) }, /* CVP-301 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1025, 0) }, /* CVP-303 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1026, 0) }, /* CVP-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1027, 0) }, /* CVP-307 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1028, 0) }, /* CVP-309 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1029, 0) }, /* CVP-309GP */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102a, 0) }, /* PSR-1500 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102b, 0) }, /* PSR-3000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x102e, 0) }, /* ELS-01/01C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1030, 0) }, /* PSR-295/293 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1031, 0) }, /* DGX-205/203 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1032, 0) }, /* DGX-305 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1033, 0) }, /* DGX-505 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1034, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1035, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1036, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1037, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1038, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1039, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x103f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1040, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1041, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1042, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1043, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1044, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1045, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x104f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1050, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1051, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1052, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1053, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1054, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1055, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1056, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1057, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1058, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1059, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105a, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105b, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105c, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x105d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x1503, 3) }, /* MOX6/MOX8 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2000, 0) }, /* DGP-7 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2001, 0) }, /* DGP-5 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2002, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x2003, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5000, 0) }, /* CS1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5001, 0) }, /* DSP1D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5002, 0) }, /* DME32 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5003, 0) }, /* DM2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5004, 0) }, /* 02R96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5005, 0) }, /* ACU16-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5006, 0) }, /* NHB32-C */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5007, 0) }, /* DM1000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5008, 0) }, /* 01V96 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x5009, 0) }, /* SPX2000 */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500a, 0) }, /* PM5D */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500b, 0) }, /* DME64N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500c, 0) }, /* DME24N */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500d, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500e, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x500f, 0) }, /* NULL */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7000, 0) }, /* DTX */ + { USB_VPI(USB_VENDOR_YAMAHA, 0x7010, 0) }, /* UB99 */ +}; + static const STRUCT_USB_HOST_ID __used uaudio_devs[] = { /* Generic USB audio class match */ {USB_IFACE_CLASS(UICLASS_AUDIO), @@ -658,7 +767,12 @@ uaudio_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - /* lookup non-standard device */ + /* lookup non-standard device(s) */ + + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + return (BUS_PROBE_SPECIFIC); + } if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { if (uaa->info.bInterfaceClass != UICLASS_VENDOR || @@ -763,6 +877,16 @@ uaudio_attach(device_t dev) device_printf(dev, "No recording.\n"); } + if (sc->sc_midi_chan.valid == 0) { + if (usbd_lookup_id_by_uaa(uaudio_vendor_midi, + sizeof(uaudio_vendor_midi), uaa) == 0) { + sc->sc_midi_chan.iface_index = + (uint8_t)uaa->driver_info; + sc->sc_midi_chan.iface_alt_index = 0; + sc->sc_midi_chan.valid = 1; + } + } + if (sc->sc_midi_chan.valid) { if (umidi_probe(dev)) { From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 10:56:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7735D585; Sat, 15 Dec 2012 10:56:17 +0000 (UTC) (envelope-from hselasky@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 4143E8FC0A; Sat, 15 Dec 2012 10:56:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFAuHOa042515; Sat, 15 Dec 2012 10:56:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFAuHsi042514; Sat, 15 Dec 2012 10:56:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201212151056.qBFAuHsi042514@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 15 Dec 2012 10:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244252 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:56:17 -0000 Author: hselasky Date: Sat Dec 15 10:56:16 2012 New Revision: 244252 URL: http://svnweb.freebsd.org/changeset/base/244252 Log: Regenerate usb.conf MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Sat Dec 15 10:48:10 2012 (r244251) +++ head/etc/devd/usb.conf Sat Dec 15 10:56:16 2012 (r244252) @@ -423,6 +423,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0499"; + match "product" "(0x1000|0x1001|0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012|0x1013|0x1014|0x1015|0x1016|0x1017|0x1018|0x1019|0x101a|0x101b|0x101c|0x101d|0x101e|0x101f|0x1020|0x1021|0x1022|0x1023|0x1024|0x1025|0x1026|0x1027|0x1028|0x1029|0x102a|0x102b|0x102e|0x1030|0x1031|0x1032|0x1033|0x1034|0x1035|0x1036|0x1037|0x1038|0x1039|0x103a|0x103b|0x103c|0x103d|0x103e|0x103f|0x1040|0x1041|0x1042|0x1043|0x1044|0x1045|0x104e|0x104f|0x1050|0x1051|0x1052|0x1053|0x1054|0x1055|0x1056|0x1057|0x1058|0x1059|0x105a|0x105b|0x105c|0x105d|0x1503|0x2000|0x2001|0x2002|0x2003|0x5000|0x5001|0x5002|0x5003|0x5004|0x5005|0x5006|0x5007|0x5008|0x5009|0x500a|0x500b|0x500c|0x500d|0x500e|0x500f|0x7000|0x7010)"; + action "kldload -n snd_uaudio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x049f"; match "product" "(0x0003|0x0032)"; action "kldload -n uipaq"; @@ -2647,6 +2655,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "0x68aa"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x0f4e"; match "product" "0x0200"; action "kldload -n uipaq"; @@ -4199,6 +4215,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x22de"; + match "product" "0x6801"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x2478"; match "product" "0x2008"; action "kldload -n uplcom"; @@ -4611,5 +4635,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2279 USB entries processed +# 2386 USB entries processed From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 10:56:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5568B6DD; Sat, 15 Dec 2012 10:56:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id CA3CD8FC12; Sat, 15 Dec 2012 10:56:28 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBFAuOux003282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 21:56:25 +1100 Date: Sat, 15 Dec 2012 21:56:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Carl Delsey Subject: Re: svn commit: r244193 - head/sys/x86/include In-Reply-To: <50CBAD0E.5050907@intel.com> Message-ID: <20121215212259.F2058@besplex.bde.org> References: <201212132140.qBDLeBhd019751@svn.freebsd.org> <20121214154930.D973@besplex.bde.org> <50CBAD0E.5050907@intel.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=L9pF2Jv8 c=1 sm=1 a=L6I1Zbe1xPYA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=RQfEP2Kgk-UA:10 a=GAnm5n-mn4thhljHDL0A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 10:56:29 -0000 On Fri, 14 Dec 2012, Carl Delsey wrote: > On 12/13/12 21:49, Bruce Evans wrote: >> On Thu, 13 Dec 2012, Jim Harris wrote: >> >>> Log: >>> Add bus_space_read_8 and bus_space_write_8 for amd64. >>> >>> Rather than trying to KASSERT for callers that invoke this on >>> IO tags, either do nothing (for write_8) or return ~0 (for read_8). >> >> read_8 returns a uint64_t, so it cannot return the signed integer ~0. >> It actually returns this signed integer converted to uint64_t. On >> amd64, this is the 32 bit value 0xffffffff. The 64-bit value >> 0xffffffffffffffff should be returned. > I double checked and 0xffffffffffffffff is being returned when compiled by > both clang and gcc. Oops. ~0 is (int)-1 (assuming 2's complement. This gets converted to (uint64_t)-1 = 0xfff...fffUL. I still prefer the explicit hex constant. Higher-level bus.h APIs and clients mostly use ~0ul (with that spelling) for this. This is the documented spelling in bus_alloc_resource(9). It is shorter and more portable than 0xfff...fffUL where the number of f's is MD. The ul in it avoids the sign extension problems that I was worried about here. ~0 is unportable (depends on 2's complement). ~0u is portable but even harder to use than ~0 in practice. It is what gives the 32-bit value unless it is actually ~0ul. I wonder how these ~0ul's work for PAE -- on i386, they only give 32-bit values, but bus addresses are 64 bits for PAE. I guess they just don't work for PAE. Nothing at all in the MI sys/bus.h supports PAE's 64-bit bus addresses, since sys/bus.h uses u_long for almost everything (int never uses [u]int64_t, [u]_quad_t or [unsigned] long long). >>> Modified: head/sys/x86/include/bus.h >>> ============================================================================== >>> --- head/sys/x86/include/bus.h Thu Dec 13 21:39:59 2012 (r244192) >>> +++ head/sys/x86/include/bus.h Thu Dec 13 21:40:11 2012 (r244193) >>> @@ -130,6 +130,7 @@ >>> #define BUS_SPACE_MAXADDR 0xFFFFFFFF >>> #endif >> >> This file spells the F in hex constants in upper case. >> >> In the above definition and in previous ones, it is careful to spell out >> the constants and not depend on sign extension. So it is also a style >> bug to use ~0. > Are you saying it is a style bug to not match the style used above, > regardless of whether that style is right or wrong, or are you saying (~0) > is always a style bug? You might as well match the above style. ~0 is at worst a style bug, not a wrong value like I said. It is harder to use since its correctness depends on the arch being 2's complement, and understanding its correctness depends on knowing C's promotion rules and not forgetting them like I did. I also don't mind using (~0ul) for most of the values, to be consistent with the MI spelling. This might reduce ifdefs. But there is only 1 ifdef for a 64-bit value now, and 1 would still be needed for the PAE case if 64 bits actually work for PAE. >> Style bug visible in the above: space instead of tab after #define. This >> style bugs is in all #define's near here, including the new one. >> >> Type error in #define's just before the above: the above BUS_SPACE_MAXADDR >> is for 32 bits. For amd64 and i386-PAE, BUS_SPACE_MAXADDR is of course >> 64 bits, but the ifdef tangle for it is not tangled enough to be correct: >> BUS_SPACE_MAXADDR is 0xFFFFFFFFFFFFFFFFULL, on both, but bus_addr_t is only >> unsigned long long on i386-PAE. > I think this should be a separate patch though, since it is unrelated to this > change. Fine. >>> +#ifdef __amd64__ >>> +static __inline uint64_t bus_space_read_8(bus_space_tag_t tag, >>> + bus_space_handle_t handle, >>> + bus_size_t offset); >>> +#endif >>> + >> >> This is style-bug for bug compatible with the existing forward >> declarations. Forward declarations of inline functions are nonsense. >> They are from NetBSD, for K&R support. But FreeBSD never supported >> K&R in bus-space headers, and the forward declarations never even >> compiled with K&R, since they never used __P(()). Almost 1/3 of the >> x86 bus.h consists of these negatively useful forward declarations. >> Some of them are almost as large as the full functions, since they are >> misformatted worse, with parameters starting at about column 40 instead >> of about column 20, so so that many lines are needed just for the >> parameters (to line them up in perfectly non-KNF gnu style). > Same with this - separate patch Fine. >>> -#if 0 /* Cause a link error for bus_space_read_8 */ >>> -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 >>> unimplemented !!! >>> +#ifdef __amd64__ >>> +static __inline uint64_t >>> +bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle, >>> + bus_size_t offset) >>> +{ >>> + >>> + if (tag == X86_BUS_SPACE_IO) /* No 8 byte IO space access on x86 */ >> >> The comment is not indented, and should probably not be placed to the >> right of the code. This file mostly doesn't place comments there, and >> when it does it doesn't capitalize them. One that does also spells IO >> as i/o. > All the #if 0 lines also start with an end of line comment, and they are all > capitalized. By "not indented" are you saying that all end of line comments > must be preceded by a tab? #if 0 lines tend to be sloppier. I would put the comments for them on separate lines. End of line comments should be preceded by enough tabs to reach the normal indentation level for such comments. This is 32 or 40 columns (indent -ci 33 or -ci 41). Verbose code may need more. Then it is impossible to use the normal indentation level. I use 2 spaces then, but prefer to avoid such code and comments to the right of any code (within functions). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 06:04:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 561AC25A; Sat, 15 Dec 2012 06:04:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id C3A708FC17; Sat, 15 Dec 2012 06:04:29 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qBF64HxN017455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Dec 2012 17:04:19 +1100 Date: Sat, 15 Dec 2012 17:04:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern In-Reply-To: <50CBC285.7060307@mu.org> Message-ID: <20121215161414.V1029@besplex.bde.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=BrrFWvr5 c=1 sm=1 a=9gktFwppygsA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=mT7c94_YR1GvEF4OrkYA:9 a=CjuIK1q_8ugA:10 a=ggKEkdPFzXdPy3Qo:21 a=9UpuXnAP4qImuvuz:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 X-Mailman-Approved-At: Sat, 15 Dec 2012 12:32:05 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Robert Watson , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 06:04:31 -0000 On Fri, 14 Dec 2012, Alfred Perlstein wrote: > On 12/14/12 4:12 PM, Robert Watson wrote: >> On Fri, 14 Dec 2012, John Baldwin wrote: >> >>> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The >>>> problem again is that not all the KASSERTS are inviolable, if you A> want >>>> to do a project to split them, then please do, it would really be A> >>>> helpful, as for now, they are a mis-mash of death/warnings and there are >>>> A> at least three vendors who approve of this as well as 3 long term A> >>>> committers that approved my change (not including Adrian). >>>> >>>> Can you show examples of not inviolable KASSERTs? >>> >>> There are none. They are all assertions for a reason. However, in my Not even one whose existence is a bug? :-) >>> experience at several large consumers of FreeBSD, no one wants to run with >>> INVARIANTS in production. Not because we don't want panics (believe me, >>> Yahoo! gets plenty of panics even with INVARIANTS disabled), but because >>> the performance overhead, and redefining INVARIANTS into printf doesn't >>> address that at all. I mostly don't use INVARIANTS, but once used Debugger() a lot. Now I only want to debug my own code and sometimes turn on INVARIANTS to try to do this, but it usually exposes more bugs not in my own code so I turn it off again :-). >> In the past, FYI, the two major INVARIANTS hits were un-inlining of >> locking, and UMA using additional global locking to perform heavier-weight >> sanity checking. For me, at least, the former wasn't such a problem, but >> the latter was extremely measurable. I have occasionally wondered if we >> should have another option name for heavier-duty sanity checking, as is the >> case with WITNESS, SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be >> made tolerable for more real-world installations. As you observe, our >> invariants tests are generally things where you catch critical problems in >> much more debuggable states, rather than sources of additional fragility, >> and it would be great if we could leave more in so that bug reports were >> able to contain more information. I think that KASSERT() is used too much: - the heavyweight uses that you mention - many lightweight unconditional panics in old code were turned into conditional panics using KASSERT(). So production code that turns off INVARIANTS no longer gets the benefit of the sanity checking for these. - newer code tends to use KASSERT() even for things that could reasonably be lightweight unconditional panics. So production code that turns off INVARIANTS never got the benefit of the sanity checking for these. - not many unconditional panics (with non-lightweight checking for them) can't be left in production code, so there were a limited number of them, with a few pushed under DIAGNOSTIC. In particular, ones for debugging didn't grow unboundedly. Now, KASSERT()s grow unboundedly and the cost of enabling INVARIANTS grows unboundedly. - the source code becomes unreadable, with half of it tending to consist ot misformatted KASSERT()s SHOUTING IN UPPER CASE. The latter bug is missing in assert(3). assert(3) has a better designed API in other respects too. For example it supplies the bloat for __func__, __FILE__ and __LINE__ whether you want this or not. This bloat was intentionally left out for KASSERT(). But many uses of KASSERT() supply this bloat in the caller, where it also bloat the source code. > The KTR system offers an interesting reference for a model that allows us to > make a compile time decision about which areas to trace. > > There used to be a DIAGNOSTIC option for the more heavy checks, this is > either removed or just not used these days. Again, using a mask like KTR > might be a win if we bring back the equivalent of heavy weight DIAGNOSTIC > option. DIGANOSTIC still exists. It is rarely used, and tends to be only used for heavyweight checks that are too buggy or too heavyweight or just too old to put in KASSERT(). > Often I've been guilty of putting KASSERT(ptr != NULL) checks into the code > too. Those are really just to make it less painful when hitting that bug, You mean to make it _more_ painful when hitting that bug. > so > instead of having to do a lot of homework to figure out the fault address and > line number, I can just get a pretty printed message under INVARIANTS. Maybe > those "pretty null checks" need to go under another option, perhaps > DIAGNOSTIC, or another .. ??PRETTY_PANIC. Null pointer panics give restartable page faults, with the fault address printed by trap_fatal() and the page fault often easy to restart using a debugger. trap_fatal() calls the debugger, so the page fault isn't completely transparent. This corresponds to gdb in userland stopping on the signal for the page fault. You might have to use "handle SIGFOO Stop/Print/Pass" to get back to the faulting instruction. In the kernel, continuing from trap_fatal() gives this behaviour. The page fault will repeat endlessly unless you fix it up. You can try various fixes until you find one that doesn't fault, or let it fault a few times to look at the context in different ways. If panic() is used for null pointers, then you get an unrestartable panic(), with the relevant context several frames back where it is hard to see and much more difficult to restart from (practically impossible now that panic() stops CPUs, etc., though it used to be possible to unwind the frame in some cases). The null pointer check doesn't even detect the common case where the pointer is &p->bar where p is null. Now the bad pointer is a small offset from a null pointer (normally at a small address). It would take an earlier check of p to detect this. > Anyhow, I've always been a huge fan of FreeBSD due the additional debugging > checks it offered. I was the one that suggested splassert() back in the day > when we would continually find issues with spl calls. Additionally I found SPLASSERT() was almost never used. The only uses that I can find of it are all in netipsec. > doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD than > under Darwin which at the time did not have such a feature. This was more useful I think :-). The main reason that SPLASSERT() was useless was because spl was a stable API that went away at about the same time that SPLASSERT() was added (SPLASSERT() was implemented about 6 months before SMPng killed spl). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 12:35:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 200593AD; Sat, 15 Dec 2012 12:35:27 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id E10288FC15; Sat, 15 Dec 2012 12:35:26 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 3C6681A3C1D; Sat, 15 Dec 2012 04:35:26 -0800 (PST) Message-ID: <50CC6E8D.6040707@mu.org> Date: Sat, 15 Dec 2012 04:35:25 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> In-Reply-To: <20121215161414.V1029@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 15 Dec 2012 12:44:37 +0000 Cc: Adrian Chadd , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Gleb Smirnoff , Robert Watson , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 12:35:27 -0000 On 12/14/12 10:04 PM, Bruce Evans wrote: > On Fri, 14 Dec 2012, Alfred Perlstein wrote: > >> On 12/14/12 4:12 PM, Robert Watson wrote: >>> On Fri, 14 Dec 2012, John Baldwin wrote: >>> >>>> On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote: >>>>> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >>>>> A> The problem again is that not all the KASSERTS are inviolable, >>>>> if you A> want to do a project to split them, then please do, it >>>>> would really be A> helpful, as for now, they are a mis-mash of >>>>> death/warnings and there are A> at least three vendors who approve >>>>> of this as well as 3 long term A> committers that approved my >>>>> change (not including Adrian). >>>>> >>>>> Can you show examples of not inviolable KASSERTs? >>>> >>>> There are none. They are all assertions for a reason. However, in my > > Not even one whose existence is a bug? :-) This is my point exactly, and exactly what I've been experiencing. People keep beating this drum "all invariants/panics are there for a reason", no, some happen to be bugs, and when I'm shipping code to a customer, I may need to skip one of these buggy assertions. Some people have responded to this by saying "alfred show me the buggy assertions" to which my response is two fold "firstly, you're calling me a liar which I do not appreciate, second prove to me that all the 1000s of asserts have zero bugs and are not overly zealous about calling panic." >>>> experience at several large consumers of FreeBSD, no one wants to >>>> run with INVARIANTS in production. Not because we don't want >>>> panics (believe me, Yahoo! gets plenty of panics even with >>>> INVARIANTS disabled), but because the performance overhead, and >>>> redefining INVARIANTS into printf doesn't address that at all. > > I mostly don't use INVARIANTS, but once used Debugger() a lot. Now I > only want to debug my own code and sometimes turn on INVARIANTS to try > to do this, but it usually exposes more bugs not in my own code so I > turn it off again :-). *yup* > >>> In the past, FYI, the two major INVARIANTS hits were un-inlining of >>> locking, and UMA using additional global locking to perform >>> heavier-weight sanity checking. For me, at least, the former wasn't >>> such a problem, but the latter was extremely measurable. I have >>> occasionally wondered if we should have another option name for >>> heavier-duty sanity checking, as is the case with WITNESS, >>> SOCKBUF_DEBUG, etc, so that INVARIANTS overhead can be made >>> tolerable for more real-world installations. As you observe, our >>> invariants tests are generally things where you catch critical >>> problems in much more debuggable states, rather than sources of >>> additional fragility, and it would be great if we could leave more >>> in so that bug reports were able to contain more information. > > I think that KASSERT() is used too much: > - the heavyweight uses that you mention > - many lightweight unconditional panics in old code were turned into > conditional panics using KASSERT(). So production code that turns off > INVARIANTS no longer gets the benefit of the sanity checking for these. > - newer code tends to use KASSERT() even for things that could reasonably > be lightweight unconditional panics. So production code that turns off > INVARIANTS never got the benefit of the sanity checking for these. > - not many unconditional panics (with non-lightweight checking for them) > can't be left in production code, so there were a limited number of > them, > with a few pushed under DIAGNOSTIC. In particular, ones for debugging > didn't grow unboundedly. Now, KASSERT()s grow unboundedly and the > cost of enabling INVARIANTS grows unboundedly. > - the source code becomes unreadable, with half of it tending to consist > ot misformatted KASSERT()s SHOUTING IN UPPER CASE. The latter bug is > missing in assert(3). assert(3) has a better designed API in other > respects too. For example it supplies the bloat for __func__, __FILE__ > and __LINE__ whether you want this or not. This bloat was > intentionally > left out for KASSERT(). But many uses of KASSERT() supply this bloat > in the caller, where it also bloat the source code. BUT I LIKE TO PANIC IN UPPER CASE BRUCE. > >> The KTR system offers an interesting reference for a model that >> allows us to make a compile time decision about which areas to trace. >> >> There used to be a DIAGNOSTIC option for the more heavy checks, this >> is either removed or just not used these days. Again, using a mask >> like KTR might be a win if we bring back the equivalent of heavy >> weight DIAGNOSTIC option. > > DIGANOSTIC still exists. It is rarely used, and tends to be only used > for > heavyweight checks that are too buggy or too heavyweight or just too old > to put in KASSERT(). Yes. > >> Often I've been guilty of putting KASSERT(ptr != NULL) checks into >> the code too. Those are really just to make it less painful when >> hitting that bug, > > You mean to make it _more_ painful when hitting that bug. ha. :) > >> so instead of having to do a lot of homework to figure out the fault >> address and line number, I can just get a pretty printed message >> under INVARIANTS. Maybe those "pretty null checks" need to go under >> another option, perhaps DIAGNOSTIC, or another .. ??PRETTY_PANIC. > > Null pointer panics give restartable page faults, with the fault address > printed by trap_fatal() and the page fault often easy to restart using a > debugger. trap_fatal() calls the debugger, so the page fault isn't > completely transparent. This corresponds to gdb in userland stopping > on the signal for the page fault. You might have to use "handle SIGFOO > Stop/Print/Pass" to get back to the faulting instruction. In the kernel, > continuing from trap_fatal() gives this behaviour. The page fault will > repeat endlessly unless you fix it up. You can try various fixes until > you find one that doesn't fault, or let it fault a few times to look > at the context in different ways. > > If panic() is used for null pointers, then you get an unrestartable > panic(), with the relevant context several frames back where it is > hard to see and much more difficult to restart from (practically > impossible now that panic() stops CPUs, etc., though it used to be > possible to unwind the frame in some cases). > > The null pointer check doesn't even detect the common case where the > pointer is &p->bar where p is null. Now the bad pointer is a small > offset from a null pointer (normally at a small address). It would > take an earlier check of p to detect this. > >> Anyhow, I've always been a huge fan of FreeBSD due the additional >> debugging checks it offered. I was the one that suggested >> splassert() back in the day when we would continually find issues >> with spl calls. Additionally I found > > SPLASSERT() was almost never used. The only uses that I can find of it > are all in netipsec. > >> doing filesystem work a ton easier with DEBUG_VFS_LOCKS under FreeBSD >> than under Darwin which at the time did not have such a feature. > > This was more useful I think :-). The main reason that SPLASSERT() > was useless was because spl was a stable API that went away at about > the same time that SPLASSERT() was added (SPLASSERT() was implemented > about 6 months before SMPng killed spl). Yes, splassert was a bit of too little too late. -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 13:02:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31FB7B9B for ; Sat, 15 Dec 2012 13:02:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9E65A8FC16 for ; Sat, 15 Dec 2012 13:02:07 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBFD1nmd097959; Sat, 15 Dec 2012 17:01:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBFD1nRf097958; Sat, 15 Dec 2012 17:01:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 15 Dec 2012 17:01:49 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215130149.GB94420@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50CC6E8D.6040707@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Sat, 15 Dec 2012 13:18:22 +0000 Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Robert Watson , Navdeep Parhar , Bruce Evans , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 13:02:08 -0000 On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: A> People keep beating this drum "all invariants/panics are there for a A> reason", no, some happen to be bugs, and when I'm shipping code to a A> customer, I may need to skip one of these buggy assertions. Yes, if you know any buggy assertions, please remove them from FreeBSD tree. A> Some people have responded to this by saying "alfred show me the buggy A> assertions" to which my response is two fold "firstly, you're calling me A> a liar which I do not appreciate, second prove to me that all the 1000s A> of asserts have zero bugs and are not overly zealous about calling panic." We are not going to prove that. If you claim that some assertion is buggy, you prove that it is buggy and happily remove it from source tree. Noone is going to spend time proving you that 1000s of assertions are not buggy. Home reading for you: http://en.wikipedia.org/wiki/Russell%27s_teapot -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 13:27:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0131042A; Sat, 15 Dec 2012 13:27:47 +0000 (UTC) (envelope-from rwatson@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 D6C0B8FC13; Sat, 15 Dec 2012 13:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFDRlel068176; Sat, 15 Dec 2012 13:27:47 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFDRkJE068164; Sat, 15 Dec 2012 13:27:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151327.qBFDRkJE068164@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 13:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244256 - in vendor/openbsm/dist: . bin/auditdistd etc sys/bsm X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 13:27:48 -0000 Author: rwatson Date: Sat Dec 15 13:27:45 2012 New Revision: 244256 URL: http://svnweb.freebsd.org/changeset/base/244256 Log: Vendor import of OpenBSM 1.2-alpha3. This eliminates most local patches made relative to OpenBSM 1.2-alpha2 in order to build OpenBSM as part of the FreeBSD base. Obtained from: TrustedBSD Project Modified: vendor/openbsm/dist/INSTALL vendor/openbsm/dist/NEWS vendor/openbsm/dist/VERSION vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 vendor/openbsm/dist/configure vendor/openbsm/dist/configure.ac vendor/openbsm/dist/etc/audit_event vendor/openbsm/dist/sys/bsm/audit_kevents.h vendor/openbsm/dist/sys/bsm/audit_record.h Modified: vendor/openbsm/dist/INSTALL ============================================================================== --- vendor/openbsm/dist/INSTALL Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/INSTALL Sat Dec 15 13:27:45 2012 (r244256) @@ -9,8 +9,8 @@ suppport is found. Typical builds will make If doing development work on OpenBSM with gcc, the following invocation of -configure may be preferred in order to generate full compiler warnings and -force the compile to fail if a warning is found: +configure is preferred in order to generate full compiler warnings and force +the compile to fail if a warning is found: CFLAGS="-Wall -Werror" ./configure Modified: vendor/openbsm/dist/NEWS ============================================================================== --- vendor/openbsm/dist/NEWS Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/NEWS Sat Dec 15 13:27:45 2012 (r244256) @@ -1,5 +1,11 @@ OpenBSM Version History +OpenBSM 1.2 alpha 3 + +- Various minor tweaks to the auditdistd build to make it fit the FreeBSD + build environment better. +- AUE_WAIT6 merged from FreeBSD 9. + OpenBSM 1.2 alpha 2 - auditdistd, a distributed audit trail management daemon, has now been @@ -489,4 +495,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#53 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: vendor/openbsm/dist/VERSION ============================================================================== --- vendor/openbsm/dist/VERSION Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/VERSION Sat Dec 15 13:27:45 2012 (r244256) @@ -1 +1 @@ -OPENBSM_1_2alpha2 +OPENBSM_1_2_alpha3 Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 13:27:45 2012 (r244256) @@ -355,7 +355,7 @@ receiver { .Xr auditdistd 8 . .Sh AUTHORS The -.Nm -was written by +.Nm auditdistd +was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: vendor/openbsm/dist/configure ============================================================================== --- vendor/openbsm/dist/configure Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/configure Sat Dec 15 13:27:45 2012 (r244256) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#62 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#65 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for OpenBSM 1.2alpha2. +# Generated by GNU Autoconf 2.69 for OpenBSM 1.2-alpha3. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.2alpha2' -PACKAGE_STRING='OpenBSM 1.2alpha2' +PACKAGE_VERSION='1.2-alpha3' +PACKAGE_STRING='OpenBSM 1.2-alpha3' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.2alpha2 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.2-alpha3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.2alpha2:";; + short | recursive ) echo "Configuration of OpenBSM 1.2-alpha3:";; esac cat <<\_ACEOF @@ -1511,7 +1511,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.2alpha2 +OpenBSM configure 1.2-alpha3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.2alpha2, which was +It was created by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -11552,7 +11552,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.2alpha2 + VERSION=1.2-alpha3 cat >>confdefs.h <<_ACEOF @@ -13559,12 +13559,14 @@ int main () { - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ; return 0; @@ -14172,7 +14174,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.2alpha2, which was +This file was extended by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14238,7 +14240,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -OpenBSM config.status 1.2alpha2 +OpenBSM config.status 1.2-alpha3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/openbsm/dist/configure.ac ============================================================================== --- vendor/openbsm/dist/configure.ac Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/configure.ac Sat Dec 15 13:27:45 2012 (r244256) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.2alpha2], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#63 $]) +AC_INIT([OpenBSM], [1.2-alpha3], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#66 $]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) @@ -217,12 +217,14 @@ AC_TRY_LINK([ #endif #include ], [ - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ], [], [ AC_DEFINE(USE_COMPAT_ENDIAN_ENC_H,, Define if compat/endian_enc.h is required) AC_MSG_RESULT([using compat/endian_enc.h]) Modified: vendor/openbsm/dist/etc/audit_event ============================================================================== --- vendor/openbsm/dist/etc/audit_event Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/etc/audit_event Sat Dec 15 13:27:45 2012 (r244256) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#42 $ +# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#43 $ # # The mapping between event identifiers and values is also hard-coded in # audit_kevents.h and audit_uevents.h, so changes must occur in both places, @@ -561,6 +561,7 @@ 43198:AUE_PDKILL:pdkill(2):pc 43199:AUE_PDGETPID:pdgetpid(2):pc 43200:AUE_PDWAIT:pdwait(2):pc +43201:AUE_WAIT6:wait6(2):pc # # Solaris userspace events. # Modified: vendor/openbsm/dist/sys/bsm/audit_kevents.h ============================================================================== --- vendor/openbsm/dist/sys/bsm/audit_kevents.h Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/sys/bsm/audit_kevents.h Sat Dec 15 13:27:45 2012 (r244256) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#9 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#10 $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -601,6 +601,7 @@ #define AUE_PDKILL 43198 /* FreeBSD. */ #define AUE_PDGETPID 43199 /* FreeBSD. */ #define AUE_PDWAIT 43200 /* FreeBSD. */ +#define AUE_WAIT6 43201 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: vendor/openbsm/dist/sys/bsm/audit_record.h ============================================================================== --- vendor/openbsm/dist/sys/bsm/audit_record.h Sat Dec 15 12:19:24 2012 (r244255) +++ vendor/openbsm/dist/sys/bsm/audit_record.h Sat Dec 15 13:27:45 2012 (r244256) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#12 $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -233,6 +233,7 @@ token_t *au_to_ipc_perm(struct ipc_perm token_t *au_to_iport(uint16_t iport); token_t *au_to_opaque(const char *data, uint16_t bytes); token_t *au_to_path(const char *path); +token_t *au_to_privset(char *privtypestr, char *privstr); token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid); token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, @@ -278,6 +279,7 @@ token_t *au_to_exec_env(char **envp); token_t *au_to_text(const char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_upriv(char sorf, char *priv); token_t *au_to_zonename(const char *zonename); /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 13:29:12 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2520E58E; Sat, 15 Dec 2012 13:29:12 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F0ED08FC12; Sat, 15 Dec 2012 13:29:11 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 1DBF41A3C1B; Sat, 15 Dec 2012 05:29:11 -0800 (PST) Message-ID: <50CC7B26.5000708@mu.org> Date: Sat, 15 Dec 2012 05:29:10 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> In-Reply-To: <20121215130149.GB94420@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 13:29:12 -0000 On 12/15/12 5:01 AM, Gleb Smirnoff wrote: > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: > A> People keep beating this drum "all invariants/panics are there for a > A> reason", no, some happen to be bugs, and when I'm shipping code to a > A> customer, I may need to skip one of these buggy assertions. > > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. > > A> Some people have responded to this by saying "alfred show me the buggy > A> assertions" to which my response is two fold "firstly, you're calling me > A> a liar which I do not appreciate, second prove to me that all the 1000s > A> of asserts have zero bugs and are not overly zealous about calling panic." > > We are not going to prove that. If you claim that some assertion is buggy, > you prove that it is buggy and happily remove it from source tree. Noone > is going to spend time proving you that 1000s of assertions are not buggy. > > Home reading for you: > > http://en.wikipedia.org/wiki/Russell%27s_teapot > Here is some reading for you: ------------------------------------------------------------------------ r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines Don't panic if the stageq here is empty; just fall through with NULL pointers and leave the stage queue flush routine to just do nothing (since both head and tail here will be NULL.) This should quieten the "stageq empty" panic where the stageq itself is empty, but it won't fix the second KASSERT() here "staging queue empty" as that's likely a different underlying problem. PR: kern/174283 ------------------------------------------------------------------------ svn diff -r244043:244044 This kassert bug has existed since rev 190579: r190579 | sam | 2009-03-30 14:53:27 -0700 (Mon, 30 Mar 2009) | 25 lines thanks, -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 13:29:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B09B4599; Sat, 15 Dec 2012 13:29:17 +0000 (UTC) (envelope-from rwatson@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 7CAAE8FC14; Sat, 15 Dec 2012 13:29:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFDTHYZ068398; Sat, 15 Dec 2012 13:29:17 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFDTHII068397; Sat, 15 Dec 2012 13:29:17 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151329.qBFDTHII068397@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 13:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r244257 - vendor/openbsm/1.2-ALPHA-3 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 13:29:17 -0000 Author: rwatson Date: Sat Dec 15 13:29:16 2012 New Revision: 244257 URL: http://svnweb.freebsd.org/changeset/base/244257 Log: Tag OpenBSM 1.2-alpha3. Obtained from: TrustedBSD Project Added: vendor/openbsm/1.2-ALPHA-3/ - copied from r244256, vendor/openbsm/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:18:09 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0B252C8; Sat, 15 Dec 2012 14:18:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 24EDA8FC18; Sat, 15 Dec 2012 14:18:08 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBFEHuHY098221; Sat, 15 Dec 2012 18:17:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBFEHtQi098220; Sat, 15 Dec 2012 18:17:55 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 15 Dec 2012 18:17:55 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215141755.GC94420@FreeBSD.org> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> <50CC7B26.5000708@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <50CC7B26.5000708@mu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:18:09 -0000 On Sat, Dec 15, 2012 at 05:29:10AM -0800, Alfred Perlstein wrote: A> On 12/15/12 5:01 AM, Gleb Smirnoff wrote: A> > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: A> > A> People keep beating this drum "all invariants/panics are there for a A> > A> reason", no, some happen to be bugs, and when I'm shipping code to a A> > A> customer, I may need to skip one of these buggy assertions. A> > A> > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. A> > A> > A> Some people have responded to this by saying "alfred show me the buggy A> > A> assertions" to which my response is two fold "firstly, you're calling me A> > A> a liar which I do not appreciate, second prove to me that all the 1000s A> > A> of asserts have zero bugs and are not overly zealous about calling panic." A> > A> > We are not going to prove that. If you claim that some assertion is buggy, A> > you prove that it is buggy and happily remove it from source tree. Noone A> > is going to spend time proving you that 1000s of assertions are not buggy. A> > A> > Home reading for you: A> > A> > http://en.wikipedia.org/wiki/Russell%27s_teapot A> > A> Here is some reading for you: A> A> ------------------------------------------------------------------------ A> r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines A> A> Don't panic if the stageq here is empty; just fall through with NULL A> pointers and leave the stage queue flush routine to just do nothing A> (since both head and tail here will be NULL.) A> A> This should quieten the "stageq empty" panic where the stageq itself A> is empty, but it won't fix the second KASSERT() here "staging queue empty" A> as that's likely a different underlying problem. A> A> PR: kern/174283 Yes, and important thing is that no one argued against this change, because Adrian explained that this particular assertion was incorrect and removed it. If you know any more incorrect assertions, please remove them as well, and no one will argue about that. But do not switch off all assertions in kernel. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:34:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2839938; Sat, 15 Dec 2012 14:34:33 +0000 (UTC) (envelope-from eadler@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 A72C48FC0A; Sat, 15 Dec 2012 14:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEYX48078102; Sat, 15 Dec 2012 14:34:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEYXLg078094; Sat, 15 Dec 2012 14:34:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151434.qBFEYXLg078094@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:34:33 +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: r244258 - stable/8/games/fortune/datfiles X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:34:33 -0000 Author: eadler Date: Sat Dec 15 14:34:32 2012 New Revision: 244258 URL: http://svnweb.freebsd.org/changeset/base/244258 Log: MFC r243899: Use Bernard Baruch's full name. The words "old than" seem to be quoted as "older than" by some sources, so use the more likely and grammatically correct text. PR: docs/173868 Approved by: cperciva (implicit) Modified: stable/8/games/fortune/datfiles/fortunes Directory Properties: stable/8/games/fortune/ (props changed) Modified: stable/8/games/fortune/datfiles/fortunes ============================================================================== --- stable/8/games/fortune/datfiles/fortunes Sat Dec 15 13:29:16 2012 (r244257) +++ stable/8/games/fortune/datfiles/fortunes Sat Dec 15 14:34:32 2012 (r244258) @@ -35766,8 +35766,8 @@ the code over again, since I also remove % Old age and treachery will overcome youth and skill. % -Old age is always fifteen years old than I am. - -- B. Baruch +Old age is always fifteen years older than I am. + -- Bernard Baruch % Old age is the harbor of all ills. -- Bion From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:34:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA2CE939; Sat, 15 Dec 2012 14:34:34 +0000 (UTC) (envelope-from eadler@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 BEA138FC0C; Sat, 15 Dec 2012 14:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEYYmL078131; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEYYlY078127; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151434.qBFEYYlY078127@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:34:34 +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: r244259 - stable/7/games/fortune/datfiles X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:34:34 -0000 Author: eadler Date: Sat Dec 15 14:34:33 2012 New Revision: 244259 URL: http://svnweb.freebsd.org/changeset/base/244259 Log: MFC r243899: Use Bernard Baruch's full name. The words "old than" seem to be quoted as "older than" by some sources, so use the more likely and grammatically correct text. PR: docs/173868 Approved by: cperciva (implicit) Modified: stable/7/games/fortune/datfiles/fortunes Directory Properties: stable/7/games/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes ============================================================================== --- stable/7/games/fortune/datfiles/fortunes Sat Dec 15 14:34:32 2012 (r244258) +++ stable/7/games/fortune/datfiles/fortunes Sat Dec 15 14:34:33 2012 (r244259) @@ -35766,8 +35766,8 @@ the code over again, since I also remove % Old age and treachery will overcome youth and skill. % -Old age is always fifteen years old than I am. - -- B. Baruch +Old age is always fifteen years older than I am. + -- Bernard Baruch % Old age is the harbor of all ills. -- Bion From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:34:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DED793A; Sat, 15 Dec 2012 14:34:35 +0000 (UTC) (envelope-from eadler@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 E74C98FC12; Sat, 15 Dec 2012 14:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEYYBR078135; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEYYks078128; Sat, 15 Dec 2012 14:34:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151434.qBFEYYks078128@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:34:34 +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: r244260 - stable/9/games/fortune/datfiles X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:34:35 -0000 Author: eadler Date: Sat Dec 15 14:34:33 2012 New Revision: 244260 URL: http://svnweb.freebsd.org/changeset/base/244260 Log: MFC r243899: Use Bernard Baruch's full name. The words "old than" seem to be quoted as "older than" by some sources, so use the more likely and grammatically correct text. PR: docs/173868 Approved by: cperciva (implicit) Modified: stable/9/games/fortune/datfiles/fortunes Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/datfiles/fortunes ============================================================================== --- stable/9/games/fortune/datfiles/fortunes Sat Dec 15 14:34:33 2012 (r244259) +++ stable/9/games/fortune/datfiles/fortunes Sat Dec 15 14:34:33 2012 (r244260) @@ -35766,8 +35766,8 @@ the code over again, since I also remove % Old age and treachery will overcome youth and skill. % -Old age is always fifteen years old than I am. - -- B. Baruch +Old age is always fifteen years older than I am. + -- Bernard Baruch % Old age is the harbor of all ills. -- Bion From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:36:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7404DE6; Sat, 15 Dec 2012 14:36:41 +0000 (UTC) (envelope-from eadler@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 922158FC13; Sat, 15 Dec 2012 14:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEafjG078593; Sat, 15 Dec 2012 14:36:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEafUW078592; Sat, 15 Dec 2012 14:36:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151436.qBFEafUW078592@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:36:41 +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: r244261 - stable/8/share/misc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:36:41 -0000 Author: eadler Date: Sat Dec 15 14:36:40 2012 New Revision: 244261 URL: http://svnweb.freebsd.org/changeset/base/244261 Log: MFC r244017: Sync with Library of Congress list. Approved by: cperciva (implicit) Modified: stable/8/share/misc/iso639 Directory Properties: stable/8/share/misc/ (props changed) Modified: stable/8/share/misc/iso639 ============================================================================== --- stable/8/share/misc/iso639 Sat Dec 15 14:34:33 2012 (r244260) +++ stable/8/share/misc/iso639 Sat Dec 15 14:36:40 2012 (r244261) @@ -12,11 +12,11 @@ # existing ones according to criteria indicated in the standard. It # maintains an accurate list of information associated with registered # language codes, processes updates of registered language codes, and -# distributes them on a regular basis to subscribers and other parties. +# distributes them on a regular basis to subscribers and other parties. # # This is the official site of the ISO 639-2 Registration Authority and thus # is the only one authorized by ISO. If you have questions concerning ISO -# 639-2 please contact us at: +# 639-2 please contact us at: # # Library of Congress # Network Development and MARC Standards Office @@ -90,7 +90,7 @@ be bel bel Belarusian bn ben ben Bengali ber ber Berber languages bho bho Bhojpuri -bh bih bih Bihari +bh bih bih Bihari languages bik bik Bikol bin bin Bini; Edo bi bis bis Bislama @@ -213,10 +213,10 @@ ha hau hau Hausa he heb heb Hebrew hz her her Herero hil hil Hiligaynon - him him Himachali + him him Himachali languages; Western Pahari languages hi hin hin Hindi hit hit Hittite - hmn hmn Hmong + hmn hmn Hmong; Mong ho hmo hmo Hiri Motu hr hrv hrv Croatian hsb hsb Upper Sorbian @@ -349,11 +349,11 @@ ne nep nep Nepali nia nia Nias nic nic Niger-Kordofanian languages niu niu Niuean +nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian +nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nog nog Nogai non non Norse, Old no nor nor Norwegian -nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian -nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nqo nqo N'Ko nso nso Pedi; Sepedi; Northern Sotho nub nub Nubian languages @@ -469,8 +469,8 @@ bo tib bod Tibetan ti tir tir Tigrinya tiv tiv Tiv tkl tkl Tokelau - tli tli Tlingit tlh tlh Klingon; tlhIngan-Hol + tli tli Tlingit tmh tmh Tamashek tog tog Tonga (Nyasa) to ton ton Tonga (Tonga Islands) From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:36:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EC87DE7; Sat, 15 Dec 2012 14:36:42 +0000 (UTC) (envelope-from eadler@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 CE2168FC14; Sat, 15 Dec 2012 14:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEafdF078606; Sat, 15 Dec 2012 14:36:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEafs6078605; Sat, 15 Dec 2012 14:36:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151436.qBFEafs6078605@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:36:41 +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: r244262 - stable/7/share/misc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:36:42 -0000 Author: eadler Date: Sat Dec 15 14:36:41 2012 New Revision: 244262 URL: http://svnweb.freebsd.org/changeset/base/244262 Log: MFC r244017: Sync with Library of Congress list. Approved by: cperciva (implicit) Modified: stable/7/share/misc/iso639 (contents, props changed) Directory Properties: stable/7/share/misc/ (props changed) Modified: stable/7/share/misc/iso639 ============================================================================== --- stable/7/share/misc/iso639 Sat Dec 15 14:36:40 2012 (r244261) +++ stable/7/share/misc/iso639 Sat Dec 15 14:36:41 2012 (r244262) @@ -12,11 +12,11 @@ # existing ones according to criteria indicated in the standard. It # maintains an accurate list of information associated with registered # language codes, processes updates of registered language codes, and -# distributes them on a regular basis to subscribers and other parties. +# distributes them on a regular basis to subscribers and other parties. # # This is the official site of the ISO 639-2 Registration Authority and thus # is the only one authorized by ISO. If you have questions concerning ISO -# 639-2 please contact us at: +# 639-2 please contact us at: # # Library of Congress # Network Development and MARC Standards Office @@ -90,7 +90,7 @@ be bel bel Belarusian bn ben ben Bengali ber ber Berber languages bho bho Bhojpuri -bh bih bih Bihari +bh bih bih Bihari languages bik bik Bikol bin bin Bini; Edo bi bis bis Bislama @@ -213,10 +213,10 @@ ha hau hau Hausa he heb heb Hebrew hz her her Herero hil hil Hiligaynon - him him Himachali + him him Himachali languages; Western Pahari languages hi hin hin Hindi hit hit Hittite - hmn hmn Hmong + hmn hmn Hmong; Mong ho hmo hmo Hiri Motu hr hrv hrv Croatian hsb hsb Upper Sorbian @@ -349,11 +349,11 @@ ne nep nep Nepali nia nia Nias nic nic Niger-Kordofanian languages niu niu Niuean +nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian +nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nog nog Nogai non non Norse, Old no nor nor Norwegian -nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian -nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nqo nqo N'Ko nso nso Pedi; Sepedi; Northern Sotho nub nub Nubian languages @@ -469,8 +469,8 @@ bo tib bod Tibetan ti tir tir Tigrinya tiv tiv Tiv tkl tkl Tokelau - tli tli Tlingit tlh tlh Klingon; tlhIngan-Hol + tli tli Tlingit tmh tmh Tamashek tog tog Tonga (Nyasa) to ton ton Tonga (Tonga Islands) From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:36:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8396DDE8; Sat, 15 Dec 2012 14:36:42 +0000 (UTC) (envelope-from eadler@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 4F0408FC15; Sat, 15 Dec 2012 14:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEag66078621; Sat, 15 Dec 2012 14:36:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEagIn078619; Sat, 15 Dec 2012 14:36:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212151436.qBFEagIn078619@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 14:36:42 +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: r244263 - stable/9/share/misc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:36:42 -0000 Author: eadler Date: Sat Dec 15 14:36:41 2012 New Revision: 244263 URL: http://svnweb.freebsd.org/changeset/base/244263 Log: MFC r244017: Sync with Library of Congress list. Approved by: cperciva (implicit) Modified: stable/9/share/misc/iso639 Directory Properties: stable/9/share/misc/ (props changed) Modified: stable/9/share/misc/iso639 ============================================================================== --- stable/9/share/misc/iso639 Sat Dec 15 14:36:41 2012 (r244262) +++ stable/9/share/misc/iso639 Sat Dec 15 14:36:41 2012 (r244263) @@ -12,11 +12,11 @@ # existing ones according to criteria indicated in the standard. It # maintains an accurate list of information associated with registered # language codes, processes updates of registered language codes, and -# distributes them on a regular basis to subscribers and other parties. +# distributes them on a regular basis to subscribers and other parties. # # This is the official site of the ISO 639-2 Registration Authority and thus # is the only one authorized by ISO. If you have questions concerning ISO -# 639-2 please contact us at: +# 639-2 please contact us at: # # Library of Congress # Network Development and MARC Standards Office @@ -90,7 +90,7 @@ be bel bel Belarusian bn ben ben Bengali ber ber Berber languages bho bho Bhojpuri -bh bih bih Bihari +bh bih bih Bihari languages bik bik Bikol bin bin Bini; Edo bi bis bis Bislama @@ -213,10 +213,10 @@ ha hau hau Hausa he heb heb Hebrew hz her her Herero hil hil Hiligaynon - him him Himachali + him him Himachali languages; Western Pahari languages hi hin hin Hindi hit hit Hittite - hmn hmn Hmong + hmn hmn Hmong; Mong ho hmo hmo Hiri Motu hr hrv hrv Croatian hsb hsb Upper Sorbian @@ -349,11 +349,11 @@ ne nep nep Nepali nia nia Nias nic nic Niger-Kordofanian languages niu niu Niuean +nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian +nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nog nog Nogai non non Norse, Old no nor nor Norwegian -nn nno nno Norwegian Nynorsk; Nynorsk, Norwegian -nb nob nob BokmÃ¥l, Norwegian; Norwegian BokmÃ¥l nqo nqo N'Ko nso nso Pedi; Sepedi; Northern Sotho nub nub Nubian languages @@ -469,8 +469,8 @@ bo tib bod Tibetan ti tir tir Tigrinya tiv tiv Tiv tkl tkl Tokelau - tli tli Tlingit tlh tlh Klingon; tlhIngan-Hol + tli tli Tlingit tmh tmh Tamashek tog tog Tonga (Nyasa) to ton ton Tonga (Tonga Islands) From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:48:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C77E702; Sat, 15 Dec 2012 14:48:10 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D8EC08FC14; Sat, 15 Dec 2012 14:48:09 +0000 (UTC) Received: from Alfreds-MacBook-Pro-6.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 07A071A3C29; Sat, 15 Dec 2012 06:48:08 -0800 (PST) Message-ID: <50CC8DA8.3010704@mu.org> Date: Sat, 15 Dec 2012 06:48:08 -0800 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <50C9271C.70803@mu.org> <20121213090215.GP97487@FreeBSD.org> <201212141149.07671.jhb@freebsd.org> <50CBC285.7060307@mu.org> <20121215161414.V1029@besplex.bde.org> <50CC6E8D.6040707@mu.org> <20121215130149.GB94420@FreeBSD.org> <50CC7B26.5000708@mu.org> <20121215141755.GC94420@FreeBSD.org> In-Reply-To: <20121215141755.GC94420@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:48:10 -0000 On 12/15/12 6:17 AM, Gleb Smirnoff wrote: > On Sat, Dec 15, 2012 at 05:29:10AM -0800, Alfred Perlstein wrote: > A> On 12/15/12 5:01 AM, Gleb Smirnoff wrote: > A> > On Sat, Dec 15, 2012 at 04:35:25AM -0800, Alfred Perlstein wrote: > A> > A> People keep beating this drum "all invariants/panics are there for a > A> > A> reason", no, some happen to be bugs, and when I'm shipping code to a > A> > A> customer, I may need to skip one of these buggy assertions. > A> > > A> > Yes, if you know any buggy assertions, please remove them from FreeBSD tree. > A> > > A> > A> Some people have responded to this by saying "alfred show me the buggy > A> > A> assertions" to which my response is two fold "firstly, you're calling me > A> > A> a liar which I do not appreciate, second prove to me that all the 1000s > A> > A> of asserts have zero bugs and are not overly zealous about calling panic." > A> > > A> > We are not going to prove that. If you claim that some assertion is buggy, > A> > you prove that it is buggy and happily remove it from source tree. Noone > A> > is going to spend time proving you that 1000s of assertions are not buggy. > A> > > A> > Home reading for you: > A> > > A> > http://en.wikipedia.org/wiki/Russell%27s_teapot > A> > > A> Here is some reading for you: > A> > A> ------------------------------------------------------------------------ > A> r244044 | adrian | 2012-12-08 17:08:44 -0800 (Sat, 08 Dec 2012) | 10 lines > A> > A> Don't panic if the stageq here is empty; just fall through with NULL > A> pointers and leave the stage queue flush routine to just do nothing > A> (since both head and tail here will be NULL.) > A> > A> This should quieten the "stageq empty" panic where the stageq itself > A> is empty, but it won't fix the second KASSERT() here "staging queue empty" > A> as that's likely a different underlying problem. > A> > A> PR: kern/174283 > > Yes, and important thing is that no one argued against this change, because > Adrian explained that this particular assertion was incorrect and removed it. > > If you know any more incorrect assertions, please remove them as well, and > no one will argue about that. But do not switch off all assertions in kernel. > Excuse me? where are the assertions switched off? -Alfred From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 14:59:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11C0C941; Sat, 15 Dec 2012 14:59:03 +0000 (UTC) (envelope-from rwatson@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 EA2F38FC15; Sat, 15 Dec 2012 14:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFEx2YO082359; Sat, 15 Dec 2012 14:59:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFEx0Ve082342; Sat, 15 Dec 2012 14:59:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151459.qBFEx0Ve082342@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 14:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244265 - in head/contrib/openbsm: . bin/auditdistd config etc sys/bsm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 14:59:03 -0000 Author: rwatson Date: Sat Dec 15 14:59:00 2012 New Revision: 244265 URL: http://svnweb.freebsd.org/changeset/base/244265 Log: Merge OpenBSM 1.2-alpha3 from the vendor branch to 10-CURRENT; this version included various upstreamed patches from the FreeBSD base to make OpenBSM compile more easily with bmake, higher warning levels, clang, and several other loose ends. Obtained from: TrustedBSD Project Modified: head/contrib/openbsm/INSTALL head/contrib/openbsm/NEWS head/contrib/openbsm/VERSION head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 head/contrib/openbsm/config/config.h head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/etc/audit_event head/contrib/openbsm/sys/bsm/audit_kevents.h head/contrib/openbsm/sys/bsm/audit_record.h Directory Properties: head/contrib/openbsm/ (props changed) Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/INSTALL Sat Dec 15 14:59:00 2012 (r244265) @@ -9,8 +9,8 @@ suppport is found. Typical builds will make If doing development work on OpenBSM with gcc, the following invocation of -configure may be preferred in order to generate full compiler warnings and -force the compile to fail if a warning is found: +configure is preferred in order to generate full compiler warnings and force +the compile to fail if a warning is found: CFLAGS="-Wall -Werror" ./configure Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/NEWS Sat Dec 15 14:59:00 2012 (r244265) @@ -1,5 +1,11 @@ OpenBSM Version History +OpenBSM 1.2 alpha 3 + +- Various minor tweaks to the auditdistd build to make it fit the FreeBSD + build environment better. +- AUE_WAIT6 merged from FreeBSD 9. + OpenBSM 1.2 alpha 2 - auditdistd, a distributed audit trail management daemon, has now been @@ -489,4 +495,4 @@ OpenBSM 1.0 alpha 1 to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/NEWS#53 $ +$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/VERSION Sat Dec 15 14:59:00 2012 (r244265) @@ -1 +1 @@ -OPENBSM_1_2alpha2 +OPENBSM_1_2_alpha3 Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.conf.5 Sat Dec 15 14:59:00 2012 (r244265) @@ -355,7 +355,7 @@ receiver { .Xr auditdistd 8 . .Sh AUTHORS The -.Nm -was written by +.Nm auditdistd +was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: head/contrib/openbsm/config/config.h ============================================================================== --- head/contrib/openbsm/config/config.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/config/config.h Sat Dec 15 14:59:00 2012 (r244265) @@ -235,7 +235,7 @@ #define PACKAGE_NAME "OpenBSM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "OpenBSM 1.2alpha2" +#define PACKAGE_STRING "OpenBSM 1.2-alpha3" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "openbsm" @@ -244,7 +244,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.2alpha2" +#define PACKAGE_VERSION "1.2-alpha3" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -280,7 +280,7 @@ #define USE_SYS_ENDIAN_H /**/ /* Version number of package */ -#define VERSION "1.2alpha2" +#define VERSION "1.2-alpha3" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ Modified: head/contrib/openbsm/configure ============================================================================== --- head/contrib/openbsm/configure Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/configure Sat Dec 15 14:59:00 2012 (r244265) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#62 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#65 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for OpenBSM 1.2alpha2. +# Generated by GNU Autoconf 2.69 for OpenBSM 1.2-alpha3. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OpenBSM' PACKAGE_TARNAME='openbsm' -PACKAGE_VERSION='1.2alpha2' -PACKAGE_STRING='OpenBSM 1.2alpha2' +PACKAGE_VERSION='1.2-alpha3' +PACKAGE_STRING='OpenBSM 1.2-alpha3' PACKAGE_BUGREPORT='trustedbsd-audit@TrustesdBSD.org' PACKAGE_URL='' @@ -1327,7 +1327,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenBSM 1.2alpha2 to adapt to many kinds of systems. +\`configure' configures OpenBSM 1.2-alpha3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1397,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenBSM 1.2alpha2:";; + short | recursive ) echo "Configuration of OpenBSM 1.2-alpha3:";; esac cat <<\_ACEOF @@ -1511,7 +1511,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenBSM configure 1.2alpha2 +OpenBSM configure 1.2-alpha3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenBSM $as_me 1.2alpha2, which was +It was created by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -11552,7 +11552,7 @@ fi # Define the identity of the package. PACKAGE=OpenBSM - VERSION=1.2alpha2 + VERSION=1.2-alpha3 cat >>confdefs.h <<_ACEOF @@ -13559,12 +13559,14 @@ int main () { - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ; return 0; @@ -14172,7 +14174,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenBSM $as_me 1.2alpha2, which was +This file was extended by OpenBSM $as_me 1.2-alpha3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14238,7 +14240,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -OpenBSM config.status 1.2alpha2 +OpenBSM config.status 1.2-alpha3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/openbsm/configure.ac ============================================================================== --- head/contrib/openbsm/configure.ac Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/configure.ac Sat Dec 15 14:59:00 2012 (r244265) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([OpenBSM], [1.2alpha2], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#63 $]) +AC_INIT([OpenBSM], [1.2-alpha3], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#66 $]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) @@ -217,12 +217,14 @@ AC_TRY_LINK([ #endif #include ], [ - bswap16(0); - bswap32(0); - bswap64(0); + int i; + + i = bswap16(0); + i = bswap32(0); + i = bswap64(0); be32enc(NULL, 0); - htole64(0); - le64toh(0); + i = htole64(0); + i = le64toh(0); ], [], [ AC_DEFINE(USE_COMPAT_ENDIAN_ENC_H,, Define if compat/endian_enc.h is required) AC_MSG_RESULT([using compat/endian_enc.h]) Modified: head/contrib/openbsm/etc/audit_event ============================================================================== --- head/contrib/openbsm/etc/audit_event Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/etc/audit_event Sat Dec 15 14:59:00 2012 (r244265) @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#42 $ +# $P4: //depot/projects/trustedbsd/openbsm/etc/audit_event#43 $ # $FreeBSD$ # # The mapping between event identifiers and values is also hard-coded in @@ -562,6 +562,7 @@ 43198:AUE_PDKILL:pdkill(2):pc 43199:AUE_PDGETPID:pdgetpid(2):pc 43200:AUE_PDWAIT:pdwait(2):pc +43201:AUE_WAIT6:wait6(2):pc # # Solaris userspace events. # Modified: head/contrib/openbsm/sys/bsm/audit_kevents.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit_kevents.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/sys/bsm/audit_kevents.h Sat Dec 15 14:59:00 2012 (r244265) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#9 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#10 $ */ #ifndef _BSM_AUDIT_KEVENTS_H_ @@ -601,6 +601,7 @@ #define AUE_PDKILL 43198 /* FreeBSD. */ #define AUE_PDGETPID 43199 /* FreeBSD. */ #define AUE_PDWAIT 43200 /* FreeBSD. */ +#define AUE_WAIT6 43201 /* FreeBSD. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the Modified: head/contrib/openbsm/sys/bsm/audit_record.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit_record.h Sat Dec 15 14:45:32 2012 (r244264) +++ head/contrib/openbsm/sys/bsm/audit_record.h Sat Dec 15 14:59:00 2012 (r244265) @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#12 $ */ #ifndef _BSM_AUDIT_RECORD_H_ @@ -233,6 +233,7 @@ token_t *au_to_ipc_perm(struct ipc_perm token_t *au_to_iport(uint16_t iport); token_t *au_to_opaque(const char *data, uint16_t bytes); token_t *au_to_path(const char *path); +token_t *au_to_privset(char *privtypestr, char *privstr); token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid); token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, @@ -278,6 +279,7 @@ token_t *au_to_exec_env(char **envp); token_t *au_to_text(const char *text); token_t *au_to_kevent(struct kevent *kev); token_t *au_to_trailer(int rec_size); +token_t *au_to_upriv(char sorf, char *priv); token_t *au_to_zonename(const char *zonename); /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 15:21:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B67B6234; Sat, 15 Dec 2012 15:21:10 +0000 (UTC) (envelope-from rwatson@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 9AA058FC0A; Sat, 15 Dec 2012 15:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFFLA3r086115; Sat, 15 Dec 2012 15:21:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFFLAVt086110; Sat, 15 Dec 2012 15:21:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201212151521.qBFFLAVt086110@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Dec 2012 15:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244267 - in head/sys: conf security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 15:21:10 -0000 Author: rwatson Date: Sat Dec 15 15:21:09 2012 New Revision: 244267 URL: http://svnweb.freebsd.org/changeset/base/244267 Log: Four .c files from OpenBSM are used, in modified form, by the kernel to implement the BSM audit trail format. Rename the kernel versions of the files to match the userspace filenames so that it's easier to work out what they correspond to, and therefore ensure they are kept in-sync. Obtained from: TrustedBSD Project Added: head/sys/security/audit/bsm_domain.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_domain.c head/sys/security/audit/bsm_errno.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/bsm_fcntl.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_fcntl.c head/sys/security/audit/bsm_socket_type.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_socket_type.c head/sys/security/audit/bsm_token.c - copied unchanged from r244254, head/sys/security/audit/audit_bsm_token.c Deleted: head/sys/security/audit/audit_bsm_domain.c head/sys/security/audit/audit_bsm_errno.c head/sys/security/audit/audit_bsm_fcntl.c head/sys/security/audit/audit_bsm_socket_type.c head/sys/security/audit/audit_bsm_token.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 15 15:01:46 2012 (r244266) +++ head/sys/conf/files Sat Dec 15 15:21:09 2012 (r244267) @@ -3531,16 +3531,16 @@ rpc/rpcsec_gss/svc_rpcsec_gss.c optional security/audit/audit.c optional audit security/audit/audit_arg.c optional audit security/audit/audit_bsm.c optional audit -security/audit/audit_bsm_domain.c optional audit -security/audit/audit_bsm_errno.c optional audit -security/audit/audit_bsm_fcntl.c optional audit security/audit/audit_bsm_klib.c optional audit -security/audit/audit_bsm_socket_type.c optional audit -security/audit/audit_bsm_token.c optional audit security/audit/audit_pipe.c optional audit security/audit/audit_syscalls.c standard security/audit/audit_trigger.c optional audit security/audit/audit_worker.c optional audit +security/audit/bsm_domain.c optional audit +security/audit/bsm_errno.c optional audit +security/audit/bsm_fcntl.c optional audit +security/audit/bsm_socket_type.c optional audit +security/audit/bsm_token.c optional audit security/mac/mac_atalk.c optional mac netatalk security/mac/mac_audit.c optional mac audit security/mac/mac_cred.c optional mac Copied: head/sys/security/audit/bsm_domain.c (from r244254, head/sys/security/audit/audit_bsm_domain.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/audit/bsm_domain.c Sat Dec 15 15:21:09 2012 (r244267, copy of r244254, head/sys/security/audit/audit_bsm_domain.c) @@ -0,0 +1,495 @@ +/*- + * Copyright (c) 2008 Apple Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include + +struct bsm_domain { + u_short bd_bsm_domain; + int bd_local_domain; +}; + +#define PF_NO_LOCAL_MAPPING -600 + +static const struct bsm_domain bsm_domains[] = { + { BSM_PF_UNSPEC, PF_UNSPEC }, + { BSM_PF_LOCAL, PF_LOCAL }, + { BSM_PF_INET, PF_INET }, + { BSM_PF_IMPLINK, +#ifdef PF_IMPLINK + PF_IMPLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PUP, +#ifdef PF_PUP + PF_PUP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CHAOS, +#ifdef PF_CHAOS + PF_CHAOS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NS, +#ifdef PF_NS + PF_NS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NBS, +#ifdef PF_NBS + PF_NBS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ECMA, +#ifdef PF_ECMA + PF_ECMA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_DATAKIT, +#ifdef PF_DATAKIT + PF_DATAKIT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CCITT, +#ifdef PF_CCITT + PF_CCITT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SNA, PF_SNA }, + { BSM_PF_DECnet, PF_DECnet }, + { BSM_PF_DLI, +#ifdef PF_DLI + PF_DLI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_LAT, +#ifdef PF_LAT + PF_LAT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_HYLINK, +#ifdef PF_HYLINK + PF_HYLINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_APPLETALK, PF_APPLETALK }, + { BSM_PF_NIT, +#ifdef PF_NIT + PF_NIT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_802, +#ifdef PF_802 + PF_802 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_OSI, +#ifdef PF_OSI + PF_OSI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_X25, +#ifdef PF_X25 + PF_X25 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_OSINET, +#ifdef PF_OSINET + PF_OSINET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_GOSIP, +#ifdef PF_GOSIP + PF_GOSIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IPX, PF_IPX }, + { BSM_PF_ROUTE, PF_ROUTE }, + { BSM_PF_LINK, +#ifdef PF_LINK + PF_LINK +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_INET6, PF_INET6 }, + { BSM_PF_KEY, PF_KEY }, + { BSM_PF_NCA, +#ifdef PF_NCA + PF_NCA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_POLICY, +#ifdef PF_POLICY + PF_POLICY +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_INET_OFFLOAD, +#ifdef PF_INET_OFFLOAD + PF_INET_OFFLOAD +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETBIOS, +#ifdef PF_NETBIOS + PF_NETBIOS +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ISO, +#ifdef PF_ISO + PF_ISO +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_XTP, +#ifdef PF_XTP + PF_XTP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_COIP, +#ifdef PF_COIP + PF_COIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CNT, +#ifdef PF_CNT + PF_CNT +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_RTIP, +#ifdef PF_RTIP + PF_RTIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SIP, +#ifdef PF_SIP + PF_SIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PIP, +#ifdef PF_PIP + PF_PIP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ISDN, +#ifdef PF_ISDN + PF_ISDN +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_E164, +#ifdef PF_E164 + PF_E164 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NATM, +#ifdef PF_NATM + PF_NATM +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ATM, +#ifdef PF_ATM + PF_ATM +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETGRAPH, +#ifdef PF_NETGRAPH + PF_NETGRAPH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SLOW, +#ifdef PF_SLOW + PF_SLOW +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SCLUSTER, +#ifdef PF_SCLUSTER + PF_SCLUSTER +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ARP, +#ifdef PF_ARP + PF_ARP +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_BLUETOOTH, +#ifdef PF_BLUETOOTH + PF_BLUETOOTH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_AX25, +#ifdef PF_AX25 + PF_AX25 +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ROSE, +#ifdef PF_ROSE + PF_ROSE +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_NETBEUI, +#ifdef PF_NETBEUI + PF_NETBEUI +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_SECURITY, +#ifdef PF_SECURITY + PF_SECURITY +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PACKET, +#ifdef PF_PACKET + PF_PACKET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ASH, +#ifdef PF_ASH + PF_ASH +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ECONET, +#ifdef PF_ECONET + PF_ECONET +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_ATMSVC, +#ifdef PF_ATMSVC + PF_ATMSVC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IRDA, +#ifdef PF_IRDA + PF_IRDA +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PPPOX, +#ifdef PF_PPPOX + PF_PPPOX +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_WANPIPE, +#ifdef PF_WANPIPE + PF_WANPIPE +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_LLC, +#ifdef PF_LLC + PF_LLC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_CAN, +#ifdef PF_CAN + PF_CAN +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_TIPC, +#ifdef PF_TIPC + PF_TIPC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_IUCV, +#ifdef PF_IUCV + PF_IUCV +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_RXRPC, +#ifdef PF_RXRPC + PF_RXRPC +#else + PF_NO_LOCAL_MAPPING +#endif + }, + { BSM_PF_PHONET, +#ifdef PF_PHONET + PF_PHONET +#else + PF_NO_LOCAL_MAPPING +#endif + }, +}; +static const int bsm_domains_count = sizeof(bsm_domains) / + sizeof(bsm_domains[0]); + +static const struct bsm_domain * +bsm_lookup_local_domain(int local_domain) +{ + int i; + + for (i = 0; i < bsm_domains_count; i++) { + if (bsm_domains[i].bd_local_domain == local_domain) + return (&bsm_domains[i]); + } + return (NULL); +} + +u_short +au_domain_to_bsm(int local_domain) +{ + const struct bsm_domain *bstp; + + bstp = bsm_lookup_local_domain(local_domain); + if (bstp == NULL) + return (BSM_PF_UNKNOWN); + return (bstp->bd_bsm_domain); +} + +static const struct bsm_domain * +bsm_lookup_bsm_domain(u_short bsm_domain) +{ + int i; + + for (i = 0; i < bsm_domains_count; i++) { + if (bsm_domains[i].bd_bsm_domain == bsm_domain) + return (&bsm_domains[i]); + } + return (NULL); +} + +int +au_bsm_to_domain(u_short bsm_domain, int *local_domainp) +{ + const struct bsm_domain *bstp; + + bstp = bsm_lookup_bsm_domain(bsm_domain); + if (bstp == NULL || bstp->bd_local_domain) + return (-1); + *local_domainp = bstp->bd_local_domain; + return (0); +} Copied: head/sys/security/audit/bsm_errno.c (from r244254, head/sys/security/audit/audit_bsm_errno.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/audit/bsm_errno.c Sat Dec 15 15:21:09 2012 (r244267, copy of r244254, head/sys/security/audit/audit_bsm_errno.c) @@ -0,0 +1,775 @@ +/*- + * Copyright (c) 2008 Apple Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include +#include + +#include + +/* + * Different operating systems use different numeric constants for different + * error numbers, and sometimes error numbers don't exist in more than one + * operating system. These routines convert between BSM and local error + * number spaces, subject to the above realities. BSM error numbers are + * stored in a single 8-bit character, so don't have a byte order. + * + * Don't include string definitions when this code is compiled into a kernel. + */ +struct bsm_errno { + int be_bsm_errno; + int be_local_errno; +#if !defined(KERNEL) && !defined(_KERNEL) + const char *be_strerror; +#endif +}; + +#define ERRNO_NO_LOCAL_MAPPING -600 + +#if !defined(KERNEL) && !defined(_KERNEL) +#define ES(x) x +#else +#define ES(x) +#endif + +/* + * Mapping table -- please maintain in numeric sorted order with respect to + * the BSM constant. Today we do a linear lookup, but could switch to a + * binary search if it makes sense. We only ifdef errors that aren't + * generally available, but it does make the table a lot more ugly. + * + * XXXRW: It would be nice to have a similar ordered table mapping to BSM + * constant from local constant, but the order of local constants varies by + * OS. Really we need to build that table at compile-time but don't do that + * yet. + * + * XXXRW: We currently embed English-language error strings here, but should + * support catalogues; these are only used if the OS doesn't have an error + * string using strerror(3). + */ +static const struct bsm_errno bsm_errnos[] = { + { BSM_ERRNO_ESUCCESS, 0, ES("Success") }, + { BSM_ERRNO_EPERM, EPERM, ES("Operation not permitted") }, + { BSM_ERRNO_ENOENT, ENOENT, ES("No such file or directory") }, + { BSM_ERRNO_ESRCH, ESRCH, ES("No such process") }, + { BSM_ERRNO_EINTR, EINTR, ES("Interrupted system call") }, + { BSM_ERRNO_EIO, EIO, ES("Input/output error") }, + { BSM_ERRNO_ENXIO, ENXIO, ES("Device not configured") }, + { BSM_ERRNO_E2BIG, E2BIG, ES("Argument list too long") }, + { BSM_ERRNO_ENOEXEC, ENOEXEC, ES("Exec format error") }, + { BSM_ERRNO_EBADF, EBADF, ES("Bad file descriptor") }, + { BSM_ERRNO_ECHILD, ECHILD, ES("No child processes") }, + { BSM_ERRNO_EAGAIN, EAGAIN, ES("Resource temporarily unavailable") }, + { BSM_ERRNO_ENOMEM, ENOMEM, ES("Cannot allocate memory") }, + { BSM_ERRNO_EACCES, EACCES, ES("Permission denied") }, + { BSM_ERRNO_EFAULT, EFAULT, ES("Bad address") }, + { BSM_ERRNO_ENOTBLK, ENOTBLK, ES("Block device required") }, + { BSM_ERRNO_EBUSY, EBUSY, ES("Device busy") }, + { BSM_ERRNO_EEXIST, EEXIST, ES("File exists") }, + { BSM_ERRNO_EXDEV, EXDEV, ES("Cross-device link") }, + { BSM_ERRNO_ENODEV, ENODEV, ES("Operation not supported by device") }, + { BSM_ERRNO_ENOTDIR, ENOTDIR, ES("Not a directory") }, + { BSM_ERRNO_EISDIR, EISDIR, ES("Is a directory") }, + { BSM_ERRNO_EINVAL, EINVAL, ES("Invalid argument") }, + { BSM_ERRNO_ENFILE, ENFILE, ES("Too many open files in system") }, + { BSM_ERRNO_EMFILE, EMFILE, ES("Too many open files") }, + { BSM_ERRNO_ENOTTY, ENOTTY, ES("Inappropriate ioctl for device") }, + { BSM_ERRNO_ETXTBSY, ETXTBSY, ES("Text file busy") }, + { BSM_ERRNO_EFBIG, EFBIG, ES("File too large") }, + { BSM_ERRNO_ENOSPC, ENOSPC, ES("No space left on device") }, + { BSM_ERRNO_ESPIPE, ESPIPE, ES("Illegal seek") }, + { BSM_ERRNO_EROFS, EROFS, ES("Read-only file system") }, + { BSM_ERRNO_EMLINK, EMLINK, ES("Too many links") }, + { BSM_ERRNO_EPIPE, EPIPE, ES("Broken pipe") }, + { BSM_ERRNO_EDOM, EDOM, ES("Numerical argument out of domain") }, + { BSM_ERRNO_ERANGE, ERANGE, ES("Result too large") }, + { BSM_ERRNO_ENOMSG, ENOMSG, ES("No message of desired type") }, + { BSM_ERRNO_EIDRM, EIDRM, ES("Identifier removed") }, + { BSM_ERRNO_ECHRNG, +#ifdef ECHRNG + ECHRNG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Channel number out of range") }, + { BSM_ERRNO_EL2NSYNC, +#ifdef EL2NSYNC + EL2NSYNC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 2 not synchronized") }, + { BSM_ERRNO_EL3HLT, +#ifdef EL3HLT + EL3HLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 3 halted") }, + { BSM_ERRNO_EL3RST, +#ifdef EL3RST + EL3RST, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 3 reset") }, + { BSM_ERRNO_ELNRNG, +#ifdef ELNRNG + ELNRNG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Link number out of range") }, + { BSM_ERRNO_EUNATCH, +#ifdef EUNATCH + EUNATCH, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Protocol driver not attached") }, + { BSM_ERRNO_ENOCSI, +#ifdef ENOCSI + ENOCSI, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("No CSI structure available") }, + { BSM_ERRNO_EL2HLT, +#ifdef EL2HLT + EL2HLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Level 2 halted") }, + { BSM_ERRNO_EDEADLK, EDEADLK, ES("Resource deadlock avoided") }, + { BSM_ERRNO_ENOLCK, ENOLCK, ES("No locks available") }, + { BSM_ERRNO_ECANCELED, ECANCELED, ES("Operation canceled") }, + { BSM_ERRNO_ENOTSUP, ENOTSUP, ES("Operation not supported") }, + { BSM_ERRNO_EDQUOT, EDQUOT, ES("Disc quota exceeded") }, + { BSM_ERRNO_EBADE, +#ifdef EBADE + EBADE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid exchange") }, + { BSM_ERRNO_EBADR, +#ifdef EBADR + EBADR, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid request descriptor") }, + { BSM_ERRNO_EXFULL, +#ifdef EXFULL + EXFULL, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Exchange full") }, + { BSM_ERRNO_ENOANO, +#ifdef ENOANO + ENOANO, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("No anode") }, + { BSM_ERRNO_EBADRQC, +#ifdef EBADRQC + EBADRQC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid request descriptor") }, + { BSM_ERRNO_EBADSLT, +#ifdef EBADSLT + EBADSLT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Invalid slot") }, + { BSM_ERRNO_EDEADLOCK, +#ifdef EDEADLOCK + EDEADLOCK, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Resource deadlock avoided") }, + { BSM_ERRNO_EBFONT, +#ifdef EBFONT + EBFONT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Bad font file format") }, + { BSM_ERRNO_EOWNERDEAD, +#ifdef EOWNERDEAD + EOWNERDEAD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Process died with the lock") }, + { BSM_ERRNO_ENOTRECOVERABLE, +#ifdef ENOTRECOVERABLE + ENOTRECOVERABLE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Lock is not recoverable") }, + { BSM_ERRNO_ENOSTR, +#ifdef ENOSTR + ENOSTR, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Device not a stream") }, + { BSM_ERRNO_ENONET, +#ifdef ENONET + ENONET, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Machine is not on the network") }, + { BSM_ERRNO_ENOPKG, +#ifdef ENOPKG + ENOPKG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Package not installed") }, + { BSM_ERRNO_EREMOTE, EREMOTE, + ES("Too many levels of remote in path") }, + { BSM_ERRNO_ENOLINK, +#ifdef ENOLINK + ENOLINK, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Link has been severed") }, + { BSM_ERRNO_EADV, +#ifdef EADV + EADV, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Advertise error") }, + { BSM_ERRNO_ESRMNT, +#ifdef ESRMNT + ESRMNT, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("srmount error") }, + { BSM_ERRNO_ECOMM, +#ifdef ECOMM + ECOMM, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Communication error on send") }, + { BSM_ERRNO_EPROTO, +#ifdef EPROTO + EPROTO, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Protocol error") }, + { BSM_ERRNO_ELOCKUNMAPPED, +#ifdef ELOCKUNMAPPED + ELOCKUNMAPPED, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Locked lock was unmapped") }, + { BSM_ERRNO_ENOTACTIVE, +#ifdef ENOTACTIVE + ENOTACTIVE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Facility is not active") }, + { BSM_ERRNO_EMULTIHOP, +#ifdef EMULTIHOP + EMULTIHOP, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Multihop attempted") }, + { BSM_ERRNO_EBADMSG, +#ifdef EBADMSG + EBADMSG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Bad message") }, + { BSM_ERRNO_ENAMETOOLONG, ENAMETOOLONG, ES("File name too long") }, + { BSM_ERRNO_EOVERFLOW, EOVERFLOW, + ES("Value too large to be stored in data type") }, + { BSM_ERRNO_ENOTUNIQ, +#ifdef ENOTUNIQ + ENOTUNIQ, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Given log name not unique") }, + { BSM_ERRNO_EBADFD, +#ifdef EBADFD + EBADFD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Given f.d. invalid for this operation") }, + { BSM_ERRNO_EREMCHG, +#ifdef EREMCHG + EREMCHG, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Remote address changed") }, + { BSM_ERRNO_ELIBACC, +#ifdef ELIBACC + ELIBACC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Can't access a needed shared lib") }, + { BSM_ERRNO_ELIBBAD, +#ifdef ELIBBAD + ELIBBAD, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Accessing a corrupted shared lib") }, + { BSM_ERRNO_ELIBSCN, +#ifdef ELIBSCN + ELIBSCN, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES(".lib section in a.out corrupted") }, + { BSM_ERRNO_ELIBMAX, +#ifdef ELIBMAX + ELIBMAX, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Attempting to link in too many libs") }, + { BSM_ERRNO_ELIBEXEC, +#ifdef ELIBEXEC + ELIBEXEC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Attempting to exec a shared library") }, + { BSM_ERRNO_EILSEQ, EILSEQ, ES("Illegal byte sequence") }, + { BSM_ERRNO_ENOSYS, ENOSYS, ES("Function not implemented") }, + { BSM_ERRNO_ELOOP, ELOOP, ES("Too many levels of symbolic links") }, + { BSM_ERRNO_ERESTART, +#ifdef ERESTART + ERESTART, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Restart syscall") }, + { BSM_ERRNO_ESTRPIPE, +#ifdef ESTRPIPE + ESTRPIPE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("If pipe/FIFO, don't sleep in stream head") }, + { BSM_ERRNO_ENOTEMPTY, ENOTEMPTY, ES("Directory not empty") }, + { BSM_ERRNO_EUSERS, EUSERS, ES("Too many users") }, + { BSM_ERRNO_ENOTSOCK, ENOTSOCK, + ES("Socket operation on non-socket") }, + { BSM_ERRNO_EDESTADDRREQ, EDESTADDRREQ, + ES("Destination address required") }, + { BSM_ERRNO_EMSGSIZE, EMSGSIZE, ES("Message too long") }, + { BSM_ERRNO_EPROTOTYPE, EPROTOTYPE, + ES("Protocol wrong type for socket") }, + { BSM_ERRNO_ENOPROTOOPT, ENOPROTOOPT, ES("Protocol not available") }, + { BSM_ERRNO_EPROTONOSUPPORT, EPROTONOSUPPORT, + ES("Protocol not supported") }, + { BSM_ERRNO_ESOCKTNOSUPPORT, ESOCKTNOSUPPORT, + ES("Socket type not supported") }, + { BSM_ERRNO_EOPNOTSUPP, EOPNOTSUPP, ES("Operation not supported") }, + { BSM_ERRNO_EPFNOSUPPORT, EPFNOSUPPORT, + ES("Protocol family not supported") }, + { BSM_ERRNO_EAFNOSUPPORT, EAFNOSUPPORT, + ES("Address family not supported by protocol family") }, + { BSM_ERRNO_EADDRINUSE, EADDRINUSE, ES("Address already in use") }, + { BSM_ERRNO_EADDRNOTAVAIL, EADDRNOTAVAIL, + ES("Can't assign requested address") }, + { BSM_ERRNO_ENETDOWN, ENETDOWN, ES("Network is down") }, + { BSM_ERRNO_ENETRESET, ENETRESET, + ES("Network dropped connection on reset") }, + { BSM_ERRNO_ECONNABORTED, ECONNABORTED, + ES("Software caused connection abort") }, + { BSM_ERRNO_ECONNRESET, ECONNRESET, ES("Connection reset by peer") }, + { BSM_ERRNO_ENOBUFS, ENOBUFS, ES("No buffer space available") }, + { BSM_ERRNO_EISCONN, EISCONN, ES("Socket is already connected") }, + { BSM_ERRNO_ENOTCONN, ENOTCONN, ES("Socket is not connected") }, + { BSM_ERRNO_ESHUTDOWN, ESHUTDOWN, + ES("Can't send after socket shutdown") }, + { BSM_ERRNO_ETOOMANYREFS, ETOOMANYREFS, + ES("Too many references: can't splice") }, + { BSM_ERRNO_ETIMEDOUT, ETIMEDOUT, ES("Operation timed out") }, + { BSM_ERRNO_ECONNREFUSED, ECONNREFUSED, ES("Connection refused") }, + { BSM_ERRNO_EHOSTDOWN, EHOSTDOWN, ES("Host is down") }, + { BSM_ERRNO_EHOSTUNREACH, EHOSTUNREACH, ES("No route to host") }, + { BSM_ERRNO_EALREADY, EALREADY, ES("Operation already in progress") }, + { BSM_ERRNO_EINPROGRESS, EINPROGRESS, + ES("Operation now in progress") }, + { BSM_ERRNO_ESTALE, ESTALE, ES("Stale NFS file handle") }, + { BSM_ERRNO_EPROCLIM, +#ifdef EPROCLIM + EPROCLIM, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Too many processes") }, + { BSM_ERRNO_EBADRPC, +#ifdef EBADRPC + EBADRPC, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("RPC struct is bad") }, + { BSM_ERRNO_ERPCMISMATCH, +#ifdef ERPCMISMATCH + ERPCMISMATCH, +#else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 17:19:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3C6F43D; Sat, 15 Dec 2012 17:19:37 +0000 (UTC) (envelope-from trociny@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 87F8E8FC0A; Sat, 15 Dec 2012 17:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFHJbWX003554; Sat, 15 Dec 2012 17:19:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFHJbj1003553; Sat, 15 Dec 2012 17:19:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151719.qBFHJbj1003553@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 17:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244268 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 17:19:37 -0000 Author: trociny Date: Sat Dec 15 17:19:36 2012 New Revision: 244268 URL: http://svnweb.freebsd.org/changeset/base/244268 Log: In pfioctl, if the permission checks failed we returned with vnet context set. As the checks don't require vnet context, this is fixed by setting vnet after the checks. PR: kern/160541 Submitted by: Nikos Vassiliadis (slightly different approach) Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Dec 15 15:21:09 2012 (r244267) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Dec 15 17:19:36 2012 (r244268) @@ -963,8 +963,6 @@ pfioctl(struct cdev *dev, u_long cmd, ca { int error = 0; - CURVNET_SET(TD_TO_VNET(td)); - /* XXX keep in sync with switch() below */ if (securelevel_gt(td->td_ucred, 2)) switch (cmd) { @@ -1068,6 +1066,8 @@ pfioctl(struct cdev *dev, u_long cmd, ca return (EACCES); } + CURVNET_SET(TD_TO_VNET(td)); + switch (cmd) { case DIOCSTART: PF_RULES_WLOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 17:54:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C96DD51; Sat, 15 Dec 2012 17:54:30 +0000 (UTC) (envelope-from phk@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 C9F878FC13; Sat, 15 Dec 2012 17:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFHsTDL008580; Sat, 15 Dec 2012 17:54:29 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFHsT5D008579; Sat, 15 Dec 2012 17:54:29 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201212151754.qBFHsT5D008579@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 15 Dec 2012 17:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244269 - head/tools/tools/sysbuild X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 17:54:30 -0000 Author: phk Date: Sat Dec 15 17:54:29 2012 New Revision: 244269 URL: http://svnweb.freebsd.org/changeset/base/244269 Log: Update to the new and brighter pkg world Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sat Dec 15 17:19:36 2012 (r244268) +++ head/tools/tools/sysbuild/sysbuild.sh Sat Dec 15 17:54:29 2012 (r244269) @@ -225,37 +225,49 @@ ports_build() ( # Now build & install them for p in `cat /tmp/_.plist` do + b=`echo $p | tr / _` t=`echo $p | sed 's,/usr/ports/,,'` pn=`cd $p && make package-name` - if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.tbz ] ; then - if [ "x$use_pkg" = "x-p" ] ; then - log_it "install $p from ${PKG_DIR}/$pn.tbz" - pkg_add ${PKG_DIR}/$pn.tbz - fi + + if pkg info $pn > /dev/null 2>&1 ; then + log_it "Already installed: $t ($pn)" + continue fi - i=`pkg_info -qO $t` - if [ -z "$i" ] ; then - log_it "build $p" - b=`echo $p | tr / _` + + if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" ] ; then + log_it "Very Special: $t ($pn)" ( - set -x - cd /usr/ports - cd $p - set +e - make clean ${PORTS_OPTS} - if make install ${PORTS_OPTS} ; then - if [ "x${PKG_DIR}" != "x" ] ; then - make package ${PORTS_OPTS} - mkdir -p ${PKG_DIR} - mv *.tbz ${PKG_DIR} - fi - else - log_it FAIL build $p - fi - make clean + cd $p + make clean all install ${PORTS_OPTS} ) > _.$b 2>&1 < /dev/null - date + continue + fi + + if [ "x${PKG_DIR}" != "x" -a -f ${PKG_DIR}/$pn.txz ] ; then + if [ "x$use_pkg" = "x-p" ] ; then + log_it "Install $t ($pn)" + ( + set +e + pkg add ${PKG_DIR}/$pn.txz || true + ) > _.$b 2>&1 < /dev/null + continue + fi fi + + log_it "build $pn ($p)" + ( + set +e + cd $p + make clean ${PORTS_OPTS} + if make install ${PORTS_OPTS} ; then + if [ "x${PKG_DIR}" != "x" ] ; then + make package ${PORTS_OPTS} + fi + else + log_it FAIL build $p + fi + make clean + ) > _.$b 2>&1 < /dev/null done ) @@ -463,7 +475,7 @@ export PORTS_OPTS ####################################################################### log_it Prepare destination partition -newfs -O2 -U /dev/${TARGET_PART} > /dev/null +newfs -t -E -O2 -U /dev/${TARGET_PART} > /dev/null mount /dev/${TARGET_PART} ${SBMNT} mkdir -p ${SBMNT}/dev mount -t devfs devfs ${SBMNT}/dev @@ -564,7 +576,7 @@ sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TA /etc/fstab > ${SBMNT}/etc/fstab log_it build ports -pwd + cp $0 ${SBMNT}/root cp /tmp/_sb_log ${SBMNT}/tmp b=`basename $0` From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 18:08:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C20A346E; Sat, 15 Dec 2012 18:08:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 79BB18FC16; Sat, 15 Dec 2012 18:08:38 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi5so2827979pad.13 for ; Sat, 15 Dec 2012 10:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=17dSUo+uexAJLnOWu/y1IqEk5jHb/Gx9hH35ud5LYcE=; b=D093P63QXoiC+TcdqcCoH1nThQ1M9zfvB5SQWp2EJ8aelu2kv1ehiFezFVC6ooATIb bWwEcX71EPN1CTx3qpZb1IKGuYRP10v55JEsK22Pdeu7W3qwW4jAmbMICV0gZ4yGM4DR NJoOIVYqnLsQYZXJ2QNsNP2jYM+M33pICKJVjyl0X8MHBloN2EsMih1WWJ8aGq9DDXTl 3U5DInvr1slqzGyhqzagYXKZAITJ7bLmLGpMTo1cQRlvC90BELIeRcoxwwOREyik9w97 uwJhrczK0BGtwQf0oVSAsWXB694JZBbUFMs6Ncf2Ig+r5/OxD6xi8L/dWLqfn5U9K66T riyw== Received: by 10.68.242.38 with SMTP id wn6mr26979755pbc.28.1355594917682; Sat, 15 Dec 2012 10:08:37 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id vs3sm5045988pbc.61.2012.12.15.10.08.32 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 10:08:35 -0800 (PST) Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201212151754.qBFHsT5D008579@svn.freebsd.org> Date: Sat, 15 Dec 2012 10:08:30 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> References: <201212151754.qBFHsT5D008579@svn.freebsd.org> To: Poul-Henning Kamp X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 18:08:38 -0000 On Dec 15, 2012, at 9:54 AM, Poul-Henning Kamp wrote: > Author: phk > Date: Sat Dec 15 17:54:29 2012 > New Revision: 244269 > URL: http://svnweb.freebsd.org/changeset/base/244269 >=20 > Log: > Update to the new and brighter pkg world If you have a ports tree, setting the appropriate variables and = then running make check-already-installed is both forwards and backwards = compatible. HTH, -Garrett= From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 18:19:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6387DA2; Sat, 15 Dec 2012 18:19:49 +0000 (UTC) (envelope-from trociny@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 AF6C38FC12; Sat, 15 Dec 2012 18:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFIJnMT012849; Sat, 15 Dec 2012 18:19:49 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFIJnQ9012845; Sat, 15 Dec 2012 18:19:49 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151819.qBFIJnQ9012845@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 18:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244270 - head/lib/libdevstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 18:19:50 -0000 Author: trociny Date: Sat Dec 15 18:19:48 2012 New Revision: 244270 URL: http://svnweb.freebsd.org/changeset/base/244270 Log: New devstat metrics for devstat_compute_statistics(): DSM_TOTAL_DURATION DSM_TOTAL_DURATION_READ DSM_TOTAL_DURATION_WRITE DSM_TOTAL_DURATION_FREE DSM_TOTAL_DURATION_OTHER DSM_TOTAL_BUSY_TIME Modified: head/lib/libdevstat/devstat.3 head/lib/libdevstat/devstat.c head/lib/libdevstat/devstat.h Modified: head/lib/libdevstat/devstat.3 ============================================================================== --- head/lib/libdevstat/devstat.3 Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.3 Sat Dec 15 18:19:48 2012 (r244270) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2003 +.Dd December 15, 2012 .Dt DEVSTAT 3 .Os .Sh NAME @@ -526,6 +526,35 @@ the acquisition of .Fa previous and .Fa current . +.It Dv DSM_TOTAL_DURATION +type: +.Vt "long double *" +.Pp +The total duration of transactions, in seconds, between the acquisition of +.Fa previous +and +.Fa current . +.It Dv DSM_TOTAL_DURATION_OTHER +.It Dv DSM_TOTAL_DURATION_READ +.It Dv DSM_TOTAL_DURATION_WRITE +.It Dv DSM_TOTAL_DURATION_FREE +type: +.Vt "long double *" +.Pp +The total duration of transactions of the specified type between +the acquisition of +.Fa previous +and +.Fa current . +.It Dv DSM_TOTAL_BUSY_TIME +type: +.Vt "long double *" +.Pp +Total time the device had one or more transactions outstanding +between the acquisition of +.Fa previous +and +.Fa current . .It Dv DSM_TOTAL_BLOCKS type: .Vt "uint64_t *" Modified: head/lib/libdevstat/devstat.c ============================================================================== --- head/lib/libdevstat/devstat.c Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.c Sat Dec 15 18:19:48 2012 (r244270) @@ -133,6 +133,12 @@ struct devstat_args { { DSM_MS_PER_TRANSACTION_FREE, DEVSTAT_ARG_LD }, { DSM_BUSY_PCT, DEVSTAT_ARG_LD }, { DSM_QUEUE_LENGTH, DEVSTAT_ARG_UINT64 }, + { DSM_TOTAL_DURATION, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_READ, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_WRITE, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_FREE, DEVSTAT_ARG_LD }, + { DSM_TOTAL_DURATION_OTHER, DEVSTAT_ARG_LD }, + { DSM_TOTAL_BUSY_TIME, DEVSTAT_ARG_LD }, }; static const char *namelist[] = { @@ -1217,11 +1223,13 @@ devstat_compute_statistics(struct devsta u_int64_t totaltransfers, totaltransfersread, totaltransferswrite; u_int64_t totaltransfersother, totalblocks, totalblocksread; u_int64_t totalblockswrite, totaltransfersfree, totalblocksfree; + long double totalduration, totaldurationread, totaldurationwrite; + long double totaldurationfree, totaldurationother; va_list ap; devstat_metric metric; u_int64_t *destu64; long double *destld; - int retval, i; + int retval; retval = 0; @@ -1263,6 +1271,13 @@ devstat_compute_statistics(struct devsta totalblocksfree /= 512; } + totaldurationread = DELTA_T(duration[DEVSTAT_READ]); + totaldurationwrite = DELTA_T(duration[DEVSTAT_WRITE]); + totaldurationfree = DELTA_T(duration[DEVSTAT_FREE]); + totaldurationother = DELTA_T(duration[DEVSTAT_NO_DATA]); + totalduration = totaldurationread + totaldurationwrite + + totaldurationfree + totaldurationother; + va_start(ap, etime); while ((metric = (devstat_metric)va_arg(ap, devstat_metric)) != 0) { @@ -1484,9 +1499,7 @@ devstat_compute_statistics(struct devsta */ case DSM_MS_PER_TRANSACTION: if (totaltransfers > 0) { - *destld = 0; - for (i = 0; i < DEVSTAT_N_TRANS_FLAGS; i++) - *destld += DELTA_T(duration[i]); + *destld = totalduration; *destld /= totaltransfers; *destld *= 1000; } else @@ -1499,7 +1512,7 @@ devstat_compute_statistics(struct devsta */ case DSM_MS_PER_TRANSACTION_READ: if (totaltransfersread > 0) { - *destld = DELTA_T(duration[DEVSTAT_READ]); + *destld = totaldurationread; *destld /= totaltransfersread; *destld *= 1000; } else @@ -1507,7 +1520,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_WRITE: if (totaltransferswrite > 0) { - *destld = DELTA_T(duration[DEVSTAT_WRITE]); + *destld = totaldurationwrite; *destld /= totaltransferswrite; *destld *= 1000; } else @@ -1515,7 +1528,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_FREE: if (totaltransfersfree > 0) { - *destld = DELTA_T(duration[DEVSTAT_FREE]); + *destld = totaldurationfree; *destld /= totaltransfersfree; *destld *= 1000; } else @@ -1523,7 +1536,7 @@ devstat_compute_statistics(struct devsta break; case DSM_MS_PER_TRANSACTION_OTHER: if (totaltransfersother > 0) { - *destld = DELTA_T(duration[DEVSTAT_NO_DATA]); + *destld = totaldurationother; *destld /= totaltransfersother; *destld *= 1000; } else @@ -1541,6 +1554,24 @@ devstat_compute_statistics(struct devsta case DSM_QUEUE_LENGTH: *destu64 = current->start_count - current->end_count; break; + case DSM_TOTAL_DURATION: + *destld = totalduration; + break; + case DSM_TOTAL_DURATION_READ: + *destld = totaldurationread; + break; + case DSM_TOTAL_DURATION_WRITE: + *destld = totaldurationwrite; + break; + case DSM_TOTAL_DURATION_FREE: + *destld = totaldurationfree; + break; + case DSM_TOTAL_DURATION_OTHER: + *destld = totaldurationother; + break; + case DSM_TOTAL_BUSY_TIME: + *destld = DELTA_T(busy_time); + break; /* * XXX: comment out the default block to see if any case's are missing. */ Modified: head/lib/libdevstat/devstat.h ============================================================================== --- head/lib/libdevstat/devstat.h Sat Dec 15 17:54:29 2012 (r244269) +++ head/lib/libdevstat/devstat.h Sat Dec 15 18:19:48 2012 (r244270) @@ -97,6 +97,12 @@ typedef enum { DSM_MS_PER_TRANSACTION_FREE, DSM_BUSY_PCT, DSM_QUEUE_LENGTH, + DSM_TOTAL_DURATION, + DSM_TOTAL_DURATION_READ, + DSM_TOTAL_DURATION_WRITE, + DSM_TOTAL_DURATION_FREE, + DSM_TOTAL_DURATION_OTHER, + DSM_TOTAL_BUSY_TIME, DSM_MAX } devstat_metric; From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 18:21:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D182BF4C; Sat, 15 Dec 2012 18:21:10 +0000 (UTC) (envelope-from trociny@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 B71758FC0A; Sat, 15 Dec 2012 18:21:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFILA8c013126; Sat, 15 Dec 2012 18:21:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFILAOP013123; Sat, 15 Dec 2012 18:21:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201212151821.qBFILAOP013123@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 15 Dec 2012 18:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244271 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 18:21:11 -0000 Author: trociny Date: Sat Dec 15 18:21:09 2012 New Revision: 244271 URL: http://svnweb.freebsd.org/changeset/base/244271 Log: Change `iostat -Ix` to display total duration of transactions instead of average duration, and total busy time instead of %. This looks more useful when one runs `iostat -Ix` periodically to collect statistics: e.g. now it is possible to calculate busy % between two runs subtracting total busy times and dividing per time period. Average duration and % busy are still available via `iostat -x`. Modified: head/usr.sbin/iostat/iostat.8 head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.8 ============================================================================== --- head/usr.sbin/iostat/iostat.8 Sat Dec 15 18:19:48 2012 (r244270) +++ head/usr.sbin/iostat/iostat.8 Sat Dec 15 18:21:09 2012 (r244271) @@ -56,7 +56,7 @@ .\" .\" @(#)iostat.8 8.1 (Berkeley) 6/6/93 .\" -.Dd November 24, 2010 +.Dd December 15, 2012 .Dt IOSTAT 8 .Os .Sh NAME @@ -366,6 +366,32 @@ average duration of transactions, in mil % of time the device had one or more outstanding transactions .El .Pp +The extended +.Nm +device display, with the +.Fl x +and +.Fl I +flags specified, shows the following statistics: +.Pp +.Bl -tag -width indent -compact +.It r/i +read operations per time period +.It w/i +write operations per time period +.It kr/i +kilobytes read per time period +.It kw/i +kilobytes write per time period +.It qlen +transactions queue length +.It tsvc_t/i +total duration of transactions per time period, in seconds +.It sb/i +total time the device had one or more outstanding transactions per +time period, in seconds +.El +.Pp The old-style .Nm display (using Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Sat Dec 15 18:19:48 2012 (r244270) +++ head/usr.sbin/iostat/iostat.c Sat Dec 15 18:21:09 2012 (r244271) @@ -731,10 +731,10 @@ devstats(int perf_select, long double et u_int64_t total_bytes, total_transfers, total_blocks; u_int64_t total_bytes_read, total_transfers_read; u_int64_t total_bytes_write, total_transfers_write; - long double busy_pct; + long double busy_pct, busy_time; u_int64_t queue_len; long double total_mb; - long double blocks_per_second, ms_per_transaction; + long double blocks_per_second, ms_per_transaction, total_duration; int firstline = 1; char *devname; @@ -745,14 +745,13 @@ devstats(int perf_select, long double et if (Cflag > 0) printf(" cpu "); printf("\n"); - if (Iflag == 0) - printf( - "device r/s w/s kr/s kw/s qlen svc_t %%b " - ); - else - printf( - "device r/i w/i kr/i kw/i qlen svc_t %%b " - ); + if (Iflag == 0) { + printf("device r/s w/s kr/s kw/s qlen " + "svc_t %%b "); + } else { + printf("device r/i w/i kr/i" + " kw/i qlen tsvc_t/i sb/i "); + } if (Tflag > 0) printf("tin tout "); if (Cflag > 0) @@ -789,6 +788,8 @@ devstats(int perf_select, long double et DSM_MS_PER_TRANSACTION, &ms_per_transaction, DSM_BUSY_PCT, &busy_pct, DSM_QUEUE_LENGTH, &queue_len, + DSM_TOTAL_DURATION, &total_duration, + DSM_TOTAL_BUSY_TIME, &busy_time, DSM_NONE) != 0) errx(1, "%s", devstat_errbuf); @@ -827,7 +828,9 @@ devstats(int perf_select, long double et queue_len, ms_per_transaction, busy_pct); else - printf("%-8.8s %5.1Lf %5.1Lf %7.1Lf %7.1Lf %4" PRIu64 " %5.1Lf %3.0Lf ", + printf("%-8.8s %11.1Lf %11.1Lf " + "%12.1Lf %12.1Lf %4" PRIu64 + " %10.1Lf %9.1Lf ", devname, (long double)total_transfers_read, (long double)total_transfers_write, @@ -836,7 +839,7 @@ devstats(int perf_select, long double et (long double) total_bytes_write / 1024, queue_len, - ms_per_transaction, busy_pct); + total_duration, busy_time); if (firstline) { /* * If this is the first device From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 18:24:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5645A1F7; Sat, 15 Dec 2012 18:24:38 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id EB3A48FC0C; Sat, 15 Dec 2012 18:24:37 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.61.101]) by phk.freebsd.dk (Postfix) with ESMTP id 2E6EE89EAF; Sat, 15 Dec 2012 18:24:31 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id qBFIOUwl039008; Sat, 15 Dec 2012 18:24:30 GMT (envelope-from phk@phk.freebsd.dk) To: Garrett Cooper Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild In-reply-to: <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> From: "Poul-Henning Kamp" References: <201212151754.qBFHsT5D008579@svn.freebsd.org> <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> Date: Sat, 15 Dec 2012 18:24:30 +0000 Message-ID: <39007.1355595870@critter.freebsd.dk> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 18:24:38 -0000 -------- In message <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com>, Garrett Cooper wri tes: > If you have a ports tree, setting the appropriate variables and >then running make check-already-installed is both forwards and backwards >compatible. Uhm, I'm not sure I understand how this would apply to sysbuild, which constructs an disk-image from scratch... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 18:45:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F03B71F; Sat, 15 Dec 2012 18:45:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 594648FC13; Sat, 15 Dec 2012 18:45:54 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so1848918dad.13 for ; Sat, 15 Dec 2012 10:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=wLxk4uZaWhxwF9eb9hWTzbTk1S+gdkiVhl+6wpFxe3M=; b=O4/EZDyVbGuRZxBvywQCLoMViri3EMIO8hD0+CwHNWPJc34wqIAW+43+A+M3lRCYxY htvLZoQMjNCEIydYDTBxSeoJGxvGJdsmJtOzxTa4x9ZDi/CvT6xhQ+YZNCcWAmocBLaH bVztc5qfv/Y0ftwPiS7Yh9vJBtNfm5OVYb3h+GWtumQrFFMrPzH9KPNtLnWZDbS59vT1 5DmoQsv2tAfM53N9fhulR1rcUlEAupUfFaYYgsQLvduxEGow6syQ+wV+o4ycjLYT5b+5 An6B4f2JUgD4oOtPfitk4idShBmRvAfAH/wU+YK86/9CFT7ok+sUeJAqk/3LedcwQTAR 8mAw== Received: by 10.66.78.168 with SMTP id c8mr8568288pax.16.1355597148261; Sat, 15 Dec 2012 10:45:48 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id rk17sm5101566pbb.3.2012.12.15.10.45.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 10:45:47 -0800 (PST) Subject: Re: svn commit: r244269 - head/tools/tools/sysbuild Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <39007.1355595870@critter.freebsd.dk> Date: Sat, 15 Dec 2012 10:45:44 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <72791331-4C62-4ACD-ADB1-94A109647032@gmail.com> References: <201212151754.qBFHsT5D008579@svn.freebsd.org> <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> <39007.1355595870@critter.freebsd.dk> To: "Poul-Henning Kamp" X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 18:45:54 -0000 On Dec 15, 2012, at 10:24 AM, Poul-Henning Kamp wrote: > -------- > In message <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com>, Garrett = Cooper wri > tes: >=20 >> If you have a ports tree, setting the appropriate variables and=20= >> then running make check-already-installed is both forwards and = backwards=20 >> compatible. >=20 > Uhm, I'm not sure I understand how this would apply to sysbuild, which > constructs an disk-image from scratch... You're checking whether or not the package has been installed on the = running system via `pkg info`. I discovered (after poking around = bsd.port.mk a bit for other things) that `make check-already-installed` = in the ports directory is an equivalent backwards compatible way of = doing this (again, setting PORTSDIR, PKGDBDIR, etc to the right values). = Example: # for i in shells/bash shells/zsh; do (cd /usr/ports/$i; make = check-already-installed; echo ec =3D $?); done =3D=3D=3D> Checking if shells/bash already installed =3D=3D=3D> bash-4.2.37 is already installed You may wish to ``make deinstall'' and install this port again by ``make reinstall'' to upgrade it properly. If you really wish to overwrite the old port of shells/bash without deleting it first, set the variable "FORCE_PKG_REGISTER" in your environment or the "make install" command line. *** Error code 1 Stop. make: stopped in /usr/ports/shells/bash ec =3D 1 =3D=3D=3D> Checking if shells/zsh already installed ec =3D 0 All you have to do is test for the exit code being non-zero (already = installed) or zero (not installed). It's unfortunate that things are = flip-flopped, but I understand the reason for it being that way in the = make rules. Also, your last commit snuck in a =3D=3D instead of a =3D -- this breaks = on older copies of /bin/sh . HTH, -Garrett PS Just trying to help make sure things are backwards compatible because = there are random people who have reported breakage issues in the past = with various tools like nanobsd, picobsd, etc that aren't tied to a = particular release.= From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 20:04:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64392669; Sat, 15 Dec 2012 20:04:25 +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 433628FC12; Sat, 15 Dec 2012 20:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFK4Pwd027938; Sat, 15 Dec 2012 20:04:25 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFK4Oo7027935; Sat, 15 Dec 2012 20:04:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201212152004.qBFK4Oo7027935@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 15 Dec 2012 20:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244272 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 20:04:25 -0000 Author: ae Date: Sat Dec 15 20:04:24 2012 New Revision: 244272 URL: http://svnweb.freebsd.org/changeset/base/244272 Log: In additional to the tailq of IPv6 addresses add the hash table. For now use 256 buckets and fnv_hash function. Use xor'ed 32-bit s6_addr32 parts of in6_addr structure as a hash key. Update in6_localip and in6_is_addr_deprecated to use hash table for fastest lookup. Sponsored by: Yandex LLC Discussed with: dwmalone, glebius, bz Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/in6.c Sat Dec 15 20:04:24 2012 (r244272) @@ -1149,6 +1149,8 @@ in6_update_ifa(struct ifnet *ifp, struct ifa_ref(&ia->ia_ifa); /* in6_ifaddrhead */ IN6_IFADDR_WLOCK(); TAILQ_INSERT_TAIL(&V_in6_ifaddrhead, ia, ia_link); + LIST_INSERT_HEAD(IN6ADDR_HASH(&ifra->ifra_addr.sin6_addr), + ia, ia6_hash); IN6_IFADDR_WUNLOCK(); } @@ -1534,6 +1536,7 @@ in6_unlink_ifa(struct in6_ifaddr *ia, st */ IN6_IFADDR_WLOCK(); TAILQ_REMOVE(&V_in6_ifaddrhead, ia, ia_link); + LIST_REMOVE(ia, ia6_hash); IN6_IFADDR_WUNLOCK(); /* @@ -2083,7 +2086,7 @@ in6_localip(struct in6_addr *in6) struct in6_ifaddr *ia; IN6_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + LIST_FOREACH(ia, IN6ADDR_HASH(in6), ia6_hash) { if (IN6_ARE_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr)) { IN6_IFADDR_RUNLOCK(); return (1); @@ -2093,22 +2096,20 @@ in6_localip(struct in6_addr *in6) return (0); } - int in6_is_addr_deprecated(struct sockaddr_in6 *sa6) { struct in6_ifaddr *ia; IN6_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - if (IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr, - &sa6->sin6_addr) && - (ia->ia6_flags & IN6_IFF_DEPRECATED) != 0) { - IN6_IFADDR_RUNLOCK(); - return (1); /* true */ + LIST_FOREACH(ia, IN6ADDR_HASH(&sa6->sin6_addr), ia6_hash) { + if (IN6_ARE_ADDR_EQUAL(IA6_IN6(ia), &sa6->sin6_addr)) { + if (ia->ia6_flags & IN6_IFF_DEPRECATED) { + IN6_IFADDR_RUNLOCK(); + return (1); /* true */ + } + break; } - - /* XXX: do we still have to go thru the rest of the list? */ } IN6_IFADDR_RUNLOCK(); Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/in6_var.h Sat Dec 15 20:04:24 2012 (r244272) @@ -67,6 +67,7 @@ #include #ifdef _KERNEL +#include #include #endif @@ -131,10 +132,13 @@ struct in6_ifaddr { /* multicast addresses joined from the kernel */ LIST_HEAD(, in6_multi_mship) ia6_memberships; + /* entry in bucket of inet6 addresses */ + LIST_ENTRY(in6_ifaddr) ia6_hash; }; /* List of in6_ifaddr's. */ TAILQ_HEAD(in6_ifaddrhead, in6_ifaddr); +LIST_HEAD(in6_ifaddrlisthead, in6_ifaddr); /* control structure to manage address selection policy */ struct in6_addrpolicy { @@ -499,7 +503,27 @@ struct in6_rrenumreq { #ifdef _KERNEL VNET_DECLARE(struct in6_ifaddrhead, in6_ifaddrhead); +VNET_DECLARE(struct in6_ifaddrlisthead *, in6_ifaddrhashtbl); +VNET_DECLARE(u_long, in6_ifaddrhmask); #define V_in6_ifaddrhead VNET(in6_ifaddrhead) +#define V_in6_ifaddrhashtbl VNET(in6_ifaddrhashtbl) +#define V_in6_ifaddrhmask VNET(in6_ifaddrhmask) + +#define IN6ADDR_NHASH_LOG2 8 +#define IN6ADDR_NHASH (1 << IN6ADDR_NHASH_LOG2) +#define IN6ADDR_HASHVAL(x) (in6_addrhash(x)) +#define IN6ADDR_HASH(x) \ + (&V_in6_ifaddrhashtbl[IN6ADDR_HASHVAL(x) & V_in6_ifaddrhmask]) + +static __inline uint32_t +in6_addrhash(struct in6_addr *in6) +{ + uint32_t x; + + x = in6->s6_addr32[0] ^ in6->s6_addr32[1] ^ in6->s6_addr32[2] ^ + in6->s6_addr32[3]; + return (fnv_32_buf(&x, sizeof(x), FNV1_32_INIT)); +} extern struct rwlock in6_ifaddr_lock; #define IN6_IFADDR_LOCK_ASSERT( ) rw_assert(&in6_ifaddr_lock, RA_LOCKED) Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Dec 15 18:21:09 2012 (r244271) +++ head/sys/netinet6/ip6_input.c Sat Dec 15 20:04:24 2012 (r244272) @@ -126,6 +126,8 @@ extern struct domain inet6domain; u_char ip6_protox[IPPROTO_MAX]; VNET_DEFINE(struct in6_ifaddrhead, in6_ifaddrhead); +VNET_DEFINE(struct in6_ifaddrlisthead *, in6_ifaddrhashtbl); +VNET_DEFINE(u_long, in6_ifaddrhmask); static struct netisr_handler ip6_nh = { .nh_name = "ip6", @@ -170,6 +172,8 @@ ip6_init(void) TUNABLE_INT_FETCH("net.inet6.ip6.no_radr", &V_ip6_no_radr); TAILQ_INIT(&V_in6_ifaddrhead); + V_in6_ifaddrhashtbl = hashinit(IN6ADDR_NHASH, M_IFADDR, + &V_in6_ifaddrhmask); /* Initialize packet filter hooks. */ V_inet6_pfil_hook.ph_type = PFIL_TYPE_AF; @@ -297,6 +301,7 @@ void ip6_destroy() { + hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); nd6_destroy(); callout_drain(&V_in6_tmpaddrtimer_ch); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 20:50:30 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C7C31D8; Sat, 15 Dec 2012 20:50:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 840B68FC0A; Sat, 15 Dec 2012 20:50:28 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4F3F1B76; Sat, 15 Dec 2012 21:48:23 +0100 (CET) Date: Sat, 15 Dec 2012 21:52:03 +0100 From: Pawel Jakub Dawidek To: Navdeep Parhar Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215205202.GF1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jkO+KyKz7TfD21mV" Content-Disposition: inline In-Reply-To: <50C91B32.4080904@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 20:50:30 -0000 --jkO+KyKz7TfD21mV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:02:58PM -0800, Navdeep Parhar wrote: > On 12/12/12 14:48, Alfred Perlstein wrote: > > On 12/12/12 2:29 PM, Andriy Gapon wrote: > >> Now we get a new middle-ground: get both worse performance (because > >> KASSERTs are compiled in) and a risk of harming your data (because > >> KASSERTs no longer panic). The upside: there is no panic! There's just > >> a log message (or etc). and chance to get more log messages because > >> the insanity propagates. And a chance to lose your data (your > >> customer's) - but I've already mentioned this. I am not sure that I > >> like this kind of middle-ground.=20 > > I have a number of points here: > >=20 > > The most important one being: > > 1) without kassert you would still have the bug, just that it would be > > unreported. > > The upside: there is no panic! There's **NO** log message (or etc). > > and chance to get more log messages because the insanity propagates. > >=20 > > Terrible! > >=20 > > Let me explain that again: > > If you don't compile in KASSERT, then it's not like the condition is > > never going to happen. Instead it will just be unreported. >=20 > A KASSERT() really is for a condition that should never happen. It is > primarily useful during development and testing (and when the code is > reworked or redesigned). I agree with Andriy here -- a non-fatal assert > shouldn't really exist. I have sort of mixed feelings about this change, but in reality we have three cases: 1. Fatal conditions that shouldn't happen, but may happen for some reason and we definiately want to stop running (corrupted file system metadata that can mess up the file system more badly). For those we have direct panic(9) calls. 2. Fatal conditions that cannot happen and for those we have KASSERT(9). 3. Non-fatal conditions that cannot happen, which we have no way to report more gracefully and we do it through KASSERT(9). It is annoying to run INVARIANTS kernel and trigger 3. I had this problem few times, for example in TCP/IP stack. It turned out to be non-fatal and KASSERT(9) was there to understand the code better. I'd much prefer to see it logged than to panic my box. Of course it is also sometimes hard to judge if it is fatal or not. I use plenty of assertions in my code to catch bugs early, but assertions like any other part of the code might have bugs and during rapid development they help a lot when the code around is changing a lot and some earlier assumptions are no longer valid. Many of those assertions are non-fatal. For me this problem is pretty complex, because: 1. It would be nice to have a macro to test non-fatal conditions, but it is hard to tell sometimes if it is fatal or not. This macro could be also used when code is hard to understand and it needs some special workload to really figure out if something is possible or not. 2. Buggy assertions can be used for DoS attack. Lack of assertions can be used for much worse problems. 3. Logging non-fatal "assertions" might make them go unnoticed, but we currently don't enable kernel dumps by default, so when panic occurs user has no idea what has happend, especially if he is in X. Logging would give better chance to actually notice the problem currently. 4. We develop using HEAD, which can have bugs, also buggy assertions and it is annoying to trigger assertions not in your code when you try to work on something. But I'm talking here about test boxes, on my laptop I'd probably prefer panic too often than too rarely and corrupt my system. In my opinion we should do the following: 1. Leave the option to make KASSERTs non-fatal, but log big fat warning that this is development feature and should not be used in production. 2. Introduce handy macro that would log the problem, but won't panic the box for non-fatal conditions, just like we do with LORs. 3. Enable kernel dumps by default. The main obstacle to do that was lack of a way to limit number of kernel dumps, which could lead to filling /var/ after hitting some panic/reboot cycle. My contribution to solve this is implementation of 3: http://people.freebsd.org/~pjd/patches/savecore.patch The first two should be easy to do. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jkO+KyKz7TfD21mV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM4vIACgkQForvXbEpPzQXLgCeLch1lhyOcSZdeleToPhoRe2/ 588AoOCn0RN1zNo2+8p242SCNIO7z2pG =oVGw -----END PGP SIGNATURE----- --jkO+KyKz7TfD21mV-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 20:56:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B0AF684; Sat, 15 Dec 2012 20:56:46 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 0C3738FC18; Sat, 15 Dec 2012 20:56:45 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C185CB7D; Sat, 15 Dec 2012 21:54:40 +0100 (CET) Date: Sat, 15 Dec 2012 21:58:21 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215205821.GG1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jt0yj30bxbg11sci" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, John Baldwin , Alfred Perlstein , svn-src-all@freebsd.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 20:56:46 -0000 --jt0yj30bxbg11sci Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:41:45PM -0800, Adrian Chadd wrote: > If a kassert is inviolable, then make it a panic() and include in the > default kernel. It is inviolable. We don't include it in default kernel as panic for performance reasons, but it doesn't mean it can happen. If it happens it is unexpected condition that is most likely not handled at all. We use plain panic(9) in places that should not but can eventually happen for reasons out of our control. For example if you are running in VM and someone is corruption your disk image as you run. We do want to detect it as quickly as possible. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --jt0yj30bxbg11sci Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM5G0ACgkQForvXbEpPzTtJwCdHp1eSsxHlvwtlJUfuqcNWOZQ DFIAoIhM3SjQp8p3/cFu2xFCwheDy3Yd =gnDn -----END PGP SIGNATURE----- --jt0yj30bxbg11sci-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:01:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD6AC876; Sat, 15 Dec 2012 21:01:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6A98FC17; Sat, 15 Dec 2012 21:01:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 4A65DB87; Sat, 15 Dec 2012 21:59:53 +0100 (CET) Date: Sat, 15 Dec 2012 22:03:34 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215210333.GH1411@garage.freebsd.pl> References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrvsYIebpInmECXG" Content-Disposition: inline In-Reply-To: <50C9271C.70803@mu.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , Andriy Gapon , Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:01:58 -0000 --lrvsYIebpInmECXG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: > Like what if I do gzipp'd kernel dumps next? (on my todo list) How many= =20 > people will complain that "gzip is too dangerous in kernel context foo=20 > foo!!!!" >=20 > Not sure, I guess I'll find out? Well... :) savecore(8) has an option to compress the dumps. The only use case for compressing-while-dumping I see is small swap/dump partition. I'm not against this change, but I would not use it myself. When you are dumping your kernel is in undefined state, so the less code you execute in that state the higher chances your dump will succeed. I much prefer to either compress the dumps with savecore(8) or use ZFS dataset with compression enabled for /var/crash/. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --lrvsYIebpInmECXG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM5aUACgkQForvXbEpPzTYUQCffdIM0UphsgrI6l2OrcYCnKfF ftQAoI5hra1A2f4Rn5tJclT1nmoJi7c3 =5xrR -----END PGP SIGNATURE----- --lrvsYIebpInmECXG-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:06:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEFFECE3; Sat, 15 Dec 2012 21:06:14 +0000 (UTC) (envelope-from andrew@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 B2E018FC15; Sat, 15 Dec 2012 21:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFL6ESC036982; Sat, 15 Dec 2012 21:06:14 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFL6E43036979; Sat, 15 Dec 2012 21:06:14 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152106.qBFL6E43036979@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244273 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:06:14 -0000 Author: andrew Date: Sat Dec 15 21:06:14 2012 New Revision: 244273 URL: http://svnweb.freebsd.org/changeset/base/244273 Log: Fix a comment in an asm block to work with compilers other than GCC Modified: head/contrib/gcc/longlong.h Modified: head/contrib/gcc/longlong.h ============================================================================== --- head/contrib/gcc/longlong.h Sat Dec 15 20:04:24 2012 (r244272) +++ head/contrib/gcc/longlong.h Sat Dec 15 21:06:14 2012 (r244273) @@ -205,7 +205,7 @@ UDItype __umulsidi3 (USItype, USItype); "rI" ((USItype) (bl)) __CLOBBER_CC) #define umul_ppmm(xh, xl, a, b) \ {register USItype __t0, __t1, __t2; \ - __asm__ ("%@ Inlined umul_ppmm\n" \ + __asm__ ("/* Inlined umul_ppmm */\n" \ " mov %2, %5, lsr #16\n" \ " mov %0, %6, lsr #16\n" \ " bic %3, %5, %2, lsl #16\n" \ From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:12:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADCA1FD3; Sat, 15 Dec 2012 21:12:14 +0000 (UTC) (envelope-from andrew@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 92AD28FC16; Sat, 15 Dec 2012 21:12:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLCETl038355; Sat, 15 Dec 2012 21:12:14 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLCEVo038354; Sat, 15 Dec 2012 21:12:14 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152112.qBFLCEVo038354@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244274 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:12:14 -0000 Author: andrew Date: Sat Dec 15 21:12:13 2012 New Revision: 244274 URL: http://svnweb.freebsd.org/changeset/base/244274 Log: Recognise vfpv2 as a value for the ARM .fpu asm directive. Clang generates these even when building soft floating-point code Submitted by: Daisuke Aoyama Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Sat Dec 15 21:06:14 2012 (r244273) +++ head/contrib/binutils/gas/config/tc-arm.c Sat Dec 15 21:12:13 2012 (r244274) @@ -20107,6 +20107,7 @@ static const struct arm_option_cpu_value {"softvfp", FPU_ARCH_VFP}, {"softvfp+vfp", FPU_ARCH_VFP_V2}, {"vfp", FPU_ARCH_VFP_V2}, + {"vfpv2", FPU_ARCH_VFP_V2}, {"vfp9", FPU_ARCH_VFP_V2}, {"vfp3", FPU_ARCH_VFP_V3}, {"vfpv3", FPU_ARCH_VFP_V3}, From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:24:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 539C29B6; Sat, 15 Dec 2012 21:24:32 +0000 (UTC) (envelope-from andrew@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 37AC48FC1E; Sat, 15 Dec 2012 21:24:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLOWYI040209; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLOWDO040208; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152124.qBFLOWDO040208@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244276 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:24:32 -0000 Author: andrew Date: Sat Dec 15 21:24:31 2012 New Revision: 244276 URL: http://svnweb.freebsd.org/changeset/base/244276 Log: Don't define CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP on arm when built with clang. When these are defined the lists are defined similar to: asm(".section .ctors"); STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; asm(".section .dtors"); STATIC func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }; The problem is clang will move the two arrays out of the .ctors and .dtors sections causing these sections to contain a single null address. By not defining these macros we use the version of the code that places the arrays is their sections by using __attribute__((section(".ctors"))) and similar for .dtors. Submitted by: Daisuke Aoyama Modified: head/contrib/gcc/config/arm/arm.h Modified: head/contrib/gcc/config/arm/arm.h ============================================================================== --- head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:15:43 2012 (r244275) +++ head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:24:31 2012 (r244276) @@ -1866,8 +1866,10 @@ typedef struct # define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) # define DTOR_LIST_END /* empty */ # else /* !defined (__ARM_EABI__) */ +# ifndef __clang__ # define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP # define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif # endif /* !defined (__ARM_EABI__) */ #endif /* !defined (IN_LIBCC2) */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:33:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36684D05; Sat, 15 Dec 2012 21:33:13 +0000 (UTC) (envelope-from andrew@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 1A9488FC13; Sat, 15 Dec 2012 21:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLXCD2041379; Sat, 15 Dec 2012 21:33:12 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLXCMA041378; Sat, 15 Dec 2012 21:33:12 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152133.qBFLXCMA041378@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244277 - head/gnu/usr.bin/binutils/as X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:33:13 -0000 Author: andrew Date: Sat Dec 15 21:33:12 2012 New Revision: 244277 URL: http://svnweb.freebsd.org/changeset/base/244277 Log: Also remove -Werror on arm with clang as there are warnings. Modified: head/gnu/usr.bin/binutils/as/Makefile Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Sat Dec 15 21:24:31 2012 (r244276) +++ head/gnu/usr.bin/binutils/as/Makefile Sat Dec 15 21:33:12 2012 (r244277) @@ -8,7 +8,7 @@ .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config -.if ${TARGET_ARCH} == "powerpc64" +.if ${TARGET} == "arm" || ${TARGET_ARCH} == "powerpc64" NO_WERROR.clang= .endif From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:35:12 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E06CE7B; Sat, 15 Dec 2012 21:35:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6CC8FC0A; Sat, 15 Dec 2012 21:35:10 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA10491; Sat, 15 Dec 2012 23:35:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TjzNu-00024L-Cs; Sat, 15 Dec 2012 23:35:02 +0200 Message-ID: <50CCED04.1000101@FreeBSD.org> Date: Sat, 15 Dec 2012 23:35:00 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek Subject: Re: svn commit: r244112 - head/sys/kern References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> In-Reply-To: <20121215210333.GH1411@garage.freebsd.pl> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , Alfred Perlstein , John Baldwin , svn-src-all@FreeBSD.org, Alfred Perlstein , src-committers@FreeBSD.org, Navdeep Parhar , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:35:12 -0000 on 15/12/2012 23:03 Pawel Jakub Dawidek said the following: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> Like what if I do gzipp'd kernel dumps next? (on my todo list) How many >> people will complain that "gzip is too dangerous in kernel context foo >> foo!!!!" >> >> Not sure, I guess I'll find out? > > Well... :) savecore(8) has an option to compress the dumps. The only use > case for compressing-while-dumping I see is small swap/dump partition. I'm > not against this change, but I would not use it myself. When you are > dumping your kernel is in undefined state, so the less code you execute in > that state the higher chances your dump will succeed. I much prefer to > either compress the dumps with savecore(8) or use ZFS dataset with > compression enabled for /var/crash/. Actually compressing core is a good thing when done right. It can speed up the core dumping process in addition to requiring less space. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:41:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A1C0FC for ; Sat, 15 Dec 2012 21:41:54 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7E68FC16 for ; Sat, 15 Dec 2012 21:41:53 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id go10so3708169lbb.13 for ; Sat, 15 Dec 2012 13:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=GcOgCH1cONqHFa4a6EVgVnbTRzcSL5cm4FlySe+/9OE=; b=XB+XXgBEDe0k+tsLgIdObFfuPCOvBDoBEs1J8IVshxhiphukQ3LLabzIfyYSCY5CsD uJqwwy6q3elH9KtCzR0bgbPLTOU4htCi83h+ZbVCEcYY+7IqpARxRzCz7FUBnKiqTRK2 liRX+0cLRPf0/03kvdH85v91Rr1GynCdOE95E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=GcOgCH1cONqHFa4a6EVgVnbTRzcSL5cm4FlySe+/9OE=; b=nVU2ElYeXt++XQb5EeAqG8CMFtNwg2KscQOeipg+uAIX1lAMaTas5LoYJToIvZygjA iT92vkVWFMtcMzkvHlpqTrg8XAupvEIzKKzdw4nyUp8Hia/eAvc54I+tbI07mQBvUGDL KnKMk27pqNZaCjFNTkffJ7GBa7IRgKfwpylly9N6Sl2WbynvhlVRtDPD77g6t1rmXE+H hn4N/5cQlSOYSEVyztSyrnqWRlZ+kFXFw00NNuLS2l/i14qtMyEbzcy6RmeD1jNUD0tL MRWfsBmwn3b6JgUjxrM4fbTCToQz0TSU+v2ApGVtCgSpSUuqa57cFWbXKeQ9UFcS30qF ASFQ== Received: by 10.152.125.136 with SMTP id mq8mr6513183lab.41.1355607712149; Sat, 15 Dec 2012 13:41:52 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.149.225 with HTTP; Sat, 15 Dec 2012 13:41:22 -0800 (PST) In-Reply-To: <201212152133.qBFLXCMA041378@svn.freebsd.org> References: <201212152133.qBFLXCMA041378@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 16:41:22 -0500 X-Google-Sender-Auth: pkF0QRoN3ianLTpclSKkAaX0ioY Message-ID: Subject: Re: svn commit: r244277 - head/gnu/usr.bin/binutils/as To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn1itB0VSZedwUBmO/onjYkjxL3/eh06yZSdL8Mzm27W7ccOmxq93JCSfhAdzxn8HpKNo59 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:41:54 -0000 On 15 December 2012 16:33, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:33:12 2012 > New Revision: 244277 > URL: http://svnweb.freebsd.org/changeset/base/244277 > > Log: > Also remove -Werror on arm with clang as there are warnings. I think it makes more sense to lower WARNS instead of making these NO_WERROR. This way the warnings that are a problem still get noticed. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:47:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A793929C; Sat, 15 Dec 2012 21:47:06 +0000 (UTC) (envelope-from andrew@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 8D5428FC0A; Sat, 15 Dec 2012 21:47:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLl6Ym043014; Sat, 15 Dec 2012 21:47:06 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLl6f1043013; Sat, 15 Dec 2012 21:47:06 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152147.qBFLl6f1043013@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244278 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:47:06 -0000 Author: andrew Date: Sat Dec 15 21:47:05 2012 New Revision: 244278 URL: http://svnweb.freebsd.org/changeset/base/244278 Log: Ignore a warning in ubldr where clang doesn't understand the %D printf specifier from libstand. Modified: head/sys/boot/arm/uboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# clang doesn't understand %D as a specifier to printf +NO_WERROR.clang= + DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:52:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 581594F6 for ; Sat, 15 Dec 2012 21:52:08 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id BD95B8FC1C for ; Sat, 15 Dec 2012 21:52:07 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so3703687lah.13 for ; Sat, 15 Dec 2012 13:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=HfXy1gBGWim4JhhW/BUziheRtFAcEk2umNaMGAUMW5w=; b=n3coRFwscLizGxaamtSDzIPp71YRAAsWVuy9TiI31qMR+sBwuPX8R2ezO6aLmRMp0L bV22enrOgUBpqf1bdQjivoI7kOvpDGXimpWCO449j6XZYnWzCallPh+CbKwTzOQRCJ8y PJLHnfembKKnvPIwlpMsNKOS7mJ3L5bcwQToo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=HfXy1gBGWim4JhhW/BUziheRtFAcEk2umNaMGAUMW5w=; b=i8vkjCw6ntYTGKJmRGVWN+QEMkQnkXx285E7g8GzUiMtSQk1mDAKcCi+5jyh/EAQXb YZrITh409CQBanguuXyyEHiWzXuLNHAZxOrXAcSC38vfl4acBlS93QaRWUZlDdB8DcOQ OUj95jQQoMJwTIKmwmX4SGqzNOIhl/l56GPF8wkYgA05N/aGtj6txmMTFnDX8FcCc/xG oWxGpHF82YBKLEKuEKEyhsL41Yi65XJKj74v+AoJCkT1Ehp9lsv0MUSwCJZFjosb/TWg 8d7HbJ4BpAv4mAl35DVdVC38bo/wIkfvAMdEwR5yiiYQgR9o5IFgJ6DgZMMcMPT78ch5 3iHQ== Received: by 10.152.148.40 with SMTP id tp8mr6452368lab.30.1355608326507; Sat, 15 Dec 2012 13:52:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.149.225 with HTTP; Sat, 15 Dec 2012 13:51:36 -0800 (PST) In-Reply-To: <201212152147.qBFLl6f1043013@svn.freebsd.org> References: <201212152147.qBFLl6f1043013@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 16:51:36 -0500 Message-ID: Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkB6FAdw0v6FuMtP6inS6JWf+BnSAP2+HSSOQwZZBfVd1YbkjzJjMqApbOC1V8cdcsLouHN Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:52:08 -0000 On 15 December 2012 16:47, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:47:05 2012 > New Revision: 244278 > URL: http://svnweb.freebsd.org/changeset/base/244278 > > Log: > Ignore a warning in ubldr where clang doesn't understand the %D printf > specifier from libstand. > > Modified: > head/sys/boot/arm/uboot/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 (r244277) > +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 (r244278) > @@ -109,6 +109,9 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib > # where to get libstand from > CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > +# clang doesn't understand %D as a specifier to printf > +NO_WERROR.clang= why not NO_WFORMAT or WFORMAT=0 ? Is there a need to eliminate the value of all the warnings? -- Eitan Adler From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:57:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDA3F8A7; Sat, 15 Dec 2012 21:57:08 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 880728FC0C; Sat, 15 Dec 2012 21:57:08 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id n2so1883004dad.13 for ; Sat, 15 Dec 2012 13:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=lO9DI04kbGziBm3VuXj2qkYOgldWx7ZNnkYx/m2mlOU=; b=dxwlefzKul/5xC2MItISXwjMJ5PG/BX3s6/VxMGkq367gKS0myiAfR9AMfK33DNuag xk2a8razpkXjkGN+46sBpjZDl0iWOVdbUsSWfyLIPXLKTQQjmFTPCGARKuIgCjKuvEz5 otPeCJQdqdRbn6Ant4wEDE+giEGcchCCcCCC8wW1SZ8B+MdQfzFC3VJ1yYeqxNyFCLwM FBbaXLLf7Z7pRiKj9SaZw9dx71iv2vifpiWXGIpvFXwF0oXKUOmhbg0gKepPL0I9hVSK +L0UkKZwrfdVikoHycxMRCJqwluh9O7LzO9FR+ECWRtXDoloJkgO3QghLNf5mB6Bqe0o 0kZQ== Received: by 10.68.225.201 with SMTP id rm9mr28580498pbc.124.1355608628075; Sat, 15 Dec 2012 13:57:08 -0800 (PST) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id rk6sm5293887pbc.20.2012.12.15.13.57.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 13:57:07 -0800 (PST) Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201212152147.qBFLl6f1043013@svn.freebsd.org> Date: Sat, 15 Dec 2012 13:57:02 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212152147.qBFLl6f1043013@svn.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:57:08 -0000 On Dec 15, 2012, at 1:47 PM, Andrew Turner wrote: > Author: andrew > Date: Sat Dec 15 21:47:05 2012 > New Revision: 244278 > URL: http://svnweb.freebsd.org/changeset/base/244278 >=20 > Log: > Ignore a warning in ubldr where clang doesn't understand the %D = printf > specifier from libstand. >=20 > Modified: > head/sys/boot/arm/uboot/Makefile >=20 > Modified: head/sys/boot/arm/uboot/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 2012 = (r244277) > +++ head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:47:05 2012 = (r244278) > @@ -109,6 +109,9 @@ CFLAGS+=3D -I${.OBJDIR}/../../uboot/lib > # where to get libstand from > CFLAGS+=3D -I${.CURDIR}/../../../../lib/libstand/ >=20 > +# clang doesn't understand %D as a specifier to printf > +NO_WERROR.clang=3D > + > DPADD=3D ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} > LDADD=3D ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand Why not fix it similar to how I fixed libi386/pxe.c on my git = branch ( = https://github.com/yaneurabeya/freebsd/commit/709c2b0a47ec887f8df3a886d318= c309a0659bf6 )? Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 21:57:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A620CA16; Sat, 15 Dec 2012 21:57:35 +0000 (UTC) (envelope-from eadler@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 8A9E78FC17; Sat, 15 Dec 2012 21:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFLvZ7a044272; Sat, 15 Dec 2012 21:57:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLvZ5j044268; Sat, 15 Dec 2012 21:57:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212152157.qBFLvZ5j044268@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Dec 2012 21:57: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: r244279 - stable/9/usr.bin/ministat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 21:57:35 -0000 Author: eadler Date: Sat Dec 15 21:57:34 2012 New Revision: 244279 URL: http://svnweb.freebsd.org/changeset/base/244279 Log: MFC r243079: Add option to suppress just the plot in ministat while still retaining the relative comparison (i.e., useful part). Approved by: cperciva (implicit) Modified: stable/9/usr.bin/ministat/ministat.1 stable/9/usr.bin/ministat/ministat.c Directory Properties: stable/9/usr.bin/ministat/ (props changed) Modified: stable/9/usr.bin/ministat/ministat.1 ============================================================================== --- stable/9/usr.bin/ministat/ministat.1 Sat Dec 15 21:47:05 2012 (r244278) +++ stable/9/usr.bin/ministat/ministat.1 Sat Dec 15 21:57:34 2012 (r244279) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2010 +.Dd November 10, 2012 .Dt MINISTAT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd statistics utility .Sh SYNOPSIS .Nm -.Op Fl ns +.Op Fl Ans .Op Fl C Ar column .Op Fl c Ar confidence_level .Op Fl d Ar delimiter @@ -47,6 +47,9 @@ in the specified files or, if no file is .Pp The options are as follows: .Bl -tag -width Fl +.It Fl A +Just report the statistics of the input and relative comparisons, +suppress the ASCII-art plot. .It Fl n Just report the raw statistics of the input, suppress the ASCII-art plot and the relative comparisons. Modified: stable/9/usr.bin/ministat/ministat.c ============================================================================== --- stable/9/usr.bin/ministat/ministat.c Sat Dec 15 21:47:05 2012 (r244278) +++ stable/9/usr.bin/ministat/ministat.c Sat Dec 15 21:57:34 2012 (r244279) @@ -509,7 +509,7 @@ usage(char const *whine) fprintf(stderr, "%s\n", whine); fprintf(stderr, - "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-ns] [-w width] [file [file ...]]\n"); + "Usage: ministat [-C column] [-c confidence] [-d delimiter(s)] [-Ans] [-w width] [file [file ...]]\n"); fprintf(stderr, "\tconfidence = {"); for (i = 0; i < NCONF; i++) { fprintf(stderr, "%s%g%%", @@ -517,6 +517,7 @@ usage(char const *whine) studentpct[i]); } fprintf(stderr, "}\n"); + fprintf(stderr, "\t-A : print statistics only. suppress the graph.\n"); fprintf(stderr, "\t-C : column number to extract (starts and defaults to 1)\n"); fprintf(stderr, "\t-d : delimiter(s) string, default to \" \\t\"\n"); fprintf(stderr, "\t-n : print summary statistics only, no graph/test\n"); @@ -538,6 +539,7 @@ main(int argc, char **argv) int flag_s = 0; int flag_n = 0; int termwidth = 74; + int suppress_plot = 0; if (isatty(STDOUT_FILENO)) { struct winsize wsz; @@ -550,8 +552,11 @@ main(int argc, char **argv) } ci = -1; - while ((c = getopt(argc, argv, "C:c:d:snw:")) != -1) + while ((c = getopt(argc, argv, "AC:c:d:snw:")) != -1) switch (c) { + case 'A': + suppress_plot = 1; + break; case 'C': column = strtol(optarg, &p, 10); if (p != NULL && *p != '\0') @@ -610,7 +615,7 @@ main(int argc, char **argv) for (i = 0; i < nds; i++) printf("%c %s\n", symbol[i+1], ds[i]->name); - if (!flag_n) { + if (!flag_n && !suppress_plot) { SetupPlot(termwidth, flag_s, nds); for (i = 0; i < nds; i++) DimPlot(ds[i]); From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 22:26:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43B0E669; Sat, 15 Dec 2012 22:26:17 +0000 (UTC) (envelope-from pjd@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 29B6E8FC0C; Sat, 15 Dec 2012 22:26:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBFMQH3K048930; Sat, 15 Dec 2012 22:26:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFMQHA3048929; Sat, 15 Dec 2012 22:26:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201212152226.qBFMQHA3048929@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 15 Dec 2012 22:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244280 - head/sys/dev/wbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 22:26:17 -0000 Author: pjd Date: Sat Dec 15 22:26:16 2012 New Revision: 244280 URL: http://svnweb.freebsd.org/changeset/base/244280 Log: sbuf_trim() cannot be used on sbuf with drain function set. This fixes panic when listing sysctls on INVARIANTS-enabled kernel while having wbwd loaded. This panic was not fatal, at worst one additional space was printed. Also sbuf_trim() makes some sense even if drain function is set. The drain function is called only when buffer is to be expanded. So we could still trim existing buffer before drain is called. In this case it worked just fine - the trailing space was correctly trimmed. Obtained from: WHEEL Systems MFC after: 1 week Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Sat Dec 15 21:57:34 2012 (r244279) +++ head/sys/dev/wbwd/wbwd.c Sat Dec 15 22:26:16 2012 (r244280) @@ -208,9 +208,8 @@ sysctl_wb_debug(SYSCTL_HANDLER_ARGS) sbuf_printf(&sb, "LDN8 (GPIO2, Watchdog): "); sbuf_printf(&sb, "CRF5 0x%02x ", sc->reg_1); sbuf_printf(&sb, "CRF6 0x%02x ", sc->reg_timeout); - sbuf_printf(&sb, "CRF7 0x%02x ", sc->reg_2); + sbuf_printf(&sb, "CRF7 0x%02x", sc->reg_2); - sbuf_trim(&sb); error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 22:33:47 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36F85843; Sat, 15 Dec 2012 22:33:47 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 0CD6A8FC1A; Sat, 15 Dec 2012 22:33:47 +0000 (UTC) Received: from [10.0.1.102] (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id EC49C1A3C1E; Sat, 15 Dec 2012 14:33:39 -0800 (PST) References: <201212110708.qBB78EWx025288@svn.freebsd.org> <201212121046.43706.jhb@freebsd.org> <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> Mime-Version: 1.0 (1.0) In-Reply-To: <20121215210333.GH1411@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> X-Mailer: iPhone Mail (10A523) From: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Date: Sat, 15 Dec 2012 14:33:37 -0800 To: Pawel Jakub Dawidek Cc: Adrian Chadd , "src-committers@FreeBSD.org" , John Baldwin , "svn-src-all@FreeBSD.org" , Alfred Perlstein , Andriy Gapon , Navdeep Parhar , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 22:33:47 -0000 Your use case (small swap & large ram) is exactly why I would like to try th= is.=20 Do you object? Sent from my iPhone On Dec 15, 2012, at 1:03 PM, Pawel Jakub Dawidek wrote: > On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: >> Like what if I do gzipp'd kernel dumps next? (on my todo list) How many=20= >> people will complain that "gzip is too dangerous in kernel context foo=20= >> foo!!!!" >>=20 >> Not sure, I guess I'll find out? >=20 > Well... :) savecore(8) has an option to compress the dumps. The only use > case for compressing-while-dumping I see is small swap/dump partition. > I'm not against this change, but I would not use it myself. When you are > dumping your kernel is in undefined state, so the less code you execute > in that state the higher chances your dump will succeed. I much prefer > to either compress the dumps with savecore(8) or use ZFS dataset with > compression enabled for /var/crash/. >=20 > --=20 > Pawel Jakub Dawidek http://www.wheelsystems.com > FreeBSD committer http://www.FreeBSD.org > Am I Evil? Yes, I Am! http://tupytaj.pl From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 22:36:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39F6D9BE; Sat, 15 Dec 2012 22:36:02 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id E9E098FC13; Sat, 15 Dec 2012 22:36:01 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MF300KV7G3TY120@smtp3.clear.net.nz>; Sun, 16 Dec 2012 11:35:53 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 16 Dec 2012 11:35:53 +1300 Date: Sun, 16 Dec 2012 11:35:40 +1300 From: Andrew Turner Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot In-reply-to: To: Eitan Adler Message-id: <20121216113540.37e5b58a@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201212152147.qBFLl6f1043013@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 22:36:02 -0000 On Sat, 15 Dec 2012 16:51:36 -0500 Eitan Adler wrote: > On 15 December 2012 16:47, Andrew Turner wrote: > > Author: andrew > > Date: Sat Dec 15 21:47:05 2012 > > New Revision: 244278 > > URL: http://svnweb.freebsd.org/changeset/base/244278 > > > > Log: > > Ignore a warning in ubldr where clang doesn't understand the %D > > printf specifier from libstand. > > > > Modified: > > head/sys/boot/arm/uboot/Makefile > > > > Modified: head/sys/boot/arm/uboot/Makefile > > ============================================================================== > > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 > > 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile Sat > > Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ > > CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand > > from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > > > +# clang doesn't understand %D as a specifier to printf > > +NO_WERROR.clang= > > why not NO_WFORMAT or WFORMAT=0 ? Is there a need to eliminate the > value of all the warnings? Because, as far as I can tell, NO_WFORMAT and WFORMAT=0 are not documented so I didn't know about them. Andrew From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 22:41:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A44E3B9A; Sat, 15 Dec 2012 22:41:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 552EB8FC0A; Sat, 15 Dec 2012 22:41:17 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C8EB5BBF; Sat, 15 Dec 2012 23:39:05 +0100 (CET) Date: Sat, 15 Dec 2012 23:42:46 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r244112 - head/sys/kern Message-ID: <20121215224245.GI1411@garage.freebsd.pl> References: <201212121658.49048.jhb@freebsd.org> <50C90567.8080406@FreeBSD.org> <50C909BD.9090709@mu.org> <50C91B32.4080904@FreeBSD.org> <50C91CD3.7030900@mu.org> <50C9206D.6080502@FreeBSD.org> <50C9271C.70803@mu.org> <20121215210333.GH1411@garage.freebsd.pl> <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QDIl5R72YNOeCxaP" Content-Disposition: inline In-Reply-To: <03D95002-35FE-4880-80FA-3E97944AB988@mu.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Adrian Chadd , "src-committers@FreeBSD.org" , John Baldwin , "svn-src-all@FreeBSD.org" , Alfred Perlstein , Andriy Gapon , Navdeep Parhar , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 22:41:18 -0000 --QDIl5R72YNOeCxaP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 15, 2012 at 02:33:37PM -0800, Alfred Perlstein wrote: > Your use case (small swap & large ram) is exactly why I would like to try= this.=20 >=20 > Do you object? Let me quote myself, because you clearly missed my position: "I'm not against this change, but I would not use it myself." I hope that's fine by you!:) > > Well... :) savecore(8) has an option to compress the dumps. The only use > > case for compressing-while-dumping I see is small swap/dump partition. > > I'm not against this change, but I would not use it myself. When you are > > dumping your kernel is in undefined state, so the less code you execute > > in that state the higher chances your dump will succeed. I much prefer > > to either compress the dumps with savecore(8) or use ZFS dataset with > > compression enabled for /var/crash/. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --QDIl5R72YNOeCxaP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDM/OUACgkQForvXbEpPzSeLQCgpAte8MHVLofWEO6DVFlCUzYZ KTgAn1sL8lczexUsX4u/HFVTNEFNA/eI =DmaK -----END PGP SIGNATURE----- --QDIl5R72YNOeCxaP-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 15 22:54:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D640EEC8; Sat, 15 Dec 2012 22:54:42 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id 915B48FC0A; Sat, 15 Dec 2012 22:54:42 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0MF300HJJG9O5950@smtp4.clear.net.nz>; Sun, 16 Dec 2012 11:39:35 +1300 (NZDT) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Sun, 16 Dec 2012 11:39:34 +1300 Date: Sun, 16 Dec 2012 11:39:21 +1300 From: Andrew Turner Subject: Re: svn commit: r244278 - head/sys/boot/arm/uboot In-reply-to: To: Garrett Cooper Message-id: <20121216113921.0c9e2c9b@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.1) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <201212152147.qBFLl6f1043013@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 22:54:42 -0000 On Sat, 15 Dec 2012 13:57:02 -0800 Garrett Cooper wrote: > On Dec 15, 2012, at 1:47 PM, Andrew Turner wrote: > > > Author: andrew > > Date: Sat Dec 15 21:47:05 2012 > > New Revision: 244278 > > URL: http://svnweb.freebsd.org/changeset/base/244278 > > > > Log: > > Ignore a warning in ubldr where clang doesn't understand the %D > > printf specifier from libstand. > > > > Modified: > > head/sys/boot/arm/uboot/Makefile > > > > Modified: head/sys/boot/arm/uboot/Makefile > > ============================================================================== > > --- head/sys/boot/arm/uboot/Makefile Sat Dec 15 21:33:12 > > 2012 (r244277) +++ head/sys/boot/arm/uboot/Makefile > > Sat Dec 15 21:47:05 2012 (r244278) @@ -109,6 +109,9 @@ > > CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get > > libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > > > > +# clang doesn't understand %D as a specifier to printf > > +NO_WERROR.clang= > > + > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBSTAND} > > LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} -lstand > > Why not fix it similar to how I fixed libi386/pxe.c on my git > branch > ( https://github.com/yaneurabeya/freebsd/commit/709c2b0a47ec887f8df3a886d318c309a0659bf6 > )? Thanks, -Garrett > When you commit the sys/boot/common/dev_net.c change from that patch we should be able to revert this commit. Andrew