From owner-svn-src-stable@FreeBSD.ORG Mon Aug 29 10:29:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CEA2106566B; Mon, 29 Aug 2011 10:29:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5798FC17; Mon, 29 Aug 2011 10:29:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7TAT6S1091010; Mon, 29 Aug 2011 10:29:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7TAT66u091008; Mon, 29 Aug 2011 10:29:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108291029.p7TAT66u091008@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 29 Aug 2011 10:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225244 - stable/8/sys/vm X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 10:29:06 -0000 Author: kib Date: Mon Aug 29 10:29:05 2011 New Revision: 225244 URL: http://svn.freebsd.org/changeset/base/225244 Log: MFC r221096 (by obrien): Reap old SPL comments. MFC r225089: Update some comments in swap_pager.c. Modified: stable/8/sys/vm/swap_pager.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/swap_pager.c ============================================================================== --- stable/8/sys/vm/swap_pager.c Mon Aug 29 10:15:15 2011 (r225243) +++ stable/8/sys/vm/swap_pager.c Mon Aug 29 10:29:05 2011 (r225244) @@ -113,9 +113,9 @@ __FBSDID("$FreeBSD$"); #include /* - * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, or 16 - * pages per allocation. We recommend you stick with the default of 8. - * The 16-page limit is due to the radix code (kern/subr_blist.c). + * SWB_NPAGES must be a power of 2. It may be set to 1, 2, 4, 8, 16 + * or 32 pages per allocation. + * The 32-page limit is due to the radix code (kern/subr_blist.c). */ #ifndef MAX_PAGEOUT_CLUSTER #define MAX_PAGEOUT_CLUSTER 16 @@ -126,14 +126,11 @@ __FBSDID("$FreeBSD$"); #endif /* - * Piecemeal swap metadata structure. Swap is stored in a radix tree. - * - * If SWB_NPAGES is 8 and sizeof(char *) == sizeof(daddr_t), our radix - * is basically 8. Assuming PAGE_SIZE == 4096, one tree level represents - * 32K worth of data, two levels represent 256K, three levels represent - * 2 MBytes. This is acceptable. - * - * Overall memory utilization is about the same as the old swap structure. + * The swblock structure maps an object and a small, fixed-size range + * of page indices to disk addresses within a swap area. + * The collection of these mappings is implemented as a hash table. + * Unused disk addresses within a swap area are allocated and managed + * using a blist. */ #define SWCORRECT(n) (sizeof(void *) * (n) / sizeof(daddr_t)) #define SWAP_META_PAGES (SWB_NPAGES * 2) @@ -392,7 +389,6 @@ swp_pager_free_nrpage(vm_page_t m) * * No restrictions on call * This routine may not block. - * This routine must be called at splvm() */ static void swp_sizecheck(void) @@ -417,8 +413,6 @@ swp_sizecheck(void) * the object and page index. It returns a pointer to a pointer * to the object, or a pointer to a NULL pointer if it could not * find a swapblk. - * - * This routine must be called at splvm(). */ static struct swblock ** swp_pager_hash(vm_object_t object, vm_pindex_t index) @@ -558,12 +552,7 @@ swap_pager_swap_init(void) * and then converting it with swp_pager_meta_build(). * * This routine may block in vm_object_allocate() and create a named - * object lookup race, so we must interlock. We must also run at - * splvm() for the object lookup to handle races with interrupts, but - * we do not have to maintain splvm() in between the lookup and the - * add because (I believe) it is not possible to attempt to create - * a new swap object w/handle when a default object with that handle - * already exists. + * object lookup race, so we must interlock. * * MPSAFE */ @@ -636,9 +625,7 @@ swap_pager_alloc(void *handle, vm_ooffse * routine is typically called only when the entire object is * about to be destroyed. * - * This routine may block, but no longer does. - * - * The object must be locked or unreferenceable. + * The object must be locked. */ static void swap_pager_dealloc(vm_object_t object) @@ -680,11 +667,7 @@ swap_pager_dealloc(vm_object_t object) * Also has the side effect of advising that somebody made a mistake * when they configured swap and didn't configure enough. * - * Must be called at splvm() to avoid races with bitmap frees from - * vm_page_remove() aka swap_pager_page_removed(). - * - * This routine may not block - * This routine must be called at splvm(). + * This routine may not sleep. * * We allocate in round-robin fashion from the configured devices. */ @@ -754,14 +737,7 @@ swp_pager_strategy(struct buf *bp) * * This routine returns the specified swap blocks back to the bitmap. * - * Note: This routine may not block (it could in the old swap code), - * and through the use of the new blist routines it does not block. - * - * We must be called at splvm() to avoid races with bitmap frees from - * vm_page_remove() aka swap_pager_page_removed(). - * - * This routine may not block - * This routine must be called at splvm(). + * This routine may not sleep. */ static void swp_pager_freeswapspace(daddr_t blk, int npages) @@ -801,9 +777,6 @@ swp_pager_freeswapspace(daddr_t blk, int * The external callers of this routine typically have already destroyed * or renamed vm_page_t's associated with this range in the object so * we should be ok. - * - * This routine may be called at any spl. We up our spl to splvm temporarily - * in order to perform the metadata removal. */ void swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size) @@ -860,23 +833,16 @@ swap_pager_reserve(vm_object_t object, v * cases where both the source and destination have a valid swapblk, * we keep the destination's. * - * This routine is allowed to block. It may block allocating metadata + * This routine is allowed to sleep. It may sleep allocating metadata * indirectly through swp_pager_meta_build() or if paging is still in * progress on the source. * - * This routine can be called at any spl - * - * XXX vm_page_collapse() kinda expects us not to block because we - * supposedly do not need to allocate memory, but for the moment we - * *may* have to get a little memory from the zone allocator, but - * it is taken from the interrupt memory. We should be ok. - * * The source object contains no vm_page_t's (which is just as well) * * The source object is of type OBJT_SWAP. * - * The source and destination objects must be locked or - * inaccessible (XXX are they ?) + * The source and destination objects must be locked. + * Both object locks may temporarily be released. */ void swap_pager_copy(vm_object_t srcobject, vm_object_t dstobject, @@ -1053,8 +1019,7 @@ swap_pager_haspage(vm_object_t object, v * does NOT change the m->dirty status of the page. Also: MADV_FREE * depends on it. * - * This routine may not block - * This routine must be called at splvm() + * This routine may not sleep. */ static void swap_pager_unswapped(vm_page_t m) @@ -1462,7 +1427,7 @@ swap_pager_putpages(vm_object_t object, * operations, we vm_page_t->busy'd unbusy all pages ( we can do this * because we marked them all VM_PAGER_PEND on return from putpages ). * - * This routine may not block. + * This routine may not sleep. */ static void swp_pager_async_iodone(struct buf *bp) @@ -1642,7 +1607,7 @@ swp_pager_async_iodone(struct buf *bp) * Return 1 if at least one page in the given object is paged * out to the given swap device. * - * This routine may not block. + * This routine may not sleep. */ int swap_pager_isswapped(vm_object_t object, struct swdevt *sp) @@ -1782,9 +1747,7 @@ restart: ************************************************************************ * * These routines manipulate the swap metadata stored in the - * OBJT_SWAP object. All swp_*() routines must be called at - * splvm() because swap can be freed up by the low level vm_page - * code which might be called from interrupts beyond what splbio() covers. + * OBJT_SWAP object. * * Swap metadata is implemented with a global hash and not directly * linked into the object. Instead the object simply contains @@ -1800,9 +1763,6 @@ restart: * The specified swapblk is added to the object's swap metadata. If * the swapblk is not valid, it is freed instead. Any previously * assigned swapblk is freed. - * - * This routine must be called at splvm(), except when used to convert - * an OBJT_DEFAULT object into an OBJT_SWAP object. */ static void swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) @@ -1899,8 +1859,6 @@ done: * This routine will free swap metadata structures as they are cleaned * out. This routine does *NOT* operate on swap metadata associated * with resident pages. - * - * This routine must be called at splvm() */ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count) @@ -1946,8 +1904,6 @@ swp_pager_meta_free(vm_object_t object, * * This routine locates and destroys all swap metadata associated with * an object. - * - * This routine must be called at splvm() */ static void swp_pager_meta_free_all(vm_object_t object) @@ -2002,8 +1958,6 @@ swp_pager_meta_free_all(vm_object_t obje * have to wait until paging is complete but otherwise can act on the * busy page. * - * This routine must be called at splvm(). - * * SWM_FREE remove and free swap block from metadata * SWM_POP remove from meta data but do not free.. pop it out */ From owner-svn-src-stable@FreeBSD.ORG Mon Aug 29 20:00:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C51E106564A; Mon, 29 Aug 2011 20:00:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6D398FC13; Mon, 29 Aug 2011 20:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7TK0Tqb010533; Mon, 29 Aug 2011 20:00:29 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7TK0ToD010531; Mon, 29 Aug 2011 20:00:29 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108292000.p7TK0ToD010531@svn.freebsd.org> From: Martin Matuska Date: Mon, 29 Aug 2011 20:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225249 - stable/8/usr.sbin/makefs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 20:00:30 -0000 Author: mm Date: Mon Aug 29 20:00:29 2011 New Revision: 225249 URL: http://svn.freebsd.org/changeset/base/225249 Log: MFC r225121: Fix buffer overflow and possible ISO image corruption in wrong handling of "." character case in makefs ISO level 1 and 2 filename conversion. Filed as NetBSD PR #45285 http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45285 Reviewed by: Christos Zoulas Modified: stable/8/usr.sbin/makefs/cd9660.c Directory Properties: stable/8/usr.sbin/makefs/ (props changed) Modified: stable/8/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660.c Mon Aug 29 19:11:45 2011 (r225248) +++ stable/8/usr.sbin/makefs/cd9660.c Mon Aug 29 20:00:29 2011 (r225249) @@ -1627,7 +1627,7 @@ cd9660_level1_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && extlen < 3) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1644,10 +1644,8 @@ cd9660_level1_convert_filename(const cha *oldname == ',' && strlen(oldname) == 4) break; /* Enforce 12.3 / 8 */ - if (((namelen == 8) && !found_ext) || - (found_ext && extlen == 3)) { + if (namelen == 8 && !found_ext) break; - } if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); @@ -1690,7 +1688,7 @@ cd9660_level2_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && namelen + extlen < 30) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1710,8 +1708,6 @@ cd9660_level2_convert_filename(const cha if (diskStructure.archimedes_enabled && *oldname == ',' && strlen(oldname) == 4) break; - if ((namelen + extlen) == 30) - break; if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); From owner-svn-src-stable@FreeBSD.ORG Mon Aug 29 20:00:57 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C361065674; Mon, 29 Aug 2011 20:00:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90B9D8FC21; Mon, 29 Aug 2011 20:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7TK0vhK010581; Mon, 29 Aug 2011 20:00:57 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7TK0vvW010579; Mon, 29 Aug 2011 20:00:57 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108292000.p7TK0vvW010579@svn.freebsd.org> From: Martin Matuska Date: Mon, 29 Aug 2011 20:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225250 - stable/7/usr.sbin/makefs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 20:00:57 -0000 Author: mm Date: Mon Aug 29 20:00:57 2011 New Revision: 225250 URL: http://svn.freebsd.org/changeset/base/225250 Log: Fix buffer overflow and possible ISO image corruption in wrong handling of "." character case in makefs ISO level 1 and 2 filename conversion. Filed as NetBSD PR #45285 http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45285 Reviewed by: Christos Zoulas Modified: stable/7/usr.sbin/makefs/cd9660.c Directory Properties: stable/7/usr.sbin/makefs/ (props changed) Modified: stable/7/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660.c Mon Aug 29 20:00:29 2011 (r225249) +++ stable/7/usr.sbin/makefs/cd9660.c Mon Aug 29 20:00:57 2011 (r225250) @@ -1627,7 +1627,7 @@ cd9660_level1_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && extlen < 3) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1644,10 +1644,8 @@ cd9660_level1_convert_filename(const cha *oldname == ',' && strlen(oldname) == 4) break; /* Enforce 12.3 / 8 */ - if (((namelen == 8) && !found_ext) || - (found_ext && extlen == 3)) { + if (namelen == 8 && !found_ext) break; - } if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); @@ -1690,7 +1688,7 @@ cd9660_level2_convert_filename(const cha int extlen = 0; int found_ext = 0; - while (*oldname != '\0') { + while (*oldname != '\0' && namelen + extlen < 30) { /* Handle period first, as it is special */ if (*oldname == '.') { if (found_ext) { @@ -1710,8 +1708,6 @@ cd9660_level2_convert_filename(const cha if (diskStructure.archimedes_enabled && *oldname == ',' && strlen(oldname) == 4) break; - if ((namelen + extlen) == 30) - break; if (islower((unsigned char)*oldname)) *newname++ = toupper((unsigned char)*oldname); From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 01:25:13 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D002106566B; Tue, 30 Aug 2011 01:25:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C6F78FC08; Tue, 30 Aug 2011 01:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7U1PDCZ026673; Tue, 30 Aug 2011 01:25:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7U1PDdI026671; Tue, 30 Aug 2011 01:25:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108300125.p7U1PDdI026671@svn.freebsd.org> From: Xin LI Date: Tue, 30 Aug 2011 01:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225254 - stable/8/etc/rc.d X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 01:25:13 -0000 Author: delphij Date: Tue Aug 30 01:25:12 2011 New Revision: 225254 URL: http://svn.freebsd.org/changeset/base/225254 Log: MFC r225120: Honor WITHOUT_IPX when installing etc/rc.d/ipxrouted. Modified: stable/8/etc/rc.d/Makefile Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/Makefile ============================================================================== --- stable/8/etc/rc.d/Makefile Tue Aug 30 01:22:27 2011 (r225253) +++ stable/8/etc/rc.d/Makefile Tue Aug 30 01:25:12 2011 (r225254) @@ -16,7 +16,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ - ipnat ipsec ipxrouted \ + ipnat ipsec \ jail \ kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ @@ -42,6 +42,10 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ypset ypupdated ypxfrd \ zfs zvol +.if ${MK_IPX} != "no" +FILES+= ipxrouted +.endif + .if ${MK_OPENSSH} != "no" FILES+= sshd .endif From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 11:47:36 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93E87106566B; Tue, 30 Aug 2011 11:47:36 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83C8D8FC08; Tue, 30 Aug 2011 11:47:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UBladT049985; Tue, 30 Aug 2011 11:47:36 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UBla7E049983; Tue, 30 Aug 2011 11:47:36 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201108301147.p7UBla7E049983@svn.freebsd.org> From: Dmitry Morozovsky Date: Tue, 30 Aug 2011 11:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225259 - stable/8/sys/boot/forth X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 11:47:36 -0000 Author: marck (doc committer) Date: Tue Aug 30 11:47:36 2011 New Revision: 225259 URL: http://svn.freebsd.org/changeset/base/225259 Log: MFC r225122: Add kern.cam.boot_delay description (with reasonable default) to default/loader.conf This should help people installing ${OS} to USB devices, where there are frequently cases where kernel tries to mount root before actual umass sensing is finished. Reviewed by: mav Approved by: kib Modified: stable/8/sys/boot/forth/loader.conf Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Tue Aug 30 04:32:16 2011 (r225258) +++ stable/8/sys/boot/forth/loader.conf Tue Aug 30 11:47:36 2011 (r225259) @@ -104,6 +104,8 @@ module_path="/boot/modules" # Set the mo #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups #kern.sgrowsiz="" # Set the amount to grow stack +#kern.cam.boot_delay="10000" # Delay (in ms) of root mount for CAM bus + # registration, useful for USB sticks as root #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI #kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable #kern.ipc.nmbclusters="" # Set the number of mbuf clusters From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 11:49:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1932B106564A; Tue, 30 Aug 2011 11:49:23 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0914A8FC19; Tue, 30 Aug 2011 11:49:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UBnMPg050084; Tue, 30 Aug 2011 11:49:22 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UBnMHr050082; Tue, 30 Aug 2011 11:49:22 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201108301149.p7UBnMHr050082@svn.freebsd.org> From: Dmitry Morozovsky Date: Tue, 30 Aug 2011 11:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225260 - stable/7/sys/boot/forth X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 11:49:23 -0000 Author: marck (doc committer) Date: Tue Aug 30 11:49:22 2011 New Revision: 225260 URL: http://svn.freebsd.org/changeset/base/225260 Log: MFC r225122: Add kern.cam.boot_delay description (with reasonable default) to default/loader.conf This should help people installing ${OS} to USB devices, where there are frequently cases where kernel tries to mount root before actual umass sensing is finished. Reviewed by: mav Approved by: kib Modified: stable/7/sys/boot/forth/loader.conf Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Tue Aug 30 11:47:36 2011 (r225259) +++ stable/7/sys/boot/forth/loader.conf Tue Aug 30 11:49:22 2011 (r225260) @@ -102,6 +102,8 @@ module_path="/boot/modules" # Set the mo #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events #kern.sgrowsiz="" # Set the amount to grow stack +#kern.cam.boot_delay="10000" # Delay (in ms) of root mount for CAM bus + # registration, useful for USB sticks as root #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI #kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable #kern.ipc.nmbclusters="" # Set the number of mbuf clusters From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 11:50:28 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6301C106567C; Tue, 30 Aug 2011 11:50:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533898FC0C; Tue, 30 Aug 2011 11:50:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UBoSLY050159; Tue, 30 Aug 2011 11:50:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UBoSur050157; Tue, 30 Aug 2011 11:50:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108301150.p7UBoSur050157@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 30 Aug 2011 11:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225261 - stable/8/sys/fs/procfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 11:50:28 -0000 Author: kib Date: Tue Aug 30 11:50:28 2011 New Revision: 225261 URL: http://svn.freebsd.org/changeset/base/225261 Log: MFC r224915: Do not return success and a string "unknown" when vn_fullpath() was unable to resolve the path of the text vnode of the process. The behaviour is very confusing for any consumer of the procfs, in particular, java. Modified: stable/8/sys/fs/procfs/procfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/procfs/procfs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs.c Tue Aug 30 11:49:22 2011 (r225260) +++ stable/8/sys/fs/procfs/procfs.c Tue Aug 30 11:50:28 2011 (r225261) @@ -67,20 +67,23 @@ int procfs_doprocfile(PFS_FILL_ARGS) { - char *fullpath = "unknown"; - char *freepath = NULL; + char *fullpath; + char *freepath; struct vnode *textvp; + int error; + freepath = NULL; PROC_LOCK(p); textvp = p->p_textvp; vhold(textvp); PROC_UNLOCK(p); - vn_fullpath(td, textvp, &fullpath, &freepath); + error = vn_fullpath(td, textvp, &fullpath, &freepath); vdrop(textvp); - sbuf_printf(sb, "%s", fullpath); - if (freepath) + if (error == 0) + sbuf_printf(sb, "%s", fullpath); + if (freepath != NULL) free(freepath, M_TEMP); - return (0); + return (error); } /* From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 17:20:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46FD1106564A; Tue, 30 Aug 2011 17:20:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9948FC12; Tue, 30 Aug 2011 17:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UHKZ8k060318; Tue, 30 Aug 2011 17:20:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UHKZHH060316; Tue, 30 Aug 2011 17:20:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201108301720.p7UHKZHH060316@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 30 Aug 2011 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225268 - stable/8/sys/dev/alc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 17:20:35 -0000 Author: yongari Date: Tue Aug 30 17:20:34 2011 New Revision: 225268 URL: http://svn.freebsd.org/changeset/base/225268 Log: MFC r225088: Disable PHY hibernation until I get more detailed hibernation programming secret. The PHY would go into sleep state when it detects no established link and it will re-establish link when the cable is plugged in. Previously it failed to re-establish link when the cable is plugged in such that it required to manually down and up the interface again to make it work. This came from incorrectly programmed hibernation parameters. According to Atheros, each PHY chip requires different configuration for hibernation and different vendor has different settings for the same chip. Disabling hibernation may consume more power but establishing link looks more important than saving power. Special thanks to Atheros for giving me instructions that disable hibernation. PR: kern/148772 Modified: stable/8/sys/dev/alc/if_alc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Tue Aug 30 16:52:25 2011 (r225267) +++ stable/8/sys/dev/alc/if_alc.c Tue Aug 30 17:20:34 2011 (r225268) @@ -534,13 +534,11 @@ alc_phy_reset(struct alc_softc *sc) uint16_t data; /* Reset magic from Linux. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | GPHY_CFG_SEL_ANA_RESET); + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); @@ -625,6 +623,23 @@ alc_phy_reset(struct alc_softc *sc) alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, data); DELAY(1000); + + /* Disable hibernation. */ + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x0029); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); + + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x000B); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); } static void @@ -650,8 +665,7 @@ alc_phy_down(struct alc_softc *sc) break; default: /* Force PHY down. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET | GPHY_CFG_PHY_IDDQ | GPHY_CFG_PWDOWN_HW); DELAY(1000); From owner-svn-src-stable@FreeBSD.ORG Tue Aug 30 17:21:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F660106564A; Tue, 30 Aug 2011 17:21:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23FEE8FC14; Tue, 30 Aug 2011 17:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UHLuiI060390; Tue, 30 Aug 2011 17:21:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UHLuvE060388; Tue, 30 Aug 2011 17:21:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201108301721.p7UHLuvE060388@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 30 Aug 2011 17:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225269 - stable/7/sys/dev/alc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 17:21:56 -0000 Author: yongari Date: Tue Aug 30 17:21:55 2011 New Revision: 225269 URL: http://svn.freebsd.org/changeset/base/225269 Log: MFC r225088: Disable PHY hibernation until I get more detailed hibernation programming secret. The PHY would go into sleep state when it detects no established link and it will re-establish link when the cable is plugged in. Previously it failed to re-establish link when the cable is plugged in such that it required to manually down and up the interface again to make it work. This came from incorrectly programmed hibernation parameters. According to Atheros, each PHY chip requires different configuration for hibernation and different vendor has different settings for the same chip. Disabling hibernation may consume more power but establishing link looks more important than saving power. Special thanks to Atheros for giving me instructions that disable hibernation. PR: kern/148772 Modified: stable/7/sys/dev/alc/if_alc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Tue Aug 30 17:20:34 2011 (r225268) +++ stable/7/sys/dev/alc/if_alc.c Tue Aug 30 17:21:55 2011 (r225269) @@ -534,13 +534,11 @@ alc_phy_reset(struct alc_softc *sc) uint16_t data; /* Reset magic from Linux. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | GPHY_CFG_SEL_ANA_RESET); + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET); CSR_READ_2(sc, ALC_GPHY_CFG); DELAY(10 * 1000); @@ -625,6 +623,23 @@ alc_phy_reset(struct alc_softc *sc) alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, data); DELAY(1000); + + /* Disable hibernation. */ + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x0029); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); + + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_ADDR, + 0x000B); + data = alc_miibus_readreg(sc->alc_dev, sc->alc_phyaddr, + ALC_MII_DBG_DATA); + data &= ~0x8000; + alc_miibus_writereg(sc->alc_dev, sc->alc_phyaddr, ALC_MII_DBG_DATA, + data); } static void @@ -650,8 +665,7 @@ alc_phy_down(struct alc_softc *sc) break; default: /* Force PHY down. */ - CSR_WRITE_2(sc, ALC_GPHY_CFG, - GPHY_CFG_EXT_RESET | GPHY_CFG_HIB_EN | GPHY_CFG_HIB_PULSE | + CSR_WRITE_2(sc, ALC_GPHY_CFG, GPHY_CFG_EXT_RESET | GPHY_CFG_SEL_ANA_RESET | GPHY_CFG_PHY_IDDQ | GPHY_CFG_PWDOWN_HW); DELAY(1000); From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 01:17:49 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E6C7106564A; Wed, 31 Aug 2011 01:17:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DA2A8FC13; Wed, 31 Aug 2011 01:17:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V1HnfI074695; Wed, 31 Aug 2011 01:17:49 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V1Hnam074693; Wed, 31 Aug 2011 01:17:49 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201108310117.p7V1Hnam074693@svn.freebsd.org> From: Glen Barber Date: Wed, 31 Aug 2011 01:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225275 - stable/8 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 01:17:49 -0000 Author: gjb (doc committer) Date: Wed Aug 31 01:17:49 2011 New Revision: 225275 URL: http://svn.freebsd.org/changeset/base/225275 Log: MFC 225142: Reword sentence noting UPDATING entries prior to October 2007[1] are only available in older FreeBSD releases. PR: 159220 [1] - October 2007 is specific to HEAD. In stable/8 and stable/7, the correct year is 2004, so that change is reflected here as well. Modified: stable/8/UPDATING (contents, props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Tue Aug 30 23:55:45 2011 (r225274) +++ stable/8/UPDATING Wed Aug 31 01:17:49 2011 (r225275) @@ -1768,9 +1768,10 @@ COMMON ITEMS: FORMAT: This file contains a list, in reverse chronological order, of major -breakages in tracking -current. Not all things will be listed here, -and it only starts on October 16, 2004. Updating files can found in -previous releases if your system is older than this. +breakages in tracking -current. It is not guaranteed to be a complete +list of such breakages, and only contains entries since October 16, 2004. +If you need to see UPDATING entries from before that date, you will need +to fetch an UPDATING file from an older FreeBSD release. Copyright information: From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 01:18:23 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5F21106566C; Wed, 31 Aug 2011 01:18:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A50A88FC12; Wed, 31 Aug 2011 01:18:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V1IN49074753; Wed, 31 Aug 2011 01:18:23 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V1IN05074751; Wed, 31 Aug 2011 01:18:23 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201108310118.p7V1IN05074751@svn.freebsd.org> From: Glen Barber Date: Wed, 31 Aug 2011 01:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225276 - stable/7 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 01:18:23 -0000 Author: gjb (doc committer) Date: Wed Aug 31 01:18:23 2011 New Revision: 225276 URL: http://svn.freebsd.org/changeset/base/225276 Log: MFC 225142: Reword sentence noting UPDATING entries prior to October 2007[1] are only available in older FreeBSD releases. PR: 159220 [1] - October 2007 is specific to HEAD. In stable/8 and stable/7, the correct year is 2004, so that change is reflected here as well. Modified: stable/7/UPDATING (contents, props changed) Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Wed Aug 31 01:17:49 2011 (r225275) +++ stable/7/UPDATING Wed Aug 31 01:18:23 2011 (r225276) @@ -1095,9 +1095,10 @@ COMMON ITEMS: FORMAT: This file contains a list, in reverse chronological order, of major -breakages in tracking -current. Not all things will be listed here, -and it only starts on October 16, 2004. Updating files can found in -previous releases if your system is older than this. +breakages in tracking -current. It is not guaranteed to be a complete +list of such breakages, and only contains entries since October 16, 2004. +If you need to see UPDATING entries from before that date, you will need +to fetch an UPDATING file from an older FreeBSD release. Copyright information: From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 06:47:40 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 648C2106566B; Wed, 31 Aug 2011 06:47:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 535B88FC0A; Wed, 31 Aug 2011 06:47:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V6ldu3086959; Wed, 31 Aug 2011 06:47:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V6ldpx086957; Wed, 31 Aug 2011 06:47:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201108310647.p7V6ldpx086957@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 31 Aug 2011 06:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225282 - stable/8/sys/ufs/ufs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 06:47:40 -0000 Author: ae Date: Wed Aug 31 06:47:39 2011 New Revision: 225282 URL: http://svn.freebsd.org/changeset/base/225282 Log: MFC r225104: Fix lock leak. Reported by: Alex Lyashkov Modified: stable/8/sys/ufs/ufs/ufs_extattr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_extattr.c Wed Aug 31 06:35:50 2011 (r225281) +++ stable/8/sys/ufs/ufs/ufs_extattr.c Wed Aug 31 06:47:39 2011 (r225282) @@ -1031,14 +1031,14 @@ vop_setextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); - /* * XXX: No longer a supported way to delete extended attributes. */ if (ap->a_uio == NULL) return (EINVAL); + ufs_extattr_uepm_lock(ump, ap->a_td); + error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace, ap->a_name, ap->a_uio, ap->a_cred, ap->a_td); From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 06:48:00 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E681065674; Wed, 31 Aug 2011 06:48:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56BFB8FC0A; Wed, 31 Aug 2011 06:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V6m0bB087005; Wed, 31 Aug 2011 06:48:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V6m0MN087003; Wed, 31 Aug 2011 06:48:00 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201108310648.p7V6m0MN087003@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 31 Aug 2011 06:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225283 - stable/7/sys/ufs/ufs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 06:48:00 -0000 Author: ae Date: Wed Aug 31 06:48:00 2011 New Revision: 225283 URL: http://svn.freebsd.org/changeset/base/225283 Log: MFC r225104: Fix lock leak. Reported by: Alex Lyashkov Modified: stable/7/sys/ufs/ufs/ufs_extattr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_extattr.c Wed Aug 31 06:47:39 2011 (r225282) +++ stable/7/sys/ufs/ufs/ufs_extattr.c Wed Aug 31 06:48:00 2011 (r225283) @@ -1032,14 +1032,14 @@ vop_setextattr { struct ufsmount *ump = VFSTOUFS(mp); int error; - ufs_extattr_uepm_lock(ump, ap->a_td); - /* * XXX: No longer a supported way to delete extended attributes. */ if (ap->a_uio == NULL) return (EINVAL); + ufs_extattr_uepm_lock(ump, ap->a_td); + error = ufs_extattr_set(ap->a_vp, ap->a_attrnamespace, ap->a_name, ap->a_uio, ap->a_cred, ap->a_td); From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 09:14:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90EF9106567C; Wed, 31 Aug 2011 09:14:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 804838FC20; Wed, 31 Aug 2011 09:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V9EumZ091539; Wed, 31 Aug 2011 09:14:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V9Eulo091537; Wed, 31 Aug 2011 09:14:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108310914.p7V9Eulo091537@svn.freebsd.org> From: Attilio Rao Date: Wed, 31 Aug 2011 09:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225288 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 09:14:56 -0000 Author: attilio Date: Wed Aug 31 09:14:56 2011 New Revision: 225288 URL: http://svn.freebsd.org/changeset/base/225288 Log: MFC r225057: Fix a race that can happen when switching spinlocks in callout_cpu_switch() and curthread is preempted. Modified: stable/8/sys/kern/kern_timeout.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_timeout.c ============================================================================== --- stable/8/sys/kern/kern_timeout.c Wed Aug 31 08:44:45 2011 (r225287) +++ stable/8/sys/kern/kern_timeout.c Wed Aug 31 09:14:56 2011 (r225288) @@ -267,10 +267,17 @@ callout_cpu_switch(struct callout *c, st MPASS(c != NULL && cc != NULL); CC_LOCK_ASSERT(cc); + /* + * Avoid interrupts and preemption firing after the callout cpu + * is blocked in order to avoid deadlocks as the new thread + * may be willing to acquire the callout cpu lock. + */ c->c_cpu = CPUBLOCK; + spinlock_enter(); CC_UNLOCK(cc); new_cc = CC_CPU(new_cpu); CC_LOCK(new_cc); + spinlock_exit(); c->c_cpu = new_cpu; return (new_cc); } From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 16:25:34 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAC97106564A; Wed, 31 Aug 2011 16:25:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8ED08FC1E; Wed, 31 Aug 2011 16:25:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7VGPYKv007908; Wed, 31 Aug 2011 16:25:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7VGPY6v007902; Wed, 31 Aug 2011 16:25:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201108311625.p7VGPY6v007902@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 31 Aug 2011 16:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225296 - stable/8/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 16:25:34 -0000 Author: des Date: Wed Aug 31 16:25:34 2011 New Revision: 225296 URL: http://svn.freebsd.org/changeset/base/225296 Log: MFH r221107, r221108: alphabetize command-line options MFH r221233: add -E option (BIO_DELETE unused blocks) Modified: stable/8/sbin/fsck_ffs/fsck.h stable/8/sbin/fsck_ffs/fsck_ffs.8 stable/8/sbin/fsck_ffs/fsutil.c stable/8/sbin/fsck_ffs/main.c stable/8/sbin/fsck_ffs/pass5.c Directory Properties: stable/8/sbin/fsck_ffs/ (props changed) Modified: stable/8/sbin/fsck_ffs/fsck.h ============================================================================== --- stable/8/sbin/fsck_ffs/fsck.h Wed Aug 31 13:39:09 2011 (r225295) +++ stable/8/sbin/fsck_ffs/fsck.h Wed Aug 31 16:25:34 2011 (r225296) @@ -270,6 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ +int Eflag; /* zero out empty data blocks */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ @@ -333,6 +334,7 @@ char *blockcheck(char *name); int blread(int fd, char *buf, ufs2_daddr_t blk, long size); void bufinit(void); void blwrite(int fd, char *buf, ufs2_daddr_t blk, long size); +void blerase(int fd, ufs2_daddr_t blk, long size); void cacheino(union dinode *dp, ino_t inumber); void catch(int); void catchquit(int); Modified: stable/8/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/8/sbin/fsck_ffs/fsck_ffs.8 Wed Aug 31 13:39:09 2011 (r225295) +++ stable/8/sbin/fsck_ffs/fsck_ffs.8 Wed Aug 31 16:25:34 2011 (r225296) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd April 27, 2011 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BFprfny +.Op Fl BEFfnpry .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -139,6 +139,34 @@ action. The following flags are interpreted by .Nm : .Bl -tag -width indent +.It Fl B +A check is done on the specified and possibly active file system. +The set of corrections that can be done is limited to those done +when running in preen mode (see the +.Fl p +flag). +If unexpected errors are found, +the file system is marked as needing a foreground check and +.Nm +exits without attempting any further cleaning. +.It Fl E +Clear unallocated blocks, notifying the underlying device that they +are not used and that their contents may be discarded. +This is useful for filesystems which have been mounted on systems +without TRIM support, or with TRIM support disabled, as well as +filesystems which have been copied from one device to another. +.Pp +See the +.Fl E +and +.Fl t +flags of +.Xr newfs 8 , +and +the +.Fl t +flag of +.Xr tunefs 8 . .It Fl F Determine whether the file system needs to be cleaned immediately in foreground, or if its cleaning can be deferred to background. @@ -160,16 +188,6 @@ The only thing that .Nm does is to determine whether a foreground or background check is needed and exit with an appropriate status code. -.It Fl B -A check is done on the specified and possibly active file system. -The set of corrections that can be done is limited to those done -when running in preen mode (see the -.Fl p -flag). -If unexpected errors are found, -the file system is marked as needing a foreground check and -.Nm -exits without attempting any further cleaning. .It Fl b Use the block specified immediately after the flag as the super block for the file system. Modified: stable/8/sbin/fsck_ffs/fsutil.c ============================================================================== --- stable/8/sbin/fsck_ffs/fsutil.c Wed Aug 31 13:39:09 2011 (r225295) +++ stable/8/sbin/fsck_ffs/fsutil.c Wed Aug 31 16:25:34 2011 (r225296) @@ -39,9 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include -#include #include #include @@ -421,6 +422,20 @@ blwrite(int fd, char *buf, ufs2_daddr_t return; } +void +blerase(int fd, ufs2_daddr_t blk, long size) +{ + off_t ioarg[2]; + + if (fd < 0) + return; + ioarg[0] = blk * dev_bsize; + ioarg[1] = size; + ioctl(fd, DIOCGDELETE, ioarg); + /* we don't really care if we succeed or not */ + return; +} + /* * Verify cylinder group's magic number and other parameters. If the * test fails, offer an option to rebuild the whole cylinder group. Modified: stable/8/sbin/fsck_ffs/main.c ============================================================================== --- stable/8/sbin/fsck_ffs/main.c Wed Aug 31 13:39:09 2011 (r225295) +++ stable/8/sbin/fsck_ffs/main.c Wed Aug 31 16:25:34 2011 (r225296) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npry")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npry")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -106,6 +106,10 @@ main(int argc, char *argv[]) debug++; break; + case 'E': + Eflag++; + break; + case 'f': skipclean = 0; break; @@ -605,9 +609,9 @@ getmntpt(const char *name) static void usage(void) { - (void) fprintf(stderr, - "usage: %s [-BFprfny] [-b block] [-c level] [-m mode] " - "filesystem ...\n", - getprogname()); - exit(1); + (void) fprintf(stderr, + "usage: %s [-BEFprfny] [-b block] [-c level] [-m mode] " + "filesystem ...\n", + getprogname()); + exit(1); } Modified: stable/8/sbin/fsck_ffs/pass5.c ============================================================================== --- stable/8/sbin/fsck_ffs/pass5.c Wed Aug 31 13:39:09 2011 (r225295) +++ stable/8/sbin/fsck_ffs/pass5.c Wed Aug 31 16:25:34 2011 (r225296) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); static void check_maps(u_char *, u_char *, int, ufs2_daddr_t, const char *, int *, int, int); +static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end); + void pass5(void) { @@ -57,7 +59,7 @@ pass5(void) int inomapsize, blkmapsize; struct fs *fs = &sblock; struct cg *cg = &cgrp; - ufs2_daddr_t d, dbase, dmax; + ufs2_daddr_t d, dbase, dmax, start; int excessdirs, rewritecg = 0; struct csum *cs; struct csum_total cstotal; @@ -241,13 +243,21 @@ pass5(void) setbit(cg_inosused(newcg), i); newcg->cg_cs.cs_nifree--; } + start = -1; for (i = 0, d = dbase; d < dmax; d += fs->fs_frag, i += fs->fs_frag) { frags = 0; for (j = 0; j < fs->fs_frag; j++) { - if (testbmap(d + j)) + if (testbmap(d + j)) { + if (Eflag && start != -1) { + clear_blocks(start, d + j - 1); + start = -1; + } continue; + } + if (start == -1) + start = d + j; setbit(cg_blksfree(newcg), i + j); frags++; } @@ -262,6 +272,8 @@ pass5(void) ffs_fragacct(fs, blk, newcg->cg_frsum, 1); } } + if (Eflag && start != -1) + clear_blocks(start, d - 1); if (fs->fs_contigsumsize > 0) { int32_t *sump = cg_clustersum(newcg); u_char *mapp = cg_clustersfree(newcg); @@ -550,3 +562,12 @@ check_maps( } } } + +static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end) +{ + + if (debug) + printf("Zero frags %jd to %jd\n", start, end); + blerase(fswritefd, fsbtodb(&sblock, start), + lfragtosize(&sblock, end - start + 1)); +} From owner-svn-src-stable@FreeBSD.ORG Wed Aug 31 16:54:05 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22001065678; Wed, 31 Aug 2011 16:54:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913158FC2A; Wed, 31 Aug 2011 16:54:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7VGs5gq008769; Wed, 31 Aug 2011 16:54:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7VGs5vw008767; Wed, 31 Aug 2011 16:54:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201108311654.p7VGs5vw008767@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 31 Aug 2011 16:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225297 - stable/7 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 16:54:05 -0000 Author: des Date: Wed Aug 31 16:54:05 2011 New Revision: 225297 URL: http://svn.freebsd.org/changeset/base/225297 Log: I have a box running 702103 that needed a new btxld. Modified: stable/7/Makefile.inc1 Modified: stable/7/Makefile.inc1 ============================================================================== --- stable/7/Makefile.inc1 Wed Aug 31 16:25:34 2011 (r225296) +++ stable/7/Makefile.inc1 Wed Aug 31 16:54:05 2011 (r225297) @@ -986,7 +986,7 @@ build-tools: # # cross-tools: Build cross-building tools # -.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 702102 +.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 702104 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld .endif From owner-svn-src-stable@FreeBSD.ORG Thu Sep 1 15:53:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50FE106564A; Thu, 1 Sep 2011 15:53:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A47F28FC1A; Thu, 1 Sep 2011 15:53:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p81FrxNT057720; Thu, 1 Sep 2011 15:53:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p81Frx52057718; Thu, 1 Sep 2011 15:53:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109011553.p81Frx52057718@svn.freebsd.org> From: Alexander Motin Date: Thu, 1 Sep 2011 15:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225312 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 15:53:59 -0000 Author: mav Date: Thu Sep 1 15:53:59 2011 New Revision: 225312 URL: http://svn.freebsd.org/changeset/base/225312 Log: MFC r225140: Add ID for ASMedia ASM1061 2-port PCIe 2.0 x1 6Gb/s SATA controller. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Sep 1 13:51:26 2011 (r225311) +++ stable/8/sys/dev/ahci/ahci.c Thu Sep 1 15:53:59 2011 (r225312) @@ -128,6 +128,7 @@ static struct { {0x43931002, 0x00, "ATI IXP700", 0}, {0x43941002, 0x00, "ATI IXP800", 0}, {0x43951002, 0x00, "ATI IXP800", 0}, + {0x06121b21, 0x00, "ASMedia ASM1061", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-stable@FreeBSD.ORG Thu Sep 1 19:39:10 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D61B1065670; Thu, 1 Sep 2011 19:39:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB9D8FC0C; Thu, 1 Sep 2011 19:39:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p81JdAEl064776; Thu, 1 Sep 2011 19:39:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p81JdAfa064773; Thu, 1 Sep 2011 19:39:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109011939.p81JdAfa064773@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 1 Sep 2011 19:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225316 - stable/8/sbin/mdconfig X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 19:39:10 -0000 Author: des Date: Thu Sep 1 19:39:10 2011 New Revision: 225316 URL: http://svn.freebsd.org/changeset/base/225316 Log: MFH 221143, 221144: whitespace MFH 221232: make "-f" optional Modified: stable/8/sbin/mdconfig/mdconfig.8 stable/8/sbin/mdconfig/mdconfig.c Directory Properties: stable/8/sbin/mdconfig/ (props changed) Modified: stable/8/sbin/mdconfig/mdconfig.8 ============================================================================== --- stable/8/sbin/mdconfig/mdconfig.8 Thu Sep 1 16:47:49 2011 (r225315) +++ stable/8/sbin/mdconfig/mdconfig.8 Thu Sep 1 19:39:10 2011 (r225316) @@ -68,6 +68,8 @@ .Op Fl n .Op Fl v .Op Fl u Ar unit +.Nm +.Ar file .Sh DESCRIPTION The .Nm @@ -185,6 +187,15 @@ Request a specific unit number for the .Xr md 4 device instead of automatic allocation. .El +.Pp +The last form, +.Nm +.Ar file , +is provided for convenience as an abbreviation of +.Nm +.Fl a +.Fl t Ar vnode +.Fl f Ar file . .Sh EXAMPLES To create a 4 megabyte .Xr malloc 9 Modified: stable/8/sbin/mdconfig/mdconfig.c ============================================================================== --- stable/8/sbin/mdconfig/mdconfig.c Thu Sep 1 16:47:49 2011 (r225315) +++ stable/8/sbin/mdconfig/mdconfig.c Thu Sep 1 19:39:10 2011 (r225316) @@ -38,6 +38,7 @@ static enum {UNSET, ATTACH, DETACH, LIST static int nflag; static void usage(void); +static void md_set_file(const char *); static int md_find(char *, const char *); static int md_query(char *name); static int md_list(char *units, int opt); @@ -59,7 +60,8 @@ usage() " [-s size] [-S sectorsize] [-u unit]\n" " [-x sectors/track] [-y heads/cyl]\n" " mdconfig -d -u unit [-o [no]force]\n" -" mdconfig -l [-v] [-n] [-u unit]\n"); +" mdconfig -l [-v] [-n] [-u unit]\n" +" mdconfig file\n"); fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n"); fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n"); @@ -82,10 +84,7 @@ main(int argc, char **argv) err(1, "could not allocate memory"); vflag = 0; bzero(mdio.md_file, PATH_MAX); - for (;;) { - ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:"); - if (ch == -1) - break; + while ((ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:")) != -1) { switch (ch) { case 'a': if (cmdline != 0) @@ -141,23 +140,9 @@ main(int argc, char **argv) mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; cmdline = 2; } - if (cmdline != 2) - usage(); - if (realpath(optarg, mdio.md_file) == NULL) { - err(1, "could not find full path for %s", - optarg); - } - fd = open(mdio.md_file, O_RDONLY); - if (fd < 0) - err(1, "could not open %s", optarg); - else if (mdio.md_mediasize == 0) { - struct stat sb; - - if (fstat(fd, &sb) == -1) - err(1, "could not stat %s", optarg); - mdio.md_mediasize = sb.st_size; - } - close(fd); + if (cmdline != 2) + usage(); + md_set_file(optarg); break; case 'o': if (action == DETACH) { @@ -267,6 +252,19 @@ main(int argc, char **argv) usage(); } } + + argc -= optind; + argv += optind; + if (action == UNSET) { + if (argc != 1) + usage(); + action = ATTACH; + mdio.md_type = MD_VNODE; + mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + cmdline = 2; + md_set_file(*argv); + } + mdio.md_version = MDIOVERSION; if (!kld_isloaded("g_md") && kld_load("geom_md") == -1) @@ -294,7 +292,7 @@ main(int argc, char **argv) } if (action == LIST) { if (mdio.md_options & MD_AUTOUNIT) { - /* + /* * Listing all devices. This is why we pass NULL * together with OPT_LIST. */ @@ -322,6 +320,26 @@ main(int argc, char **argv) return (0); } +static void +md_set_file(const char *fn) +{ + struct stat sb; + int fd; + + if (realpath(fn, mdio.md_file) == NULL) + err(1, "could not find full path for %s", fn); + fd = open(mdio.md_file, O_RDONLY); + if (fd < 0) + err(1, "could not open %s", fn); + if (fstat(fd, &sb) == -1) + err(1, "could not stat %s", fn); + if (!S_ISREG(sb.st_mode)) + errx(1, "%s is not a regular file", fn); + if (mdio.md_mediasize == 0) + mdio.md_mediasize = sb.st_size; + close(fd); +} + /* * Lists md(4) disks. Is used also as a query routine, since it handles XML * interface. 'units' can be NULL for listing memory disks. It might be From owner-svn-src-stable@FreeBSD.ORG Fri Sep 2 07:37:56 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10469106566B; Fri, 2 Sep 2011 07:37:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFA768FC12; Fri, 2 Sep 2011 07:37:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p827btZj087127; Fri, 2 Sep 2011 07:37:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p827bt2o087115; Fri, 2 Sep 2011 07:37:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201109020737.p827bt2o087115@svn.freebsd.org> From: Martin Matuska Date: Fri, 2 Sep 2011 07:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225320 - in stable/8/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/msdosfs fs/nfsclient fs/nwfs fs/smbfs fs/tmpfs gnu/fs/xfs/FreeBSD kern nfsclient sys ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 07:37:56 -0000 Author: mm Date: Fri Sep 2 07:37:55 2011 New Revision: 225320 URL: http://svn.freebsd.org/changeset/base/225320 Log: MFC r207662 (trasz): Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize(). Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/fs/msdosfs/msdosfs_vnops.c stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nwfs/nwfs_io.c stable/8/sys/fs/smbfs/smbfs_io.c stable/8/sys/fs/tmpfs/tmpfs_vnops.c stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c stable/8/sys/kern/vfs_vnops.c stable/8/sys/nfsclient/nfs_bio.c stable/8/sys/sys/vnode.h stable/8/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -5696,16 +5696,8 @@ zfs_freebsd_write(ap) } */ *ap; { - if (ap->a_vp->v_type == VREG && ap->a_uio->uio_td != NULL) { - PROC_LOCK(ap->a_uio->uio_td->td_proc); - if (ap->a_uio->uio_offset + ap->a_uio->uio_resid > - lim_cur(ap->a_uio->uio_td->td_proc, RLIMIT_FSIZE)) { - psignal(ap->a_uio->uio_td->td_proc, SIGXFSZ); - PROC_UNLOCK(ap->a_uio->uio_td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(ap->a_uio->uio_td->td_proc); - } + if (vn_rlimit_fsize(ap->a_vp, ap->a_uio, ap->a_uio->uio_td)) + return (EFBIG); return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -61,9 +61,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -699,16 +696,8 @@ msdosfs_write(ap) /* * If they've exceeded their filesize limit, tell them about it. */ - if (td != NULL) { - PROC_LOCK(td->td_proc); - if ((uoff_t)uio->uio_offset + uio->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + if (vn_rlimit_fsize(vp, uio, td)) + return (EFBIG); /* * If the offset we are starting the write at is beyond the end of Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Fri Sep 2 07:37:55 2011 (r225320) @@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include @@ -867,7 +864,6 @@ ncl_write(struct vop_write_args *ap) daddr_t lbn; int bcount; int n, on, error = 0; - struct proc *p = td?td->td_proc:NULL; off_t tmp_off; KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); @@ -948,16 +944,8 @@ flush_and_restart: * Maybe this should be above the vnode op call, but so long as * file servers have no limits, i don't think it matters */ - if (p != NULL) { - PROC_LOCK(p); - if (uio->uio_offset + uio->uio_resid > - lim_cur(p, RLIMIT_FSIZE)) { - psignal(p, SIGXFSZ); - PROC_UNLOCK(p); - return (EFBIG); - } - PROC_UNLOCK(p); - } + if (vn_rlimit_fsize(vp, uio, td)) + return (EFBIG); biosize = vp->v_mount->mnt_stat.f_iosize; /* Modified: stable/8/sys/fs/nwfs/nwfs_io.c ============================================================================== --- stable/8/sys/fs/nwfs/nwfs_io.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/fs/nwfs/nwfs_io.c Fri Sep 2 07:37:55 2011 (r225320) @@ -34,16 +34,13 @@ */ #include #include -#include /* defines plimit structure in proc struct */ #include #include #include -#include #include #include #include #include -#include #include #include @@ -235,16 +232,10 @@ nwfs_writevnode(vp, uiop, cred, ioflag) } } if (uiop->uio_resid == 0) return 0; - if (td != NULL) { - PROC_LOCK(td->td_proc); - if (uiop->uio_offset + uiop->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + + if (vn_rlimit_fsize(vp, uiop, td)) + return (EFBIG); + error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cred); NCPVNDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid); if (!error) { Modified: stable/8/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/8/sys/fs/smbfs/smbfs_io.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/fs/smbfs/smbfs_io.c Fri Sep 2 07:37:55 2011 (r225320) @@ -34,9 +34,7 @@ */ #include #include -#include /* defines plimit structure in proc struct */ #include -#include #include #include #include @@ -241,7 +239,6 @@ smbfs_writevnode(struct vnode *vp, struc struct smbmount *smp = VTOSMBFS(vp); struct smbnode *np = VTOSMB(vp); struct smb_cred scred; - struct proc *p; struct thread *td; int error = 0; @@ -255,7 +252,6 @@ smbfs_writevnode(struct vnode *vp, struc /* if (uiop->uio_offset + uiop->uio_resid > smp->nm_maxfilesize) return (EFBIG);*/ td = uiop->uio_td; - p = td->td_proc; if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { smbfs_attr_cacheremove(vp); @@ -277,16 +273,10 @@ smbfs_writevnode(struct vnode *vp, struc } if (uiop->uio_resid == 0) return 0; - if (p != NULL) { - PROC_LOCK(p); - if (uiop->uio_offset + uiop->uio_resid > - lim_cur(p, RLIMIT_FSIZE)) { - psignal(p, SIGXFSZ); - PROC_UNLOCK(p); - return EFBIG; - } - PROC_UNLOCK(p); - } + + if (vn_rlimit_fsize(vp, uiop, td)) + return (EFBIG); + smb_makescred(&scred, td, cred); error = smb_write(smp->sm_share, np->n_fid, uiop, &scred); SMBVDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid); Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -723,16 +722,8 @@ tmpfs_write(struct vop_write_args *v) VFS_TO_TMPFS(vp->v_mount)->tm_maxfilesize) return (EFBIG); - if (vp->v_type == VREG && td != NULL) { - PROC_LOCK(td->td_proc); - if (uio->uio_offset + uio->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + if (vn_rlimit_fsize(vp, uio, td)) + return (EFBIG); extended = uio->uio_offset + uio->uio_resid > node->tn_size; if (extended) { Modified: stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c ============================================================================== --- stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -598,16 +598,8 @@ xfs_write_file(xfs_inode_t *xip, struct */ #if 0 td = uio->uio_td; - if (vp->v_type == VREG && td != NULL) { - PROC_LOCK(td->td_proc); - if (uio->uio_offset + uio->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) + return (EFBIG); #endif resid = uio->uio_resid; Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/kern/vfs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1334,3 +1335,21 @@ vn_vget_ino(struct vnode *vp, ino_t ino, } return (error); } + +int +vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, const struct thread *td) +{ + if (vp->v_type != VREG || td == NULL) + return (0); + + PROC_LOCK(td->td_proc); + if (uio->uio_offset + uio->uio_resid > + lim_cur(td->td_proc, RLIMIT_FSIZE)) { + psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + return (EFBIG); + } + PROC_UNLOCK(td->td_proc); + + return (0); +} Modified: stable/8/sys/nfsclient/nfs_bio.c ============================================================================== --- stable/8/sys/nfsclient/nfs_bio.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/nfsclient/nfs_bio.c Fri Sep 2 07:37:55 2011 (r225320) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include @@ -862,7 +860,6 @@ nfs_write(struct vop_write_args *ap) daddr_t lbn; int bcount; int n, on, error = 0; - struct proc *p = td?td->td_proc:NULL; KASSERT(uio->uio_rw == UIO_WRITE, ("nfs_write mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, @@ -940,16 +937,8 @@ flush_and_restart: * Maybe this should be above the vnode op call, but so long as * file servers have no limits, i don't think it matters */ - if (p != NULL) { - PROC_LOCK(p); - if (uio->uio_offset + uio->uio_resid > - lim_cur(p, RLIMIT_FSIZE)) { - psignal(p, SIGXFSZ); - PROC_UNLOCK(p); - return (EFBIG); - } - PROC_UNLOCK(p); - } + if (vn_rlimit_fsize(vp, uio, td)) + return (EFBIG); biosize = vp->v_mount->mnt_stat.f_iosize; /* Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/sys/vnode.h Fri Sep 2 07:37:55 2011 (r225320) @@ -778,6 +778,7 @@ struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_unixify_accmode(accmode_t *accmode); +int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio, const struct thread *td); #endif /* _KERNEL */ Modified: stable/8/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vnops.c Fri Sep 2 07:19:27 2011 (r225319) +++ stable/8/sys/ufs/ffs/ffs_vnops.c Fri Sep 2 07:37:55 2011 (r225320) @@ -75,9 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include #include @@ -651,7 +648,6 @@ ffs_write(ap) struct inode *ip; struct fs *fs; struct buf *bp; - struct thread *td; ufs_lbn_t lbn; off_t osize; int seqcount; @@ -703,17 +699,8 @@ ffs_write(ap) * Maybe this should be above the vnode op call, but so long as * file servers have no limits, I don't think it matters. */ - td = uio->uio_td; - if (vp->v_type == VREG && td != NULL) { - PROC_LOCK(td->td_proc); - if (uio->uio_offset + uio->uio_resid > - lim_cur(td->td_proc, RLIMIT_FSIZE)) { - psignal(td->td_proc, SIGXFSZ); - PROC_UNLOCK(td->td_proc); - return (EFBIG); - } - PROC_UNLOCK(td->td_proc); - } + if (vn_rlimit_fsize(vp, uio, uio->uio_td)) + return (EFBIG); resid = uio->uio_resid; osize = ip->i_size; From owner-svn-src-stable@FreeBSD.ORG Fri Sep 2 08:19:20 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16580106566C; Fri, 2 Sep 2011 08:19:20 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03DA18FC12; Fri, 2 Sep 2011 08:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p828JJfM088796; Fri, 2 Sep 2011 08:19:19 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p828JJJ2088791; Fri, 2 Sep 2011 08:19:19 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201109020819.p828JJJ2088791@svn.freebsd.org> From: Martin Matuska Date: Fri, 2 Sep 2011 08:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225326 - in stable/8/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys ufs/ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 08:19:20 -0000 Author: mm Date: Fri Sep 2 08:19:19 2011 New Revision: 225326 URL: http://svn.freebsd.org/changeset/base/225326 Log: MFC r226155: Generalize ffs_pages_remove() into vn_pages_remove(). Remove mapped pages for all dataset vnodes in zfs_rezget() using new vn_pages_remove() to fix mmapped files changed by zfs rollback or zfs receive -F. PR: kern/160035, kern/156933 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/kern/vfs_vnops.c stable/8/sys/sys/vnode.h stable/8/sys/ufs/ffs/ffs_inode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Sep 2 08:15:48 2011 (r225325) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Fri Sep 2 08:19:19 2011 (r225326) @@ -1259,6 +1259,7 @@ zfs_rezget(znode_t *zp) zfsvfs_t *zfsvfs = zp->z_zfsvfs; dmu_object_info_t doi; dmu_buf_t *db; + vnode_t *vp; uint64_t obj_num = zp->z_id; uint64_t mode, size; sa_bulk_attr_t bulk[8]; @@ -1334,8 +1335,9 @@ zfs_rezget(znode_t *zp) * that for example regular file was replaced with directory * which has the same object number. */ - if (ZTOV(zp) != NULL && - ZTOV(zp)->v_type != IFTOVT((mode_t)zp->z_mode)) { + vp = ZTOV(zp); + if (vp != NULL && + vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); return (EIO); @@ -1343,8 +1345,11 @@ zfs_rezget(znode_t *zp) zp->z_unlinked = (zp->z_links == 0); zp->z_blksz = doi.doi_data_block_size; - if (zp->z_size != size && ZTOV(zp) != NULL) - vnode_pager_setsize(ZTOV(zp), zp->z_size); + if (vp != NULL) { + vn_pages_remove(vp, 0, 0); + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); + } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Fri Sep 2 08:15:48 2011 (r225325) +++ stable/8/sys/kern/vfs_vnops.c Fri Sep 2 08:19:19 2011 (r225326) @@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include + static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_truncate_t vn_truncate; @@ -1353,3 +1356,15 @@ vn_rlimit_fsize(const struct vnode *vp, return (0); } + +void +vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) +{ + vm_object_t object; + + if ((object = vp->v_object) == NULL) + return; + VM_OBJECT_LOCK(object); + vm_object_page_remove(object, start, end, 0); + VM_OBJECT_UNLOCK(object); +} Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Fri Sep 2 08:15:48 2011 (r225325) +++ stable/8/sys/sys/vnode.h Fri Sep 2 08:19:19 2011 (r225326) @@ -644,6 +644,7 @@ int _vn_lock(struct vnode *vp, int flags int vn_open(struct nameidata *ndp, int *flagp, int cmode, struct file *fp); int vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags, struct ucred *cred, struct file *fp); +void vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end); int vn_pollrecord(struct vnode *vp, struct thread *p, int events); int vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, enum uio_seg segflg, int ioflg, Modified: stable/8/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_inode.c Fri Sep 2 08:15:48 2011 (r225325) +++ stable/8/sys/ufs/ffs/ffs_inode.c Fri Sep 2 08:19:19 2011 (r225326) @@ -129,18 +129,6 @@ ffs_update(vp, waitfor) } } -static void -ffs_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) -{ - vm_object_t object; - - if ((object = vp->v_object) == NULL) - return; - VM_OBJECT_LOCK(object); - vm_object_page_remove(object, start, end, FALSE); - VM_OBJECT_UNLOCK(object); -} - #define SINGLE 0 /* index of single indirect block */ #define DOUBLE 1 /* index of double indirect block */ #define TRIPLE 2 /* index of triple indirect block */ @@ -218,7 +206,7 @@ ffs_truncate(vp, length, flags, cred, td (void) chkdq(ip, -extblocks, NOCRED, 0); #endif vinvalbuf(vp, V_ALT, 0, 0); - ffs_pages_remove(vp, + vn_pages_remove(vp, OFF_TO_IDX(lblktosize(fs, -extblocks)), 0); ip->i_din2->di_extsize = 0; for (i = 0; i < NXADDR; i++) { @@ -297,7 +285,7 @@ ffs_truncate(vp, length, flags, cred, td ASSERT_VOP_LOCKED(vp, "ffs_truncate1"); vinvalbuf(vp, needextclean ? 0 : V_NORMAL, 0, 0); if (!needextclean) - ffs_pages_remove(vp, 0, + vn_pages_remove(vp, 0, OFF_TO_IDX(lblktosize(fs, -extblocks))); vnode_pager_setsize(vp, 0); ip->i_flag |= IN_CHANGE | IN_UPDATE; From owner-svn-src-stable@FreeBSD.ORG Fri Sep 2 16:17:53 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483E5106566C; Fri, 2 Sep 2011 16:17:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2A598FC0C; Fri, 2 Sep 2011 16:17:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82GHqgI006499; Fri, 2 Sep 2011 16:17:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82GHqDh006497; Fri, 2 Sep 2011 16:17:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109021617.p82GHqDh006497@svn.freebsd.org> From: Marius Strobl Date: Fri, 2 Sep 2011 16:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225332 - stable/8/sys/sparc64/sbus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 16:17:53 -0000 Author: marius Date: Fri Sep 2 16:17:52 2011 New Revision: 225332 URL: http://svn.freebsd.org/changeset/base/225332 Log: MFC: r225229 Since r221218 (MFC'ed to stable/8 in r223500) rman_manage_region(9) actually honors rm_start and rm_end which may cause problems when these contain garbage so zero the range descriptors embedding the rmans when allocating them. Modified: stable/8/sys/sparc64/sbus/sbus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/8/sys/sparc64/sbus/sbus.c Fri Sep 2 16:00:51 2011 (r225331) +++ stable/8/sys/sparc64/sbus/sbus.c Fri Sep 2 16:17:52 2011 (r225332) @@ -303,8 +303,8 @@ sbus_attach(device_t dev) sizeof(*range), (void **)&range)) == -1) { panic("%s: error getting ranges property", __func__); } - sc->sc_rd = (struct sbus_rd *)malloc(sizeof(*sc->sc_rd) * sc->sc_nrange, - M_DEVBUF, M_NOWAIT); + sc->sc_rd = malloc(sizeof(*sc->sc_rd) * sc->sc_nrange, M_DEVBUF, + M_NOWAIT | M_ZERO); if (sc->sc_rd == NULL) panic("%s: cannot allocate rmans", __func__); /* From owner-svn-src-stable@FreeBSD.ORG Fri Sep 2 16:18:07 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D47010656D1; Fri, 2 Sep 2011 16:18:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE8F8FC0C; Fri, 2 Sep 2011 16:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82GI77j006544; Fri, 2 Sep 2011 16:18:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82GI7DU006542; Fri, 2 Sep 2011 16:18:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109021618.p82GI7DU006542@svn.freebsd.org> From: Marius Strobl Date: Fri, 2 Sep 2011 16:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225333 - stable/7/sys/sparc64/sbus X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 16:18:07 -0000 Author: marius Date: Fri Sep 2 16:18:06 2011 New Revision: 225333 URL: http://svn.freebsd.org/changeset/base/225333 Log: MFC: r225229 Since r221218 rman_manage_region(9) actually honors rm_start and rm_end which may cause problems when these contain garbage so zero the range descriptors embedding the rmans when allocating them. Modified: stable/7/sys/sparc64/sbus/sbus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sbus/sbus.c ============================================================================== --- stable/7/sys/sparc64/sbus/sbus.c Fri Sep 2 16:17:52 2011 (r225332) +++ stable/7/sys/sparc64/sbus/sbus.c Fri Sep 2 16:18:06 2011 (r225333) @@ -348,8 +348,8 @@ sbus_attach(device_t dev) sizeof(*range), (void **)&range)) == -1) { panic("%s: error getting ranges property", __func__); } - sc->sc_rd = (struct sbus_rd *)malloc(sizeof(*sc->sc_rd) * sc->sc_nrange, - M_DEVBUF, M_NOWAIT); + sc->sc_rd = malloc(sizeof(*sc->sc_rd) * sc->sc_nrange, M_DEVBUF, + M_NOWAIT | M_ZERO); if (sc->sc_rd == NULL) panic("%s: cannot allocate rmans", __func__); /* From owner-svn-src-stable@FreeBSD.ORG Sat Sep 3 01:45:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D59C106566B; Sat, 3 Sep 2011 01:45:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE3B8FC08; Sat, 3 Sep 2011 01:45:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p831jbNn024376; Sat, 3 Sep 2011 01:45:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p831jbR5024374; Sat, 3 Sep 2011 01:45:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201109030145.p831jbR5024374@svn.freebsd.org> From: Rick Macklem Date: Sat, 3 Sep 2011 01:45:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225358 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 01:45:37 -0000 Author: rmacklem Date: Sat Sep 3 01:45:37 2011 New Revision: 225358 URL: http://svn.freebsd.org/changeset/base/225358 Log: MFC: r225049 Fix the NFSv4 server so that it returns NFSERR_SYMLINK when an attempt to do an Open operation on any type of file other than VREG is done. A recent discussion on the IETF working group's mailing list (nfsv4@ietf.org) decided that NFSERR_SYMLINK should be returned for all non-regular files and not just symlinks, so that the Linux client would work correctly. This change does not affect the FreeBSD NFSv4 client and is not believed to have a negative effect on other NFSv4 clients. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Sep 3 00:47:28 2011 (r225357) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Sep 3 01:45:37 2011 (r225358) @@ -2741,12 +2741,11 @@ nfsrvd_open(struct nfsrv_descript *nd, _ * Do basic access checking. */ if (!nd->nd_repstat && vnode_vtype(vp) != VREG) { - if (vnode_vtype(vp) == VDIR) - nd->nd_repstat = NFSERR_ISDIR; - else if (vnode_vtype(vp) == VLNK) + /* + * The IETF working group decided that this is the correct + * error return for all non-regular files. + */ nd->nd_repstat = NFSERR_SYMLINK; - else - nd->nd_repstat = NFSERR_INVAL; } if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS)) nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, From owner-svn-src-stable@FreeBSD.ORG Sat Sep 3 03:13:35 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CBC41065674; Sat, 3 Sep 2011 03:13:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3C18FC15; Sat, 3 Sep 2011 03:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p833DZlp027316; Sat, 3 Sep 2011 03:13:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p833DZRS027314; Sat, 3 Sep 2011 03:13:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201109030313.p833DZRS027314@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 3 Sep 2011 03:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225360 - stable/8/sbin/fsck_ffs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 03:13:35 -0000 Author: des Date: Sat Sep 3 03:13:35 2011 New Revision: 225360 URL: http://svn.freebsd.org/changeset/base/225360 Log: insta-mfh r225359: cosmetic nit in usage string. Modified: stable/8/sbin/fsck_ffs/main.c Directory Properties: stable/8/sbin/fsck_ffs/ (props changed) Modified: stable/8/sbin/fsck_ffs/main.c ============================================================================== --- stable/8/sbin/fsck_ffs/main.c Sat Sep 3 03:12:33 2011 (r225359) +++ stable/8/sbin/fsck_ffs/main.c Sat Sep 3 03:13:35 2011 (r225360) @@ -610,7 +610,7 @@ static void usage(void) { (void) fprintf(stderr, - "usage: %s [-BEFprfny] [-b block] [-c level] [-m mode] " + "usage: %s [-BEFfnpry] [-b block] [-c level] [-m mode] " "filesystem ...\n", getprogname()); exit(1); From owner-svn-src-stable@FreeBSD.ORG Sat Sep 3 08:31:59 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF2A6106566C; Sat, 3 Sep 2011 08:31:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF2718FC08; Sat, 3 Sep 2011 08:31:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p838Vxqh037013; Sat, 3 Sep 2011 08:31:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p838Vxka037011; Sat, 3 Sep 2011 08:31:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109030831.p838Vxka037011@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 3 Sep 2011 08:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225365 - stable/8/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 08:31:59 -0000 Author: kib Date: Sat Sep 3 08:31:59 2011 New Revision: 225365 URL: http://svn.freebsd.org/changeset/base/225365 Log: MFC r225040: Prevent the hiwatermark for the unix domain socket from becoming effectively negative. Often seen as upstream fastcgi connection timeouts in nginx when using sendfile over unix domain sockets for communication. Modified: stable/8/sys/kern/uipc_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/uipc_usrreq.c ============================================================================== --- stable/8/sys/kern/uipc_usrreq.c Sat Sep 3 08:08:24 2011 (r225364) +++ stable/8/sys/kern/uipc_usrreq.c Sat Sep 3 08:31:59 2011 (r225365) @@ -776,7 +776,7 @@ uipc_send(struct socket *so, int flags, struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt_delta, sbcc; - u_long newhiwat; + u_int newhiwat; int error = 0; unp = sotounpcb(so); @@ -911,7 +911,10 @@ uipc_send(struct socket *so, int flags, sorwakeup_locked(so2); SOCKBUF_LOCK(&so->so_snd); - newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); + if ((int)so->so_snd.sb_hiwat >= (int)(sbcc - unp2->unp_cc)) + newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); + else + newhiwat = 0; (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, newhiwat, RLIM_INFINITY); so->so_snd.sb_mbmax -= mbcnt_delta; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 3 20:46:30 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999BA106566C; Sat, 3 Sep 2011 20:46:30 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EEF8FC14; Sat, 3 Sep 2011 20:46:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p83KkUd7061254; Sat, 3 Sep 2011 20:46:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p83KkUGO061252; Sat, 3 Sep 2011 20:46:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201109032046.p83KkUGO061252@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 Sep 2011 20:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225369 - stable/8/bin/ed X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 20:46:30 -0000 Author: brueffer Date: Sat Sep 3 20:46:30 2011 New Revision: 225369 URL: http://svn.freebsd.org/changeset/base/225369 Log: MFC: r225215 Fix memory leaks in error cases. Modified: stable/8/bin/ed/buf.c Directory Properties: stable/8/bin/ed/ (props changed) Modified: stable/8/bin/ed/buf.c ============================================================================== --- stable/8/bin/ed/buf.c Sat Sep 3 15:34:18 2011 (r225368) +++ stable/8/bin/ed/buf.c Sat Sep 3 20:46:30 2011 (r225369) @@ -94,6 +94,7 @@ put_sbuf_line(const char *cs) ; if (s - cs >= LINECHARS) { errmsg = "line too long"; + free(lp); return NULL; } len = s - cs; @@ -102,6 +103,7 @@ put_sbuf_line(const char *cs) if (fseeko(sfp, (off_t)0, SEEK_END) < 0) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot seek temp file"; + free(lp); return NULL; } sfseek = ftello(sfp); @@ -112,6 +114,7 @@ put_sbuf_line(const char *cs) sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; + free(lp); return NULL; } lp->len = len; From owner-svn-src-stable@FreeBSD.ORG Sat Sep 3 21:28:26 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1FA4106566C; Sat, 3 Sep 2011 21:28:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E140F8FC13; Sat, 3 Sep 2011 21:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p83LSQT0062539; Sat, 3 Sep 2011 21:28:26 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p83LSQqG062537; Sat, 3 Sep 2011 21:28:26 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201109032128.p83LSQqG062537@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 Sep 2011 21:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225370 - stable/7/bin/ed X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 21:28:27 -0000 Author: brueffer Date: Sat Sep 3 21:28:26 2011 New Revision: 225370 URL: http://svn.freebsd.org/changeset/base/225370 Log: MFC: r225215 Fix memory leak in error cases. Modified: stable/7/bin/ed/buf.c Directory Properties: stable/7/bin/ed/ (props changed) Modified: stable/7/bin/ed/buf.c ============================================================================== --- stable/7/bin/ed/buf.c Sat Sep 3 20:46:30 2011 (r225369) +++ stable/7/bin/ed/buf.c Sat Sep 3 21:28:26 2011 (r225370) @@ -94,6 +94,7 @@ put_sbuf_line(const char *cs) ; if (s - cs >= LINECHARS) { errmsg = "line too long"; + free(lp); return NULL; } len = s - cs; @@ -102,6 +103,7 @@ put_sbuf_line(const char *cs) if (fseeko(sfp, (off_t)0, SEEK_END) < 0) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot seek temp file"; + free(lp); return NULL; } sfseek = ftello(sfp); @@ -112,6 +114,7 @@ put_sbuf_line(const char *cs) sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; + free(lp); return NULL; } lp->len = len;