From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 00:11:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D6E1065670; Sun, 7 Aug 2011 00:11:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28F368FC0C; Sun, 7 Aug 2011 00:11: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 p770BeM2072892; Sun, 7 Aug 2011 00:11:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p770BeaC072890; Sun, 7 Aug 2011 00:11:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201108070011.p770BeaC072890@svn.freebsd.org> From: Alan Cox Date: Sun, 7 Aug 2011 00:11:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224689 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 00:11:40 -0000 Author: alc Date: Sun Aug 7 00:11:39 2011 New Revision: 224689 URL: http://svn.freebsd.org/changeset/base/224689 Log: Fix an error in kmem_alloc_attr(). Unless "tries" is updated, kmem_alloc_attr() could get stuck in a loop. Approved by: re (kib) MFC after: 3 days Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Sat Aug 6 19:20:17 2011 (r224688) +++ head/sys/vm/vm_contig.c Sun Aug 7 00:11:39 2011 (r224689) @@ -265,6 +265,7 @@ retry: vm_contig_grow_cache(tries, low, high); vm_map_lock(map); VM_OBJECT_LOCK(object); + tries++; goto retry; } while (i != 0) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 02:35:58 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57745106564A; Sun, 7 Aug 2011 02:35:58 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 215BF8FC08; Sun, 7 Aug 2011 02:35:57 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p772Zn6s008922 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 6 Aug 2011 19:35:56 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20110806232415.GE48988@alchemy.franken.de> Date: Sat, 6 Aug 2011 19:35:49 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> <20110806232415.GE48988@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1244.3) Cc: src-committers@FreeBSD.org, Ruslan Mahmatkhanov , Garrett Cooper , svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 02:35:58 -0000 On Aug 6, 2011, at 4:24 PM, Marius Strobl wrote: > On Sun, Aug 07, 2011 at 01:06:48AM +0300, Andriy Gapon wrote: >> on 07/08/2011 00:41 Garrett Cooper said the following: >>> It's not just i386. It's other architectures like arm, mips, and = pc98 >>> according to the tinderbox reports (this list is potentially >>> incomplete). >>=20 >> Yeah, confusingly enough thr_pread_long() is declared to take = uint64_t* as its >> third argument, so this commit breaks all platforms where uint64_t is = not >> derived from (unsigned) long. >> Just in case, thr_pread_int() takes uint32_t* as well. >>=20 >=20 > Yes, the type of val is wrong. I'm currently running a fix through a > universe build Ah, euh, ok, I forgot about this particular quirk: uint64_t is deliberate, because it's the width of long on 64-bit architectures and thread_db is to be used as a support library for a cross-tool (i.e. a 32-bit debugger for a 64-bit target). That's why thr_pread_long() takes a pointer to uint64_t and thr_pread_int() takes a pointer to uint32_t... Sorry for missing this in the review. FYI, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 08:35:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27A9C106564A; Sun, 7 Aug 2011 08:35:16 +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 0DE8C8FC12; Sun, 7 Aug 2011 08:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p778ZFLA088088; Sun, 7 Aug 2011 08:35:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p778ZFVF088086; Sun, 7 Aug 2011 08:35:15 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108070835.p778ZFVF088086@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Aug 2011 08:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224690 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 08:35:16 -0000 Author: mm Date: Sun Aug 7 08:35:15 2011 New Revision: 224690 URL: http://svn.freebsd.org/changeset/base/224690 Log: Fix NetBSD PR bin/44114: makefs with -t cd9660 -o rockridge against directories with deep structure creates a corrupted cd9660 image. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114 Fix NetBSD PR bin/45217: makefs creates ISO9660 images that violate the ECMA-119 (ISO9660) specification. This is caused by erroneously writing 32 bytes with value 0x20 to the volume_set_id field and 128 bytes with value 0x20 to the the following 37-byte fields in the PVD: copyright_file_id, abstract_file_id, bibliographic_file_id This causes, among other unwanted results the reserved4 field to be overwritten with the value 0x20. To comply with the specification, this field muse be zero. As a result, all FreeBSD distribution images created with makefs have not been 100% valid ISO9660 files. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217 Reviewed by: kientzle Approved by: re (kib) Obtained from: NetBSD MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Aug 7 00:11:39 2011 (r224689) +++ head/usr.sbin/makefs/cd9660.c Sun Aug 7 08:35:15 2011 (r224690) @@ -223,13 +223,12 @@ cd9660_set_defaults(void) /* Make sure the PVD is clear */ memset(&diskStructure.primaryDescriptor, 0, 2048); - memset(diskStructure.primaryDescriptor.volume_set_id, 0x20,32); memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); memset(diskStructure.primaryDescriptor.application_id, 0x20,128); - memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); @@ -669,11 +668,11 @@ cd9660_finalize_PVD(void) cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, 128); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.copyright_file_id, 128); + diskStructure.primaryDescriptor.copyright_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.abstract_file_id, 128); + diskStructure.primaryDescriptor.abstract_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.bibliographic_file_id, 128); + diskStructure.primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ time(&tim); @@ -1307,6 +1306,8 @@ cd9660_rrip_move_directory(cd9660node *d /* Set the new name */ memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); strncpy(dir->isoDirRecord->name, newname, 8); + dir->isoDirRecord->length[0] = 34 + 8; + dir->isoDirRecord->name_len[0] = 8; return dir; } From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 08:42:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21B53106566B; Sun, 7 Aug 2011 08:42:37 +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 108DC8FC08; Sun, 7 Aug 2011 08:42: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 p778gbXg088334; Sun, 7 Aug 2011 08:42:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p778gaFI088322; Sun, 7 Aug 2011 08:42:36 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108070842.p778gaFI088322@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Aug 2011 08:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224691 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 08:42:37 -0000 Author: mm Date: Sun Aug 7 08:42:36 2011 New Revision: 224691 URL: http://svn.freebsd.org/changeset/base/224691 Log: Add compatibility for ISO images created with unfixed makefs that violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD. This allows tar to read FreeBSD distribution ISO images created with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1). In addition, merge following important bugfixes from libarchive's release/2.8 branch: Revision 2812: Merge 2811 from trunk: Don't try to verify that compression-level=0 produces larger results than the default compression, since this isn't true for all versions of liblzma. Revision 2817: Merge 2814 from trunk: Fix Issue 121 (mtree parser error) http://code.google.com/p/libarchive/issues/detail?id=121 Revision 2820: Fix issue 119. Change the file location check that a file location does not exceed volume block. New one is that a file content does not exceed volume block(end of an ISO image). It is better than previous check even if the issue did not happen. While reading an ISO image generated by an older version of mkisofs utility, a file location indicates the end the ISO image if its file size is zero and it is the last file of all files of the ISO image, so it is possible that the location value is the same as the number of the total block of the ISO image. http://code.google.com/p/libarchive/issues/detail?id=119 Revision 2955: Issue 134: Fix libarchive 2.8 crashing in archive_write_finish() when the open has failed and we're trying to write Zip format. http://code.google.com/p/libarchive/issues/detail?id=134 Revision 2958: Followup on Issue 134: 1) Port test_open_failure to libarchive 2.8 branch to test the problem reported in Issue 134. This test also shows that archive_read_open() sometimes fails to report open errors correctly. 2) Fix the bug in archive_read.c 3) Comment out the tests that close functions are invoked promptly when open fails; that's fully fixed in libarchive 3.0, but I don't think it's worth fixing here. Revision 3484: Use uintmax_t with %ju Revision 3487: Fix issue 163. Correctly allocate enough memory for a input buffer saved. http://code.google.com/p/libarchive/issues/detail?id=163 Revision 3542: Merge 2516, 2536 from trunk: Allow path table offset values of 0 and 18, which are used by some ISO writers. Reviewed by: kientzle Approved by: re (kib) MFC after: 3 days Added: head/lib/libarchive/test/test_open_failure.c (contents, props changed) Modified: head/lib/libarchive/archive_read.c head/lib/libarchive/archive_read_support_compression_uu.c head/lib/libarchive/archive_read_support_format_iso9660.c head/lib/libarchive/archive_read_support_format_mtree.c head/lib/libarchive/archive_write_set_compression_xz.c head/lib/libarchive/archive_write_set_format_zip.c head/lib/libarchive/test/Makefile head/lib/libarchive/test/test_read_format_mtree.c head/lib/libarchive/test/test_write_compress_lzma.c head/lib/libarchive/test/test_write_compress_xz.c Modified: head/lib/libarchive/archive_read.c ============================================================================== --- head/lib/libarchive/archive_read.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_read.c Sun Aug 7 08:42:36 2011 (r224691) @@ -377,6 +377,12 @@ build_stream(struct archive_read *a) /* If no bidder, we're done. */ if (best_bidder == NULL) { + /* Verify the final pipelin by asking it for some data. */ + __archive_read_filter_ahead(a->filter, 1, &avail); + if (avail < 0) { + cleanup_filters(a); + return (ARCHIVE_FATAL); + } a->archive.compression_name = a->filter->name; a->archive.compression_code = a->filter->code; return (ARCHIVE_OK); @@ -389,17 +395,11 @@ build_stream(struct archive_read *a) filter->bidder = best_bidder; filter->archive = a; filter->upstream = a->filter; - r = (best_bidder->init)(filter); - if (r != ARCHIVE_OK) { - free(filter); - return (r); - } a->filter = filter; - /* Verify the filter by asking it for some data. */ - __archive_read_filter_ahead(filter, 1, &avail); - if (avail < 0) { + r = (best_bidder->init)(a->filter); + if (r != ARCHIVE_OK) { cleanup_filters(a); - return (ARCHIVE_FATAL); + return (r); } } } Modified: head/lib/libarchive/archive_read_support_compression_uu.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_uu.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_read_support_compression_uu.c Sun Aug 7 08:42:36 2011 (r224691) @@ -381,7 +381,17 @@ ensure_in_buff_size(struct archive_read_ unsigned char *ptr; size_t newsize; - newsize = uudecode->in_allocated << 1; + /* + * Calculate a new buffer size for in_buff. + * Increase its value until it has enough size we need. + */ + newsize = uudecode->in_allocated; + do { + if (newsize < IN_BUFF_SIZE*32) + newsize <<= 1; + else + newsize += IN_BUFF_SIZE; + } while (size > newsize); ptr = malloc(newsize); if (ptr == NULL || newsize < uudecode->in_allocated) { Modified: head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_iso9660.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_read_support_format_iso9660.c Sun Aug 7 08:42:36 2011 (r224691) @@ -709,16 +709,18 @@ isSVD(struct iso9660 *iso9660, const uns /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+SVD_type_L_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must be at a valid location (WinISO + * and probably other programs omit this, so we allow zero) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+SVD_type_M_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Read Root Directory Record in Volume Descriptor. */ @@ -781,16 +783,17 @@ isEVD(struct iso9660 *iso9660, const uns /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); /* Location of Occurrence of Type M Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ @@ -862,19 +865,24 @@ isPVD(struct iso9660 *iso9660, const uns * available location, * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must also be at a valid location + * (although ECMA 119 requires a Type M Path Table, WinISO and + * probably other programs omit it, so we permit a zero here) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ + /* FreeBSD: makefs erroneously created images with 0x20 */ for (i = 0; i < PVD_reserved4_size; ++i) - if (h[PVD_reserved4_offset + i] != 0) + if (h[PVD_reserved4_offset + i] != 0 && + h[PVD_reserved4_offset + i] != 32) return (0); /* Reserved field must be 0. */ @@ -1677,6 +1685,7 @@ parse_file_info(struct archive_read *a, const unsigned char *rr_start, *rr_end; const unsigned char *p; size_t dr_len; + uint64_t fsize; int32_t location; int flags; @@ -1685,6 +1694,7 @@ parse_file_info(struct archive_read *a, dr_len = (size_t)isodirrec[DR_length_offset]; name_len = (size_t)isodirrec[DR_name_len_offset]; location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that dr_len needs at least 34. */ if (dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1703,7 +1713,10 @@ parse_file_info(struct archive_read *a, * link or file size is zero. As far as I know latest mkisofs * do that. */ - if (location >= iso9660->volume_block) { + if (location > 0 && + (location + ((fsize + iso9660->logical_block_size -1) + / iso9660->logical_block_size)) > + (unsigned int)iso9660->volume_block) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid location of extent of file"); return (NULL); @@ -1719,7 +1732,7 @@ parse_file_info(struct archive_read *a, memset(file, 0, sizeof(*file)); file->parent = parent; file->offset = iso9660->logical_block_size * (uint64_t)location; - file->size = toi(isodirrec + DR_size_offset, DR_size_size); + file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; Modified: head/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_mtree.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_read_support_format_mtree.c Sun Aug 7 08:42:36 2011 (r224691) @@ -525,6 +525,7 @@ parse_file(struct archive_read *a, struc /* Initialize reasonable defaults. */ mtree->filetype = AE_IFREG; archive_entry_set_size(entry, 0); + archive_string_empty(&mtree->contents_name); /* Parse options from this line. */ parsed_kws = 0; @@ -613,9 +614,8 @@ parse_file(struct archive_read *a, struc } /* - * If there is a contents file on disk, use that size; - * otherwise leave it as-is (it might have been set from - * the mtree size= keyword). + * Check for a mismatch between the type in the specification and + * the type of the contents object on disk. */ if (st != NULL) { mismatched_type = 0; @@ -660,6 +660,11 @@ parse_file(struct archive_read *a, struc } } + /* + * If there is a contents file on disk, pick some of the metadata + * from that file. For most of these, we only set it from the contents + * if it wasn't already parsed from the specification. + */ if (st != NULL) { if ((parsed_kws & MTREE_HAS_DEVICE) == 0 && (archive_entry_filetype(entry) == AE_IFCHR || Modified: head/lib/libarchive/archive_write_set_compression_xz.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_xz.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_write_set_compression_xz.c Sun Aug 7 08:42:36 2011 (r224691) @@ -421,8 +421,8 @@ drive_compressor(struct archive_write *a archive_set_error(&a->archive, ENOMEM, "lzma compression error: " "%ju MiB would have been needed", - (lzma_memusage(&(state->stream)) + 1024 * 1024 -1) - / (1024 * 1024)); + (uintmax_t)((lzma_memusage(&(state->stream)) + 1024 * 1024 -1) + / (1024 * 1024))); return (ARCHIVE_FATAL); default: /* Any other return value indicates an error. */ Modified: head/lib/libarchive/archive_write_set_format_zip.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_zip.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/archive_write_set_format_zip.c Sun Aug 7 08:42:36 2011 (r224691) @@ -502,6 +502,9 @@ archive_write_zip_finish(struct archive_ int entries; int ret; + if (a->compressor.write == NULL) + return (ARCHIVE_OK); + zip = a->format_data; l = zip->central_directory; Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/test/Makefile Sun Aug 7 08:42:36 2011 (r224691) @@ -25,6 +25,7 @@ TESTS= \ test_fuzz.c \ test_link_resolver.c \ test_open_fd.c \ + test_open_failure.c \ test_open_file.c \ test_open_filename.c \ test_pax_filename_encoding.c \ Added: head/lib/libarchive/test/test_open_failure.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_open_failure.c Sun Aug 7 08:42:36 2011 (r224691) @@ -0,0 +1,198 @@ +/*- + * Copyright (c) 2003-2010 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define MAGIC 123456789 +struct my_data { + int magic; + int read_return; + int read_called; + int write_return; + int write_called; + int open_return; + int open_called; + int close_return; + int close_called; +}; + +static ssize_t +my_read(struct archive *a, void *_private, const void **buff) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->read_called; + return (private->read_return); +} + +static ssize_t +my_write(struct archive *a, void *_private, const void *buff, size_t s) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->write_called; + return (private->write_return); +} + +static int +my_open(struct archive *a, void *_private) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->open_called; + return (private->open_return); +} + +static int +my_close(struct archive *a, void *_private) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->close_called; + return (private->close_return); +} + + +DEFINE_TEST(test_open_failure) +{ + struct archive *a; + struct my_data private; + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FATAL, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FAILED; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FAILED, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_WARN; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_WARN, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_OK; + private.read_return = ARCHIVE_FATAL; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_OK, + archive_read_support_compression_compress(a)); + assertEqualInt(ARCHIVE_OK, archive_read_support_format_tar(a)); + assertEqualInt(ARCHIVE_FATAL, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(1, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(1, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + archive_write_set_compression_compress(a); + archive_write_set_format_zip(a); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + archive_write_set_compression_gzip(a); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + +} Modified: head/lib/libarchive/test/test_read_format_mtree.c ============================================================================== --- head/lib/libarchive/test/test_read_format_mtree.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/test/test_read_format_mtree.c Sun Aug 7 08:42:36 2011 (r224691) @@ -134,10 +134,53 @@ test_read_format_mtree2(void) assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +/* + * Reported to libarchive.googlecode.com as Issue 121. + */ +static void +test_read_format_mtree3(void) +{ + static char archive[] = + "#mtree\n" + "a type=file contents=file\n" + "b type=link link=a\n" + "c type=file contents=file\n"; + struct archive_entry *ae; + struct archive *a; + + assertMakeDir("mtree3", 0777); + assertChdir("mtree3"); + assertMakeFile("file", 0644, "file contents"); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "a"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "b"); + assertEqualInt(archive_entry_filetype(ae), AE_IFLNK); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "c"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + + assertChdir(".."); +} + DEFINE_TEST(test_read_format_mtree) { test_read_format_mtree1(); test_read_format_mtree2(); + test_read_format_mtree3(); } Modified: head/lib/libarchive/test/test_write_compress_lzma.c ============================================================================== --- head/lib/libarchive/test/test_write_compress_lzma.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/test/test_write_compress_lzma.c Sun Aug 7 08:42:36 2011 (r224691) @@ -185,10 +185,15 @@ DEFINE_TEST(test_write_compress_lzma) archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* It would be nice to assert that compression-level=0 produced + * consistently larger/smaller results than the default compression, + * but the results here vary a lot depending on the version of liblzma + * being used. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); Modified: head/lib/libarchive/test/test_write_compress_xz.c ============================================================================== --- head/lib/libarchive/test/test_write_compress_xz.c Sun Aug 7 08:35:15 2011 (r224690) +++ head/lib/libarchive/test/test_write_compress_xz.c Sun Aug 7 08:42:36 2011 (r224691) @@ -193,10 +193,14 @@ DEFINE_TEST(test_write_compress_xz) archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* I would like to assert that compression-level=0 results in + * larger data than the default compression, but that's not true + * for all versions of liblzma. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 09:35:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B8051065672; Sun, 7 Aug 2011 09:35:07 +0000 (UTC) (envelope-from ttsestt@gmail.com) Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com [209.85.210.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5FD8FC14; Sun, 7 Aug 2011 09:35:06 +0000 (UTC) Received: by pzk33 with SMTP id 33so1976024pzk.18 for ; Sun, 07 Aug 2011 02:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=eZp0RKcLJtBWznPjr8Tu5K6iUlpeaSJKFVQKNvd3BM8=; b=d2o2u90MgSDRPnYO9UkDs3yYy919lUZdguOII2JNz9WVcc5dDmBRn2NT24c1vOzJkC TsOpUYbl24/oEBVZn6BMbZiaYGarvDkdgumIrCbdyza/rHcb1K/AaX7T+znx3IdhhoTE 6NxyH377cdM1LH0DnGcPZ8ZbNmHZJhs3ntONU= Received: by 10.143.60.13 with SMTP id n13mr4352662wfk.373.1312708183279; Sun, 07 Aug 2011 02:09:43 -0700 (PDT) Received: from localhost (tor-exit-router45-readme.formlessnetworking.net [199.48.147.45]) by mx.google.com with ESMTPS id l7sm5049570pbh.74.2011.08.07.02.09.40 (version=SSLv3 cipher=OTHER); Sun, 07 Aug 2011 02:09:42 -0700 (PDT) From: Test Rat To: Martin Matuska References: <201108070842.p778gaFI088322@svn.freebsd.org> Date: Sun, 07 Aug 2011 13:09:33 +0400 In-Reply-To: <201108070842.p778gaFI088322@svn.freebsd.org> (Martin Matuska's message of "Sun, 7 Aug 2011 08:42:36 +0000 (UTC)") Message-ID: <86ei0xio4y.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224691 - in head/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 09:35:07 -0000 Martin Matuska writes: > Author: mm > Date: Sun Aug 7 08:42:36 2011 > New Revision: 224691 > URL: http://svn.freebsd.org/changeset/base/224691 > > Log: > Add compatibility for ISO images created with unfixed makefs that > violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD. > This allows tar to read FreeBSD distribution ISO images created > with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1). > > In addition, merge following important bugfixes from > libarchive's release/2.8 branch: [...] Can you also merge libarchive/trunk@2431? It should fix a bug uncovered by /head@207790 and reported in bin/149409 which is still more easily reproducable on /head than on /stable/8. From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 11:52:58 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE9D106566B; Sun, 7 Aug 2011 11:52:58 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 42F288FC14; Sun, 7 Aug 2011 11:52:57 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p77BquK9043998; Sun, 7 Aug 2011 13:52:57 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p77Bquwt043997; Sun, 7 Aug 2011 13:52:56 +0200 (CEST) (envelope-from marius) Date: Sun, 7 Aug 2011 13:52:56 +0200 From: Marius Strobl To: Marcel Moolenaar Message-ID: <20110807115256.GG48988@alchemy.franken.de> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> <20110806232415.GE48988@alchemy.franken.de> <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> User-Agent: Mutt/1.4.2.3i Cc: src-committers@FreeBSD.org, Ruslan Mahmatkhanov , Garrett Cooper , svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 11:52:58 -0000 On Sat, Aug 06, 2011 at 07:35:49PM -0700, Marcel Moolenaar wrote: > > On Aug 6, 2011, at 4:24 PM, Marius Strobl wrote: > > > On Sun, Aug 07, 2011 at 01:06:48AM +0300, Andriy Gapon wrote: > >> on 07/08/2011 00:41 Garrett Cooper said the following: > >>> It's not just i386. It's other architectures like arm, mips, and pc98 > >>> according to the tinderbox reports (this list is potentially > >>> incomplete). > >> > >> Yeah, confusingly enough thr_pread_long() is declared to take uint64_t* as its > >> third argument, so this commit breaks all platforms where uint64_t is not > >> derived from (unsigned) long. > >> Just in case, thr_pread_int() takes uint32_t* as well. > >> > > > > Yes, the type of val is wrong. I'm currently running a fix through a > > universe build > > Ah, euh, ok, I forgot about this particular quirk: > > uint64_t is deliberate, because it's the width of long on 64-bit > architectures and thread_db is to be used as a support library > for a cross-tool (i.e. a 32-bit debugger for a 64-bit target). > > That's why thr_pread_long() takes a pointer to uint64_t and > thr_pread_int() takes a pointer to uint32_t... > > Sorry for missing this in the review. Okay, but then I don't know how to properly fix this given that thr_p{read,write}_long() still seem to do the wrong thing as they supply sizeof(long) rather than the size of a long on the target to thr_p{read,write}() as the size of the value in the target address space. If I change the callers of thr_pread_long() to supply a uint64_t this will compile but it still does the wrong thing in the cross-debugging case and I can't even think of how to fix that without additional information about the target, i.e. just using sizeof(uint64_t) obviously also is the wrong thing. Both thr_p{read,write}_ptr() are similarly confusing as they take a psaddr_t which is defined as uint64_t but use sizeof(void *) which again is specific to the host rather tan the target. Do you have a suggestion how to fix these? Marius From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 12:22:07 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48A7C1065673; Sun, 7 Aug 2011 12:22:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id C97708FC19; Sun, 7 Aug 2011 12:22:06 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A356125D3888; Sun, 7 Aug 2011 12:22:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B6F16BD3C89; Sun, 7 Aug 2011 12:22:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id x3WCx-OeIQKj; Sun, 7 Aug 2011 12:22:03 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 28E96BD3C3F; Sun, 7 Aug 2011 12:22:03 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20110807115256.GG48988@alchemy.franken.de> Date: Sun, 7 Aug 2011 12:22:02 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6949F340-1B6F-4001-9E99-7D6AF2FD5B48@FreeBSD.org> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> <20110806232415.GE48988@alchemy.franken.de> <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> <20110807115256.GG48988@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 12:22:07 -0000 On Aug 7, 2011, at 11:52 AM, Marius Strobl wrote: > On Sat, Aug 06, 2011 at 07:35:49PM -0700, Marcel Moolenaar wrote: >>=20 >> On Aug 6, 2011, at 4:24 PM, Marius Strobl wrote: >>=20 >>> On Sun, Aug 07, 2011 at 01:06:48AM +0300, Andriy Gapon wrote: >>>> on 07/08/2011 00:41 Garrett Cooper said the following: >>>>> It's not just i386. It's other architectures like arm, mips, and = pc98 >>>>> according to the tinderbox reports (this list is potentially >>>>> incomplete). >>>>=20 >>>> Yeah, confusingly enough thr_pread_long() is declared to take = uint64_t* as its >>>> third argument, so this commit breaks all platforms where uint64_t = is not >>>> derived from (unsigned) long. >>>> Just in case, thr_pread_int() takes uint32_t* as well. >>>>=20 >>>=20 >>> Yes, the type of val is wrong. I'm currently running a fix through a >>> universe build >>=20 >> Ah, euh, ok, I forgot about this particular quirk: >>=20 >> uint64_t is deliberate, because it's the width of long on 64-bit >> architectures and thread_db is to be used as a support library >> for a cross-tool (i.e. a 32-bit debugger for a 64-bit target). >>=20 >> That's why thr_pread_long() takes a pointer to uint64_t and >> thr_pread_int() takes a pointer to uint32_t... >>=20 >> Sorry for missing this in the review. >=20 > Okay, but then I don't know how to properly fix this given that > thr_p{read,write}_long() still seem to do the wrong thing as they > supply sizeof(long) rather than the size of a long on the target > to thr_p{read,write}() as the size of the value in the target > address space. If I change the callers of thr_pread_long() to > supply a uint64_t this will compile but it still does the wrong > thing in the cross-debugging case and I can't even think of how > to fix that without additional information about the target, i.e. > just using sizeof(uint64_t) obviously also is the wrong thing. > Both thr_p{read,write}_ptr() are similarly confusing as they take > a psaddr_t which is defined as uint64_t but use sizeof(void *) > which again is specific to the host rather tan the target. > Do you have a suggestion how to fix these? Given this, can you please back it out, find a proper solution together, = test it and re-add that then? Thanks --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.= From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 12:33:59 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F138C106564A; Sun, 7 Aug 2011 12:33:58 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 69CDD8FC08; Sun, 7 Aug 2011 12:33:58 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p77CXu0U044233; Sun, 7 Aug 2011 14:33:56 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p77CXu4C044232; Sun, 7 Aug 2011 14:33:56 +0200 (CEST) (envelope-from marius) Date: Sun, 7 Aug 2011 14:33:56 +0200 From: Marius Strobl To: "Bjoern A. Zeeb" Message-ID: <20110807123356.GH48988@alchemy.franken.de> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> <20110806232415.GE48988@alchemy.franken.de> <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> <20110807115256.GG48988@alchemy.franken.de> <6949F340-1B6F-4001-9E99-7D6AF2FD5B48@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6949F340-1B6F-4001-9E99-7D6AF2FD5B48@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 12:33:59 -0000 On Sun, Aug 07, 2011 at 12:22:02PM +0000, Bjoern A. Zeeb wrote: > > On Aug 7, 2011, at 11:52 AM, Marius Strobl wrote: > > > On Sat, Aug 06, 2011 at 07:35:49PM -0700, Marcel Moolenaar wrote: > >> > >> On Aug 6, 2011, at 4:24 PM, Marius Strobl wrote: > >> > >>> On Sun, Aug 07, 2011 at 01:06:48AM +0300, Andriy Gapon wrote: > >>>> on 07/08/2011 00:41 Garrett Cooper said the following: > >>>>> It's not just i386. It's other architectures like arm, mips, and pc98 > >>>>> according to the tinderbox reports (this list is potentially > >>>>> incomplete). > >>>> > >>>> Yeah, confusingly enough thr_pread_long() is declared to take uint64_t* as its > >>>> third argument, so this commit breaks all platforms where uint64_t is not > >>>> derived from (unsigned) long. > >>>> Just in case, thr_pread_int() takes uint32_t* as well. > >>>> > >>> > >>> Yes, the type of val is wrong. I'm currently running a fix through a > >>> universe build > >> > >> Ah, euh, ok, I forgot about this particular quirk: > >> > >> uint64_t is deliberate, because it's the width of long on 64-bit > >> architectures and thread_db is to be used as a support library > >> for a cross-tool (i.e. a 32-bit debugger for a 64-bit target). > >> > >> That's why thr_pread_long() takes a pointer to uint64_t and > >> thr_pread_int() takes a pointer to uint32_t... > >> > >> Sorry for missing this in the review. > > > > Okay, but then I don't know how to properly fix this given that > > thr_p{read,write}_long() still seem to do the wrong thing as they > > supply sizeof(long) rather than the size of a long on the target > > to thr_p{read,write}() as the size of the value in the target > > address space. If I change the callers of thr_pread_long() to > > supply a uint64_t this will compile but it still does the wrong > > thing in the cross-debugging case and I can't even think of how > > to fix that without additional information about the target, i.e. > > just using sizeof(uint64_t) obviously also is the wrong thing. > > Both thr_p{read,write}_ptr() are similarly confusing as they take > > a psaddr_t which is defined as uint64_t but use sizeof(void *) > > which again is specific to the host rather tan the target. > > Do you have a suggestion how to fix these? > > Given this, can you please back it out, find a proper solution together, test it and re-add that then? > I'm currently running a universe build with lwp changed from long to int64_t. This should compile and work on all architectures for native-debugging and as such be a step in the right direction. In a second step thr_p{read,write}_{long,ptr}() then can be fixed to also do the right thing when cross-debugging. Marius From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 12:48:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8213F106564A; Sun, 7 Aug 2011 12:48:07 +0000 (UTC) (envelope-from ttsestt@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B71C28FC08; Sun, 7 Aug 2011 12:48:05 +0000 (UTC) Received: by fxe4 with SMTP id 4so1524027fxe.13 for ; Sun, 07 Aug 2011 05:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=MA7D+QXWMBp1IJdLv+kMLzny5pxCVu/1YiMOGC8Ty/U=; b=RBNlkXljhSEQpXrQU0Ppq8sKvIIfTvqHGJ+daOVBJAfi+BF3tTlZM/DFOhxBflt4/D XhUuRNUP7wI1no1pNHftjDpsQoheEaLofV+tqLCNUnmJOk0oMPukxO3MMtT4ERaESD9x gBYabKRPPypBozVjga7KNWAjVtEn1tDiMA/uM= Received: by 10.223.76.201 with SMTP id d9mr5820936fak.119.1312721285245; Sun, 07 Aug 2011 05:48:05 -0700 (PDT) Received: from localhost (shell.digitalcipher.net [76.10.214.89]) by mx.google.com with ESMTPS id e10sm3396793fak.42.2011.08.07.05.48.03 (version=SSLv3 cipher=OTHER); Sun, 07 Aug 2011 05:48:04 -0700 (PDT) From: Test Rat To: Hans Petter Selasky References: <201105080822.p488MCEV036152@svn.freebsd.org> Date: Sun, 07 Aug 2011 16:48:00 +0400 In-Reply-To: <201105080822.p488MCEV036152@svn.freebsd.org> (Hans Petter Selasky's message of "Sun, 8 May 2011 08:22:12 +0000 (UTC)") Message-ID: <86ei0xcrr3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221623 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 12:48:07 -0000 Hans Petter Selasky writes: > Author: hselasky > Date: Sun May 8 08:22:11 2011 > New Revision: 221623 > URL: http://svn.freebsd.org/changeset/base/221623 > > Log: > Cleanup usb_notify_addq_compat(). It should not > be needed any more. > > MFC after: 7 days This seems to break existing devd(8) configurations that use attach/detach for ugen(4) devices, e.g. ports/159313. Can you mention the burned bridge in relnotes for 9.0-RELEASE? From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 12:54:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC16106564A; Sun, 7 Aug 2011 12:54:08 +0000 (UTC) (envelope-from ttsestt@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A97AF8FC12; Sun, 7 Aug 2011 12:54:07 +0000 (UTC) Received: by fxe4 with SMTP id 4so1527793fxe.13 for ; Sun, 07 Aug 2011 05:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=wd9YX7b8RZyG6mss5BZxqsuIq3Dts7Lg8rEeaxg5p3I=; b=SZDgoNA3PV9vS5m2AgynGfBykIZglV9sFSW2F0aLKHtOjX1rqRRbHWtFNZnpkQsCZL pnt8OOq3FcxjzBI/wX8N+QDAG73+3xYBZuUNk6WiekXreGhP4VD6296Dpbyw7/ySDYfG iGJfkSfIpUPvThpjuhpVoC5yIReouW2xtEElo= Received: by 10.223.98.83 with SMTP id p19mr5968048fan.2.1312721646534; Sun, 07 Aug 2011 05:54:06 -0700 (PDT) Received: from localhost (shell.digitalcipher.net [76.10.214.89]) by mx.google.com with ESMTPS id x2sm3405035fal.20.2011.08.07.05.54.05 (version=SSLv3 cipher=OTHER); Sun, 07 Aug 2011 05:54:06 -0700 (PDT) From: Test Rat To: Hans Petter Selasky References: <201105080822.p488MCEV036152@svn.freebsd.org> <86ei0xcrr3.fsf@gmail.com> Date: Sun, 07 Aug 2011 16:54:02 +0400 In-Reply-To: <86ei0xcrr3.fsf@gmail.com> (Test Rat's message of "Sun, 07 Aug 2011 16:48:00 +0400") Message-ID: <861uwxcrh1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221623 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 12:54:08 -0000 Test Rat writes: > Hans Petter Selasky writes: > >> Author: hselasky >> Date: Sun May 8 08:22:11 2011 >> New Revision: 221623 >> URL: http://svn.freebsd.org/changeset/base/221623 >> >> Log: >> Cleanup usb_notify_addq_compat(). It should not >> be needed any more. >> >> MFC after: 7 days > > This seems to break existing devd(8) configurations that use > attach/detach for ugen(4) devices, e.g. ports/159313. Can you mention > the burned bridge in relnotes for 9.0-RELEASE? Oops, it should be in UPDATING, not relnotes. From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 15:52:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6AB51065670; Sun, 7 Aug 2011 15:52:13 +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 D639A8FC0C; Sun, 7 Aug 2011 15:52: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 p77FqDTR006579; Sun, 7 Aug 2011 15:52:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77FqDrE006577; Sun, 7 Aug 2011 15:52:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108071552.p77FqDrE006577@svn.freebsd.org> From: Marius Strobl Date: Sun, 7 Aug 2011 15:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224693 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 15:52:14 -0000 Author: marius Date: Sun Aug 7 15:52:13 2011 New Revision: 224693 URL: http://svn.freebsd.org/changeset/base/224693 Log: Change lwp to int64_t as thr_pread_long() always uses a 64-bit value in order to account for LP64 targets when cross-debugging on ILP32, allowing r224683 to compile on ILP32. Note that thr_p{read,write}_{long,ptr}() still incorrectly use the size of the respective types on the host rather than that on the target when accessing the target address space which still needs to be fixed. This means that r224683 alone may not be sufficient to solve the problem it's intended to fix when cross-debugging. Approved by: re (hrs) Modified: head/lib/libthread_db/libthr_db.c Modified: head/lib/libthread_db/libthr_db.c ============================================================================== --- head/lib/libthread_db/libthr_db.c Sun Aug 7 13:17:35 2011 (r224692) +++ head/lib/libthread_db/libthr_db.c Sun Aug 7 15:52:13 2011 (r224693) @@ -202,7 +202,7 @@ static td_err_e pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) { psaddr_t pt; - long lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -245,7 +245,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, { td_thrhandle_t th; psaddr_t pt; - long lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -368,7 +368,7 @@ pt_ta_event_getmsg(const td_thragent_t * psaddr_t pt; td_thr_events_e tmp; - long lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -672,7 +672,7 @@ pt_thr_event_getmsg(const td_thrhandle_t static td_thrhandle_t handle; const td_thragent_t *ta = th->th_ta; psaddr_t pt, pt_temp; - long lwp; + int64_t lwp; int ret; td_thr_events_e tmp; From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 17:18:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEEC6106566C; Sun, 7 Aug 2011 17:18:22 +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 9DBD58FC13; Sun, 7 Aug 2011 17:18:22 +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 p77HIM9x009200; Sun, 7 Aug 2011 17:18:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77HIMUh009197; Sun, 7 Aug 2011 17:18:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108071718.p77HIMUh009197@svn.freebsd.org> From: Alexander Motin Date: Sun, 7 Aug 2011 17:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224694 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 17:18:22 -0000 Author: mav Date: Sun Aug 7 17:18:22 2011 New Revision: 224694 URL: http://svn.freebsd.org/changeset/base/224694 Log: MFC r224498: In some cases, at least on Marvell 88SE912x controllers, Current Command Slot field of the PxCMD register may point to an empty command slot. That breaks command timeout detection logic, making impossible to find what command actually caused timeout, and leading to infinite wait. Workaround that by checking whether pointed command slot is really used and can timeout in its time. And if not, fallback to the dumb algorithm used with FBS -- let all commands to time out and then fail all of them. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Aug 7 15:52:13 2011 (r224693) +++ stable/8/sys/dev/ahci/ahci.c Sun Aug 7 17:18:22 2011 (r224694) @@ -1873,12 +1873,13 @@ ahci_execute_transaction(struct ahci_slo device_printf(dev, "Poll timeout on slot %d port %d\n", slot->slot, port); device_printf(dev, "is %08x cs %08x ss %08x " - "rs %08x tfd %02x serr %08x\n", + "rs %08x tfd %02x serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), - ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); et = AHCI_ERR_TIMEOUT; } @@ -1954,8 +1955,12 @@ ahci_timeout(struct ahci_slot *slot) ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT; if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot || - ch->fbs_enabled) + ch->fbs_enabled || ch->wrongccs) slot->state = AHCI_SLOT_EXECUTING; + else if ((ch->rslots & (1 << ccs)) == 0) { + ch->wrongccs = 1; + slot->state = AHCI_SLOT_EXECUTING; + } callout_reset(&slot->timeout, (int)slot->ccb->ccb_h.timeout * hz / 2000, @@ -1965,10 +1970,12 @@ ahci_timeout(struct ahci_slot *slot) device_printf(dev, "Timeout on slot %d port %d\n", slot->slot, slot->ccb->ccb_h.target_id & 0x0f); - device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n", + device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x " + "serr %08x cmd %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, - ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR)); + ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR), + ATA_INL(ch->r_mem, AHCI_P_CMD)); /* Handle frozen command. */ if (ch->frozen) { @@ -1981,7 +1988,7 @@ ahci_timeout(struct ahci_slot *slot) } xpt_done(fccb); } - if (!ch->fbs_enabled) { + if (!ch->fbs_enabled && !ch->wrongccs) { /* Without FBS we know real timeout source. */ ch->fatalerr = 1; /* Handle command with timeout. */ @@ -2579,6 +2586,7 @@ ahci_reset(device_t dev) xpt_release_simq(ch->sim, TRUE); ch->eslots = 0; ch->toslots = 0; + ch->wrongccs = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); Modified: stable/8/sys/dev/ahci/ahci.h ============================================================================== --- stable/8/sys/dev/ahci/ahci.h Sun Aug 7 15:52:13 2011 (r224693) +++ stable/8/sys/dev/ahci/ahci.h Sun Aug 7 17:18:22 2011 (r224694) @@ -426,6 +426,7 @@ struct ahci_channel { int resetting; /* Hard-reset in progress. */ int resetpolldiv; /* Hard-reset poll divider. */ int listening; /* SUD bit is cleared. */ + int wrongccs; /* CCS field in CMD was wrong */ union ccb *frozen; /* Frozen command */ struct callout pm_timer; /* Power management events */ struct callout reset_timer; /* Hard-reset timeout */ From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 17:19:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8720106566B; Sun, 7 Aug 2011 17:19: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 D7BE28FC0C; Sun, 7 Aug 2011 17:19: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 p77HJxRl009292; Sun, 7 Aug 2011 17:19:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77HJxnp009290; Sun, 7 Aug 2011 17:19:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108071719.p77HJxnp009290@svn.freebsd.org> From: Alexander Motin Date: Sun, 7 Aug 2011 17:19: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: r224695 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 17:20:00 -0000 Author: mav Date: Sun Aug 7 17:19:59 2011 New Revision: 224695 URL: http://svn.freebsd.org/changeset/base/224695 Log: MFC r224531: Higher-priority initialization request can eat request scheduling done from adaclose(). Add immediate_priority check into adaschedule() to restore it. Modified: stable/8/sys/cam/ata/ata_da.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/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sun Aug 7 17:18:22 2011 (r224694) +++ stable/8/sys/cam/ata/ata_da.c Sun Aug 7 17:19:59 2011 (r224695) @@ -444,12 +444,20 @@ static void adaschedule(struct cam_periph *periph) { struct ada_softc *softc = (struct ada_softc *)periph->softc; + uint32_t prio; + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ if (bioq_first(&softc->bio_queue) || (!softc->trim_running && bioq_first(&softc->trim_queue))) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + prio = CAM_PRIORITY_NORMAL; } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); } /* From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 17:28:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7AC1065670; Sun, 7 Aug 2011 17:28:08 +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 827C28FC08; Sun, 7 Aug 2011 17:28:08 +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 p77HS8LC009647; Sun, 7 Aug 2011 17:28:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77HS8QD009645; Sun, 7 Aug 2011 17:28:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108071728.p77HS8QD009645@svn.freebsd.org> From: Alexander Motin Date: Sun, 7 Aug 2011 17:28:08 +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: r224696 - stable/8/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 17:28:08 -0000 Author: mav Date: Sun Aug 7 17:28:08 2011 New Revision: 224696 URL: http://svn.freebsd.org/changeset/base/224696 Log: MFC r224496: In some cases failed SATA disks may report their presence, but don't respond to any commands. I've found, that because of multiple command retries, each of which cause 30s timeout, bus reset and another retry or requeue for many commands, it may take ages to eventually drop the failed device. The odd thing is that those retries continue even after XPT considered device as dead and invalidated it. This patch makes cam_periph_error() to block any command retries after periph was marked as invalid. With that patch all activity completes in 1-2 minutes, just after several timeouts, required to consider device death. This should make ZFS, gmirror, graid, etc. operation more robust. Modified: stable/8/sys/cam/cam_periph.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/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Sun Aug 7 17:19:59 2011 (r224695) +++ stable/8/sys/cam/cam_periph.c Sun Aug 7 17:28:08 2011 (r224696) @@ -1484,7 +1484,8 @@ camperiphscsisenseerror(union ccb *ccb, * make sure we actually have retries available. */ if ((err_action & SSQ_DECREMENT_COUNT) != 0) { - if (ccb->ccb_h.retry_count > 0) + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) ccb->ccb_h.retry_count--; else { *action_string = "Retries exhausted"; @@ -1643,6 +1644,7 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { + struct cam_periph *periph; const char *action_string; cam_status status; int frozen; @@ -1650,7 +1652,8 @@ cam_periph_error(union ccb *ccb, cam_fla int openings; u_int32_t relsim_flags; u_int32_t timeout = 0; - + + periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; @@ -1712,9 +1715,9 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Data overrun\n"); printed++; } - error = EIO; /* we have to kill the command */ /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; } else { @@ -1733,7 +1736,8 @@ cam_periph_error(union ccb *ccb, cam_fla struct cam_path *newpath; if ((camflags & CAM_RETRY_SELTO) != 0) { - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; @@ -1751,10 +1755,11 @@ cam_periph_error(union ccb *ccb, cam_fla timeout = periph_selto_delay; break; } + action_string = "Retries exhausted"; } error = ENXIO; /* Should we do more if we can't create the path?? */ - if (xpt_create_path(&newpath, xpt_path_periph(ccb->ccb_h.path), + if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), CAM_LUN_WILDCARD) != CAM_REQ_CMP) @@ -1799,11 +1804,16 @@ cam_periph_error(union ccb *ccb, cam_fla /* FALLTHROUGH */ case CAM_REQUEUE_REQ: /* Unconditional requeue */ - error = ERESTART; if (bootverbose && printed == 0) { xpt_print(ccb->ccb_h.path, "Request requeued\n"); printed++; } + if ((periph->flags & CAM_PERIPH_INVALID) == 0) + error = ERESTART; + else { + action_string = "Retries exhausted"; + error = EIO; + } break; case CAM_RESRC_UNAVAIL: /* Wait a bit for the resource shortage to abate. */ @@ -1818,7 +1828,8 @@ cam_periph_error(union ccb *ccb, cam_fla /* FALLTHROUGH */ default: /* decrement the number of retries */ - if (ccb->ccb_h.retry_count > 0) { + if (ccb->ccb_h.retry_count > 0 && + (periph->flags & CAM_PERIPH_INVALID) == 0) { ccb->ccb_h.retry_count--; error = ERESTART; if (bootverbose && printed == 0) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 17:30:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E77281065673; Sun, 7 Aug 2011 17:30:03 +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 CCD258FC21; Sun, 7 Aug 2011 17:30:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p77HU3TM009755; Sun, 7 Aug 2011 17:30:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77HU3XB009754; Sun, 7 Aug 2011 17:30:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108071730.p77HU3XB009754@svn.freebsd.org> From: Alexander Motin Date: Sun, 7 Aug 2011 17:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224697 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 17:30:04 -0000 Author: mav Date: Sun Aug 7 17:30:03 2011 New Revision: 224697 URL: http://svn.freebsd.org/changeset/base/224697 Log: MFC r224497: Add control for ATA disk read-ahead, alike to the previously added write cache control. Some controller BIOS'es tend to disable read-ahead, that dramatically reduces read performance. Previously ata(4) always enabled read-ahead unconditionally. Modified: stable/8/sys/cam/ata/ata_da.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/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sun Aug 7 17:28:08 2011 (r224696) +++ stable/8/sys/cam/ata/ata_da.c Sun Aug 7 17:30:03 2011 (r224697) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #define ATA_MAX_28BIT_LBA 268435455UL typedef enum { + ADA_STATE_RAHEAD, ADA_STATE_WCACHE, ADA_STATE_NORMAL } ada_state; @@ -93,7 +94,8 @@ typedef enum { } ada_quirks; typedef enum { - ADA_CCB_WCACHE = 0x01, + ADA_CCB_RAHEAD = 0x01, + ADA_CCB_WCACHE = 0x02, ADA_CCB_BUFFER_IO = 0x03, ADA_CCB_WAITING = 0x04, ADA_CCB_DUMP = 0x05, @@ -130,6 +132,7 @@ struct ada_softc { int outstanding_cmds; int trim_max_ranges; int trim_running; + int read_ahead; int write_cache; #ifdef ADA_TEST_FAILURE int force_read_error; @@ -278,10 +281,19 @@ static void adashutdown(void *arg, int #define ADA_DEFAULT_SPINDOWN_SHUTDOWN 1 #endif +#ifndef ADA_DEFAULT_READ_AHEAD +#define ADA_DEFAULT_READ_AHEAD 1 +#endif + #ifndef ADA_DEFAULT_WRITE_CACHE #define ADA_DEFAULT_WRITE_CACHE 1 #endif +#define ADA_RA (softc->read_ahead >= 0 ? \ + softc->read_ahead : ada_read_ahead) +#define ADA_WC (softc->write_cache >= 0 ? \ + softc->write_cache : ada_write_cache) + /* * Most platforms map firmware geometry to actual, but some don't. If * not overridden, default to nothing. @@ -294,6 +306,7 @@ static int ada_retry_count = ADA_DEFAULT static int ada_default_timeout = ADA_DEFAULT_TIMEOUT; static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOWN_SHUTDOWN; +static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, @@ -310,6 +323,9 @@ TUNABLE_INT("kern.cam.ada.ada_send_order SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW, &ada_spindown_shutdown, 0, "Spin down upon shutdown"); TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW, + &ada_read_ahead, 0, "Enable disk read-ahead"); +TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead); SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW, &ada_write_cache, 0, "Enable disk write cache"); TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache); @@ -715,16 +731,19 @@ adaasync(void *callback_arg, u_int32_t c softc = (struct ada_softc *)periph->softc; cam_periph_async(periph, code, path, arg); - if (ada_write_cache < 0 && softc->write_cache < 0) - break; if (softc->state != ADA_STATE_NORMAL) break; xpt_setup_ccb(&cgd.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - if ((cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) == 0) - break; - softc->state = ADA_STATE_WCACHE; + if (ADA_RA >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) + softc->state = ADA_STATE_RAHEAD; + else if (ADA_WC >= 0 && + cgd.ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) + softc->state = ADA_STATE_WCACHE; + else + break; cam_periph_acquire(periph); cam_freeze_devq_arg(periph->path, RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); @@ -767,6 +786,9 @@ adasysctlinit(void *context, int pending } SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "read_ahead", CTLFLAG_RW | CTLFLAG_MPSAFE, + &softc->read_ahead, 0, "Enable disk read ahead."); + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "write_cache", CTLFLAG_RW | CTLFLAG_MPSAFE, &softc->write_cache, 0, "Enable disk write cache."); #ifdef ADA_TEST_FAILURE @@ -881,6 +903,10 @@ adaregister(struct cam_periph *periph, v quirks = softc->quirks; TUNABLE_INT_FETCH(announce_buf, &quirks); softc->quirks = quirks; + softc->read_ahead = -1; + snprintf(announce_buf, sizeof(announce_buf), + "kern.cam.ada.%d.read_ahead", periph->unit_number); + TUNABLE_INT_FETCH(announce_buf, &softc->read_ahead); softc->write_cache = -1; snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); @@ -979,7 +1005,14 @@ adaregister(struct cam_periph *periph, v (ADA_DEFAULT_TIMEOUT * hz) / ADA_ORDEREDTAG_INTERVAL, adasendorderedtag, softc); - if ((ada_write_cache >= 0 || softc->write_cache >= 0) && + if (ADA_RA >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { + softc->state = ADA_STATE_RAHEAD; + cam_periph_acquire(periph); + cam_freeze_devq_arg(periph->path, + RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); + xpt_schedule(periph, CAM_PRIORITY_DEV); + } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); @@ -1236,8 +1269,19 @@ out: adaschedule(periph); break; } + case ADA_STATE_RAHEAD: case ADA_STATE_WCACHE: { + if (softc->flags & ADA_FLAG_PACK_INVALID) { + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(start_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } + cam_fill_ataio(ataio, 1, adadone, @@ -1247,10 +1291,15 @@ out: 0, ada_default_timeout*1000); - ata_28bit_cmd(ataio, ATA_SETFEATURES, (softc->write_cache > 0 || - (softc->write_cache < 0 && ada_write_cache)) ? - ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); - start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + if (softc->state == ADA_STATE_RAHEAD) { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_RA ? + ATA_SF_ENAB_RCACHE : ATA_SF_DIS_RCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_RAHEAD; + } else { + ata_28bit_cmd(ataio, ATA_SETFEATURES, ADA_WC ? + ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); + start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; + } xpt_action(start_ccb); break; } @@ -1262,6 +1311,7 @@ adadone(struct cam_periph *periph, union { struct ada_softc *softc; struct ccb_ataio *ataio; + struct ccb_getdev *cgd; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; @@ -1343,6 +1393,47 @@ adadone(struct cam_periph *periph, union biodone(bp); break; } + case ADA_CCB_RAHEAD: + { + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + if (adaerror(done_ccb, 0, 0) == ERESTART) { + return; + } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*reduction*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } + + /* + * Since our peripheral may be invalidated by an error + * above or an external event, we must release our CCB + * before releasing the reference on the peripheral. + * The peripheral will only go away once the last reference + * is removed, and we need it around for the CCB release + * operation. + */ + cgd = (struct ccb_getdev *)done_ccb; + xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); + if (ADA_WC >= 0 && + cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { + softc->state = ADA_STATE_WCACHE; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, CAM_PRIORITY_DEV); + return; + } + softc->state = ADA_STATE_NORMAL; + xpt_release_ccb(done_ccb); + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + adaschedule(periph); + cam_periph_release_locked(periph); + return; + } case ADA_CCB_WCACHE: { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 18:37:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E634B106564A; Sun, 7 Aug 2011 18:37:05 +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 D57BC8FC0A; Sun, 7 Aug 2011 18:37: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 p77Ib5t9011698; Sun, 7 Aug 2011 18:37:05 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77Ib5QB011694; Sun, 7 Aug 2011 18:37:05 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108071837.p77Ib5QB011694@svn.freebsd.org> From: Attilio Rao Date: Sun, 7 Aug 2011 18:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224698 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 18:37:06 -0000 Author: attilio Date: Sun Aug 7 18:37:05 2011 New Revision: 224698 URL: http://svn.freebsd.org/changeset/base/224698 Log: Convert pmcstat about using cpuset_t rather than relying on plain 32 bit ints. That fixes a first bug where pmcstat wasn't using the old cpumask_t interface and now also brings the full support for more than 32 cpus. While here, make the functions pmcstat_clone_event_descriptor() and pmcstat_get_cpumask() private to pmcstat. The problem of assuming cpu dense masks still persists and should be eventually fixed, as reported by avg. Tested by: pluknet Reviewed by: gnn Approved by: re (kib) Modified: head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat.h head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Sun Aug 7 17:30:03 2011 (r224697) +++ head/usr.sbin/pmcstat/pmcstat.c Sun Aug 7 18:37:05 2011 (r224698) @@ -31,9 +31,9 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include +#include +#include #include #include #include @@ -114,6 +114,55 @@ kvm_t *pmcstat_kvm; struct kinfo_proc *pmcstat_plist; struct pmcstat_args args; +static void +pmcstat_clone_event_descriptor(struct pmcstat_ev *ev, const cpuset_t *cpumask) +{ + int cpu, mcpu; + struct pmcstat_ev *ev_clone; + + mcpu = sizeof(*cpumask) * NBBY; + for (cpu = 0; cpu < mcpu; cpu++) { + if (!CPU_ISSET(cpu, cpumask)) + continue; + + if ((ev_clone = malloc(sizeof(*ev_clone))) == NULL) + errx(EX_SOFTWARE, "ERROR: Out of memory"); + (void) memset(ev_clone, 0, sizeof(*ev_clone)); + + ev_clone->ev_count = ev->ev_count; + ev_clone->ev_cpu = cpu; + ev_clone->ev_cumulative = ev->ev_cumulative; + ev_clone->ev_flags = ev->ev_flags; + ev_clone->ev_mode = ev->ev_mode; + ev_clone->ev_name = strdup(ev->ev_name); + ev_clone->ev_pmcid = ev->ev_pmcid; + ev_clone->ev_saved = ev->ev_saved; + ev_clone->ev_spec = strdup(ev->ev_spec); + + STAILQ_INSERT_TAIL(&args.pa_events, ev_clone, ev_next); + } +} + +static void +pmcstat_get_cpumask(const char *cpuspec, cpuset_t *cpumask) +{ + int cpu; + const char *s; + char *end; + + CPU_ZERO(cpumask); + s = cpuspec; + + do { + cpu = strtol(s, &end, 0); + if (cpu < 0 || end == s) + errx(EX_USAGE, "ERROR: Illegal CPU specification " + "\"%s\".", cpuspec); + CPU_SET(cpu, cpumask); + s = end + strspn(end, ", \t"); + } while (*s); +} + void pmcstat_attach_pmcs(void) { @@ -173,36 +222,6 @@ pmcstat_cleanup(void) } void -pmcstat_clone_event_descriptor(struct pmcstat_ev *ev, - uint32_t cpumask) -{ - int cpu; - struct pmcstat_ev *ev_clone; - - while ((cpu = ffs(cpumask)) > 0) { - cpu--; - - if ((ev_clone = malloc(sizeof(*ev_clone))) == NULL) - errx(EX_SOFTWARE, "ERROR: Out of memory"); - (void) memset(ev_clone, 0, sizeof(*ev_clone)); - - ev_clone->ev_count = ev->ev_count; - ev_clone->ev_cpu = cpu; - ev_clone->ev_cumulative = ev->ev_cumulative; - ev_clone->ev_flags = ev->ev_flags; - ev_clone->ev_mode = ev->ev_mode; - ev_clone->ev_name = strdup(ev->ev_name); - ev_clone->ev_pmcid = ev->ev_pmcid; - ev_clone->ev_saved = ev->ev_saved; - ev_clone->ev_spec = strdup(ev->ev_spec); - - STAILQ_INSERT_TAIL(&args.pa_events, ev_clone, ev_next); - - cpumask &= ~(1 << cpu); - } -} - -void pmcstat_create_process(void) { char token; @@ -322,29 +341,6 @@ pmcstat_find_targets(const char *spec) /*NOTREACHED*/ } -uint32_t -pmcstat_get_cpumask(const char *cpuspec) -{ - uint32_t cpumask; - int cpu; - const char *s; - char *end; - - s = cpuspec; - cpumask = 0ULL; - - do { - cpu = strtol(s, &end, 0); - if (cpu < 0 || end == s) - errx(EX_USAGE, "ERROR: Illegal CPU specification " - "\"%s\".", cpuspec); - cpumask |= (1 << cpu); - s = end + strspn(end, ", \t"); - } while (*s); - - return (cpumask); -} - void pmcstat_kill_process(void) { @@ -551,8 +547,9 @@ pmcstat_topexit(void) int main(int argc, char **argv) { + cpuset_t cpumask; double interval; - int option, npmc, ncpu; + int hcpu, option, npmc, ncpu; int c, check_driver_stats, current_cpu, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; int do_print; @@ -561,7 +558,6 @@ main(int argc, char **argv) int pipefd[2], rfd; int use_cumulative_counts; short cf, cb; - uint32_t cpumask; char *end, *tmp; const char *errmsg, *graphfilename; enum pmcstat_state runstate; @@ -608,6 +604,7 @@ main(int argc, char **argv) bzero(&ds_start, sizeof(ds_start)); bzero(&ds_end, sizeof(ds_end)); ev = NULL; + CPU_ZERO(&cpumask); /* * The initial CPU mask specifies all non-halted CPUS in the @@ -616,7 +613,8 @@ main(int argc, char **argv) dummy = sizeof(int); if (sysctlbyname("hw.ncpu", &ncpu, &dummy, NULL, 0) < 0) err(EX_OSERR, "ERROR: Cannot determine the number of CPUs"); - cpumask = (1 << ncpu) - 1; + for (hcpu = 0; hcpu < ncpu; hcpu++) + CPU_SET(hcpu, &cpumask); while ((option = getopt(argc, argv, "CD:EF:G:M:NO:P:R:S:TWc:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) @@ -628,10 +626,11 @@ main(int argc, char **argv) case 'c': /* CPU */ - if (optarg[0] == '*' && optarg[1] == '\0') - cpumask = (1 << ncpu) - 1; - else - cpumask = pmcstat_get_cpumask(optarg); + if (optarg[0] == '*' && optarg[1] == '\0') { + for (hcpu = 0; hcpu < ncpu; hcpu++) + CPU_SET(hcpu, &cpumask); + } else + pmcstat_get_cpumask(optarg, &cpumask); args.pa_flags |= FLAGS_HAS_CPUMASK; args.pa_required |= FLAG_HAS_SYSTEM_PMCS; @@ -745,9 +744,13 @@ main(int argc, char **argv) else ev->ev_count = -1; - if (option == 'S' || option == 's') - ev->ev_cpu = ffs(cpumask) - 1; - else + if (option == 'S' || option == 's') { + hcpu = sizeof(cpumask) * NBBY; + for (hcpu--; hcpu >= 0; hcpu--) + if (CPU_ISSET(hcpu, &cpumask)) + break; + ev->ev_cpu = hcpu; + } else ev->ev_cpu = PMC_CPU_ANY; ev->ev_flags = 0; @@ -773,9 +776,13 @@ main(int argc, char **argv) STAILQ_INSERT_TAIL(&args.pa_events, ev, ev_next); - if (option == 's' || option == 'S') - pmcstat_clone_event_descriptor(ev, - cpumask & ~(1 << ev->ev_cpu)); + if (option == 's' || option == 'S') { + hcpu = CPU_ISSET(ev->ev_cpu, &cpumask); + CPU_CLR(ev->ev_cpu, &cpumask); + pmcstat_clone_event_descriptor(ev, &cpumask); + if (hcpu != 0) + CPU_SET(ev->ev_cpu, &cpumask); + } break; @@ -882,7 +889,7 @@ main(int argc, char **argv) */ if ((args.pa_flags & FLAG_READ_LOGFILE) && (args.pa_flags & FLAGS_HAS_CPUMASK) == 0) - cpumask = 0xffffffff; + CPU_FILL(&cpumask); args.pa_cpumask = cpumask; /* For selecting CPUs using -R. */ Modified: head/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.h Sun Aug 7 17:30:03 2011 (r224697) +++ head/usr.sbin/pmcstat/pmcstat.h Sun Aug 7 18:37:05 2011 (r224698) @@ -33,6 +33,8 @@ #ifndef _PMCSTAT_H_ #define _PMCSTAT_H_ +#include + #define FLAG_HAS_TARGET 0x00000001 /* process target */ #define FLAG_HAS_WAIT_INTERVAL 0x00000002 /* -w secs */ #define FLAG_HAS_OUTPUT_LOGFILE 0x00000004 /* -O file or pipe */ @@ -140,7 +142,7 @@ struct pmcstat_args { FILE *pa_graphfile; /* where to send the callgraph */ int pa_graphdepth; /* print depth for callgraphs */ double pa_interval; /* printing interval in seconds */ - uint32_t pa_cpumask; /* filter for CPUs analysed */ + cpuset_t pa_cpumask; /* filter for CPUs analysed */ int pa_ctdumpinstr; /* dump instructions with calltree */ int pa_topmode; /* delta or accumulative */ int pa_toptty; /* output to tty or file */ @@ -159,8 +161,6 @@ extern struct pmcstat_args args; /* comm /* Function prototypes */ void pmcstat_attach_pmcs(void); void pmcstat_cleanup(void); -void pmcstat_clone_event_descriptor( - struct pmcstat_ev *_ev, uint32_t _cpumask); int pmcstat_close_log(void); void pmcstat_create_process(void); void pmcstat_find_targets(const char *_arg); @@ -178,7 +178,6 @@ int pmcstat_process_log(void); int pmcstat_keypress_log(void); void pmcstat_display_log(void); void pmcstat_pluginconfigure_log(char *_opt); -uint32_t pmcstat_get_cpumask(const char *_a); void pmcstat_topexit(void); #endif /* _PMCSTAT_H_ */ Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Sun Aug 7 17:30:03 2011 (r224697) +++ head/usr.sbin/pmcstat/pmcstat_log.c Sun Aug 7 18:37:05 2011 (r224698) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1435,7 +1436,7 @@ pmcstat_analyze_log(void) cpu = PMC_CALLCHAIN_CPUFLAGS_TO_CPU(cpuflags); /* Filter on the CPU id. */ - if ((args.pa_cpumask & (1 << cpu)) == 0) { + if (!CPU_ISSET(cpu, &(args.pa_cpumask))) { pmcstat_stats.ps_samples_skipped++; break; } From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 18:41:04 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E88FD1065672; Sun, 7 Aug 2011 18:41:04 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id B22A48FC0A; Sun, 7 Aug 2011 18:41:04 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p77Ieu6H012958 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 7 Aug 2011 11:41:03 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20110807115256.GG48988@alchemy.franken.de> Date: Sun, 7 Aug 2011 11:40:58 -0700 Content-Transfer-Encoding: 7bit Message-Id: <937CC3F7-CA11-4C85-AB45-8EB4431B7FEE@xcllnt.net> References: <201108061748.p76HmUbM061259@svn.freebsd.org> <4E3DA560.6020100@yandex.ru> <4E3DBAF8.5040102@FreeBSD.org> <20110806232415.GE48988@alchemy.franken.de> <96C6C36B-E521-4438-9AEF-59D9A922D3B4@xcllnt.net> <20110807115256.GG48988@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1244.3) Cc: src-committers@FreeBSD.org, Ruslan Mahmatkhanov , Garrett Cooper , svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org Subject: Re: svn commit: r224683 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 18:41:05 -0000 On Aug 7, 2011, at 4:52 AM, Marius Strobl wrote: > > Okay, but then I don't know how to properly fix this given that > thr_p{read,write}_long() still seem to do the wrong thing as they > supply sizeof(long) rather than the size of a long on the target > to thr_p{read,write}() as the size of the value in the target > address space. Don't worry about cross use. The implementation isn't quite there yet. That's why you see sizeof(long) in some places even though that's obviously only vid for the native case. FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 20:16:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE31A106566B; Sun, 7 Aug 2011 20:16:46 +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 AD1448FC14; Sun, 7 Aug 2011 20:16:46 +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 p77KGkmq014642; Sun, 7 Aug 2011 20:16:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77KGkMe014613; Sun, 7 Aug 2011 20:16:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108072016.p77KGkMe014613@svn.freebsd.org> From: Rick Macklem Date: Sun, 7 Aug 2011 20:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224699 - in head/sys: amd64/conf arm/conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 20:16:46 -0000 Author: rmacklem Date: Sun Aug 7 20:16:46 2011 New Revision: 224699 URL: http://svn.freebsd.org/changeset/base/224699 Log: Change all the sample kernel configurations to use NFSCL, NFSD instead of NFSCLIENT, NFSSERVER since NFSCL and NFSD are now the defaults. The client change is needed for diskless configurations, so that the root mount works for fstype nfs. Reported by seanbru at yahoo-inc.com for i386/XEN. Approved by: re (hrs) Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/EP80219 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/QILA9G20 head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SIMICS head/sys/arm/conf/TS7800 head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/i386/conf/XEN head/sys/pc98/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/amd64/conf/GENERIC Sun Aug 7 20:16:46 2011 (r224699) @@ -37,7 +37,7 @@ options MD_ROOT # MD is a potential r options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/AVILA Sun Aug 7 20:16:46 2011 (r224699) @@ -50,8 +50,8 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #New Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/BWCT Sun Aug 7 20:16:46 2011 (r224699) @@ -46,10 +46,10 @@ options SOFTUPDATES #Enable FFS soft u #options MD_ROOT_SIZE=4096 # 3MB ram disk #options ROOTDEVNAME=\"ufs:md0\" #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP_NFSROOT options BOOTP Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/CAMBRIA Sun Aug 7 20:16:46 2011 (r224699) @@ -51,8 +51,8 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #New Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/CNS11XXNAS Sun Aug 7 20:16:46 2011 (r224699) @@ -66,10 +66,10 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/CRB Sun Aug 7 20:16:46 2011 (r224699) @@ -41,10 +41,10 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/DB-78XXX Sun Aug 7 20:16:46 2011 (r224699) @@ -17,9 +17,9 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/DB-88F5XXX Sun Aug 7 20:16:46 2011 (r224699) @@ -17,9 +17,9 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/DB-88F6XXX Sun Aug 7 20:16:46 2011 (r224699) @@ -17,9 +17,9 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/DOCKSTAR Sun Aug 7 20:16:46 2011 (r224699) @@ -17,9 +17,9 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/EP80219 Sun Aug 7 20:16:46 2011 (r224699) @@ -40,10 +40,10 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/GUMSTIX Sun Aug 7 20:16:46 2011 (r224699) @@ -45,9 +45,9 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/HL200 Sun Aug 7 20:16:46 2011 (r224699) @@ -39,10 +39,10 @@ options FFS #Berkeley Fast Filesystem #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 3MB ram disk #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP_NFSROOT options BOOTP options BOOTP_NFSV3 Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/HL201 Sun Aug 7 20:16:46 2011 (r224699) @@ -39,10 +39,10 @@ options FFS #Berkeley Fast Filesystem #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 3MB ram disk #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP_NFSROOT options BOOTP options BOOTP_NFSV3 Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/IQ31244 Sun Aug 7 20:16:46 2011 (r224699) @@ -41,10 +41,10 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/KB920X Sun Aug 7 20:16:46 2011 (r224699) @@ -40,10 +40,10 @@ options FFS #Berkeley Fast Filesystem #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options NFS_ROOT #NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/LN2410SBC Sun Aug 7 20:16:46 2011 (r224699) @@ -45,7 +45,7 @@ options ROOTDEVNAME=\"ufs:da0s1\" #options BOOTP #options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info -#options NFSCLIENT #Network File System client +#options NFSCL #New Network Filesystem Client #options NFS_ROOT #NFS usable as root device options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/NSLU Sun Aug 7 20:16:46 2011 (r224699) @@ -58,10 +58,10 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/QILA9G20 Sun Aug 7 20:16:46 2011 (r224699) @@ -39,10 +39,10 @@ options FFS #Berkeley Fast Filesystem #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 3MB ram disk -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options NFS_ROOT #NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP #options BOOTP_NFSV3 Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/SAM9G20EK Sun Aug 7 20:16:46 2011 (r224699) @@ -38,10 +38,10 @@ options FFS #Berkeley Fast Filesystem #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 3MB ram disk -options NFSCLIENT #Network Filesystem Client -#options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options NFS_ROOT #NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP #options BOOTP_NFSV3 Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/SHEEVAPLUG Sun Aug 7 20:16:46 2011 (r224699) @@ -17,9 +17,9 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/arm/conf/SIMICS ============================================================================== --- head/sys/arm/conf/SIMICS Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/SIMICS Sun Aug 7 20:16:46 2011 (r224699) @@ -39,10 +39,10 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories options MD_ROOT #MD is a potential root device options ROOTDEVNAME=\"ufs:md0\" -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server +options NFSCL #New Network Filesystem Client +options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/arm/conf/TS7800 Sun Aug 7 20:16:46 2011 (r224699) @@ -18,9 +18,9 @@ options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support -options NFSCLIENT #Network Filesystem Client +options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/i386/conf/GENERIC Sun Aug 7 20:16:46 2011 (r224699) @@ -39,7 +39,7 @@ options MD_ROOT # MD is a potential r options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/i386/conf/XBOX Sun Aug 7 20:16:46 2011 (r224699) @@ -27,10 +27,10 @@ options SOFTUPDATES # Enable FFS soft #options UFS_ACL # Support for access control lists #options UFS_DIRHASH # Improve performance on big directories #options MD_ROOT # MD is a potential root device -options NFSCLIENT # Network Filesystem Client -#options NFSSERVER # Network Filesystem Server +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server #options NFSLOCKD # Network Lock Manager -#options NFS_ROOT # NFS usable as /, requires NFSCLIENT +#options NFS_ROOT # NFS usable as /, requires NFSCL #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/i386/conf/XEN Sun Aug 7 20:16:46 2011 (r224699) @@ -21,10 +21,10 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options NFSCLIENT # Network Filesystem Client -options NFSSERVER # Network Filesystem Server +options NFSCL # New Network Filesystem Client +options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/pc98/conf/GENERIC Sun Aug 7 20:16:46 2011 (r224699) @@ -39,7 +39,7 @@ options MD_ROOT # MD is a potential r options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Aug 7 18:37:05 2011 (r224698) +++ head/sys/sparc64/conf/GENERIC Sun Aug 7 20:16:46 2011 (r224699) @@ -40,7 +40,7 @@ options MD_ROOT # MD is a potential r options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 20:24:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ECCB106566C; Sun, 7 Aug 2011 20:24:33 +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 04BB28FC08; Sun, 7 Aug 2011 20:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p77KOWtG014915; Sun, 7 Aug 2011 20:24:32 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p77KOWvk014911; Sun, 7 Aug 2011 20:24:32 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108072024.p77KOWvk014911@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Aug 2011 20:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224700 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 20:24:33 -0000 Author: mm Date: Sun Aug 7 20:24:32 2011 New Revision: 224700 URL: http://svn.freebsd.org/changeset/base/224700 Log: Merge revision 3554 from libarchive's release/2.8 branch: Partial merge of 2431 from trunk: Retry writes on EINTR. This should fix the SIGINT handler in bsdtar. Note: The rest of r2431 can't be merged, since it interacts with a big write-side rearchitecture. PR: bin/149409 Reviewed by: kientzle Approved by: re (kib) MFC after: 3 days Modified: head/lib/libarchive/archive_write_open_fd.c head/lib/libarchive/archive_write_open_file.c head/lib/libarchive/archive_write_open_filename.c Modified: head/lib/libarchive/archive_write_open_fd.c ============================================================================== --- head/lib/libarchive/archive_write_open_fd.c Sun Aug 7 20:16:46 2011 (r224699) +++ head/lib/libarchive/archive_write_open_fd.c Sun Aug 7 20:24:32 2011 (r224700) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "archive.h" struct write_fd_data { - off_t offset; int fd; }; @@ -122,12 +121,16 @@ file_write(struct archive *a, void *clie ssize_t bytesWritten; mine = (struct write_fd_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int Modified: head/lib/libarchive/archive_write_open_file.c ============================================================================== --- head/lib/libarchive/archive_write_open_file.c Sun Aug 7 20:16:46 2011 (r224699) +++ head/lib/libarchive/archive_write_open_file.c Sun Aug 7 20:24:32 2011 (r224700) @@ -86,12 +86,16 @@ file_write(struct archive *a, void *clie size_t bytesWritten; mine = client_data; - bytesWritten = fwrite(buff, 1, length, mine->f); - if (bytesWritten < length) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = fwrite(buff, 1, length, mine->f); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int Modified: head/lib/libarchive/archive_write_open_filename.c ============================================================================== --- head/lib/libarchive/archive_write_open_filename.c Sun Aug 7 20:16:46 2011 (r224699) +++ head/lib/libarchive/archive_write_open_filename.c Sun Aug 7 20:24:32 2011 (r224700) @@ -142,12 +142,16 @@ file_write(struct archive *a, void *clie ssize_t bytesWritten; mine = (struct write_file_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int From owner-svn-src-all@FreeBSD.ORG Sun Aug 7 20:51:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D93810656D7; Sun, 7 Aug 2011 20:51:33 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from emx.nitro.dk (emx.nitro.dk [IPv6:2a01:4f8:120:7384::102]) by mx1.freebsd.org (Postfix) with ESMTP id BAF128FC14; Sun, 7 Aug 2011 20:51:32 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id 22233BD292; Sun, 7 Aug 2011 20:51:32 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id uaW8QOFkgYAT; Sun, 7 Aug 2011 20:51:30 +0000 (UTC) Received: from [192.168.4.21] (4304ds2-vlb.1.fullrate.dk [90.184.171.166]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id C6DEABD28A; Sun, 7 Aug 2011 20:51:29 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=us-ascii From: "Simon L. B. Nielsen" In-Reply-To: <201108060916.p769Gr4A043462@svn.freebsd.org> Date: Sun, 7 Aug 2011 22:51:29 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> References: <201108060916.p769Gr4A043462@svn.freebsd.org> To: Doug Barton X-Mailer: Apple Mail (2.1244.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Aug 2011 20:51:33 -0000 On 6 Aug 2011, at 11:16, Doug Barton wrote: > Author: dougb > Date: Sat Aug 6 09:16:53 2011 > New Revision: 224674 > URL: http://svn.freebsd.org/changeset/base/224674 >=20 > Log: > Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D = "no" > comment out the NIS _compat options by default, but leave them in > the file for the convenience of users who want to enable it. >=20 > Update the comment in the file accordingly. This disables NIS by default which is rather surprising considering = there has been no prior (which I have been able to find) discussion of = this. At the _VERY_ least people need to be warned about this loudly. Unless = you can show this really helps non-NIS users this is IMO a bad idea. Yes, if you hand merge all /etc files this won't be a problem... but I = don't since life's to short for that, so this change just broke login on = one of the FreeBSD.org during an upgrade. --=20 Simon L. B. Nielsen From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 01:05:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CED1065677; Mon, 8 Aug 2011 01:05:14 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id E55018FC1A; Mon, 8 Aug 2011 01:05:13 +0000 (UTC) Received: by vxh11 with SMTP id 11so1397461vxh.13 for ; Sun, 07 Aug 2011 18:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=f4UlpoLIlmY26yoi0Vmzds5+M98rYj514dQA/Ke6Jww=; b=oMWvr6hTwlWkfaNe6VlLYzaEeBItNm5mx0IVM4gd4PCuLveqyS56Hq8J1RPKEliVh5 0kLvxA5O3ibS0rIU8cufRuKZehJA12QLDITic84ZYHmXtHjigdBvKBL248+LP6WZ0gpW /BGzkzi+eaF/fnFodvKYukfMA8kiyj0hEsfDQ= MIME-Version: 1.0 Received: by 10.220.115.6 with SMTP id g6mr1545433vcq.89.1312765512449; Sun, 07 Aug 2011 18:05:12 -0700 (PDT) Received: by 10.220.172.18 with HTTP; Sun, 7 Aug 2011 18:05:12 -0700 (PDT) In-Reply-To: <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> Date: Sun, 7 Aug 2011 18:05:12 -0700 Message-ID: From: Garrett Cooper To: "Simon L. B. Nielsen" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 01:05:14 -0000 On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wrote: > > On 6 Aug 2011, at 11:16, Doug Barton wrote: > >> Author: dougb >> Date: Sat Aug =A06 09:16:53 2011 >> New Revision: 224674 >> URL: http://svn.freebsd.org/changeset/base/224674 >> >> Log: >> =A0Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D "no= " >> =A0comment out the NIS _compat options by default, but leave them in >> =A0the file for the convenience of users who want to enable it. >> >> =A0Update the comment in the file accordingly. > > This disables NIS by default which is rather surprising considering there= has been no prior (which I have been able to find) discussion of this. > > At the _VERY_ least people need to be warned about this loudly. Unless yo= u can show this really helps non-NIS users this is IMO a bad idea. > > Yes, if you hand merge all /etc files this won't be a problem... but I do= n't since life's to short for that, so this change just broke login on one = of the FreeBSD.org during an upgrade. non-POLA changes are bad, and this _definitely_ deserves an UPDATING entry and/or further discussion. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 03:09:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDB1106566B; Mon, 8 Aug 2011 03:09:03 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5138FC08; Mon, 8 Aug 2011 03:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p78393AO028242; Mon, 8 Aug 2011 03:09:03 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78393G7028240; Mon, 8 Aug 2011 03:09:03 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201108080309.p78393G7028240@svn.freebsd.org> From: Hiroki Sato Date: Mon, 8 Aug 2011 03:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224701 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 03:09:03 -0000 Author: hrs Date: Mon Aug 8 03:09:03 2011 New Revision: 224701 URL: http://svn.freebsd.org/changeset/base/224701 Log: Fix a pathname (s,netinet/if_ether.h,net/ethernet.h,). PR: docs/159341 Submitted by: Garrett Cooper Approved by: re (kib) Modified: head/lib/libc/net/ethers.3 Modified: head/lib/libc/net/ethers.3 ============================================================================== --- head/lib/libc/net/ethers.3 Sun Aug 7 20:24:32 2011 (r224700) +++ head/lib/libc/net/ethers.3 Mon Aug 8 03:09:03 2011 (r224701) @@ -68,7 +68,7 @@ These functions operate on ethernet addresses using an .Vt ether_addr structure, which is defined in the header file -.In netinet/if_ether.h : +.In net/ethernet.h : .Bd -literal -offset indent /* * The number of bytes in an ethernet (MAC) address. From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 04:12:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id A59A5106566B; Mon, 8 Aug 2011 04:12:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 1209614E526; Mon, 8 Aug 2011 04:12:04 +0000 (UTC) Message-ID: <4E3F6216.5080706@FreeBSD.org> Date: Sun, 07 Aug 2011 21:12:06 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Garrett Cooper References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> In-Reply-To: X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 04:12:05 -0000 On 8/7/2011 6:05 PM, Garrett Cooper wrote: > On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wrote: >> >> On 6 Aug 2011, at 11:16, Doug Barton wrote: >> >>> Author: dougb >>> Date: Sat Aug 6 09:16:53 2011 >>> New Revision: 224674 >>> URL: http://svn.freebsd.org/changeset/base/224674 >>> >>> Log: >>> Rather than edit the nsswitch.conf file based on ${MK_NIS} == "no" >>> comment out the NIS _compat options by default, but leave them in >>> the file for the convenience of users who want to enable it. >>> >>> Update the comment in the file accordingly. >> >> This disables NIS by default which is rather surprising considering there has been no prior (which I have been able to find) discussion of this. >> >> At the _VERY_ least people need to be warned about this loudly. Unless you can show this really helps non-NIS users this is IMO a bad idea. >> >> Yes, if you hand merge all /etc files this won't be a problem... but I don't since life's to short for that, so this change just broke login on one of the FreeBSD.org during an upgrade. mergemaster has been in the tree for almost 12 years now. :) In any case, I can't think of a situation where blindly copying new files to /etc is a good idea (with all due respect). > non-POLA changes are bad, and this _definitely_ deserves an UPDATING > entry and/or further discussion. I'm happy to ask for permission to do the UPDATING entry, do you have suggestions for the text? Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 05:22:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A34B1065675; Mon, 8 Aug 2011 05:22:09 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59D7D8FC0C; Mon, 8 Aug 2011 05:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p785M9Bt032368; Mon, 8 Aug 2011 05:22:09 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p785M9R8032366; Mon, 8 Aug 2011 05:22:09 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201108080522.p785M9R8032366@svn.freebsd.org> From: Kevin Lo Date: Mon, 8 Aug 2011 05:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224702 - head/usr.bin/xlint/lint1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 05:22:09 -0000 Author: kevlo Date: Mon Aug 8 05:22:09 2011 New Revision: 224702 URL: http://svn.freebsd.org/changeset/base/224702 Log: catstrg() does not set the resulting string length. PR: bin/152549 Submitted by: Henning Petersen Approved by: re (hrs) Modified: head/usr.bin/xlint/lint1/tree.c Modified: head/usr.bin/xlint/lint1/tree.c ============================================================================== --- head/usr.bin/xlint/lint1/tree.c Mon Aug 8 03:09:03 2011 (r224701) +++ head/usr.bin/xlint/lint1/tree.c Mon Aug 8 05:22:09 2011 (r224702) @@ -3786,6 +3786,7 @@ catstrg(strg_t *strg1, strg_t *strg2) (len2 + 1) * sizeof (wchar_t)); free(strg2->st_wcp); } + strg1->st_len = len; free(strg2); return (strg1); From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 05:25:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BB8106566C; Mon, 8 Aug 2011 05:25:52 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 038338FC13; Mon, 8 Aug 2011 05:25: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 p785Ppl2032507; Mon, 8 Aug 2011 05:25:51 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p785Pplq032505; Mon, 8 Aug 2011 05:25:51 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201108080525.p785Pplq032505@svn.freebsd.org> From: Kevin Lo Date: Mon, 8 Aug 2011 05:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224703 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 05:25:52 -0000 Author: kevlo Date: Mon Aug 8 05:25:51 2011 New Revision: 224703 URL: http://svn.freebsd.org/changeset/base/224703 Log: In rtinit1(), before rtrequest1_fib() is called, info.rti_flags is initialized by flags (function argument) or-ed with ifa->ifa_flags. If both NIC has a loopback route to itself, so IFA_RTSELF is set on ifa(s). As IFA_RTSELF is defined by RTF_HOST, rtrequest1_fib() is called with RTF_HOST flag even if netmask is not NULL. Consequently, netmask is set to zero in rtrequest1_fib(), and request to add network route is changed under hands to request to add host route. Tested by: Andrew Boyer Submitted by: Svatopluk Kraus Approved by: re (hrs) Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Aug 8 05:22:09 2011 (r224702) +++ head/sys/net/route.c Mon Aug 8 05:25:51 2011 (r224703) @@ -1478,7 +1478,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int */ bzero((caddr_t)&info, sizeof(info)); info.rti_ifa = ifa; - info.rti_flags = flags | ifa->ifa_flags; + info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF); info.rti_info[RTAX_DST] = dst; /* * doing this for compatibility reasons From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 06:42:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA879106564A; Mon, 8 Aug 2011 06:42:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2A19D8FC0A; Mon, 8 Aug 2011 06:42:35 +0000 (UTC) Received: by vws18 with SMTP id 18so2377590vws.13 for ; Sun, 07 Aug 2011 23:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=TEGsJnLA2AKzf3/pBgLwlCUV6fWm9EvwiWiPQ4Oh+pE=; b=MwAelznUBCmtMlJc+tlkq0ccfNS1PnT0KGPjn1iBpvDxcHHJp1ImKZh7TwTBuWknX0 /byxF0XYdR5mUgYBPaSw0tXuWxkyyn2I01PPZ0uvg3+IoBlJIOxfX+KTMxelDvUA5oi6 qemHTx6u7j3bA9nJggEfsm2UqwI16fWduhU4s= MIME-Version: 1.0 Received: by 10.220.198.135 with SMTP id eo7mr1587151vcb.19.1312785753650; Sun, 07 Aug 2011 23:42:33 -0700 (PDT) Received: by 10.220.172.18 with HTTP; Sun, 7 Aug 2011 23:42:33 -0700 (PDT) In-Reply-To: <4E3F6216.5080706@FreeBSD.org> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E3F6216.5080706@FreeBSD.org> Date: Sun, 7 Aug 2011 23:42:33 -0700 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 06:42:36 -0000 On Sun, Aug 7, 2011 at 9:12 PM, Doug Barton wrote: > On 8/7/2011 6:05 PM, Garrett Cooper wrote: >> On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wro= te: >>> >>> On 6 Aug 2011, at 11:16, Doug Barton wrote: >>> >>>> Author: dougb >>>> Date: Sat Aug =A06 09:16:53 2011 >>>> New Revision: 224674 >>>> URL: http://svn.freebsd.org/changeset/base/224674 >>>> >>>> Log: >>>> =A0Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D "= no" >>>> =A0comment out the NIS _compat options by default, but leave them in >>>> =A0the file for the convenience of users who want to enable it. >>>> >>>> =A0Update the comment in the file accordingly. >>> >>> This disables NIS by default which is rather surprising considering the= re has been no prior (which I have been able to find) discussion of this. >>> >>> At the _VERY_ least people need to be warned about this loudly. Unless = you can show this really helps non-NIS users this is IMO a bad idea. >>> >>> Yes, if you hand merge all /etc files this won't be a problem... but I = don't since life's to short for that, so this change just broke login on on= e of the FreeBSD.org during an upgrade. > > mergemaster has been in the tree for almost 12 years now. :) =A0In any > case, I can't think of a situation where blindly copying new files to > /etc is a good idea (with all due respect). > >> non-POLA changes are bad, and this _definitely_ deserves an UPDATING >> entry and/or further discussion. > > I'm happy to ask for permission to do the UPDATING entry, do you have > suggestions for the text? Maybe this? -Garrett $ svn diff UPDATING Index: UPDATING =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- UPDATING (revision 224699) +++ UPDATING (working copy) @@ -22,6 +22,10 @@ machines to maximize performance. (To disable malloc debugging, ru= n ln -s aj /etc/malloc.conf.) +20110807: + Prior versions of nsswitch.conf explicitly enabled NIS lookup of gr= oup, + passwd, and services information; it is now disabled by default. + 20110628: The packet filter (pf) code has been updated to OpenBSD 4.5. You need to update userland tools to be in sync with kernel. From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 07:07:24 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E818106564A; Mon, 8 Aug 2011 07:07:23 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id AD6C38FC1A; Mon, 8 Aug 2011 07:07:22 +0000 (UTC) Received: from alph.allbsd.org (p3028-ipbf608funabasi.chiba.ocn.ne.jp [125.175.94.28]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id p7876ufP098512; Mon, 8 Aug 2011 16:07:06 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id p7876rLn011174; Mon, 8 Aug 2011 16:06:53 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 08 Aug 2011 16:06:25 +0900 (JST) Message-Id: <20110808.160625.465966131558285623.hrs@allbsd.org> To: yanegomi@gmail.com From: Hiroki Sato In-Reply-To: References: <4E3F6216.5080706@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Aug__8_16_06_25_2011_870)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Mon, 08 Aug 2011 16:07:11 +0900 (JST) X-Spam-Status: No, score=-102.0 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, DIRECTOCNDYN, MIMEQENC, QENCPTR1, QENCPTR2, RCVD_IN_RP_RNBL, SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, simon@nitro.dk, svn-src-all@FreeBSD.org, dougb@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 07:07:24 -0000 ----Security_Multipart(Mon_Aug__8_16_06_25_2011_870)-- Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Garrett Cooper wrote in : ya> On Sun, Aug 7, 2011 at 9:12 PM, Doug Barton wro= te: ya> > On 8/7/2011 6:05 PM, Garrett Cooper wrote: ya> >> On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wrote: ya> >>> ya> >>> On 6 Aug 2011, at 11:16, Doug Barton wrote: ya> >>> ya> >>>> Author: dougb ya> >>>> Date: Sat Aug =A06 09:16:53 2011 ya> >>>> New Revision: 224674 ya> >>>> URL: http://svn.freebsd.org/changeset/base/224674 ya> >>>> ya> >>>> Log: ya> >>>> =A0Rather than edit the nsswitch.conf file based on ${MK_NIS} = =3D=3D "no" ya> >>>> =A0comment out the NIS _compat options by default, but leave t= hem in ya> >>>> =A0the file for the convenience of users who want to enable it= .= ya> >>>> ya> >>>> =A0Update the comment in the file accordingly. ya> >>> ya> >>> This disables NIS by default which is rather surprising conside= ring there has been no prior (which I have been able to find) discussio= n of this. ya> >>> ya> >>> At the _VERY_ least people need to be warned about this loudly.= Unless you can show this really helps non-NIS users this is IMO a bad = idea. ya> >>> ya> >>> Yes, if you hand merge all /etc files this won't be a problem..= . but I don't since life's to short for that, so this change just broke= login on one of the FreeBSD.org during an upgrade. ya> > ya> > mergemaster has been in the tree for almost 12 years now. :) =A0I= n any ya> > case, I can't think of a situation where blindly copying new file= s to ya> > /etc is a good idea (with all due respect). ya> > ya> >> non-POLA changes are bad, and this _definitely_ deserves an UPDA= TING ya> >> entry and/or further discussion. ya> > ya> > I'm happy to ask for permission to do the UPDATING entry, do you = have ya> > suggestions for the text? ya> = ya> Maybe this? ya> -Garrett Could you all please discuss this topic on -current? I was not fully aware of the impact and possible controversy when I approved this change (sorry), but simon@'s comment implies an objection against the change as well as a suggestion to discuss it for a consensus. I think it is better to discuss this on a (more) public mailing list before taking further actions. -- Hiroki ----Security_Multipart(Mon_Aug__8_16_06_25_2011_870)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk4/ivEACgkQTyzT2CeTzy13ZwCgw5dA38Uo6BVJYMMquYr5X/sU ef4An3npKtoj5pxNfv62znqvLjAqtAct =hWYW -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Aug__8_16_06_25_2011_870)---- From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 08:22:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49747106566B; Mon, 8 Aug 2011 08:22:16 +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 38D678FC12; Mon, 8 Aug 2011 08:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p788MGCX037593; Mon, 8 Aug 2011 08:22:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p788MG0s037591; Mon, 8 Aug 2011 08:22:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108080822.p788MG0s037591@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 8 Aug 2011 08:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224704 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 08:22:16 -0000 Author: kib Date: Mon Aug 8 08:22:15 2011 New Revision: 224704 URL: http://svn.freebsd.org/changeset/base/224704 Log: MFC r224581: Fix the LK_NOSHARE lockmgr flag interaction with LK_UPGRADE and LK_DOWNGRADE lock ops. Namely, the ops should be NOP since LK_NOSHARE locks are always exclusive. Modified: stable/8/sys/kern/kern_lock.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_lock.c ============================================================================== --- stable/8/sys/kern/kern_lock.c Mon Aug 8 05:25:51 2011 (r224703) +++ stable/8/sys/kern/kern_lock.c Mon Aug 8 08:22:15 2011 (r224704) @@ -451,8 +451,18 @@ __lockmgr_args(struct lock *lk, u_int fl return (0); } - if (op == LK_SHARED && (lk->lock_object.lo_flags & LK_NOSHARE)) - op = LK_EXCLUSIVE; + if (lk->lock_object.lo_flags & LK_NOSHARE) { + switch (op) { + case LK_SHARED: + op = LK_EXCLUSIVE; + break; + case LK_UPGRADE: + case LK_DOWNGRADE: + _lockmgr_assert(lk, KA_XLOCKED | KA_NOTRECURSED, + file, line); + return (0); + } + } wakeup_swapper = 0; switch (op) { From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 09:42:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB330106566B; Mon, 8 Aug 2011 09:42:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5158FC16; Mon, 8 Aug 2011 09:42:59 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 564A425D38A5; Mon, 8 Aug 2011 09:42:58 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 6DC8EBD3C2D; Mon, 8 Aug 2011 09:42:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id yCRZDHWdMTEN; Mon, 8 Aug 2011 09:42:55 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 91656BD3C03; Mon, 8 Aug 2011 09:42:55 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> Date: Mon, 8 Aug 2011 09:42:54 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5A22B4EF-3B5A-497D-8F7C-8D9EED3F1BE3@FreeBSD.org> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> To: "Simon L. B. Nielsen" X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Doug Barton Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 09:43:00 -0000 On Aug 7, 2011, at 8:51 PM, Simon L. B. Nielsen wrote: >=20 > On 6 Aug 2011, at 11:16, Doug Barton wrote: >=20 >> Author: dougb >> Date: Sat Aug 6 09:16:53 2011 >> New Revision: 224674 >> URL: http://svn.freebsd.org/changeset/base/224674 >>=20 >> Log: >> Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D = "no" >> comment out the NIS _compat options by default, but leave them in >> the file for the convenience of users who want to enable it. >>=20 >> Update the comment in the file accordingly. >=20 > This disables NIS by default which is rather surprising considering = there has been no prior (which I have been able to find) discussion of = this. >=20 > At the _VERY_ least people need to be warned about this loudly. Unless = you can show this really helps non-NIS users this is IMO a bad idea. Back in the days, when I introduced NO_NIS (which was the name back = then), I considered both this and something along Ed's initial change and I am sure some of the discussions can still be found in the archives (from around 2005/-2y). While I could never be bothered enough to do the Ed-kind of change, it was very clear back then that a change like this was a really bad idea as it would break setups left and right. We want to support the default compilation base system by default as well. If people prefer to go non- default (WITHOUT_NIS), it's fine to have them make other adjustments to alter defaults as well or live with the logging. The solution as is now is even more confusing as both Ed and Doug have missed to update the man page to clarify the new behaviour. I also do not like the longerish version of the file now and the new description is only talking about nis but ignoring all other sources, which we do not provide samples for, for the inconvenience of people wanting to use those. I think I'd like to see this reverted to avoid massive breakage of freebsd updated machines and, to be clear, I do not think an UPDATING entry is an adequate solution to mitigate this.=20 /bz --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.= From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 12:16:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C80106564A; Mon, 8 Aug 2011 12:16:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 757D98FC13; Mon, 8 Aug 2011 12:16:42 +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 p78CGgDi046871; Mon, 8 Aug 2011 12:16:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78CGgNu046869; Mon, 8 Aug 2011 12:16:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201108081216.p78CGgNu046869@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 8 Aug 2011 12:16:42 +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: r224706 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 12:16:42 -0000 Author: pluknet Date: Mon Aug 8 12:16:42 2011 New Revision: 224706 URL: http://svn.freebsd.org/changeset/base/224706 Log: MFC r224571: Add missing MODULE_VERSION() definition. PR: kern/159345 Modified: stable/8/sys/net/if_lagg.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/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Mon Aug 8 11:33:07 2011 (r224705) +++ stable/8/sys/net/if_lagg.c Mon Aug 8 12:16:42 2011 (r224706) @@ -204,6 +204,7 @@ static moduledata_t lagg_mod = { }; DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_lagg, 1); #if __FreeBSD_version >= 800000 /* From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 12:19:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F662106566B; Mon, 8 Aug 2011 12:19:21 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E2178FC1C; Mon, 8 Aug 2011 12:19:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p78CJK7A046998; Mon, 8 Aug 2011 12:19:20 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78CJK3i046996; Mon, 8 Aug 2011 12:19:20 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201108081219.p78CJK3i046996@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 8 Aug 2011 12:19:20 +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: r224707 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 12:19:21 -0000 Author: pluknet Date: Mon Aug 8 12:19:20 2011 New Revision: 224707 URL: http://svn.freebsd.org/changeset/base/224707 Log: MFC r224571: Add missing MODULE_VERSION() definition. PR: kern/159345 Modified: stable/7/sys/net/if_lagg.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/net/if_lagg.c ============================================================================== --- stable/7/sys/net/if_lagg.c Mon Aug 8 12:16:42 2011 (r224706) +++ stable/7/sys/net/if_lagg.c Mon Aug 8 12:19:20 2011 (r224707) @@ -203,6 +203,7 @@ static moduledata_t lagg_mod = { }; DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_lagg, 1); static int lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 13:13:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F02C106566B; Mon, 8 Aug 2011 13:13:23 +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 3E15A8FC14; Mon, 8 Aug 2011 13:13: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 p78DDNtS048626; Mon, 8 Aug 2011 13:13:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78DDNKV048624; Mon, 8 Aug 2011 13:13:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201108081313.p78DDNKV048624@svn.freebsd.org> From: Rick Macklem Date: Mon, 8 Aug 2011 13:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224708 - head/share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 13:13:23 -0000 Author: rmacklem Date: Mon Aug 8 13:13:22 2011 New Revision: 224708 URL: http://svn.freebsd.org/changeset/base/224708 Log: Change "options NFSCLIENT" to "options NFSCL" in diskless.8, since that is now the default NFS client. This is a content change. Reported by: shuvaev at physik.uni-wuerzburg.de Approved by: re (hrs) Modified: head/share/man/man8/diskless.8 Modified: head/share/man/man8/diskless.8 ============================================================================== --- head/share/man/man8/diskless.8 Mon Aug 8 12:19:20 2011 (r224707) +++ head/share/man/man8/diskless.8 Mon Aug 8 13:13:22 2011 (r224708) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2005 +.Dd August 7, 2011 .Dt DISKLESS 8 .Os .Sh NAME @@ -417,7 +417,7 @@ or .Tn TFTP , must include support for the NFS client: .Pp -.D1 Cd "options NFSCLIENT" +.D1 Cd "options NFSCL" .D1 Cd "options NFS_ROOT" .Pp If you are using a boot mechanism that does not pass network configuration From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 13:15:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B97B2106566C; Mon, 8 Aug 2011 13:15:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A79208FC15; Mon, 8 Aug 2011 13:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p78DFdPl048758; Mon, 8 Aug 2011 13:15:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78DFdCK048749; Mon, 8 Aug 2011 13:15:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081315.p78DFdCK048749@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 13:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224709 - in head/sys/dev/ath: . ath_hal ath_hal/ar5212 ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 13:15:39 -0000 Author: adrian Date: Mon Aug 8 13:15:39 2011 New Revision: 224709 URL: http://svn.freebsd.org/changeset/base/224709 Log: Add another HAL method - ah_isFastClockEnabled - which returns AH_TRUE if 5ghz fast clock is enabled in the current operating mode. It's slightly dirty, but it's part of the reference HAL and used by the (currently closed-source) radar event code to map radar pulses back to microsecond durations. Obtained from: Atheros Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ah.h Mon Aug 8 13:15:39 2011 (r224709) @@ -958,6 +958,7 @@ struct ath_hal { HAL_BOOL __ahdecl(*ah_procRadarEvent)(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); + HAL_BOOL __ahdecl(*ah_isFastClockEnabled)(struct ath_hal *ah); /* Key Cache Functions */ uint32_t __ahdecl(*ah_getKeyCacheSize)(struct ath_hal*); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Aug 8 13:15:39 2011 (r224709) @@ -625,5 +625,6 @@ extern void ar5212GetDfsThresh(struct at extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); +extern HAL_BOOL ar5212IsFastClockEnabled(struct ath_hal *ah); #endif /* _ATH_AR5212_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Mon Aug 8 13:15:39 2011 (r224709) @@ -133,6 +133,7 @@ static const struct ath_hal_private ar52 .ah_enableDfs = ar5212EnableDfs, .ah_getDfsThresh = ar5212GetDfsThresh, .ah_procRadarEvent = ar5212ProcessRadarEvent, + .ah_isFastClockEnabled = ar5212IsFastClockEnabled, /* Key Cache Functions */ .ah_getKeyCacheSize = ar5212GetKeyCacheSize, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Mon Aug 8 13:15:39 2011 (r224709) @@ -1222,3 +1222,13 @@ ar5212ProcessRadarEvent(struct ath_hal * return AH_TRUE; } + +/* + * Return whether 5GHz fast-clock (44MHz) is enabled. + * It's always disabled for AR5212 series NICs. + */ +HAL_BOOL +ar5212IsFastClockEnabled(struct ath_hal *ah) +{ + return AH_FALSE; +} Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Aug 8 13:15:39 2011 (r224709) @@ -208,6 +208,7 @@ extern void ar5416GetDfsThresh(struct at extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event); +extern HAL_BOOL ar5416IsFastClockEnabled(struct ath_hal *ah); extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Aug 8 13:15:39 2011 (r224709) @@ -150,6 +150,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_enableDfs = ar5416EnableDfs; ah->ah_getDfsThresh = ar5416GetDfsThresh; ah->ah_procRadarEvent = ar5416ProcessRadarEvent; + ah->ah_isFastClockEnabled = ar5416IsFastClockEnabled; /* Power Management Functions */ ah->ah_setPowerMode = ar5416SetPowerMode; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Mon Aug 8 13:15:39 2011 (r224709) @@ -731,3 +731,15 @@ ar5416ProcessRadarEvent(struct ath_hal * */ return AH_FALSE; } + +/* + * Return whether fast-clock is currently enabled for this + * channel. + */ +HAL_BOOL +ar5416IsFastClockEnabled(struct ath_hal *ah) +{ + struct ath_hal_private *ahp = AH_PRIVATE(ah); + + return IS_5GHZ_FAST_CLOCK_EN(ah, ahp->ah_curchan); +} Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Aug 8 13:13:22 2011 (r224708) +++ head/sys/dev/ath/if_athvar.h Mon Aug 8 13:15:39 2011 (r224709) @@ -712,6 +712,8 @@ void ath_intr(void *); ((*(_ah)->ah_getDfsThresh)((_ah), (_param))) #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event))) +#define ath_hal_isfastclockenabled(_ah) \ + ((*(_ah)->ah_isFastClockEnabled((_ah)) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 13:56:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D361065673; Mon, 8 Aug 2011 13:56:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 126878FC18; Mon, 8 Aug 2011 13:56: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 p78DuR0A050012; Mon, 8 Aug 2011 13:56:27 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78DuRLW050010; Mon, 8 Aug 2011 13:56:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201108081356.p78DuRLW050010@svn.freebsd.org> From: Ed Maste Date: Mon, 8 Aug 2011 13:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224710 - stable/8/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 13:56:28 -0000 Author: emaste Date: Mon Aug 8 13:56:27 2011 New Revision: 224710 URL: http://svn.freebsd.org/changeset/base/224710 Log: MFC r224047: Remove note that claims pthread_set_name_np is for debugging only. As Garrett points out, It is no more a debugging interface than setproctitle(3), and has not been since the name started getting stuffed into the kernel. This statement may have made sense when the name was only visible in thread state dumps and the debugger. PR: threads/158815 Modified: stable/8/share/man/man3/pthread_set_name_np.3 Directory Properties: stable/8/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/pthread_set_name_np.3 ============================================================================== --- stable/8/share/man/man3/pthread_set_name_np.3 Mon Aug 8 13:15:39 2011 (r224709) +++ stable/8/share/man/man3/pthread_set_name_np.3 Mon Aug 8 13:56:27 2011 (r224710) @@ -44,9 +44,6 @@ function sets internal name for thread s argument to string value specified by .Fa name argument. -.Pp -This is a debugging interface and using it on a day-by-day basis makes -no sense. .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 13:58:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACB491065670; Mon, 8 Aug 2011 13:58:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B48D8FC1D; Mon, 8 Aug 2011 13:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p78DwdsZ050131; Mon, 8 Aug 2011 13:58:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78DwdLO050129; Mon, 8 Aug 2011 13:58:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201108081358.p78DwdLO050129@svn.freebsd.org> From: Ed Maste Date: Mon, 8 Aug 2011 13:58:39 +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: r224711 - stable/7/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 13:58:39 -0000 Author: emaste Date: Mon Aug 8 13:58:39 2011 New Revision: 224711 URL: http://svn.freebsd.org/changeset/base/224711 Log: MFC r224047: Remove note that claims pthread_set_name_np is for debugging only. As Garrett points out, It is no more a debugging interface than setproctitle(3), and has not been since the name started getting stuffed into the kernel. This statement may have made sense when the name was only visible in thread state dumps and the debugger. PR: threads/158815 Modified: stable/7/share/man/man3/pthread_set_name_np.3 Directory Properties: stable/7/share/man/man3/ (props changed) Modified: stable/7/share/man/man3/pthread_set_name_np.3 ============================================================================== --- stable/7/share/man/man3/pthread_set_name_np.3 Mon Aug 8 13:56:27 2011 (r224710) +++ stable/7/share/man/man3/pthread_set_name_np.3 Mon Aug 8 13:58:39 2011 (r224711) @@ -44,9 +44,6 @@ function sets internal name for thread s argument to string value specified by .Fa name argument. -.Pp -This is a debugging interface and using it on a day-by-day basis makes -no sense. .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 14:02:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B3791065672; Mon, 8 Aug 2011 14:02:09 +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 0046C8FC13; Mon, 8 Aug 2011 14:02:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p78E28NZ050290; Mon, 8 Aug 2011 14:02:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78E287S050288; Mon, 8 Aug 2011 14:02:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108081402.p78E287S050288@svn.freebsd.org> From: Martin Matuska Date: Mon, 8 Aug 2011 14:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224712 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 14:02:09 -0000 Author: mm Date: Mon Aug 8 14:02:08 2011 New Revision: 224712 URL: http://svn.freebsd.org/changeset/base/224712 Log: Revert r224655 and r224614 because vn_fullpath* does not always work on nullfs mounts. Change shall be reconsidered after 9.0 is released. Requested by: re (kib) Approved by: re (kib) Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Aug 8 13:58:39 2011 (r224711) +++ head/sys/kern/vfs_mount.c Mon Aug 8 14:02:08 2011 (r224712) @@ -362,60 +362,6 @@ vfs_mergeopts(struct vfsoptlist *toopts, } /* - * Verify vnode's global path - */ -static int -vfs_verify_global_path(struct thread *td, struct vnode *vp, char *fspath) -{ - struct nameidata nd; - struct vnode *vp1; - char *rpath, *fbuf; - int error; - - ASSERT_VOP_ELOCKED(vp, __func__); - - /* Construct global filesystem path from vp. */ - VOP_UNLOCK(vp, 0); - error = vn_fullpath_global(td, vp, &rpath, &fbuf); - if (error != 0) { - vrele(vp); - return (error); - } - if (strlen(rpath) >= MNAMELEN) { - vrele(vp); - error = ENAMETOOLONG; - goto out; - } - - /* - * Re-lookup the vnode by path. As a side effect, the vnode is - * relocked. If vnode was renamed, return ENOENT. - */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - UIO_SYSSPACE, fspath, td); - error = namei(&nd); - if (error != 0) { - vrele(vp); - goto out; - } - if (NDHASGIANT(&nd)) - mtx_unlock(&Giant); - NDFREE(&nd, NDF_ONLY_PNBUF); - vp1 = nd.ni_vp; - vrele(vp); - if (vp1 != vp) { - vput(vp1); - error = ENOENT; - goto out; - } - - strlcpy(fspath,rpath,MNAMELEN); -out: - free(fbuf, M_TEMP); - return (error); -} - -/* * Mount a filesystem. */ int @@ -1124,14 +1070,16 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - error = vfs_verify_global_path(td, vp, fspath); - if (error == 0) - error = vfs_domount_first(td, vfsp, fspath, vp, - fsflags, optlist); - } else + error = vfs_domount_first(td, vfsp, fspath, vp, fsflags, + optlist); + } else { error = vfs_domount_update(td, vp, fsflags, optlist); + } mtx_unlock(&Giant); + ASSERT_VI_UNLOCKED(vp, __func__); + ASSERT_VOP_UNLOCKED(vp, __func__); + return (error); } @@ -1157,7 +1105,6 @@ unmount(td, uap) } */ *uap; { struct mount *mp; - struct nameidata nd; char *pathbuf; int error, id0, id1; @@ -1193,25 +1140,6 @@ unmount(td, uap) mtx_unlock(&mountlist_mtx); } else { AUDIT_ARG_UPATH1(td, pathbuf); - /* - * If we are jailed and this is not a root jail try to find - * global path for path argument. - */ - if (jailed(td->td_ucred) && - td->td_ucred->cr_prison->pr_root != rootvnode) { - NDINIT(&nd, LOOKUP, - FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1, - UIO_SYSSPACE, pathbuf, td); - if (namei(&nd) == 0) { - if (NDHASGIANT(&nd)) - mtx_unlock(&Giant); - NDFREE(&nd, NDF_ONLY_PNBUF); - error = vfs_verify_global_path(td, nd.ni_vp, - pathbuf); - if (error == 0) - vput(nd.ni_vp); - } - } mtx_lock(&mountlist_mtx); TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) { if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 14:14:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F375106566C; Mon, 8 Aug 2011 14:14:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BE57E8FC15; Mon, 8 Aug 2011 14:14:46 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p78EEYsw093756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Aug 2011 17:14:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p78EEYP6004576; Mon, 8 Aug 2011 17:14:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p78EEYw0004575; Mon, 8 Aug 2011 17:14:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 8 Aug 2011 17:14:34 +0300 From: Kostik Belousov To: Martin Matuska Message-ID: <20110808141434.GX17489@deviant.kiev.zoral.com.ua> References: <201108081402.p78E287S050288@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oiHIG38sQGusYEpV" Content-Disposition: inline In-Reply-To: <201108081402.p78E287S050288@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224712 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 14:14:47 -0000 --oiHIG38sQGusYEpV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 08, 2011 at 02:02:08PM +0000, Martin Matuska wrote: > Author: mm > Date: Mon Aug 8 14:02:08 2011 > New Revision: 224712 > URL: http://svn.freebsd.org/changeset/base/224712 >=20 > Log: > Revert r224655 and r224614 because vn_fullpath* does not always work > on nullfs mounts. > =20 > Change shall be reconsidered after 9.0 is released. > =20 > Requested by: re (kib) > Approved by: re (kib) Thank you. --oiHIG38sQGusYEpV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4/70kACgkQC3+MBN1Mb4iR4gCgjZCsCl8GNtGshI23oJkh/p7E Qw4AoN1qhJT+WO+POY7LLF8J77gCqISq =JrAc -----END PGP SIGNATURE----- --oiHIG38sQGusYEpV-- From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 15:41:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11CB41065672; Mon, 8 Aug 2011 15:41:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01AB18FC1A; Mon, 8 Aug 2011 15:41:04 +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 p78Ff32T053277; Mon, 8 Aug 2011 15:41:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78Ff3Fr053275; Mon, 8 Aug 2011 15:41:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081541.p78Ff3Fr053275@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 15:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224714 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 15:41:04 -0000 Author: adrian Date: Mon Aug 8 15:41:03 2011 New Revision: 224714 URL: http://svn.freebsd.org/changeset/base/224714 Log: Fix method naming to match the reference HAL definition. Obtained from: Atheros Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Aug 8 14:40:23 2011 (r224713) +++ head/sys/dev/ath/if_athvar.h Mon Aug 8 15:41:03 2011 (r224714) @@ -712,7 +712,7 @@ void ath_intr(void *); ((*(_ah)->ah_getDfsThresh)((_ah), (_param))) #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event))) -#define ath_hal_isfastclockenabled(_ah) \ +#define ath_hal_is_fast_clock_enabled(_ah) \ ((*(_ah)->ah_isFastClockEnabled((_ah)) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 15:42:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66D941065675; Mon, 8 Aug 2011 15:42:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56CE78FC1C; Mon, 8 Aug 2011 15:42: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 p78Fgb0M053360; Mon, 8 Aug 2011 15:42:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78FgbfD053358; Mon, 8 Aug 2011 15:42:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081542.p78FgbfD053358@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 15:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224715 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 15:42:37 -0000 Author: adrian Date: Mon Aug 8 15:42:37 2011 New Revision: 224715 URL: http://svn.freebsd.org/changeset/base/224715 Log: .. and add a missing bracket. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Aug 8 15:41:03 2011 (r224714) +++ head/sys/dev/ath/if_athvar.h Mon Aug 8 15:42:37 2011 (r224715) @@ -713,7 +713,7 @@ void ath_intr(void *); #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event))) #define ath_hal_is_fast_clock_enabled(_ah) \ - ((*(_ah)->ah_isFastClockEnabled((_ah)) + ((*(_ah)->ah_isFastClockEnabled)((_ah)) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 16:22:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4B4B1065676; Mon, 8 Aug 2011 16:22:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3BE08FC12; Mon, 8 Aug 2011 16:22:42 +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 p78GMgT1054701; Mon, 8 Aug 2011 16:22:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78GMgk5054693; Mon, 8 Aug 2011 16:22:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081622.p78GMgk5054693@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 16:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224716 - in head/sys/dev/ath: . ath_dfs/null ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 16:22:42 -0000 Author: adrian Date: Mon Aug 8 16:22:42 2011 New Revision: 224716 URL: http://svn.freebsd.org/changeset/base/224716 Log: Introduce some more DFS related hooks, inspired both by local work and the Atheros reference code. The radar detection code needs to know what the current DFS domain is. Since net80211 doesn't currently know this information, it's extracted from the HAL regulatory domain information. The specifics: * add a new ath_dfs API hook, ath_dfs_init_radar_filters(), which updates the radar filters whenever the regulatory domain changes. * add HAL_DFS_DOMAIN which describes the currently configured DFS domain . * add a new HAL internal variable which tracks the currently configured HAL DFS domain. * add a new HAL capability, HAL_CAP_DFS_DMN, which returns the currently configured HAL DFS domain setting. * update the HAL DFS domain setting whenever the channel setting is updated. Since this isn't currently used by any radar code, these should all be no-ops for existing users. Obtained from: Atheros Submitted by: KBC Networks, sibridge Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athdfs.h Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Aug 8 16:22:42 2011 (r224716) @@ -226,3 +226,13 @@ ath_dfs_get_thresholds(struct ath_softc ath_hal_getdfsthresh(sc->sc_ah, param); return 1; } + +/* + * Update the current radar patterns based on the + * current operating mode/regulatory domain. + */ +int +ath_dfs_init_radar_filters(struct ath_softc *sc) +{ + return 1; +} Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/ath_hal/ah.c Mon Aug 8 16:22:42 2011 (r224716) @@ -522,6 +522,9 @@ ath_hal_getcapability(struct ath_hal *ah case HAL_CAP_REG_DMN: /* regulatory domain */ *result = AH_PRIVATE(ah)->ah_currentRD; return HAL_OK; + case HAL_CAP_DFS_DMN: /* DFS Domain */ + *result = AH_PRIVATE(ah)->ah_dfsDomain; + return HAL_OK; case HAL_CAP_CIPHER: /* cipher handled in hardware */ case HAL_CAP_TKIP_MIC: /* handle TKIP MIC in hardware */ return HAL_ENOTSUPP; Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/ath_hal/ah.h Mon Aug 8 16:22:42 2011 (r224716) @@ -735,6 +735,15 @@ typedef struct { #define HAL_PHYERR_PARAM_NOVAL 65535 #define HAL_PHYERR_PARAM_ENABLE 0x8000 /* Enable/Disable if applicable */ +/* + * DFS operating mode flags. + */ +typedef enum { + HAL_DFS_UNINIT_DOMAIN = 0, /* Uninitialized dfs domain */ + HAL_DFS_FCC_DOMAIN = 1, /* FCC3 dfs domain */ + HAL_DFS_ETSI_DOMAIN = 2, /* ETSI dfs domain */ + HAL_DFS_MKK4_DOMAIN = 3, /* Japan dfs domain */ +} HAL_DFS_DOMAIN; /* * Flag for setting QUIET period Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/ath_hal/ah_internal.h Mon Aug 8 16:22:42 2011 (r224716) @@ -303,6 +303,7 @@ struct ath_hal_private { */ HAL_REG_DOMAIN ah_currentRD; /* EEPROM regulatory domain */ HAL_REG_DOMAIN ah_currentRDext; /* EEPROM extended regdomain flags */ + HAL_DFS_DOMAIN ah_dfsDomain; /* current DFS domain */ HAL_CHANNEL_INTERNAL ah_channels[AH_MAXCHAN]; /* private chan state */ u_int ah_nchan; /* valid items in ah_channels */ const struct regDomain *ah_rd2GHz; /* reg state for 2G band */ Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 16:22:42 2011 (r224716) @@ -687,8 +687,9 @@ ath_hal_init_channels(struct ath_hal *ah HAL_BOOL enableExtendedChannels) { COUNTRY_CODE_TO_ENUM_RD *country; - REG_DOMAIN *rd5GHz, *rd2GHz; + REG_DOMAIN *rd5GHz = AH_NULL, *rd2GHz; HAL_STATUS status; + HAL_DFS_DOMAIN dfsDomain = HAL_DFS_UNINIT_DOMAIN; status = getchannels(ah, chans, maxchans, nchans, modeSelect, cc, regDmn, enableExtendedChannels, &country, &rd2GHz, &rd5GHz); @@ -702,6 +703,18 @@ ath_hal_init_channels(struct ath_hal *ah __func__, ah->ah_countryCode); } else status = HAL_EINVAL; + + /* Update the DFS setting for the current regulatory domain */ + if (status == HAL_OK && rd5GHz != AH_NULL) { + if (rd5GHz->dfsMask & DFS_FCC3) + dfsDomain = HAL_DFS_FCC_DOMAIN; + if (rd5GHz->dfsMask & DFS_ETSI) + dfsDomain = HAL_DFS_ETSI_DOMAIN; + if (rd5GHz->dfsMask & DFS_MKK4) + dfsDomain = HAL_DFS_MKK4_DOMAIN; + } + AH_PRIVATE(ah)->ah_dfsDomain = dfsDomain; + return status; } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/if_ath.c Mon Aug 8 16:22:42 2011 (r224716) @@ -5031,6 +5031,13 @@ ath_setregdomain(struct ieee80211com *ic __func__, status); return EINVAL; /* XXX */ } + + /* + * Setting country code might change the DFS domain + * so initialize the DFS Radar filters + */ + ath_dfs_init_radar_filters(sc); + return 0; } Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Mon Aug 8 15:42:37 2011 (r224715) +++ head/sys/dev/ath/if_athdfs.h Mon Aug 8 16:22:42 2011 (r224716) @@ -42,6 +42,8 @@ extern int ath_dfs_process_radar_event(s extern int ath_dfs_tasklet_needed(struct ath_softc *sc, struct ieee80211_channel *chan); extern int ath_ioctl_phyerr(struct ath_softc *sc, struct ath_diag *ad); -extern int ath_dfs_get_thresholds(struct ath_softc *sc, HAL_PHYERR_PARAM *param); +extern int ath_dfs_get_thresholds(struct ath_softc *sc, + HAL_PHYERR_PARAM *param); +extern int ath_dfs_init_radar_filters(struct ath_softc *sc); #endif /* __IF_ATHDFS_H__ */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 16:29:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980591065672; Mon, 8 Aug 2011 16:29:07 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E5328FC1F; Mon, 8 Aug 2011 16:29: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 p78GT7Ne055342; Mon, 8 Aug 2011 16:29:07 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78GT7dF055340; Mon, 8 Aug 2011 16:29:07 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201108081629.p78GT7dF055340@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 8 Aug 2011 16:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224717 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 16:29:07 -0000 Author: bschmidt Date: Mon Aug 8 16:29:07 2011 New Revision: 224717 URL: http://svn.freebsd.org/changeset/base/224717 Log: When setting a fixed channel on adapters with 11n support the scan channel list ends up with 2 entries, the HT and the legacy channel. The scan itself is currently always done at legacy rates so we end up receiving scan results for legacy networks on the HT channel and erroneously assigning the BSS to the 11n channel. As the channel's capabilities are used to setup the adapter we might end up with non-working settings and/or firmware crashes. Fix this by ensuring that scan results received on a HT channel are only assigned to that channel if the htcap IE is available, else use the legacy channel equivalent. Tested by: Pawel Worach, Raoul Megelas, Maciej Milewski, Andrei Approved by: re (kib) Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Mon Aug 8 16:22:42 2011 (r224716) +++ head/sys/net80211/ieee80211_scan_sta.c Mon Aug 8 16:29:07 2011 (r224717) @@ -238,6 +238,7 @@ sta_add(struct ieee80211_scan_state *ss, const uint8_t *macaddr = wh->i_addr2; struct ieee80211vap *vap = ss->ss_vap; struct ieee80211com *ic = vap->iv_ic; + struct ieee80211_channel *c; struct sta_entry *se; struct ieee80211_scan_entry *ise; int hash; @@ -300,7 +301,6 @@ found: * association on the wrong channel. */ if (sp->status & IEEE80211_BPARSE_OFFCHAN) { - struct ieee80211_channel *c; /* * Off-channel, locate the home/bss channel for the sta * using the value broadcast in the DSPARMS ie. We know @@ -317,6 +317,14 @@ found: } } else ise->se_chan = ic->ic_curchan; + if (IEEE80211_IS_CHAN_HT(ise->se_chan) && sp->htcap == NULL) { + /* Demote legacy networks to a non-HT channel. */ + c = ieee80211_find_channel(ic, ise->se_chan->ic_freq, + ise->se_chan->ic_flags & ~IEEE80211_CHAN_HT); + KASSERT(c != NULL, + ("no legacy channel %u", ise->se_chan->ic_ieee)); + ise->se_chan = c; + } ise->se_fhdwell = sp->fhdwell; ise->se_fhindex = sp->fhindex; ise->se_erp = sp->erp; From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 17:33:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55E50106566C; Mon, 8 Aug 2011 17:33:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 457CA8FC12; Mon, 8 Aug 2011 17:33: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 p78HXaJv057250; Mon, 8 Aug 2011 17:33:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78HXa2p057248; Mon, 8 Aug 2011 17:33:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081733.p78HXa2p057248@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 17:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224718 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 17:33:36 -0000 Author: adrian Date: Mon Aug 8 17:33:35 2011 New Revision: 224718 URL: http://svn.freebsd.org/changeset/base/224718 Log: The older HAL code sets up the regulatory domain once; FreeBSD/net80211 allows it to be overridden at runtime. Thus, add a function which updates ah_dfsDomain after a channel set call to ath_hal_set_channels(). Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 16:29:07 2011 (r224717) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 17:33:35 2011 (r224718) @@ -125,6 +125,8 @@ static const struct cmode modes[] = { IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D }, }; +static void ath_hal_update_dfsdomain(struct ath_hal *ah); + static OS_INLINE uint16_t getEepromRD(struct ath_hal *ah) { @@ -687,9 +689,8 @@ ath_hal_init_channels(struct ath_hal *ah HAL_BOOL enableExtendedChannels) { COUNTRY_CODE_TO_ENUM_RD *country; - REG_DOMAIN *rd5GHz = AH_NULL, *rd2GHz; + REG_DOMAIN *rd5GHz, *rd2GHz; HAL_STATUS status; - HAL_DFS_DOMAIN dfsDomain = HAL_DFS_UNINIT_DOMAIN; status = getchannels(ah, chans, maxchans, nchans, modeSelect, cc, regDmn, enableExtendedChannels, &country, &rd2GHz, &rd5GHz); @@ -701,20 +702,12 @@ ath_hal_init_channels(struct ath_hal *ah ah->ah_countryCode = country->countryCode; HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: cc %u\n", __func__, ah->ah_countryCode); + + /* Update current DFS domain */ + ath_hal_update_dfsdomain(ah); } else status = HAL_EINVAL; - /* Update the DFS setting for the current regulatory domain */ - if (status == HAL_OK && rd5GHz != AH_NULL) { - if (rd5GHz->dfsMask & DFS_FCC3) - dfsDomain = HAL_DFS_FCC_DOMAIN; - if (rd5GHz->dfsMask & DFS_ETSI) - dfsDomain = HAL_DFS_ETSI_DOMAIN; - if (rd5GHz->dfsMask & DFS_MKK4) - dfsDomain = HAL_DFS_MKK4_DOMAIN; - } - AH_PRIVATE(ah)->ah_dfsDomain = dfsDomain; - return status; } @@ -759,6 +752,11 @@ ath_hal_set_channels(struct ath_hal *ah, __func__, ah->ah_countryCode); } else status = HAL_EINVAL; + + if (status == HAL_OK) { + /* Update current DFS domain */ + (void) ath_hal_update_dfsdomain(ah); + } return status; } @@ -824,6 +822,37 @@ ath_hal_getctl(struct ath_hal *ah, const return ctl; } + +/* + * Update the current dfsDomain setting based on the given + * country code. + * + * Since FreeBSD/net80211 allows the channel set to change + * after the card has been setup (via ath_hal_init_channels()) + * this function method is needed to update ah_dfsDomain. + */ +void +ath_hal_update_dfsdomain(struct ath_hal *ah) +{ + const REG_DOMAIN *rd5GHz = AH_PRIVATE(ah)->ah_rd5GHz; + HAL_CTRY_CODE cc = ah->ah_countryCode; + HAL_DFS_DOMAIN dfsDomain = HAL_DFS_UNINIT_DOMAIN; + HAL_REG_DOMAIN regDmn = AH_PRIVATE(ah)->ah_currentRD; + + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s CC: %d, RegDmn: %d\n",__func__, + cc, regDmn); + if (rd5GHz->dfsMask & DFS_FCC3) + dfsDomain = HAL_DFS_FCC_DOMAIN; + if (rd5GHz->dfsMask & DFS_ETSI) + dfsDomain = HAL_DFS_ETSI_DOMAIN; + if (rd5GHz->dfsMask & DFS_MKK4) + dfsDomain = HAL_DFS_MKK4_DOMAIN; + AH_PRIVATE(ah)->ah_dfsDomain = dfsDomain; + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s ah_dfsDomain: %d\n", + __func__, AH_PRIVATE(ah)->ah_dfsDomain); +} + + /* * Return the max allowed antenna gain and apply any regulatory * domain specific changes. From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 18:05:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEB0A106564A; Mon, 8 Aug 2011 18:05:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEC498FC1A; Mon, 8 Aug 2011 18:05:22 +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 p78I5MRw058189; Mon, 8 Aug 2011 18:05:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78I5MY8058187; Mon, 8 Aug 2011 18:05:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081805.p78I5MY8058187@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 18:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224719 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 18:05:23 -0000 Author: adrian Date: Mon Aug 8 18:05:22 2011 New Revision: 224719 URL: http://svn.freebsd.org/changeset/base/224719 Log: Bitten again by the optional HALDEBUG compilation. Remove this debugging, it's not needed anymore and when not enabled, those variables trigger a compiler warning. Approved by: re (kib, blanket) Pointy-hat-to: adrian, for not testing a non-debug compile of this code enough Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 17:33:35 2011 (r224718) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Mon Aug 8 18:05:22 2011 (r224719) @@ -835,12 +835,8 @@ void ath_hal_update_dfsdomain(struct ath_hal *ah) { const REG_DOMAIN *rd5GHz = AH_PRIVATE(ah)->ah_rd5GHz; - HAL_CTRY_CODE cc = ah->ah_countryCode; HAL_DFS_DOMAIN dfsDomain = HAL_DFS_UNINIT_DOMAIN; - HAL_REG_DOMAIN regDmn = AH_PRIVATE(ah)->ah_currentRD; - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s CC: %d, RegDmn: %d\n",__func__, - cc, regDmn); if (rd5GHz->dfsMask & DFS_FCC3) dfsDomain = HAL_DFS_FCC_DOMAIN; if (rd5GHz->dfsMask & DFS_ETSI) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 19:03:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14AD1106564A; Mon, 8 Aug 2011 19:03:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFBD98FC19; Mon, 8 Aug 2011 19:03: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 p78J3QWB059997; Mon, 8 Aug 2011 19:03:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78J3QKb059995; Mon, 8 Aug 2011 19:03:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108081903.p78J3QKb059995@svn.freebsd.org> From: Adrian Chadd Date: Mon, 8 Aug 2011 19:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224720 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 19:03:27 -0000 Author: adrian Date: Mon Aug 8 19:03:26 2011 New Revision: 224720 URL: http://svn.freebsd.org/changeset/base/224720 Log: And add another missing brace. Another pointy hat moment. This one however isn't used by any public code yet, so it didn't break the build. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Aug 8 18:05:22 2011 (r224719) +++ head/sys/dev/ath/if_athvar.h Mon Aug 8 19:03:26 2011 (r224720) @@ -713,7 +713,7 @@ void ath_intr(void *); #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event))) #define ath_hal_is_fast_clock_enabled(_ah) \ - ((*(_ah)->ah_isFastClockEnabled)((_ah)) + ((*(_ah)->ah_isFastClockEnabled)((_ah))) #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 20:36:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B673106564A; Mon, 8 Aug 2011 20:36:53 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0EF8FC13; Mon, 8 Aug 2011 20:36:53 +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 p78KarnO062812; Mon, 8 Aug 2011 20:36:53 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78KarlR062810; Mon, 8 Aug 2011 20:36:53 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108082036.p78KarlR062810@svn.freebsd.org> From: Jonathan Anderson Date: Mon, 8 Aug 2011 20:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 20:36:53 -0000 Author: jonathan Date: Mon Aug 8 20:36:52 2011 New Revision: 224721 URL: http://svn.freebsd.org/changeset/base/224721 Log: Create timeval2timespec() and timespec2timeval(). These functions will be used by process descriptors to convert process creation time into process descriptor [acm]time. Approved by: re (kib), mentor (rwatson) Suggested by: jhb Sponsored by: Google Inc Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Mon Aug 8 19:03:26 2011 (r224720) +++ head/sys/sys/time.h Mon Aug 8 20:36:52 2011 (r224721) @@ -195,6 +195,24 @@ timeval2bintime(const struct timeval *tv ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) +/* Conversion between timespec and timeval. */ + +static __inline void +timeval2timespec(const struct timeval *tv, struct timespec *ts) +{ + + ts->tv_sec = tv->tv_sec; + ts->tv_nsec = 1000 * tv->tv_usec; +} + +static __inline void +timespec2timeval(const struct timespec *ts, struct timeval *tv) +{ + + tv->tv_sec = ts->tv_sec; + tv->tv_usec = ts->tv_nsec / 1000; +} + /* timevaladd and timevalsub are not inlined */ #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Mon Aug 8 20:53:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F8B106568D; Mon, 8 Aug 2011 20:53:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB0118FC0C; Mon, 8 Aug 2011 20:53:04 +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 p78Kr4No063299; Mon, 8 Aug 2011 20:53:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p78Kr4Ro063297; Mon, 8 Aug 2011 20:53:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201108082053.p78Kr4Ro063297@svn.freebsd.org> From: Dimitry Andric Date: Mon, 8 Aug 2011 20:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224722 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2011 20:53:05 -0000 Author: dim Date: Mon Aug 8 20:53:04 2011 New Revision: 224722 URL: http://svn.freebsd.org/changeset/base/224722 Log: Fix buffer overflow in sys/boot/common/util.c's printf(), when printing large (>= 10^10) numbers. In theory, 20 characaters should be enough, but bump the buffer to 32 characters, so we have some room for the future. Reviewed by: pjd Approved by: re (kib) Modified: head/sys/boot/common/util.c Modified: head/sys/boot/common/util.c ============================================================================== --- head/sys/boot/common/util.c Mon Aug 8 20:36:52 2011 (r224721) +++ head/sys/boot/common/util.c Mon Aug 8 20:53:04 2011 (r224722) @@ -119,7 +119,7 @@ printf(const char *fmt, ...) { va_list ap; const char *hex = "0123456789abcdef"; - char buf[10], *s; + char buf[32], *s; unsigned long long u; int c, l; From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 02:16:15 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8FFD106566C; Tue, 9 Aug 2011 02:16:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4F08FC08; Tue, 9 Aug 2011 02:16:14 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p792GBhv028832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Aug 2011 12:16:12 +1000 Date: Tue, 9 Aug 2011 12:16:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jonathan Anderson In-Reply-To: <201108082036.p78KarlR062810@svn.freebsd.org> Message-ID: <20110809105824.P896@besplex.bde.org> References: <201108082036.p78KarlR062810@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 02:16:15 -0000 On Mon, 8 Aug 2011, Jonathan Anderson wrote: > Log: > Create timeval2timespec() and timespec2timeval(). > > These functions will be used by process descriptors to convert process > creation time into process descriptor [acm]time. These were intentionally left out. What is wrong with the existing APIs TIMEVAL_TO_TIMESPEC() and TIMESPEC_TO_TIMEVAL(), which are used for these conversions by almost everything now? Well, quite a bit is wrong with them, starting with the loudness of their names, but not including a twee spelling of "to" in their names. The main bugs in them is that they give undocumented APIs and namespace pollution in userland and undocumented APIs in the kernel. > Approved by: re (kib), mentor (rwatson) > Suggested by: jhb Should know better. > Modified: head/sys/sys/time.h > ============================================================================== > --- head/sys/sys/time.h Mon Aug 8 19:03:26 2011 (r224720) > +++ head/sys/sys/time.h Mon Aug 8 20:36:52 2011 (r224721) > @@ -195,6 +195,24 @@ timeval2bintime(const struct timeval *tv > ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ > ((tvp)->tv_sec cmp (uvp)->tv_sec)) > > +/* Conversion between timespec and timeval. */ > + > +static __inline void > +timeval2timespec(const struct timeval *tv, struct timespec *ts) > +{ > + > + ts->tv_sec = tv->tv_sec; > + ts->tv_nsec = 1000 * tv->tv_usec; > +} > + > +static __inline void > +timespec2timeval(const struct timespec *ts, struct timeval *tv) > +{ > + > + tv->tv_sec = ts->tv_sec; > + tv->tv_usec = ts->tv_nsec / 1000; > +} > + > /* timevaladd and timevalsub are not inlined */ > > #endif /* _KERNEL */ These are in the _KERNEL section, so they don't pollute userland. Otherwise, the pollution would consist of 2 function names, 2 parameter names and possibly 1 struct member names (I think tv_sec and tv_usec are reserved in , but perhaps timespecs and tv_nsec are not, since is mainly for old timeval interfaces. This is another reason why the implementation of timespec conversions belongs in where they already are and not in ). Style bugs in these include: - use of inline functions instead of macros. Macros are used for all the other APIs in this section. Using macros would limit the namespace pollution. E.g., it keeps parameter names out of other namespaces. - not using Hungrarian notation for pointers. Names of pointers are spelled with a trailing p in all other APIs in this section. sys/time.h has mounds of older implementation bugs. The bintime section is especially bad. The following is mostly about buigs in the non-_KERNEL sections. 1) Userland pollution in starts with everything in . 2) Then there is everything in . The only pollution is the undocumented TIMEPSEC conversion macros mentioned above (these are conditional on __BSD_VISIBLE). 4) Then there is struct timezone and its members. 5) Then there is DST_* for using tz_dsttime. 6) Then there is mounds of pollution from struct bintime and its APIs. This is conditional on __BSD_VISIBLE. Most of the bintime APIs are undocumented. (zgrep -r bintime in /usr/share/man gives many hits, while zgrep -r TIMESPEC in /usr/share/man gives zero hits, but most of the hits for bintime are in peripheral man pages and bintime(9); bintime(9) only documents the highest level of bintime APIs, leaving all of the arithmetic and conversion APIs undocumented.) Inlines instead of macros are used to implement most of the bintime APIs. This gives the following undocumented pollution: - bintime struct tag name 'bintime' - bintime struct member names 'sec' and 'frac'. These are especially bad since they are missing a prefix. - all the API names - all the parameter names: bt, x, bt2, ts, tv. Of course, these are also missing Hungrarian notation. - all the local variable names: u. 7) Then there is mounds of documented pollution for the NetBSD/OpenBSD compatibility APIs. These are not under __BSD_VISIBLE, so they are pure pollution. These were obsolete before they were born, since they are only for timevals. The kernel has always had equivalent interfaces, but they were intentionally left out of userland. Then they came back :-(. But they are documented, and they implemented using macros so they are missing the namespace pollution for parameter and local variable names, and their parameter names are spelled in Hungrarian notations, so they are missing most of the bugs described in this mail. FreeBSD still doesn't have the corresponding mistakes for manipulating timespecs. You just have to manipulate timespecs for yourself, like you should have to do for timevals too. I prefer to convert everything to floating point (int64_t has been usable too, ever since C99 standardized it). It is easier to multiply by 1e-6 to convert seconds to microseconds than to remember the nonstandard APIs that manipulate timespecs as timespecs. The timespec manipulation APIs may or may not be faster than floating point calculations, depending on whether the branches in them are faster than non-branchy FP code, but it is hard to think if situations where the efficiency matters. Most uses of the NetBSD APIs are for manipulating timeouts for things like setitimer(2) where the syscall overcall dominates. 8) Then there is the itimer section. This is POSIX, so it is actually permitted in this file! 9) Then there is the clockinfo section. This is pure nonstandard pollution. It is only partially documented (in sysctl(3)). 10) Then there is the POSIX timer section (CLOCK_REALTIME... and TIMER_ABSTIME...). This is POSIX, but is not properly ifdefed for the versions of POSIX that support it. 11) Then there is everything in . The structure of vs is still sort of backwards. This bug became more serious when POSIX started specifying in 2001 (old versions of POSIX didn't have timevals. Then in 2001, POSIX specified all the old timeval APIs that it had intentionally left out in 1988, and is the home for them in POSIX. But POSIX doesn't specifiy all of the other pollution that is traditional or has accrufted in ). 12) Finally, there is a section that declares prototypes of user APIs. This is mostly correct (properly ifdefed). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 02:40:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 109891065672; Tue, 9 Aug 2011 02:40:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 12-207-105-211.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 937B114F0F1; Tue, 9 Aug 2011 02:40:21 +0000 (UTC) Message-ID: <4E409E15.2080708@FreeBSD.org> Date: Mon, 08 Aug 2011 19:40:21 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <5A22B4EF-3B5A-497D-8F7C-8D9EED3F1BE3@FreeBSD.org> In-Reply-To: <5A22B4EF-3B5A-497D-8F7C-8D9EED3F1BE3@FreeBSD.org> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------000400010700050905030004" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 02:40:22 -0000 This is a multi-part message in MIME format. --------------000400010700050905030004 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 08/08/2011 02:42, Bjoern A. Zeeb wrote: > Back in the days, when I introduced NO_NIS (which was the name back > then), I considered both this and something along Ed's initial change > and I am sure some of the discussions can still be found in the > archives (from around 2005/-2y). > > While I could never be bothered enough to do the Ed-kind of change, > it was very clear back then that a change like this was a really bad > idea as it would break setups left and right. Ed's change was perfectly safe since if you're defining WITHOUT_NIS not having the system depend on NIS is a feature. > We want to support the > default compilation base system by default as well. If people prefer > to go non- default (WITHOUT_NIS), it's fine to have them make other > adjustments to alter defaults as well or live with the logging. A) Your argument is a red herring to start with. Out of the box we don't support NIS. At minimum you have to enable rpcbind_ and nis_client_, and set nisdomain. So no matter how you cut it, the system as it shipped by default prior to my change was broken. Ed's change was an incremental improvement. B) The argument that we should ship something broken by default is just plain stupid. The fact that we've been doing it for a long time isn't an excuse. So users who wish to use NIS (of which I am one, btw) already have to configure it. Asking them to configure one more file out of a default install is not a huge burden, and will prevent us shipping the system broken-by-default. However, to make things more clear I'm suggesting the attached, which has the UPDATING entry and a note for etc/defaults/rc.conf so that users who need to configure NIS will know that they need to make this change too. For those who are upgrading an existing installation I have no sympathy for blindly installing new files into /etc. > The solution as is now is even more confusing as both Ed and Doug > have missed to update the man page to clarify the new behaviour. It's not clear to me exactly what needs changing (and I did review the man page several times before making my patch). It describes the default behavior if the file does not exist, but I'm not sure how that's relevant? If you have suggestions for changes I'd be glad to take a look. > I also do not like the longerish version of the file now Seriously? > and the new > description is only talking about nis but ignoring all other > sources, which we do not provide samples for, for the inconvenience > of people wanting to use those. NIS is already a minority of our users. I'm sure anyone who is using anything else that's relevant to nsswitch.conf is already well aware of how to configure it. However, if you have suggestions for improving that comment that's fine. It might make the file longer though. :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------000400010700050905030004 Content-Type: text/plain; name="nis.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="nis.diff" Index: UPDATING =================================================================== --- UPDATING (revision 224688) +++ UPDATING (working copy) @@ -22,6 +22,10 @@ machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110806: + Prior versions of nsswitch.conf explicitly enabled NIS lookup of group, + passwd, and services information. It is now disabled by default. + 20110628: The packet filter (pf) code has been updated to OpenBSD 4.5. You need to update userland tools to be in sync with kernel. Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 224688) +++ etc/defaults/rc.conf (working copy) @@ -363,6 +363,7 @@ # Flags to ntpd (if enabled). # Network Information Services (NIS) options: All need rpcbind_enable="YES" ### +# Adust /etc/nsswitch.conf appropriately as well nis_client_enable="NO" # We're an NIS client (or NO). nis_client_flags="" # Flags to ypbind (if enabled). nis_ypset_enable="NO" # Run ypset at boot time (or NO). --------------000400010700050905030004-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 04:24:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240191065673; Tue, 9 Aug 2011 04:24:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 132E88FC12; Tue, 9 Aug 2011 04:24: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 p794Ouex076685; Tue, 9 Aug 2011 04:24:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p794OufP076683; Tue, 9 Aug 2011 04:24:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108090424.p794OufP076683@svn.freebsd.org> From: Adrian Chadd Date: Tue, 9 Aug 2011 04:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224724 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 04:24:57 -0000 Author: adrian Date: Tue Aug 9 04:24:56 2011 New Revision: 224724 URL: http://svn.freebsd.org/changeset/base/224724 Log: Remove this call, now that I've solved the radar module problem without needing this particular modification. It can be called during ath_dfs_radar_enable() and still achieve the same functionality, so I am. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Aug 8 22:16:07 2011 (r224723) +++ head/sys/dev/ath/if_ath.c Tue Aug 9 04:24:56 2011 (r224724) @@ -5032,12 +5032,6 @@ ath_setregdomain(struct ieee80211com *ic return EINVAL; /* XXX */ } - /* - * Setting country code might change the DFS domain - * so initialize the DFS Radar filters - */ - ath_dfs_init_radar_filters(sc); - return 0; } From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 06:36:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id EB55C106564A; Tue, 9 Aug 2011 06:36:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 12-207-105-211.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 5D3F2152317; Tue, 9 Aug 2011 06:36:44 +0000 (UTC) Message-ID: <4E40D57C.3070705@FreeBSD.org> Date: Mon, 08 Aug 2011 23:36:44 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Peter Wemm References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E3F6216.5080706@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 06:36:45 -0000 On 08/08/2011 23:31, Peter Wemm wrote: > No, if people use mergemaster in this mode: > -U Attempt to auto upgrade files that have not been user modified. > .. then mergemaster will silently turn off NIS for you. > > If it is considered bad practice to use -U, then people should be > directed away from it. I've been telling people that this is a bad idea since day 1. It's also the reason I refuse to make it the default. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 06:41:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0664106564A; Tue, 9 Aug 2011 06:41:21 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2778FC13; Tue, 9 Aug 2011 06:41:21 +0000 (UTC) Received: by vxh11 with SMTP id 11so2660201vxh.13 for ; Mon, 08 Aug 2011 23:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=/fnBFHvW4UpuBT1bPCkc4dpBQUhrUZwdh5DHEsXlToo=; b=iENktaGXFs9+V4lQ1oMOmQWr5De0ApPTbhtdYPGi1RiYemqDuf4KV5DyA8o9q/7ZQn DhLSJuGEu8GRIFLG7UnGjxztnLFg3zY2ltogeF3B4LS2i5c9ITdbcNfiv2DR+RWqh14C Q540I/hHPeQOfQXriCyTzxoJZMAeSGrB6O0aY= MIME-Version: 1.0 Received: by 10.220.9.5 with SMTP id j5mr1790157vcj.203.1312872080532; Mon, 08 Aug 2011 23:41:20 -0700 (PDT) Received: by 10.220.93.75 with HTTP; Mon, 8 Aug 2011 23:41:20 -0700 (PDT) In-Reply-To: <4E40D57C.3070705@FreeBSD.org> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E3F6216.5080706@FreeBSD.org> <4E40D57C.3070705@FreeBSD.org> Date: Mon, 8 Aug 2011 23:41:20 -0700 Message-ID: From: Peter Wemm To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Garrett Cooper , "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 06:41:21 -0000 On Mon, Aug 8, 2011 at 11:36 PM, Doug Barton wrote: > On 08/08/2011 23:31, Peter Wemm wrote: >> No, if people use mergemaster in this mode: >> =A0 =A0 =A0-U =A0 =A0 =A0 =A0 =A0Attempt to auto upgrade files that have= not been user modified. >> .. then mergemaster will silently turn off NIS for you. >> >> If it is considered bad practice to use -U, then people should be >> directed away from it. > > I've been telling people that this is a bad idea since day 1. It's also > the reason I refuse to make it the default. It should say so in the documentation. As it stands now, it gives no hints of the danger and that it should not be used. "Attempt to auto upgrade files that have not been user modied." certainly looks like something that a random person would want. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:00:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6BF51065672; Tue, 9 Aug 2011 07:00:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6103E8FC0C; Tue, 9 Aug 2011 07:00:55 +0000 (UTC) Received: by vxh11 with SMTP id 11so2670627vxh.13 for ; Tue, 09 Aug 2011 00:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=nuGUODPlO/Ji8n53x/C698sk4iyHO+uz0SlJXAcuH+Y=; b=HlvlFhOcwPNhPmYOa1lL822Tx6vmmTHTi5UJK4VPqK9ZJsFvRUP69MJbn13XnUWADG 5Kn8huI0T+NPKAtW0Rz5wHK5ge1QNMBVPoQEsdQQhWeqkkDRR6t1UMZnVd+aPkiBnJar FG+Q41t2AWVP5CkNQgs+RmkdmLcKPP1FmrAaE= MIME-Version: 1.0 Received: by 10.52.74.74 with SMTP id r10mr6608255vdv.374.1312871460141; Mon, 08 Aug 2011 23:31:00 -0700 (PDT) Received: by 10.220.93.75 with HTTP; Mon, 8 Aug 2011 23:31:00 -0700 (PDT) In-Reply-To: <4E3F6216.5080706@FreeBSD.org> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E3F6216.5080706@FreeBSD.org> Date: Mon, 8 Aug 2011 23:31:00 -0700 Message-ID: From: Peter Wemm To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Garrett Cooper , "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:00:55 -0000 On Sun, Aug 7, 2011 at 9:12 PM, Doug Barton wrote: > On 8/7/2011 6:05 PM, Garrett Cooper wrote: >> On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wro= te: >>> >>> On 6 Aug 2011, at 11:16, Doug Barton wrote: >>> >>>> Author: dougb >>>> Date: Sat Aug =A06 09:16:53 2011 >>>> New Revision: 224674 >>>> URL: http://svn.freebsd.org/changeset/base/224674 >>>> >>>> Log: >>>> =A0Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D "= no" >>>> =A0comment out the NIS _compat options by default, but leave them in >>>> =A0the file for the convenience of users who want to enable it. >>>> >>>> =A0Update the comment in the file accordingly. >>> >>> This disables NIS by default which is rather surprising considering the= re has been no prior (which I have been able to find) discussion of this. >>> >>> At the _VERY_ least people need to be warned about this loudly. Unless = you can show this really helps non-NIS users this is IMO a bad idea. >>> >>> Yes, if you hand merge all /etc files this won't be a problem... but I = don't since life's to short for that, so this change just broke login on on= e of the FreeBSD.org during an upgrade. > > mergemaster has been in the tree for almost 12 years now. :) =A0In any > case, I can't think of a situation where blindly copying new files to > /etc is a good idea (with all due respect). No, if people use mergemaster in this mode: -U Attempt to auto upgrade files that have not been user modi= fied. .. then mergemaster will silently turn off NIS for you. If it is considered bad practice to use -U, then people should be directed away from it. I think this is what killed the freebsd.org machine. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:07:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15340106566C; Tue, 9 Aug 2011 07:07:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 79DC98FC08; Tue, 9 Aug 2011 07:07:54 +0000 (UTC) Received: by vxh11 with SMTP id 11so2674800vxh.13 for ; Tue, 09 Aug 2011 00:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Cs/w45qu2X4vkHDFom8l/MhnPSgRbmKAUwP8l8uCAck=; b=TGxG9Re0ZIpndZOHdcEGxvNQiUe0CYGkcPY/tlBvRcpNaHAvMiBeSoYfnw0o4FH5Q8 xVRnrLcRvZ5+NelZOCShS2PU6eFKvJGC/CpldhXwJ50j6W15+VkHN10QnL3R9lIvgBfZ lmN9bo5FM3MsN3id0gf4yUZ3LIzv0IhB57d+w= MIME-Version: 1.0 Received: by 10.220.199.69 with SMTP id er5mr1787880vcb.238.1312873672793; Tue, 09 Aug 2011 00:07:52 -0700 (PDT) Received: by 10.220.93.75 with HTTP; Tue, 9 Aug 2011 00:07:52 -0700 (PDT) In-Reply-To: <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> Date: Tue, 9 Aug 2011 00:07:52 -0700 Message-ID: From: Peter Wemm To: "Simon L. B. Nielsen" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, re@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:07:55 -0000 On Sun, Aug 7, 2011 at 1:51 PM, Simon L. B. Nielsen wrote: > > On 6 Aug 2011, at 11:16, Doug Barton wrote: > >> Author: dougb >> Date: Sat Aug =A06 09:16:53 2011 >> New Revision: 224674 >> URL: http://svn.freebsd.org/changeset/base/224674 >> >> Log: >> =A0Rather than edit the nsswitch.conf file based on ${MK_NIS} =3D=3D "no= " >> =A0comment out the NIS _compat options by default, but leave them in >> =A0the file for the convenience of users who want to enable it. >> >> =A0Update the comment in the file accordingly. > > This disables NIS by default which is rather surprising considering there= has been no prior (which I have been able to find) discussion of this. > > At the _VERY_ least people need to be warned about this loudly. Unless yo= u can show this really helps non-NIS users this is IMO a bad idea. As much as I'd like to see NIS die a painful death, the answer to the question of helping non-NIS users is "not much" as things stand. The nis, files and dns components are statically compiled into libc. There is no expensive dlopen("/usr/lib/nss_nis.so") to optimize out, unlike some other systems. The runtime overheads are negligible. The compiled-in routines check if nis activated with one syscall and immediately return NS_UNAVAIL if nis is not configured. As much as I hate NIS, I suspect this will break every single user of NIS who happens to also use mergemaster -U. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:26:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 77C1D1065687; Tue, 9 Aug 2011 07:26:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 12-207-105-211.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 674AF155A11; Tue, 9 Aug 2011 07:26:00 +0000 (UTC) Message-ID: <4E40E108.700@FreeBSD.org> Date: Tue, 09 Aug 2011 00:26:00 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Peter Wemm References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E3F6216.5080706@FreeBSD.org> <4E40D57C.3070705@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:26:02 -0000 On 08/08/2011 23:41, Peter Wemm wrote: > On Mon, Aug 8, 2011 at 11:36 PM, Doug Barton wrote: >> On 08/08/2011 23:31, Peter Wemm wrote: >>> No, if people use mergemaster in this mode: >>> -U Attempt to auto upgrade files that have not been user modified. >>> .. then mergemaster will silently turn off NIS for you. >>> >>> If it is considered bad practice to use -U, then people should be >>> directed away from it. >> >> I've been telling people that this is a bad idea since day 1. It's also >> the reason I refuse to make it the default. > > It should say so in the documentation. Patch sent to re@. Thanks. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:30:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C8623106566B; Tue, 9 Aug 2011 07:30:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 12-207-105-211.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 642371572A9; Tue, 9 Aug 2011 07:30:23 +0000 (UTC) Message-ID: <4E40E20E.5050804@FreeBSD.org> Date: Tue, 09 Aug 2011 00:30:22 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Peter Wemm References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> In-Reply-To: X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, re@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:30:32 -0000 On 08/09/2011 00:07, Peter Wemm wrote: > As much as I'd like to see NIS die a painful death, the answer to the > question of helping non-NIS users is "not much" as things stand. > > The nis, files and dns components are statically compiled into libc. > There is no expensive dlopen("/usr/lib/nss_nis.so") to optimize out, > unlike some other systems. > > The runtime overheads are negligible. The compiled-in routines check > if nis activated with one syscall and immediately return NS_UNAVAIL if > nis is not configured. None of this is relevant. The problem is that when you install the system, by default it generates errors for every access to /etc/passwd, /etc/group, or /etc/services. This is a silly way to ship a system. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:35:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B82B106564A; Tue, 9 Aug 2011 07:35:57 +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 3088C8FC19; Tue, 9 Aug 2011 07:35: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 p797ZvjL082242; Tue, 9 Aug 2011 07:35:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p797ZvVk082239; Tue, 9 Aug 2011 07:35:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108090735.p797ZvVk082239@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Aug 2011 07:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224725 - in stable/8/sys/dev: ahci ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:35:57 -0000 Author: mav Date: Tue Aug 9 07:35:56 2011 New Revision: 224725 URL: http://svn.freebsd.org/changeset/base/224725 Log: MFC r224603: Do not force AHCI mode on NVIDIA MCP89 SATA controllers. Recent Apple Mac with this chipset does not initialize AHCI mode unless it is started from EFI loader. However, legacy ATA mode works. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/chipsets/ata-nvidia.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 Tue Aug 9 04:24:56 2011 (r224724) +++ stable/8/sys/dev/ahci/ahci.c Tue Aug 9 07:35:56 2011 (r224725) @@ -264,7 +264,7 @@ static struct { {0x0abe10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0abf10de, 0x00, "NVIDIA MCP79", AHCI_Q_NOAA}, {0x0d8410de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, - {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, + {0x0d8510de, 0x00, "NVIDIA MCP89", AHCI_Q_NOFORCE|AHCI_Q_NOAA}, {0x0d8610de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8710de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, {0x0d8810de, 0x00, "NVIDIA MCP89", AHCI_Q_NOAA}, Modified: stable/8/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-nvidia.c Tue Aug 9 04:24:56 2011 (r224724) +++ stable/8/sys/dev/ata/chipsets/ata-nvidia.c Tue Aug 9 07:35:56 2011 (r224725) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_nvidia_chipinit(device_t dev); static int ata_nvidia_ch_attach(device_t dev); +static int ata_nvidia_ch_attach_dumb(device_t dev); static int ata_nvidia_status(device_t dev); static void ata_nvidia_reset(device_t dev); static int ata_nvidia_setmode(device_t dev, int target, int mode); @@ -62,6 +63,7 @@ static int ata_nvidia_setmode(device_t d #define NV4 0x01 #define NVQ 0x02 #define NVAHCI 0x04 +#define NVNOFORCE 0x08 /* @@ -158,7 +160,7 @@ ata_nvidia_probe(device_t dev) { ATA_NFORCE_MCP79_AA, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP79_AB, 0, NVAHCI, 0, ATA_SA300, "nForce MCP79" }, { ATA_NFORCE_MCP89_A0, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, - { ATA_NFORCE_MCP89_A1, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, + { ATA_NFORCE_MCP89_A1, 0, NVAHCI|NVNOFORCE, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A2, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A3, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, { ATA_NFORCE_MCP89_A4, 0, NVAHCI, 0, ATA_SA300, "nForce MCP89" }, @@ -178,7 +180,9 @@ ata_nvidia_probe(device_t dev) return ENXIO; ata_set_desc(dev); - if (ctlr->chip->cfg1 & NVAHCI) + if ((ctlr->chip->cfg1 & NVAHCI) && + ((ctlr->chip->cfg1 & NVNOFORCE) == 0 || + pci_get_subclass(dev) != PCIS_STORAGE_IDE)) ctlr->chipinit = ata_ahci_chipinit; else ctlr->chipinit = ata_nvidia_chipinit; @@ -193,7 +197,10 @@ ata_nvidia_chipinit(device_t dev) if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - if (ctlr->chip->max_dma >= ATA_SA150) { + if (ctlr->chip->cfg1 & NVAHCI) { + ctlr->ch_attach = ata_nvidia_ch_attach_dumb; + ctlr->setmode = ata_sata_setmode; + } else if (ctlr->chip->max_dma >= ATA_SA150) { if (pci_read_config(dev, PCIR_BAR(5), 1) & 1) ctlr->r_type2 = SYS_RES_IOPORT; else @@ -264,6 +271,17 @@ ata_nvidia_ch_attach(device_t dev) return 0; } +static int +ata_nvidia_ch_attach_dumb(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + if (ata_pci_ch_attach(dev)) + return ENXIO; + ch->flags |= ATA_SATA; + return 0; +} + static int ata_nvidia_status(device_t dev) { From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 07:42:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F8C106568A; Tue, 9 Aug 2011 07:42:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714D18FC08; Tue, 9 Aug 2011 07:42:19 +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 p797gJYK082510; Tue, 9 Aug 2011 07:42:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p797gJ7i082507; Tue, 9 Aug 2011 07:42:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108090742.p797gJ7i082507@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 07:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224726 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 07:42:19 -0000 Author: dougb Date: Tue Aug 9 07:42:19 2011 New Revision: 224726 URL: http://svn.freebsd.org/changeset/base/224726 Log: Make clear that the -U option can be dangerous. [1] In -p mode install the group file with the same permissions as normally done in etc/Makefile. Update the copyright. Requested by: peter [1] Approved by: re (kib) Modified: head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Tue Aug 9 07:35:56 2011 (r224725) +++ head/usr.sbin/mergemaster/mergemaster.8 Tue Aug 9 07:42:19 2011 (r224726) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2010 Douglas Barton +.\" Copyright (c) 1998-2011 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2010 +.Dd August 9, 2011 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -244,6 +244,8 @@ or another directory you specify in your rc file. .It Fl U Attempt to auto upgrade files that have not been user modified. +This option can be dangerous when there are critical changes +in the new versions that affect your running system. .It Fl m Ar /path/to/sources Specify the path to the directory where you want to do the .Xr make 1 . @@ -360,6 +362,7 @@ with all values commented out: #AUTO_INSTALL= # # Automatically upgrade files that have not been user modified (-U) +# ***DANGEROUS*** #AUTO_UPGRADE= # # Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) @@ -461,7 +464,7 @@ temporary root environment comes from Ni make world tutorial which is referenced above. .Sh AUTHORS This manual page and the script itself were written by -.An Douglas Barton Aq DougB@FreeBSD.org . +.An Douglas Barton Aq dougb@FreeBSD.org . .Sh BUGS There are no known bugs. Please report any problems, Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Tue Aug 9 07:35:56 2011 (r224725) +++ head/usr.sbin/mergemaster/mergemaster.sh Tue Aug 9 07:42:19 2011 (r224726) @@ -5,8 +5,8 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2010 Douglas Barton -# DougB@FreeBSD.org +# Copyright 1998-2011 Douglas Barton +# dougb@FreeBSD.org # $FreeBSD$ @@ -30,6 +30,7 @@ display_usage () { echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' echo " -U Attempt to auto upgrade files that have not been user modified" + echo ' ***DANGEROUS***' echo '' echo " -m /path/directory Specify location of source to do the make in" echo " -t /path/directory Specify temp root directory" @@ -635,7 +636,7 @@ case "${RERUN}" in # Only set up files that are crucial to {build|install}world { mkdir -p ${TEMPROOT}/etc && cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && - cp -p ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || + install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 08:09:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657EA1065673; Tue, 9 Aug 2011 08:09:32 +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 539088FC0A; Tue, 9 Aug 2011 08:09:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7989WpN083347; Tue, 9 Aug 2011 08:09:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7989WtV083345; Tue, 9 Aug 2011 08:09:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108090809.p7989WtV083345@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 9 Aug 2011 08:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224727 - stable/8/sys/i386/ibcs2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 08:09:32 -0000 Author: kib Date: Tue Aug 9 08:09:32 2011 New Revision: 224727 URL: http://svn.freebsd.org/changeset/base/224727 Log: MFC r224613: Corrections for the iBCS2 support. Modified: stable/8/sys/i386/ibcs2/imgact_coff.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/i386/ibcs2/imgact_coff.c ============================================================================== --- stable/8/sys/i386/ibcs2/imgact_coff.c Tue Aug 9 07:42:19 2011 (r224726) +++ stable/8/sys/i386/ibcs2/imgact_coff.c Tue Aug 9 08:09:32 2011 (r224727) @@ -91,9 +91,10 @@ load_coff_section(struct vmspace *vmspac map_len = round_page(offset + filsz) - trunc_page(map_offset); } - DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08lx, 0x%x, 0x%x, " + DPRINTF(("%s(%d): vm_mmap(&vmspace->vm_map, &0x%08jx, 0x%x, 0x%x, " "VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, vp, 0x%x)\n", - __FILE__, __LINE__, map_addr, map_len, prot, map_offset)); + __FILE__, __LINE__, (uintmax_t)map_addr, map_len, prot, + map_offset)); if ((error = vm_mmap(&vmspace->vm_map, &map_addr, @@ -123,16 +124,16 @@ load_coff_section(struct vmspace *vmspac map_addr = trunc_page((vm_offset_t)vmaddr + filsz); map_len = round_page((vm_offset_t)vmaddr + memsz) - map_addr; - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx,0x%x, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, map_addr, map_len)); + DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08jx,0x%x, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", __FILE__, __LINE__, (uintmax_t)map_addr, map_len)); if (map_len != 0) { error = vm_map_find(&vmspace->vm_map, NULL, 0, &map_addr, - map_len, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0); + map_len, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); if (error) - return error; + return (vm_mmap_to_errno(error)); } - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &data_buf, PAGE_SIZE, VM_PROT_READ, @@ -145,7 +146,7 @@ load_coff_section(struct vmspace *vmspac error = copyout(data_buf, (caddr_t) map_addr, copy_len); - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) data_buf, (vm_offset_t) data_buf + PAGE_SIZE)) panic("load_coff_section vm_map_remove failed"); @@ -213,7 +214,7 @@ coff_load_file(struct thread *td, char * */ VOP_UNLOCK(vp, 0); - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &ptr, PAGE_SIZE, VM_PROT_READ, @@ -279,7 +280,7 @@ coff_load_file(struct thread *td, char * error = 0; dealloc_and_fail: - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) ptr, (vm_offset_t) ptr + PAGE_SIZE)) panic("%s vm_map_remove failed", __func__); @@ -306,7 +307,7 @@ exec_coff_imgact(imgp) unsigned long text_offset = 0, text_address = 0, text_size = 0; unsigned long data_offset = 0, data_address = 0, data_size = 0; unsigned long bss_size = 0; - caddr_t hole; + vm_offset_t hole; if (fhdr->f_magic != I386_COFF || !(fhdr->f_flags & F_EXEC)) { @@ -343,9 +344,9 @@ exec_coff_imgact(imgp) for (i = 0; i < nscns; i++) { - DPRINTF(("i = %d, scns[i].s_name = %s, scns[i].s_vaddr = %08lx, " - "scns[i].s_scnptr = %d\n", i, scns[i].s_name, - scns[i].s_vaddr, scns[i].s_scnptr)); + DPRINTF(("i = %d, s_name = %s, s_vaddr = %08lx, " + "s_scnptr = %ld s_size = %lx\n", i, scns[i].s_name, + scns[i].s_vaddr, scns[i].s_scnptr, scns[i].s_size)); if (scns[i].s_flags & STYP_NOLOAD) { /* * A section that is not loaded, for whatever @@ -372,12 +373,12 @@ exec_coff_imgact(imgp) int len = round_page(scns[i].s_size + PAGE_SIZE); int j; - if ((error = vm_mmap(kernel_map, + if ((error = vm_mmap(exec_map, (vm_offset_t *) &buf, len, VM_PROT_READ, VM_PROT_READ, - 0, + MAP_SHARED, OBJT_VNODE, imgp->vp, foff)) != 0) { @@ -411,12 +412,16 @@ exec_coff_imgact(imgp) error = coff_load_file( FIRST_THREAD_IN_PROC(imgp->proc), libname); - if (error) + if (error) { + printf( + "error %d loading coff shared library %s\n", + error, libname); break; + } } free(libbuf, M_TEMP); } - if (vm_map_remove(kernel_map, + if (vm_map_remove(exec_map, (vm_offset_t) buf, (vm_offset_t) buf + len)) panic("exec_coff_imgact vm_map_remove failed"); @@ -429,7 +434,7 @@ exec_coff_imgact(imgp) */ DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, %08lx, %08lx, 0x%x, 0x%x, 0x%x)\n", + "imgp->vp, %08lx, %08lx, 0x%lx, 0x%lx, 0x%x)\n", __FILE__, __LINE__, text_offset, text_address, text_size, text_size, VM_PROT_READ | VM_PROT_EXECUTE)); if ((error = load_coff_section(vmspace, imgp->vp, @@ -446,7 +451,7 @@ exec_coff_imgact(imgp) DPRINTF(("%s(%d): load_coff_section(vmspace, " - "imgp->vp, 0x%08lx, 0x%08lx, 0x%x, 0x%x, 0x%x)\n", + "imgp->vp, 0x%08lx, 0x%08lx, 0x%lx, 0x%lx, 0x%x)\n", __FILE__, __LINE__, data_offset, data_address, data_size + bss_size, data_size, VM_PROT_ALL)); if ((error = load_coff_section(vmspace, imgp->vp, @@ -467,26 +472,25 @@ exec_coff_imgact(imgp) vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)text_address; vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t)data_address; - hole = (caddr_t)trunc_page((vm_offset_t)vmspace->vm_daddr) + ctob(vmspace->vm_dsize); - + hole = trunc_page((vm_offset_t)vmspace->vm_daddr + + ctob(vmspace->vm_dsize)); - DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%08lx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", - __FILE__, __LINE__, hole)); + DPRINTF(("%s(%d): vm_map_find(&vmspace->vm_map, NULL, 0, &0x%jx, PAGE_SIZE, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0)\n", + __FILE__, __LINE__, (uintmax_t)hole)); DPRINTF(("imgact: error = %d\n", error)); - error = vm_map_find(&vmspace->vm_map, NULL, 0, - (vm_offset_t *) &hole, PAGE_SIZE, FALSE, - VM_PROT_ALL, VM_PROT_ALL, 0); - - DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%x end = 0x%x\n", + vm_map_find(&vmspace->vm_map, NULL, 0, + (vm_offset_t *)&hole, PAGE_SIZE, VMFS_NO_SPACE, + VM_PROT_ALL, VM_PROT_ALL, 0); + DPRINTF(("IBCS2: start vm_dsize = 0x%x, vm_daddr = 0x%p end = 0x%p\n", ctob(vmspace->vm_dsize), vmspace->vm_daddr, ctob(vmspace->vm_dsize) + vmspace->vm_daddr )); - DPRINTF(("%s(%d): returning successfully!\n", __FILE__, __LINE__)); + DPRINTF(("%s(%d): returning %d!\n", __FILE__, __LINE__, error)); fail: vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - return error; + return (error); } /* From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 08:11:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 546D3106564A; Tue, 9 Aug 2011 08:11:27 +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 442808FC1E; Tue, 9 Aug 2011 08:11:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p798BRhv083515; Tue, 9 Aug 2011 08:11:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p798BRgS083513; Tue, 9 Aug 2011 08:11:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201108090811.p798BRgS083513@svn.freebsd.org> From: Alexander Motin Date: Tue, 9 Aug 2011 08:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224728 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 08:11:27 -0000 Author: mav Date: Tue Aug 9 08:11:26 2011 New Revision: 224728 URL: http://svn.freebsd.org/changeset/base/224728 Log: Do not block zero report ID. It is correct value for devices with single ID. This fixes USB_SET_IMMED call (synchronous operation) of the uhid(4) driver on devices with single report ID. Reviewed by: hselasky Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Tue Aug 9 08:09:32 2011 (r224727) +++ head/sys/dev/usb/usb_request.c Tue Aug 9 08:11:26 2011 (r224728) @@ -1769,7 +1769,7 @@ usbd_req_get_report(struct usb_device *u struct usb_interface *iface = usbd_get_iface(udev, iface_index); struct usb_device_request req; - if ((iface == NULL) || (iface->idesc == NULL) || (id == 0)) { + if ((iface == NULL) || (iface->idesc == NULL)) { return (USB_ERR_INVAL); } DPRINTFN(5, "len=%d\n", len); From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 12:23:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94279106564A; Tue, 9 Aug 2011 12:23:27 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 821898FC0A; Tue, 9 Aug 2011 12:23:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79CNRnA094574; Tue, 9 Aug 2011 12:23:27 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79CNRTU094563; Tue, 9 Aug 2011 12:23:27 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108091223.p79CNRTU094563@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Aug 2011 12:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224729 - vendor/one-true-awk/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 12:23:29 -0000 Author: ru Date: Tue Aug 9 12:23:27 2011 New Revision: 224729 URL: http://svn.freebsd.org/changeset/base/224729 Log: Vendor import of bwk's 7-Aug-2011 release. Modified: vendor/one-true-awk/dist/FIXES vendor/one-true-awk/dist/awkgram.y vendor/one-true-awk/dist/b.c vendor/one-true-awk/dist/lex.c vendor/one-true-awk/dist/lib.c vendor/one-true-awk/dist/main.c vendor/one-true-awk/dist/makefile vendor/one-true-awk/dist/proto.h vendor/one-true-awk/dist/run.c vendor/one-true-awk/dist/tran.c Modified: vendor/one-true-awk/dist/FIXES ============================================================================== --- vendor/one-true-awk/dist/FIXES Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/FIXES Tue Aug 9 12:23:27 2011 (r224729) @@ -25,6 +25,24 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 7, 2011: + split(s, a, //) now behaves the same as split(s, a, "") + +Jun 12, 2011: + /pat/, \n /pat/ {...} is now legal, though bad style to use. + + added checks to new -v code that permits -vnospace; thanks to + ruslan ermilov for spotting this and providing the patch. + + removed fixed limit on number of open files; thanks to aleksey + cheusov and christos zoulos. + + fixed day 1 bug that resurrected deleted elements of ARGV when + used as filenames (in lib.c). + + minor type fiddles to make gcc -Wall -pedantic happier (but not + totally so); turned on -fno-strict-aliasing in makefile. + May 6, 2011: added #ifdef for isblank. now allows -ffoo as well as -f foo arguments. Modified: vendor/one-true-awk/dist/awkgram.y ============================================================================== --- vendor/one-true-awk/dist/awkgram.y Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/awkgram.y Tue Aug 9 12:23:27 2011 (r224729) @@ -174,8 +174,8 @@ pa_pat: pa_stat: pa_pat { $$ = stat2(PASTAT, $1, stat2(PRINT, rectonode(), NIL)); } | pa_pat lbrace stmtlist '}' { $$ = stat2(PASTAT, $1, $3); } - | pa_pat ',' pa_pat { $$ = pa2stat($1, $3, stat2(PRINT, rectonode(), NIL)); } - | pa_pat ',' pa_pat lbrace stmtlist '}' { $$ = pa2stat($1, $3, $5); } + | pa_pat ',' opt_nl pa_pat { $$ = pa2stat($1, $4, stat2(PRINT, rectonode(), NIL)); } + | pa_pat ',' opt_nl pa_pat lbrace stmtlist '}' { $$ = pa2stat($1, $4, $6); } | lbrace stmtlist '}' { $$ = stat2(PASTAT, NIL, $2); } | XBEGIN lbrace stmtlist '}' { beginloc = linkum(beginloc, $3); $$ = 0; } Modified: vendor/one-true-awk/dist/b.c ============================================================================== --- vendor/one-true-awk/dist/b.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/b.c Tue Aug 9 12:23:27 2011 (r224729) @@ -231,7 +231,7 @@ void freetr(Node *p) /* free parse tree /* in the parsing of regular expressions, metacharacters like . have */ /* to be seen literally; \056 is not a metacharacter. */ -int hexstr(char **pp) /* find and eval hex string at pp, return new p */ +int hexstr(uschar **pp) /* find and eval hex string at pp, return new p */ { /* only pick up one 8-bit byte (2 chars) */ uschar *p; int n = 0; @@ -245,16 +245,16 @@ int hexstr(char **pp) /* find and eval h else if (*p >= 'A' && *p <= 'F') n = 16 * n + *p - 'A' + 10; } - *pp = (char *) p; + *pp = (uschar *) p; return n; } #define isoctdigit(c) ((c) >= '0' && (c) <= '7') /* multiple use of arg */ -int quoted(char **pp) /* pick up next thing after a \\ */ +int quoted(uschar **pp) /* pick up next thing after a \\ */ /* and increment *pp */ { - char *p = *pp; + uschar *p = *pp; int c; if ((c = *p++) == 't') @@ -299,13 +299,13 @@ char *cclenter(const char *argp) /* add bp = buf; for (i = 0; (c = *p++) != 0; ) { if (c == '\\') { - c = quoted((char **) &p); + c = quoted(&p); } else if (c == '-' && i > 0 && bp[-1] != 0) { if (*p != 0) { c = bp[-1]; c2 = *p++; if (c2 == '\\') - c2 = quoted((char **) &p); + c2 = quoted(&p); if (c > c2) { /* empty; ignore */ bp--; i--; @@ -789,7 +789,7 @@ int relex(void) /* lexical analyzer for case ')': return c; case '\\': - rlxval = quoted((char **) &prestr); + rlxval = quoted(&prestr); return CHAR; default: rlxval = c; Modified: vendor/one-true-awk/dist/lex.c ============================================================================== --- vendor/one-true-awk/dist/lex.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/lex.c Tue Aug 9 12:23:27 2011 (r224729) @@ -411,7 +411,7 @@ int string(void) } *px = 0; unput(c); - sscanf(xbuf, "%x", &n); + sscanf(xbuf, "%x", (unsigned int *) &n); *bp++ = n; break; } Modified: vendor/one-true-awk/dist/lib.c ============================================================================== --- vendor/one-true-awk/dist/lib.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/lib.c Tue Aug 9 12:23:27 2011 (r224729) @@ -124,7 +124,7 @@ int getrec(char **pbuf, int *pbufsize, i dprintf( ("argno=%d, file=|%s|\n", argno, file) ); if (infile == NULL) { /* have to open a new file */ file = getargv(argno); - if (*file == '\0') { /* it's been zapped */ + if (file == NULL || *file == '\0') { /* deleted or zapped */ argno++; continue; } @@ -187,6 +187,7 @@ int readrec(char **pbuf, int *pbufsize, if (strlen(*FS) >= sizeof(inputFS)) FATAL("field separator %.10s... is too long", *FS); + /*fflush(stdout); avoids some buffering problem but makes it 25% slower*/ strcpy(inputFS, *FS); /* for subsequent field splitting */ if ((sep = **RS) == 0) { sep = '\n'; @@ -227,6 +228,8 @@ char *getargv(int n) /* get ARGV[n] */ extern Array *ARGVtab; sprintf(temp, "%d", n); + if (lookup(temp, ARGVtab) == NULL) + return NULL; x = setsymtab(temp, "", 0.0, STR, ARGVtab); s = getsval(x); dprintf( ("getargv(%d) returns |%s|\n", n, s) ); @@ -477,14 +480,14 @@ void recbld(void) /* create $0 from $1.. if (!adjbuf(&record, &recsize, 2+r-record, recsize, &r, "recbld 3")) FATAL("built giant record `%.30s...'", record); *r = '\0'; - dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, fldtab[0]) ); + dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) ); if (freeable(fldtab[0])) xfree(fldtab[0]->sval); fldtab[0]->tval = REC | STR | DONTFREE; fldtab[0]->sval = record; - dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, fldtab[0]) ); + dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) ); dprintf( ("recbld = |%s|\n", record) ); donerec = 1; } Modified: vendor/one-true-awk/dist/main.c ============================================================================== --- vendor/one-true-awk/dist/main.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/main.c Tue Aug 9 12:23:27 2011 (r224729) @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20110506"; +const char *version = "version 20110807"; #define DEBUG #include @@ -121,10 +121,20 @@ int main(int argc, char *argv[]) WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ - if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1])) - setclvar(argv[1]); - else if (argv[1][2] != '\0') - setclvar(&argv[1][2]); + if (argv[1][2] != 0) { /* arg is -vsomething */ + if (isclvar(&argv[1][2])) + setclvar(&argv[1][2]); + else + FATAL("invalid -v option argument: %s", &argv[1][2]); + } else { /* arg is -v something */ + argc--; argv++; + if (argc <= 1) + FATAL("no variable name"); + if (isclvar(argv[1])) + setclvar(argv[1]); + else + FATAL("invalid -v option argument: %s", argv[1]); + } break; case 'd': dbg = atoi(&argv[1][2]); Modified: vendor/one-true-awk/dist/makefile ============================================================================== --- vendor/one-true-awk/dist/makefile Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/makefile Tue Aug 9 12:23:27 2011 (r224729) @@ -30,7 +30,7 @@ CC = gcc -Wall -g CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov -CC = gcc -O4 +CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing YACC = bison -y YACC = yacc Modified: vendor/one-true-awk/dist/proto.h ============================================================================== --- vendor/one-true-awk/dist/proto.h Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/proto.h Tue Aug 9 12:23:27 2011 (r224729) @@ -43,8 +43,8 @@ extern fa *mkdfa(const char *, int); extern int makeinit(fa *, int); extern void penter(Node *); extern void freetr(Node *); -extern int hexstr(char **); -extern int quoted(char **); +extern int hexstr(uschar **); +extern int quoted(uschar **); extern char *cclenter(const char *); extern void overflo(const char *); extern void cfoll(fa *, Node *); Modified: vendor/one-true-awk/dist/run.c ============================================================================== --- vendor/one-true-awk/dist/run.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/run.c Tue Aug 9 12:23:27 2011 (r224729) @@ -1236,6 +1236,12 @@ Cell *split(Node **a, int nnn) /* split( ap->sval = (char *) makesymtab(NSYMTAB); n = 0; + if (arg3type == REGEXPR && strlen((char*)((fa*)a[2])->restr) == 0) { + /* split(s, a, //); have to arrange that it looks like empty sep */ + arg3type = 0; + fs = ""; + sep = 0; + } if (*s != '\0' && (strlen(fs) > 1 || arg3type == REGEXPR)) { /* reg expr */ fa *pfa; if (arg3type == REGEXPR) { /* it's ready already */ @@ -1618,17 +1624,25 @@ struct files { FILE *fp; const char *fname; int mode; /* '|', 'a', 'w' => LE/LT, GT */ -} files[FOPEN_MAX] ={ - { NULL, "/dev/stdin", LT }, /* watch out: don't free this! */ - { NULL, "/dev/stdout", GT }, - { NULL, "/dev/stderr", GT } -}; +} *files; + +int nfiles; void stdinit(void) /* in case stdin, etc., are not constants */ { - files[0].fp = stdin; - files[1].fp = stdout; - files[2].fp = stderr; + nfiles = FOPEN_MAX; + files = calloc(nfiles, sizeof(*files)); + if (files == NULL) + FATAL("can't allocate file memory for %u files", nfiles); + files[0].fp = stdin; + files[0].fname = "/dev/stdin"; + files[0].mode = LT; + files[1].fp = stdout; + files[1].fname = "/dev/stdout"; + files[1].mode = GT; + files[2].fp = stderr; + files[2].fname = "/dev/stderr"; + files[2].mode = GT; } FILE *openfile(int a, const char *us) @@ -1639,7 +1653,7 @@ FILE *openfile(int a, const char *us) if (*s == '\0') FATAL("null file name in print or getline"); - for (i=0; i < FOPEN_MAX; i++) + for (i=0; i < nfiles; i++) if (files[i].fname && strcmp(s, files[i].fname) == 0) { if (a == files[i].mode || (a==APPEND && files[i].mode==GT)) return files[i].fp; @@ -1649,11 +1663,19 @@ FILE *openfile(int a, const char *us) if (a == FFLUSH) /* didn't find it, so don't create it! */ return NULL; - for (i=0; i < FOPEN_MAX; i++) + for (i=0; i < nfiles; i++) if (files[i].fp == 0) break; - if (i >= FOPEN_MAX) - FATAL("%s makes too many open files", s); + if (i >= nfiles) { + struct files *nf; + int nnf = nfiles + FOPEN_MAX; + nf = realloc(files, nnf * sizeof(*nf)); + if (nf == NULL) + FATAL("cannot grow files for %s and %d files", s, nnf); + memset(&nf[nfiles], 0, FOPEN_MAX * sizeof(*nf)); + nfiles = nnf; + files = nf; + } fflush(stdout); /* force a semblance of order */ m = a; if (a == GT) { @@ -1681,7 +1703,7 @@ const char *filename(FILE *fp) { int i; - for (i = 0; i < FOPEN_MAX; i++) + for (i = 0; i < nfiles; i++) if (fp == files[i].fp) return files[i].fname; return "???"; @@ -1696,7 +1718,7 @@ Cell *closefile(Node **a, int n) x = execute(a[0]); getsval(x); stat = -1; - for (i = 0; i < FOPEN_MAX; i++) { + for (i = 0; i < nfiles; i++) { if (files[i].fname && strcmp(x->sval, files[i].fname) == 0) { if (ferror(files[i].fp)) WARNING( "i/o error occurred on %s", files[i].fname ); @@ -1740,7 +1762,7 @@ void flush_all(void) { int i; - for (i = 0; i < FOPEN_MAX; i++) + for (i = 0; i < nfiles; i++) if (files[i].fp) fflush(files[i].fp); } Modified: vendor/one-true-awk/dist/tran.c ============================================================================== --- vendor/one-true-awk/dist/tran.c Tue Aug 9 08:11:26 2011 (r224728) +++ vendor/one-true-awk/dist/tran.c Tue Aug 9 12:23:27 2011 (r224729) @@ -212,7 +212,7 @@ Cell *setsymtab(const char *n, const cha if (n != NULL && (p = lookup(n, tp)) != NULL) { dprintf( ("setsymtab found %p: n=%s s=\"%s\" f=%g t=%o\n", - p, NN(p->nval), NN(p->sval), p->fval, p->tval) ); + (void*)p, NN(p->nval), NN(p->sval), p->fval, p->tval) ); return(p); } p = (Cell *) malloc(sizeof(Cell)); @@ -231,7 +231,7 @@ Cell *setsymtab(const char *n, const cha p->cnext = tp->tab[h]; tp->tab[h] = p; dprintf( ("setsymtab set %p: n=%s s=\"%s\" f=%g t=%o\n", - p, p->nval, p->sval, p->fval, p->tval) ); + (void*)p, p->nval, p->sval, p->fval, p->tval) ); return(p); } @@ -298,7 +298,7 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ - dprintf( ("setfval %p: %s = %g, t=%o\n", vp, NN(vp->nval), f, vp->tval) ); + dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } @@ -318,7 +318,7 @@ char *setsval(Cell *vp, const char *s) / int fldno; dprintf( ("starting setsval %p: %s = \"%s\", t=%o, r,f=%d,%d\n", - vp, NN(vp->nval), s, vp->tval, donerec, donefld) ); + (void*)vp, NN(vp->nval), s, vp->tval, donerec, donefld) ); if ((vp->tval & (NUM | STR)) == 0) funnyvar(vp, "assign to"); if (isfld(vp)) { @@ -338,7 +338,7 @@ char *setsval(Cell *vp, const char *s) / vp->tval |= STR; vp->tval &= ~DONTFREE; dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", - vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); + (void*)vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); return(vp->sval = t); } @@ -355,7 +355,8 @@ Awkfloat getfval(Cell *vp) /* get float if (is_number(vp->sval) && !(vp->tval&CON)) vp->tval |= NUM; /* make NUM only sparingly */ } - dprintf( ("getfval %p: %s = %g, t=%o\n", vp, NN(vp->nval), vp->fval, vp->tval) ); + dprintf( ("getfval %p: %s = %g, t=%o\n", + (void*)vp, NN(vp->nval), vp->fval, vp->tval) ); return(vp->fval); } @@ -381,7 +382,8 @@ static char *get_str_val(Cell *vp, char vp->tval &= ~DONTFREE; vp->tval |= STR; } - dprintf( ("getsval %p: %s = \"%s (%p)\", t=%o\n", vp, NN(vp->nval), vp->sval, vp->sval, vp->tval) ); + dprintf( ("getsval %p: %s = \"%s (%p)\", t=%o\n", + (void*)vp, NN(vp->nval), vp->sval, vp->sval, vp->tval) ); return(vp->sval); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 12:24:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25CF1065680; Tue, 9 Aug 2011 12:24:33 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8844C8FC13; Tue, 9 Aug 2011 12:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79COXGp094718; Tue, 9 Aug 2011 12:24:33 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79COXBV094717; Tue, 9 Aug 2011 12:24:33 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108091224.p79COXBV094717@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Aug 2011 12:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224730 - vendor/one-true-awk/20110807 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 12:24:33 -0000 Author: ru Date: Tue Aug 9 12:24:33 2011 New Revision: 224730 URL: http://svn.freebsd.org/changeset/base/224730 Log: Tag a 20110807 release. Added: vendor/one-true-awk/20110807/ - copied from r224729, vendor/one-true-awk/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 12:54:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3716A1065670; Tue, 9 Aug 2011 12:54:44 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2509D8FC1D; Tue, 9 Aug 2011 12:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79CsiVJ096545; Tue, 9 Aug 2011 12:54:44 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79Csi4e096534; Tue, 9 Aug 2011 12:54:44 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108091254.p79Csi4e096534@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 9 Aug 2011 12:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224731 - head/contrib/one-true-awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 12:54:44 -0000 Author: ru Date: Tue Aug 9 12:54:43 2011 New Revision: 224731 URL: http://svn.freebsd.org/changeset/base/224731 Log: Update to a 7-Aug-2011 release. Approved by: re (kib) Modified: head/contrib/one-true-awk/FIXES head/contrib/one-true-awk/awkgram.y head/contrib/one-true-awk/b.c head/contrib/one-true-awk/lex.c head/contrib/one-true-awk/lib.c head/contrib/one-true-awk/main.c head/contrib/one-true-awk/makefile head/contrib/one-true-awk/proto.h head/contrib/one-true-awk/run.c head/contrib/one-true-awk/tran.c Directory Properties: head/contrib/one-true-awk/ (props changed) Modified: head/contrib/one-true-awk/FIXES ============================================================================== --- head/contrib/one-true-awk/FIXES Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/FIXES Tue Aug 9 12:54:43 2011 (r224731) @@ -25,6 +25,24 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 7, 2011: + split(s, a, //) now behaves the same as split(s, a, "") + +Jun 12, 2011: + /pat/, \n /pat/ {...} is now legal, though bad style to use. + + added checks to new -v code that permits -vnospace; thanks to + ruslan ermilov for spotting this and providing the patch. + + removed fixed limit on number of open files; thanks to aleksey + cheusov and christos zoulos. + + fixed day 1 bug that resurrected deleted elements of ARGV when + used as filenames (in lib.c). + + minor type fiddles to make gcc -Wall -pedantic happier (but not + totally so); turned on -fno-strict-aliasing in makefile. + May 6, 2011: added #ifdef for isblank. now allows -ffoo as well as -f foo arguments. Modified: head/contrib/one-true-awk/awkgram.y ============================================================================== --- head/contrib/one-true-awk/awkgram.y Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/awkgram.y Tue Aug 9 12:54:43 2011 (r224731) @@ -174,8 +174,8 @@ pa_pat: pa_stat: pa_pat { $$ = stat2(PASTAT, $1, stat2(PRINT, rectonode(), NIL)); } | pa_pat lbrace stmtlist '}' { $$ = stat2(PASTAT, $1, $3); } - | pa_pat ',' pa_pat { $$ = pa2stat($1, $3, stat2(PRINT, rectonode(), NIL)); } - | pa_pat ',' pa_pat lbrace stmtlist '}' { $$ = pa2stat($1, $3, $5); } + | pa_pat ',' opt_nl pa_pat { $$ = pa2stat($1, $4, stat2(PRINT, rectonode(), NIL)); } + | pa_pat ',' opt_nl pa_pat lbrace stmtlist '}' { $$ = pa2stat($1, $4, $6); } | lbrace stmtlist '}' { $$ = stat2(PASTAT, NIL, $2); } | XBEGIN lbrace stmtlist '}' { beginloc = linkum(beginloc, $3); $$ = 0; } Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/b.c Tue Aug 9 12:54:43 2011 (r224731) @@ -234,7 +234,7 @@ void freetr(Node *p) /* free parse tree /* in the parsing of regular expressions, metacharacters like . have */ /* to be seen literally; \056 is not a metacharacter. */ -int hexstr(char **pp) /* find and eval hex string at pp, return new p */ +int hexstr(uschar **pp) /* find and eval hex string at pp, return new p */ { /* only pick up one 8-bit byte (2 chars) */ uschar *p; int n = 0; @@ -248,16 +248,16 @@ int hexstr(char **pp) /* find and eval h else if (*p >= 'A' && *p <= 'F') n = 16 * n + *p - 'A' + 10; } - *pp = (char *) p; + *pp = (uschar *) p; return n; } #define isoctdigit(c) ((c) >= '0' && (c) <= '7') /* multiple use of arg */ -int quoted(char **pp) /* pick up next thing after a \\ */ +int quoted(uschar **pp) /* pick up next thing after a \\ */ /* and increment *pp */ { - char *p = *pp; + uschar *p = *pp; int c; if ((c = *p++) == 't') @@ -314,13 +314,13 @@ char *cclenter(const char *argp) /* add bp = buf; for (i = 0; (c = *p++) != 0; ) { if (c == '\\') { - c = quoted((char **) &p); + c = quoted(&p); } else if (c == '-' && i > 0 && bp[-1] != 0) { if (*p != 0) { c = bp[-1]; c2 = *p++; if (c2 == '\\') - c2 = quoted((char **) &p); + c2 = quoted(&p); if (collate_range_cmp(c, c2) > 0) { bp--; i--; @@ -807,7 +807,7 @@ int relex(void) /* lexical analyzer for case ')': return c; case '\\': - rlxval = quoted((char **) &prestr); + rlxval = quoted(&prestr); return CHAR; default: rlxval = c; Modified: head/contrib/one-true-awk/lex.c ============================================================================== --- head/contrib/one-true-awk/lex.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/lex.c Tue Aug 9 12:54:43 2011 (r224731) @@ -411,7 +411,7 @@ int string(void) } *px = 0; unput(c); - sscanf(xbuf, "%x", &n); + sscanf(xbuf, "%x", (unsigned int *) &n); *bp++ = n; break; } Modified: head/contrib/one-true-awk/lib.c ============================================================================== --- head/contrib/one-true-awk/lib.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/lib.c Tue Aug 9 12:54:43 2011 (r224731) @@ -124,7 +124,7 @@ int getrec(char **pbuf, int *pbufsize, i dprintf( ("argno=%d, file=|%s|\n", argno, file) ); if (infile == NULL) { /* have to open a new file */ file = getargv(argno); - if (*file == '\0') { /* it's been zapped */ + if (file == NULL || *file == '\0') { /* deleted or zapped */ argno++; continue; } @@ -187,6 +187,7 @@ int readrec(char **pbuf, int *pbufsize, if (strlen(*FS) >= sizeof(inputFS)) FATAL("field separator %.10s... is too long", *FS); + /*fflush(stdout); avoids some buffering problem but makes it 25% slower*/ strcpy(inputFS, *FS); /* for subsequent field splitting */ if ((sep = **RS) == 0) { sep = '\n'; @@ -227,6 +228,8 @@ char *getargv(int n) /* get ARGV[n] */ extern Array *ARGVtab; sprintf(temp, "%d", n); + if (lookup(temp, ARGVtab) == NULL) + return NULL; x = setsymtab(temp, "", 0.0, STR, ARGVtab); s = getsval(x); dprintf( ("getargv(%d) returns |%s|\n", n, s) ); @@ -477,14 +480,14 @@ void recbld(void) /* create $0 from $1.. if (!adjbuf(&record, &recsize, 2+r-record, recsize, &r, "recbld 3")) FATAL("built giant record `%.30s...'", record); *r = '\0'; - dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, fldtab[0]) ); + dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) ); if (freeable(fldtab[0])) xfree(fldtab[0]->sval); fldtab[0]->tval = REC | STR | DONTFREE; fldtab[0]->sval = record; - dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, fldtab[0]) ); + dprintf( ("in recbld inputFS=%s, fldtab[0]=%p\n", inputFS, (void*)fldtab[0]) ); dprintf( ("recbld = |%s|\n", record) ); donerec = 1; } Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/main.c Tue Aug 9 12:54:43 2011 (r224731) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110506 (FreeBSD)"; +const char *version = "version 20110807 (FreeBSD)"; #define DEBUG #include @@ -125,10 +125,20 @@ int main(int argc, char *argv[]) WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ - if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1])) - setclvar(argv[1]); - else if (argv[1][2] != '\0') - setclvar(&argv[1][2]); + if (argv[1][2] != 0) { /* arg is -vsomething */ + if (isclvar(&argv[1][2])) + setclvar(&argv[1][2]); + else + FATAL("invalid -v option argument: %s", &argv[1][2]); + } else { /* arg is -v something */ + argc--; argv++; + if (argc <= 1) + FATAL("no variable name"); + if (isclvar(argv[1])) + setclvar(argv[1]); + else + FATAL("invalid -v option argument: %s", argv[1]); + } break; case 'd': dbg = atoi(&argv[1][2]); Modified: head/contrib/one-true-awk/makefile ============================================================================== --- head/contrib/one-true-awk/makefile Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/makefile Tue Aug 9 12:54:43 2011 (r224731) @@ -30,7 +30,7 @@ CC = gcc -Wall -g CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov -CC = gcc -O4 +CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing YACC = bison -y YACC = yacc Modified: head/contrib/one-true-awk/proto.h ============================================================================== --- head/contrib/one-true-awk/proto.h Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/proto.h Tue Aug 9 12:54:43 2011 (r224731) @@ -43,8 +43,8 @@ extern fa *mkdfa(const char *, int); extern int makeinit(fa *, int); extern void penter(Node *); extern void freetr(Node *); -extern int hexstr(char **); -extern int quoted(char **); +extern int hexstr(uschar **); +extern int quoted(uschar **); extern char *cclenter(const char *); extern void overflo(const char *); extern void cfoll(fa *, Node *); Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/run.c Tue Aug 9 12:54:43 2011 (r224731) @@ -1239,6 +1239,12 @@ Cell *split(Node **a, int nnn) /* split( ap->sval = (char *) makesymtab(NSYMTAB); n = 0; + if (arg3type == REGEXPR && strlen((char*)((fa*)a[2])->restr) == 0) { + /* split(s, a, //); have to arrange that it looks like empty sep */ + arg3type = 0; + fs = ""; + sep = 0; + } if (*s != '\0' && (strlen(fs) > 1 || arg3type == REGEXPR)) { /* reg expr */ fa *pfa; if (arg3type == REGEXPR) { /* it's ready already */ @@ -1621,17 +1627,25 @@ struct files { FILE *fp; const char *fname; int mode; /* '|', 'a', 'w' => LE/LT, GT */ -} files[FOPEN_MAX] ={ - { NULL, "/dev/stdin", LT }, /* watch out: don't free this! */ - { NULL, "/dev/stdout", GT }, - { NULL, "/dev/stderr", GT } -}; +} *files; + +int nfiles; void stdinit(void) /* in case stdin, etc., are not constants */ { - files[0].fp = stdin; - files[1].fp = stdout; - files[2].fp = stderr; + nfiles = FOPEN_MAX; + files = calloc(nfiles, sizeof(*files)); + if (files == NULL) + FATAL("can't allocate file memory for %u files", nfiles); + files[0].fp = stdin; + files[0].fname = "/dev/stdin"; + files[0].mode = LT; + files[1].fp = stdout; + files[1].fname = "/dev/stdout"; + files[1].mode = GT; + files[2].fp = stderr; + files[2].fname = "/dev/stderr"; + files[2].mode = GT; } FILE *openfile(int a, const char *us) @@ -1642,7 +1656,7 @@ FILE *openfile(int a, const char *us) if (*s == '\0') FATAL("null file name in print or getline"); - for (i=0; i < FOPEN_MAX; i++) + for (i=0; i < nfiles; i++) if (files[i].fname && strcmp(s, files[i].fname) == 0) { if (a == files[i].mode || (a==APPEND && files[i].mode==GT)) return files[i].fp; @@ -1652,11 +1666,19 @@ FILE *openfile(int a, const char *us) if (a == FFLUSH) /* didn't find it, so don't create it! */ return NULL; - for (i=0; i < FOPEN_MAX; i++) + for (i=0; i < nfiles; i++) if (files[i].fp == 0) break; - if (i >= FOPEN_MAX) - FATAL("%s makes too many open files", s); + if (i >= nfiles) { + struct files *nf; + int nnf = nfiles + FOPEN_MAX; + nf = realloc(files, nnf * sizeof(*nf)); + if (nf == NULL) + FATAL("cannot grow files for %s and %d files", s, nnf); + memset(&nf[nfiles], 0, FOPEN_MAX * sizeof(*nf)); + nfiles = nnf; + files = nf; + } fflush(stdout); /* force a semblance of order */ m = a; if (a == GT) { @@ -1684,7 +1706,7 @@ const char *filename(FILE *fp) { int i; - for (i = 0; i < FOPEN_MAX; i++) + for (i = 0; i < nfiles; i++) if (fp == files[i].fp) return files[i].fname; return "???"; @@ -1699,7 +1721,7 @@ Cell *closefile(Node **a, int n) x = execute(a[0]); getsval(x); stat = -1; - for (i = 0; i < FOPEN_MAX; i++) { + for (i = 0; i < nfiles; i++) { if (files[i].fname && strcmp(x->sval, files[i].fname) == 0) { if (ferror(files[i].fp)) WARNING( "i/o error occurred on %s", files[i].fname ); @@ -1743,7 +1765,7 @@ void flush_all(void) { int i; - for (i = 0; i < FOPEN_MAX; i++) + for (i = 0; i < nfiles; i++) if (files[i].fp) fflush(files[i].fp); } Modified: head/contrib/one-true-awk/tran.c ============================================================================== --- head/contrib/one-true-awk/tran.c Tue Aug 9 12:24:33 2011 (r224730) +++ head/contrib/one-true-awk/tran.c Tue Aug 9 12:54:43 2011 (r224731) @@ -212,7 +212,7 @@ Cell *setsymtab(const char *n, const cha if (n != NULL && (p = lookup(n, tp)) != NULL) { dprintf( ("setsymtab found %p: n=%s s=\"%s\" f=%g t=%o\n", - p, NN(p->nval), NN(p->sval), p->fval, p->tval) ); + (void*)p, NN(p->nval), NN(p->sval), p->fval, p->tval) ); return(p); } p = (Cell *) malloc(sizeof(Cell)); @@ -231,7 +231,7 @@ Cell *setsymtab(const char *n, const cha p->cnext = tp->tab[h]; tp->tab[h] = p; dprintf( ("setsymtab set %p: n=%s s=\"%s\" f=%g t=%o\n", - p, p->nval, p->sval, p->fval, p->tval) ); + (void*)p, p->nval, p->sval, p->fval, p->tval) ); return(p); } @@ -298,7 +298,7 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ - dprintf( ("setfval %p: %s = %g, t=%o\n", vp, NN(vp->nval), f, vp->tval) ); + dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } @@ -318,7 +318,7 @@ char *setsval(Cell *vp, const char *s) / int fldno; dprintf( ("starting setsval %p: %s = \"%s\", t=%o, r,f=%d,%d\n", - vp, NN(vp->nval), s, vp->tval, donerec, donefld) ); + (void*)vp, NN(vp->nval), s, vp->tval, donerec, donefld) ); if ((vp->tval & (NUM | STR)) == 0) funnyvar(vp, "assign to"); if (isfld(vp)) { @@ -338,7 +338,7 @@ char *setsval(Cell *vp, const char *s) / vp->tval |= STR; vp->tval &= ~DONTFREE; dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", - vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); + (void*)vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); return(vp->sval = t); } @@ -355,7 +355,8 @@ Awkfloat getfval(Cell *vp) /* get float if (is_number(vp->sval) && !(vp->tval&CON)) vp->tval |= NUM; /* make NUM only sparingly */ } - dprintf( ("getfval %p: %s = %g, t=%o\n", vp, NN(vp->nval), vp->fval, vp->tval) ); + dprintf( ("getfval %p: %s = %g, t=%o\n", + (void*)vp, NN(vp->nval), vp->fval, vp->tval) ); return(vp->fval); } @@ -381,7 +382,8 @@ static char *get_str_val(Cell *vp, char vp->tval &= ~DONTFREE; vp->tval |= STR; } - dprintf( ("getsval %p: %s = \"%s (%p)\", t=%o\n", vp, NN(vp->nval), vp->sval, vp->sval, vp->tval) ); + dprintf( ("getsval %p: %s = \"%s (%p)\", t=%o\n", + (void*)vp, NN(vp->nval), vp->sval, vp->sval, vp->tval) ); return(vp->sval); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 14:06:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4281065673; Tue, 9 Aug 2011 14:06:51 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9128FC12; Tue, 9 Aug 2011 14:06:51 +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 p79E6pKL098662; Tue, 9 Aug 2011 14:06:51 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79E6oRf098660; Tue, 9 Aug 2011 14:06:51 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108091406.p79E6oRf098660@svn.freebsd.org> From: Jonathan Anderson Date: Tue, 9 Aug 2011 14:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224732 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 14:06:51 -0000 Author: jonathan Date: Tue Aug 9 14:06:50 2011 New Revision: 224732 URL: http://svn.freebsd.org/changeset/base/224732 Log: Remove timeval2timespec and its converse, since we already have TIMEVAL_TO_TIMESPEC() in . Spotted by: bde Approved by: re (kib), mentor (rwatson) Modified: head/sys/sys/time.h Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Tue Aug 9 12:54:43 2011 (r224731) +++ head/sys/sys/time.h Tue Aug 9 14:06:50 2011 (r224732) @@ -195,24 +195,6 @@ timeval2bintime(const struct timeval *tv ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ ((tvp)->tv_sec cmp (uvp)->tv_sec)) -/* Conversion between timespec and timeval. */ - -static __inline void -timeval2timespec(const struct timeval *tv, struct timespec *ts) -{ - - ts->tv_sec = tv->tv_sec; - ts->tv_nsec = 1000 * tv->tv_usec; -} - -static __inline void -timespec2timeval(const struct timespec *ts, struct timeval *tv) -{ - - tv->tv_sec = ts->tv_sec; - tv->tv_usec = ts->tv_nsec / 1000; -} - /* timevaladd and timevalsub are not inlined */ #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 15:29:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164CB106566B; Tue, 9 Aug 2011 15:29:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B638FC13; Tue, 9 Aug 2011 15:29: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 p79FTw1f001421; Tue, 9 Aug 2011 15:29:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79FTwZJ001417; Tue, 9 Aug 2011 15:29:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201108091529.p79FTwZJ001417@svn.freebsd.org> From: John Baldwin Date: Tue, 9 Aug 2011 15:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224733 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 15:29:59 -0000 Author: jhb Date: Tue Aug 9 15:29:58 2011 New Revision: 224733 URL: http://svn.freebsd.org/changeset/base/224733 Log: Merge 220876, 220877, and 221537 from the new NFS client to the old: Allow the NFS client to use a max file size larger than 1TB for v3 mounts. It now allows files up to OFF_MAX subject to whatever limit the server advertises. Reviewed by: rmacklem Approved by: re (kib) MFC after: 1 week Modified: head/sys/nfsclient/nfs_bio.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Tue Aug 9 14:06:50 2011 (r224732) +++ head/sys/nfsclient/nfs_bio.c Tue Aug 9 15:29:58 2011 (r224733) @@ -445,6 +445,7 @@ nfs_bioread(struct vnode *vp, struct uio struct thread *td; struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn, rabn; + off_t end; int bcount; int seqcount; int nra, error = 0, n = 0, on = 0; @@ -464,8 +465,9 @@ nfs_bioread(struct vnode *vp, struct uio } else mtx_unlock(&nmp->nm_mtx); + end = uio->uio_offset + uio->uio_resid; if (vp->v_type != VDIR && - (uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + (end > nmp->nm_maxfilesize || end < uio->uio_offset)) return (EFBIG); if (nfs_directio_enable && (ioflag & IO_DIRECT) && (vp->v_type == VREG)) @@ -865,6 +867,7 @@ nfs_write(struct vop_write_args *ap) struct vattr vattr; struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; + off_t end; int bcount; int n, on, error = 0; @@ -932,7 +935,8 @@ flush_and_restart: if (uio->uio_offset < 0) return (EINVAL); - if ((uio->uio_offset + uio->uio_resid) > nmp->nm_maxfilesize) + end = uio->uio_offset + uio->uio_resid; + if (end > nmp->nm_maxfilesize || end < uio->uio_offset) return (EFBIG); if (uio->uio_resid == 0) return (0); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Aug 9 14:06:50 2011 (r224732) +++ head/sys/nfsclient/nfs_vfsops.c Tue Aug 9 15:29:58 2011 (r224733) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1228,13 +1229,11 @@ mountnfs(struct nfs_args *argp, struct m * * For V3, nfs_fsinfo will adjust this as necessary. Assume maximum * that we can handle until we find out otherwise. - * XXX Our "safe" limit on the client is what we can store in our - * buffer cache using signed(!) block numbers. */ if ((argp->flags & NFSMNT_NFSV3) == 0) nmp->nm_maxfilesize = 0xffffffffLL; else - nmp->nm_maxfilesize = (u_int64_t)0x80000000 * DEV_BSIZE - 1; + nmp->nm_maxfilesize = OFF_MAX; nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Tue Aug 9 14:06:50 2011 (r224732) +++ head/sys/nfsclient/nfs_vnops.c Tue Aug 9 15:29:58 2011 (r224733) @@ -1276,6 +1276,7 @@ nfs_readrpc(struct vnode *vp, struct uio caddr_t bpos, dpos; struct mbuf *mreq, *mrep, *md, *mb; struct nfsmount *nmp; + off_t end; int error = 0, len, retlen, tsiz, eof, attrflag; int v3 = NFS_ISV3(vp); int rsize; @@ -1286,7 +1287,8 @@ nfs_readrpc(struct vnode *vp, struct uio nmp = VFSTONFS(vp->v_mount); tsiz = uiop->uio_resid; mtx_lock(&nmp->nm_mtx); - if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { + end = uiop->uio_offset + tsiz; + if (end > nmp->nm_maxfilesize || end < uiop->uio_offset) { mtx_unlock(&nmp->nm_mtx); return (EFBIG); } @@ -1348,6 +1350,7 @@ nfs_writerpc(struct vnode *vp, struct ui caddr_t bpos, dpos; struct mbuf *mreq, *mrep, *md, *mb; struct nfsmount *nmp = VFSTONFS(vp->v_mount); + off_t end; int error = 0, len, tsiz, wccflag = NFSV3_WCCRATTR, rlen, commit; int v3 = NFS_ISV3(vp), committed = NFSV3WRITE_FILESYNC; int wsize; @@ -1356,7 +1359,8 @@ nfs_writerpc(struct vnode *vp, struct ui *must_commit = 0; tsiz = uiop->uio_resid; mtx_lock(&nmp->nm_mtx); - if (uiop->uio_offset + tsiz > nmp->nm_maxfilesize) { + end = uiop->uio_offset + tsiz; + if (end > nmp->nm_maxfilesize || end < uiop->uio_offset) { mtx_unlock(&nmp->nm_mtx); return (EFBIG); } From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 15:46:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4610B1065678; Tue, 9 Aug 2011 15:46:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3589E8FC20; Tue, 9 Aug 2011 15:46:53 +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 p79Fkrj3001957; Tue, 9 Aug 2011 15:46:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79FkrIc001954; Tue, 9 Aug 2011 15:46:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108091546.p79FkrIc001954@svn.freebsd.org> From: Adrian Chadd Date: Tue, 9 Aug 2011 15:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224734 - in head/sys/dev/ath: . ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 15:46:53 -0000 Author: adrian Date: Tue Aug 9 15:46:52 2011 New Revision: 224734 URL: http://svn.freebsd.org/changeset/base/224734 Log: Remove the now unneeded references to these DFS methods. Sorry for the noise everyone. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c head/sys/dev/ath/if_athdfs.h Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Tue Aug 9 15:29:58 2011 (r224733) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Tue Aug 9 15:46:52 2011 (r224734) @@ -226,13 +226,3 @@ ath_dfs_get_thresholds(struct ath_softc ath_hal_getdfsthresh(sc->sc_ah, param); return 1; } - -/* - * Update the current radar patterns based on the - * current operating mode/regulatory domain. - */ -int -ath_dfs_init_radar_filters(struct ath_softc *sc) -{ - return 1; -} Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Tue Aug 9 15:29:58 2011 (r224733) +++ head/sys/dev/ath/if_athdfs.h Tue Aug 9 15:46:52 2011 (r224734) @@ -44,6 +44,5 @@ extern int ath_dfs_tasklet_needed(struct extern int ath_ioctl_phyerr(struct ath_softc *sc, struct ath_diag *ad); extern int ath_dfs_get_thresholds(struct ath_softc *sc, HAL_PHYERR_PARAM *param); -extern int ath_dfs_init_radar_filters(struct ath_softc *sc); #endif /* __IF_ATHDFS_H__ */ From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 16:42:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3E8C106564A; Tue, 9 Aug 2011 16:42:31 +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 93BD18FC12; Tue, 9 Aug 2011 16:42:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79GgVv9003770; Tue, 9 Aug 2011 16:42:31 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79GgVNo003768; Tue, 9 Aug 2011 16:42:31 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108091642.p79GgVNo003768@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Aug 2011 16:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224736 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 16:42:31 -0000 Author: attilio Date: Tue Aug 9 16:42:31 2011 New Revision: 224736 URL: http://svn.freebsd.org/changeset/base/224736 Log: Add the PCI ID for the PCH DH89xxCC on ichsmb as got from Linux counterpart. Sponsored by: Sandvine Incorporated Reviewed by: emaste, rstone Approved by: re (bz) MFC after: 3 days Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Tue Aug 9 15:47:54 2011 (r224735) +++ head/sys/dev/ichsmb/ichsmb_pci.c Tue Aug 9 16:42:31 2011 (r224736) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ +#define ID_PCH_DH89XXCC 0x23308086 #define ID_82801AA 0x24138086 #define ID_82801AB 0x24238086 #define ID_82801BA 0x24438086 @@ -169,6 +170,7 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; + case ID_PCH_DH89XXCC: case ID_PCH: device_set_desc(dev, "Intel PCH SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 17:05:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70035106566C; Tue, 9 Aug 2011 17:05:00 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id D7AE38FC14; Tue, 9 Aug 2011 17:04:59 +0000 (UTC) Received: by vws18 with SMTP id 18so229821vws.13 for ; Tue, 09 Aug 2011 10:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=BfMMtCWpp5gLLpVgwFO6kZhcuMe07QDZyvA1mGn0NGY=; b=BIHsrMTzFTYYUShv5mw0kWOjCM6mYvIYmHUl9h+pKILxbHjhmi7oz7VWcyEm+JGPA4 zQqbKLZZXcdAbzOozhpHp0Lk5/rtdiaS7wWWQk8td94zHSd+bFsfV6+3YFlA84nNMkae wpAbHeTpqO9pUWLKvUBtYrqTUyGmRNo8zBHpE= MIME-Version: 1.0 Received: by 10.220.199.69 with SMTP id er5mr1960594vcb.238.1312909498710; Tue, 09 Aug 2011 10:04:58 -0700 (PDT) Received: by 10.220.93.75 with HTTP; Tue, 9 Aug 2011 10:04:58 -0700 (PDT) In-Reply-To: <4E40E20E.5050804@FreeBSD.org> References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E40E20E.5050804@FreeBSD.org> Date: Tue, 9 Aug 2011 10:04:58 -0700 Message-ID: From: Peter Wemm To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, re@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 17:05:00 -0000 On Tue, Aug 9, 2011 at 12:30 AM, Doug Barton wrote: > On 08/09/2011 00:07, Peter Wemm wrote: >> As much as I'd like to see NIS die a painful death, the answer to the >> question of helping non-NIS users is "not much" as things stand. >> >> The nis, files and dns components are statically compiled into libc. >> There is no expensive dlopen("/usr/lib/nss_nis.so") to optimize out, >> unlike some other systems. >> >> The runtime overheads are negligible. =A0The compiled-in routines check >> if nis activated with one syscall and immediately return NS_UNAVAIL if >> nis is not configured. > > None of this is relevant. The problem is that when you install the > system, by default it generates errors for every access to /etc/passwd, > /etc/group, or /etc/services. This is a silly way to ship a system. It does what?? The code is completely passive unless NIS is configured. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 18:11:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id BE6241065670; Tue, 9 Aug 2011 18:11:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 12-207-105-211.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 54068150B0E; Tue, 9 Aug 2011 18:11:48 +0000 (UTC) Message-ID: <4E417863.2010909@FreeBSD.org> Date: Tue, 09 Aug 2011 11:11:47 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Peter Wemm References: <201108060916.p769Gr4A043462@svn.freebsd.org> <9DDF0DAB-9056-45CD-8CE9-81B621A35B13@nitro.dk> <4E40E20E.5050804@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------030606070107020804080600" Cc: svn-src-head@freebsd.org, "Simon L. B. Nielsen" , svn-src-all@freebsd.org, src-committers@freebsd.org, re@freebsd.org Subject: Re: svn commit: r224674 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 18:11:48 -0000 This is a multi-part message in MIME format. --------------030606070107020804080600 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 08/09/2011 10:04, Peter Wemm wrote: > On Tue, Aug 9, 2011 at 12:30 AM, Doug Barton wrote: >> On 08/09/2011 00:07, Peter Wemm wrote: >>> As much as I'd like to see NIS die a painful death, the answer to the >>> question of helping non-NIS users is "not much" as things stand. >>> >>> The nis, files and dns components are statically compiled into libc. >>> There is no expensive dlopen("/usr/lib/nss_nis.so") to optimize out, >>> unlike some other systems. >>> >>> The runtime overheads are negligible. The compiled-in routines check >>> if nis activated with one syscall and immediately return NS_UNAVAIL if >>> nis is not configured. >> >> None of this is relevant. The problem is that when you install the >> system, by default it generates errors for every access to /etc/passwd, >> /etc/group, or /etc/services. This is a silly way to ship a system. > > It does what?? The code is completely passive unless NIS is configured. Well I feel stupid. What I was remembering as the default state (errors produced by default) was incorrect. I had recently installed a new system and thought that I was seeing what I remembered, but it turns out that was a different issue. As a result I failed to check my facts, and it turns out that I was 100% wrong. My sincere apologies to all involved for the time-suck, as well as the breakage I caused. Meanwhile, here is a patch which restores the old nsswitch.conf, and restores Ed's change with a slightly improved sed filter which produces this output instead of removing the _compat lines altogether: group: files # group_compat: nis hosts: files dns networks: files passwd: files # passwd_compat: nis shells: files services: files # services_compat: nis protocols: files rpc: files IMO that will make it easier if users want to go back and enable NIS down the road. However if the prevailing wisdom is to just back out my change and go back to Ed's previous version I'm Ok with that. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------030606070107020804080600 Content-Type: text/plain; name="fix-nsswitch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-nsswitch.diff" Index: Makefile =================================================================== --- Makefile (revision 224688) +++ Makefile (working copy) @@ -256,6 +256,10 @@ ${DESTDIR}/boot/device.hints .endif .endif +.if ${MK_NIS} == "no" + sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ + ${DESTDIR}/etc/nsswitch.conf +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ Index: nsswitch.conf =================================================================== --- nsswitch.conf (revision 224688) +++ nsswitch.conf (working copy) @@ -1,23 +1,15 @@ # +# nsswitch.conf(5) - name service switch configuration file # $FreeBSD$ # -# To enable NIS the commented entries should replace their uncommented -# equivalents. See nsswitch.conf(5) for more information. -# -group: files -#group_compat: nis -#group: compat - -passwd: files -#passwd_compat: nis -#passwd: compat - -services: files -#services_compat: nis -#services: compat - +group: compat +group_compat: nis hosts: files dns networks: files +passwd: compat +passwd_compat: nis shells: files +services: compat +services_compat: nis protocols: files rpc: files --------------030606070107020804080600-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 19:59:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00C44106566B; Tue, 9 Aug 2011 19:59:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48118FC14; Tue, 9 Aug 2011 19:59:22 +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 p79JxMuh009504; Tue, 9 Aug 2011 19:59:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79JxMqJ009502; Tue, 9 Aug 2011 19:59:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108091959.p79JxMqJ009502@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 19:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224737 - stable/8/usr.sbin/service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 19:59:23 -0000 Author: dougb Date: Tue Aug 9 19:59:22 2011 New Revision: 224737 URL: http://svn.freebsd.org/changeset/base/224737 Log: MFC r224672: Fix a silly typo on my part. Modified: stable/8/usr.sbin/service/service.8 Directory Properties: stable/8/usr.sbin/service/ (props changed) Modified: stable/8/usr.sbin/service/service.8 ============================================================================== --- stable/8/usr.sbin/service/service.8 Tue Aug 9 16:42:31 2011 (r224736) +++ stable/8/usr.sbin/service/service.8 Tue Aug 9 19:59:22 2011 (r224737) @@ -123,7 +123,7 @@ for the names of the rc.d scripts: .Sh HISTORY The .Nm -manual page service first appeared in +utility first appeared in .Fx 7.3 . .Sh AUTHORS This From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:02:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A510C106566B; Tue, 9 Aug 2011 20:02:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 947EF8FC16; Tue, 9 Aug 2011 20:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79K2hDY009702; Tue, 9 Aug 2011 20:02:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79K2hGt009700; Tue, 9 Aug 2011 20:02:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092002.p79K2hGt009700@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:02:43 +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: r224738 - stable/7/usr.sbin/service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:02:43 -0000 Author: dougb Date: Tue Aug 9 20:02:43 2011 New Revision: 224738 URL: http://svn.freebsd.org/changeset/base/224738 Log: MFC r209031: mdoc nitpicking: the title argument shall be uppercase Modified: stable/7/usr.sbin/service/service.8 Directory Properties: stable/7/usr.sbin/service/ (props changed) Modified: stable/7/usr.sbin/service/service.8 ============================================================================== --- stable/7/usr.sbin/service/service.8 Tue Aug 9 19:59:22 2011 (r224737) +++ stable/7/usr.sbin/service/service.8 Tue Aug 9 20:02:43 2011 (r224738) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 26, 2009 -.Dt service 8 +.Dt SERVICE 8 .Os .Sh NAME .Nm service From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:07:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7F58106566C; Tue, 9 Aug 2011 20:07:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A468FC1C; Tue, 9 Aug 2011 20:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79K7Gba009917; Tue, 9 Aug 2011 20:07:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79K7GgO009915; Tue, 9 Aug 2011 20:07:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092007.p79K7GgO009915@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:07:16 +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: r224739 - stable/7/usr.sbin/service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:07:16 -0000 Author: dougb Date: Tue Aug 9 20:07:16 2011 New Revision: 224739 URL: http://svn.freebsd.org/changeset/base/224739 Log: MFC r224672: Fix a silly typo on my part. Modified: stable/7/usr.sbin/service/service.8 Directory Properties: stable/7/usr.sbin/service/ (props changed) Modified: stable/7/usr.sbin/service/service.8 ============================================================================== --- stable/7/usr.sbin/service/service.8 Tue Aug 9 20:02:43 2011 (r224738) +++ stable/7/usr.sbin/service/service.8 Tue Aug 9 20:07:16 2011 (r224739) @@ -123,7 +123,7 @@ for the names of the rc.d scripts: .Sh HISTORY The .Nm -manual page service first appeared in +utility first appeared in .Fx 7.3 . .Sh AUTHORS This From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:38:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C86106564A; Tue, 9 Aug 2011 20:38:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE1028FC14; Tue, 9 Aug 2011 20:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79KcLKI010940; Tue, 9 Aug 2011 20:38:21 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79KcLEx010938; Tue, 9 Aug 2011 20:38:21 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092038.p79KcLEx010938@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224740 - stable/8/sbin/rcorder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:38:22 -0000 Author: dougb Date: Tue Aug 9 20:38:21 2011 New Revision: 224740 URL: http://svn.freebsd.org/changeset/base/224740 Log: MFC r208027: mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the bottom of the manpages and order them consistently. Modified: stable/8/sbin/rcorder/rcorder.8 Directory Properties: stable/8/sbin/rcorder/ (props changed) Modified: stable/8/sbin/rcorder/rcorder.8 ============================================================================== --- stable/8/sbin/rcorder/rcorder.8 Tue Aug 9 20:07:16 2011 (r224739) +++ stable/8/sbin/rcorder/rcorder.8 Tue Aug 9 20:38:21 2011 (r224740) @@ -152,6 +152,19 @@ processing the stated condition. A set of files has a circular dependency which was detected while processing the stated file. .El +.Sh SEE ALSO +.Xr rc 8 +.Sh HISTORY +The +.Nm +utility first appeared in +.Nx 1.5 . +.Sh AUTHORS +.An -nosplit +Written by +.An Perry E. Metzger Aq perry@piermont.com +and +.An Matthew R. Green Aq mrg@eterna.com.au . .Sh BUGS The .Dq Li REQUIRE @@ -171,16 +184,3 @@ script in the dependency ordering, not necessarily that it requires .Xr named 8 to be started or enabled. -.Sh SEE ALSO -.Xr rc 8 -.Sh HISTORY -The -.Nm -utility first appeared in -.Nx 1.5 . -.Sh AUTHORS -.An -nosplit -Written by -.An Perry E. Metzger Aq perry@piermont.com -and -.An Matthew R. Green Aq mrg@eterna.com.au . From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:41:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 285FD106567A; Tue, 9 Aug 2011 20:41:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1814F8FC12; Tue, 9 Aug 2011 20:41:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79KfhJa011088; Tue, 9 Aug 2011 20:41:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79KfhAE011086; Tue, 9 Aug 2011 20:41:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092041.p79KfhAE011086@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224741 - stable/8/sbin/rcorder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:41:44 -0000 Author: dougb Date: Tue Aug 9 20:41:43 2011 New Revision: 224741 URL: http://svn.freebsd.org/changeset/base/224741 Log: MFC r224673: Put information about supported-but-deprecated headers in comments Modified: stable/8/sbin/rcorder/rcorder.8 Directory Properties: stable/8/sbin/rcorder/ (props changed) Modified: stable/8/sbin/rcorder/rcorder.8 ============================================================================== --- stable/8/sbin/rcorder/rcorder.8 Tue Aug 9 20:38:21 2011 (r224740) +++ stable/8/sbin/rcorder/rcorder.8 Tue Aug 9 20:41:43 2011 (r224741) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 9, 2008 +.Dd August 5, 2011 .Dt RCORDER 8 .Os .Sh NAME @@ -89,6 +89,9 @@ and lines may appear, but all such lines must appear in a sequence without any intervening lines, as once a line that does not follow the format is reached, parsing stops. +.\" Note that for historical reasons REQUIRES, PROVIDES, and KEYWORDS +.\" are also accepted in addition to the above, but not documented so +.\" that they can be deprecated at some point in the future. .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:52:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DCDD1065670; Tue, 9 Aug 2011 20:52:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6588FC12; Tue, 9 Aug 2011 20:52:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p79KqCe6011452; Tue, 9 Aug 2011 20:52:12 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79KqCte011450; Tue, 9 Aug 2011 20:52:12 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092052.p79KqCte011450@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:52:12 +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: r224742 - stable/7/sbin/rcorder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:52:12 -0000 Author: dougb Date: Tue Aug 9 20:52:12 2011 New Revision: 224742 URL: http://svn.freebsd.org/changeset/base/224742 Log: MFC r208027: mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the bottom of the manpages and order them consistently. Modified: stable/7/sbin/rcorder/rcorder.8 Directory Properties: stable/7/sbin/rcorder/ (props changed) Modified: stable/7/sbin/rcorder/rcorder.8 ============================================================================== --- stable/7/sbin/rcorder/rcorder.8 Tue Aug 9 20:41:43 2011 (r224741) +++ stable/7/sbin/rcorder/rcorder.8 Tue Aug 9 20:52:12 2011 (r224742) @@ -165,3 +165,22 @@ Written by .An Perry E. Metzger Aq perry@piermont.com and .An Matthew R. Green Aq mrg@eterna.com.au . +.Sh BUGS +The +.Dq Li REQUIRE +keyword is misleading: +It doesn't describe which daemons have to be running before a script +will be started. +It describes which scripts must be placed before it in +the dependency ordering. +For example, +if your script has a +.Dq Li REQUIRE +on +.Dq Li named , +it means the script must be placed after the +.Dq Li named +script in the dependency ordering, +not necessarily that it requires +.Xr named 8 +to be started or enabled. From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:53:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BB39106564A; Tue, 9 Aug 2011 20:53:34 +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 3C12D8FC17; Tue, 9 Aug 2011 20:53: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 p79KrYKe011538; Tue, 9 Aug 2011 20:53:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79KrYt3011536; Tue, 9 Aug 2011 20:53:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108092053.p79KrYt3011536@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 9 Aug 2011 20:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224743 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:53:34 -0000 Author: kib Date: Tue Aug 9 20:53:33 2011 New Revision: 224743 URL: http://svn.freebsd.org/changeset/base/224743 Log: Do not update mountpoint generation counter to the value which was not yet acted upon by devfs_populate(). Submitted by: Kohji Okuno Approved by: re (bz) MFC after: 1 week Modified: head/sys/fs/devfs/devfs_devs.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Tue Aug 9 20:52:12 2011 (r224742) +++ head/sys/fs/devfs/devfs_devs.c Tue Aug 9 20:53:33 2011 (r224743) @@ -630,13 +630,15 @@ devfs_populate_loop(struct devfs_mount * void devfs_populate(struct devfs_mount *dm) { + unsigned gen; sx_assert(&dm->dm_lock, SX_XLOCKED); - if (dm->dm_generation == devfs_generation) + gen = devfs_generation; + if (dm->dm_generation == gen) return; while (devfs_populate_loop(dm, 0)) continue; - dm->dm_generation = devfs_generation; + dm->dm_generation = gen; } /* From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:54:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D761065672; Tue, 9 Aug 2011 20:54:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857D18FC1A; Tue, 9 Aug 2011 20:54: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 p79Ks0mb011590; Tue, 9 Aug 2011 20:54:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79Ks0Pw011588; Tue, 9 Aug 2011 20:54:00 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108092054.p79Ks0Pw011588@svn.freebsd.org> From: Doug Barton Date: Tue, 9 Aug 2011 20:54: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: r224744 - stable/7/sbin/rcorder X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:54:00 -0000 Author: dougb Date: Tue Aug 9 20:54:00 2011 New Revision: 224744 URL: http://svn.freebsd.org/changeset/base/224744 Log: MFC r224673: Put information about supported-but-deprecated headers in comments Modified: stable/7/sbin/rcorder/rcorder.8 Directory Properties: stable/7/sbin/rcorder/ (props changed) Modified: stable/7/sbin/rcorder/rcorder.8 ============================================================================== --- stable/7/sbin/rcorder/rcorder.8 Tue Aug 9 20:53:33 2011 (r224743) +++ stable/7/sbin/rcorder/rcorder.8 Tue Aug 9 20:54:00 2011 (r224744) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2000 +.Dd August 5, 2011 .Dt RCORDER 8 .Os .Sh NAME @@ -89,6 +89,9 @@ and lines may appear, but all such lines must appear in a sequence without any intervening lines, as once a line that does not follow the format is reached, parsing stops. +.\" Note that for historical reasons REQUIRES, PROVIDES, and KEYWORDS +.\" are also accepted in addition to the above, but not documented so +.\" that they can be deprecated at some point in the future. .Pp The options are as follows: .Bl -tag -width indent From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 20:55:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77CE6106566B; Tue, 9 Aug 2011 20:55:54 +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 683A98FC0A; Tue, 9 Aug 2011 20:55:54 +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 p79Kts3k011700; Tue, 9 Aug 2011 20:55:54 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79KtsSf011698; Tue, 9 Aug 2011 20:55:54 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108092055.p79KtsSf011698@svn.freebsd.org> From: Attilio Rao Date: Tue, 9 Aug 2011 20:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224745 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 20:55:54 -0000 Author: attilio Date: Tue Aug 9 20:55:54 2011 New Revision: 224745 URL: http://svn.freebsd.org/changeset/base/224745 Log: Revert r224736 as the introduced value was already present. Reported by: tinderbox, pluknet Approved by: re (kib) Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Tue Aug 9 20:54:00 2011 (r224744) +++ head/sys/dev/ichsmb/ichsmb_pci.c Tue Aug 9 20:55:54 2011 (r224745) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define ID_PCH_DH89XXCC 0x23308086 #define ID_82801AA 0x24138086 #define ID_82801AB 0x24238086 #define ID_82801BA 0x24438086 @@ -170,7 +169,6 @@ ichsmb_pci_probe(device_t dev) case ID_82801JI: device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); break; - case ID_PCH_DH89XXCC: case ID_PCH: device_set_desc(dev, "Intel PCH SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Tue Aug 9 21:01:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B35B106564A; Tue, 9 Aug 2011 21:01:37 +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 486F58FC16; Tue, 9 Aug 2011 21:01: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 p79L1bQT011932; Tue, 9 Aug 2011 21:01:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p79L1b2R011923; Tue, 9 Aug 2011 21:01:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201108092101.p79L1b2R011923@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 9 Aug 2011 21:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224746 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke powerpc/include sparc64/sparc64 vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2011 21:01:37 -0000 Author: kib Date: Tue Aug 9 21:01:36 2011 New Revision: 224746 URL: http://svn.freebsd.org/changeset/base/224746 Log: - Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flag to VPO_UNMANAGED (and also making the flag protected by the vm object lock, instead of vm page queue lock). - Mark the fake pages with both PG_FICTITIOUS (as it is now) and VPO_UNMANAGED. As a consequence, pmap code now can use use just VPO_UNMANAGED to decide whether the page is unmanaged. Reviewed by: alc Tested by: pho (x86, previous version), marius (sparc64), marcel (arm, ia64, powerpc), ray (mips) Sponsored by: The FreeBSD Foundation Approved by: re (bz) Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/pmap.h head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tsb.c head/sys/vm/vm_kern.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/amd64/amd64/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -2320,7 +2320,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse va_last = va + NBPDR - PAGE_SIZE; do { m++; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_pv_demote_pde: page %p is not managed", m)); va += PAGE_SIZE; pmap_insert_entry(pmap, va, m); @@ -2847,7 +2847,7 @@ pmap_remove_all(vm_page_t m) vm_offset_t va; vm_page_t free; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); free = NULL; vm_page_lock_queues(); @@ -3194,8 +3194,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va)); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || + VM_OBJECT_LOCKED(m->object), ("pmap_enter: page %p is not busy", m)); mpte = NULL; @@ -3276,7 +3276,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) @@ -3389,7 +3389,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t } newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 1) | PG_PS | PG_V; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { newpde |= PG_MANAGED; /* @@ -3498,7 +3498,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ vm_paddr_t pa; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, + (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -3556,7 +3556,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && + if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, va, m)) { if (mpte != NULL) { free = NULL; @@ -3581,7 +3581,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Now validate mapping with RO protection */ - if (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) + if ((m->oflags & VPO_UNMANAGED) != 0) pte_store(pte, pa | PG_V | PG_U); else pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); @@ -3958,7 +3958,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -3999,7 +3999,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); count = pmap_pvh_wired_mappings(&m->md, count); @@ -4041,7 +4041,7 @@ pmap_page_is_mapped(vm_page_t m) { boolean_t rv; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); vm_page_lock_queues(); rv = !TAILQ_EMPTY(&m->md.pv_list) || @@ -4199,7 +4199,7 @@ pmap_is_modified(vm_page_t m) { boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); /* @@ -4280,7 +4280,7 @@ pmap_is_referenced(vm_page_t m) { boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); vm_page_lock_queues(); rv = pmap_is_referenced_pvh(&m->md) || @@ -4328,7 +4328,7 @@ pmap_remove_write(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* @@ -4397,7 +4397,7 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); vm_page_lock_queues(); @@ -4471,7 +4471,7 @@ pmap_clear_modify(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -4548,7 +4548,7 @@ pmap_clear_reference(vm_page_t m) pt_entry_t *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/arm/arm/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -3120,7 +3120,7 @@ pmap_remove_all(vm_page_t m) pmap_t curpm; int flags = 0; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); if (TAILQ_EMPTY(&m->md.pv_list)) return; @@ -3242,7 +3242,7 @@ pmap_protect(pmap_t pm, vm_offset_t sva, PTE_SYNC(ptep); if (pg != NULL) { - if (!(pg->flags & PG_UNMANAGED)) { + if (!(pg->oflags & VPO_UNMANAGED)) { f = pmap_modify_pv(pg, pm, sva, PVF_WRITE, 0); vm_page_dirty(pg); @@ -3327,8 +3327,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0 || (flags & M_NOWAIT) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || + (flags & M_NOWAIT) != 0, ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); } @@ -3417,7 +3417,7 @@ do_l2b_alloc: if (prot & VM_PROT_WRITE) { npte |= L2_S_PROT_W; if (m != NULL && - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + (m->oflags & VPO_UNMANAGED) == 0) vm_page_flag_set(m, PG_WRITEABLE); } npte |= pte_l2_s_cache_mode; @@ -3480,36 +3480,36 @@ do_l2b_alloc: * this physical page is not/is already mapped. */ - if (m && ((m->flags & PG_FICTITIOUS) || - ((m->flags & PG_UNMANAGED) && + if (m && (m->oflags & VPO_UNMANAGED) && !m->md.pv_kva && - TAILQ_EMPTY(&m->md.pv_list)))) { + TAILQ_EMPTY(&m->md.pv_list)) { pmap_free_pv_entry(pve); pve = NULL; } - } else if (m && !(m->flags & PG_FICTITIOUS) && - (!(m->flags & PG_UNMANAGED) || m->md.pv_kva || + } else if (m && + (!(m->oflags & VPO_UNMANAGED) || m->md.pv_kva || !TAILQ_EMPTY(&m->md.pv_list))) pve = pmap_get_pv_entry(); - } else if (m && !(m->flags & PG_FICTITIOUS) && - (!(m->flags & PG_UNMANAGED) || m->md.pv_kva || + } else if (m && + (!(m->oflags & VPO_UNMANAGED) || m->md.pv_kva || !TAILQ_EMPTY(&m->md.pv_list))) pve = pmap_get_pv_entry(); - if (m && !(m->flags & PG_FICTITIOUS)) { - KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, - ("pmap_enter: managed mapping within the clean submap")); - if (m->flags & PG_UNMANAGED) { + if (m) { + if ((m->oflags & VPO_UNMANAGED)) { if (!TAILQ_EMPTY(&m->md.pv_list) || - m->md.pv_kva) { + m->md.pv_kva) { KASSERT(pve != NULL, ("No pv")); nflags |= PVF_UNMAN; pmap_enter_pv(m, pve, pmap, va, nflags); } else m->md.pv_kva = va; } else { - KASSERT(pve != NULL, ("No pv")); - pmap_enter_pv(m, pve, pmap, va, nflags); + KASSERT(va < kmi.clean_sva || + va >= kmi.clean_eva, + ("pmap_enter: managed mapping within the clean submap")); + KASSERT(pve != NULL, ("No pv")); + pmap_enter_pv(m, pve, pmap, va, nflags); } } } @@ -4423,7 +4423,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -4453,7 +4453,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) @@ -4472,7 +4472,7 @@ int pmap_ts_referenced(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); return (pmap_clearbit(m, PVF_REF)); } @@ -4482,7 +4482,7 @@ boolean_t pmap_is_modified(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); if (m->md.pvh_attrs & PVF_MOD) return (TRUE); @@ -4498,7 +4498,7 @@ void pmap_clear_modify(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -4526,7 +4526,7 @@ boolean_t pmap_is_referenced(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); return ((m->md.pvh_attrs & PVF_REF) != 0); } @@ -4540,7 +4540,7 @@ void pmap_clear_reference(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); if (m->md.pvh_attrs & PVF_REF) pmap_clearbit(m, PVF_REF); @@ -4554,7 +4554,7 @@ void pmap_remove_write(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/i386/i386/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -2400,7 +2400,7 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse va_last = va + NBPDR - PAGE_SIZE; do { m++; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_pv_demote_pde: page %p is not managed", m)); va += PAGE_SIZE; pmap_insert_entry(pmap, va, m); @@ -2927,7 +2927,7 @@ pmap_remove_all(vm_page_t m) vm_offset_t va; vm_page_t free; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); free = NULL; vm_page_lock_queues(); @@ -3299,8 +3299,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || + VM_OBJECT_LOCKED(m->object), ("pmap_enter: page %p is not busy", m)); mpte = NULL; @@ -3388,7 +3388,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) @@ -3498,7 +3498,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t } newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 1) | PG_PS | PG_V; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { newpde |= PG_MANAGED; /* @@ -3604,7 +3604,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ vm_page_t free; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, + (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -3667,7 +3667,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && + if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, va, m)) { if (mpte != NULL) { free = NULL; @@ -3695,7 +3695,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Now validate mapping with RO protection */ - if (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) + if ((m->oflags & VPO_UNMANAGED) != 0) pte_store(pte, pa | PG_V | PG_U); else pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); @@ -4096,7 +4096,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -4137,7 +4137,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); count = pmap_pvh_wired_mappings(&m->md, count); @@ -4181,7 +4181,7 @@ pmap_page_is_mapped(vm_page_t m) { boolean_t rv; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); vm_page_lock_queues(); rv = !TAILQ_EMPTY(&m->md.pv_list) || @@ -4341,7 +4341,7 @@ pmap_is_modified(vm_page_t m) { boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); /* @@ -4424,7 +4424,7 @@ pmap_is_referenced(vm_page_t m) { boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); vm_page_lock_queues(); rv = pmap_is_referenced_pvh(&m->md) || @@ -4474,7 +4474,7 @@ pmap_remove_write(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* @@ -4550,7 +4550,7 @@ pmap_ts_referenced(vm_page_t m) vm_offset_t va; int rtval = 0; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); vm_page_lock_queues(); @@ -4626,7 +4626,7 @@ pmap_clear_modify(vm_page_t m) pt_entry_t oldpte, *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -4715,7 +4715,7 @@ pmap_clear_reference(vm_page_t m) pt_entry_t *pte; vm_offset_t va; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); sched_pin(); Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/i386/xen/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -2430,7 +2430,7 @@ pmap_remove_all(vm_page_t m) pt_entry_t *pte, tpte; vm_page_t free; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); free = NULL; vm_page_lock_queues(); @@ -2616,8 +2616,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va)); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; @@ -2715,7 +2714,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) @@ -2915,7 +2914,7 @@ pmap_enter_quick_locked(multicall_entry_ multicall_entry_t *mcl = *mclpp; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, + (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -2979,7 +2978,7 @@ pmap_enter_quick_locked(multicall_entry_ /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && + if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, va, m)) { if (mpte != NULL) { free = NULL; @@ -3008,7 +3007,7 @@ pmap_enter_quick_locked(multicall_entry_ /* * Now validate mapping with RO protection */ - if (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) + if ((m->oflags & VPO_UNMANAGED) != 0) pte_store(pte, pa | PG_V | PG_U); else pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); @@ -3016,7 +3015,7 @@ pmap_enter_quick_locked(multicall_entry_ /* * Now validate mapping with RO protection */ - if (m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) + if ((m->oflags & VPO_UNMANAGED) != 0) pa = xpmap_ptom(pa | PG_V | PG_U); else pa = xpmap_ptom(pa | PG_V | PG_U | PG_MANAGED); @@ -3403,7 +3402,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -3435,7 +3434,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); sched_pin(); @@ -3461,7 +3460,7 @@ pmap_page_is_mapped(vm_page_t m) { boolean_t rv; - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (FALSE); vm_page_lock_queues(); rv = !TAILQ_EMPTY(&m->md.pv_list) || @@ -3600,7 +3599,7 @@ pmap_is_modified(vm_page_t m) pmap_t pmap; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; @@ -3671,7 +3670,7 @@ pmap_is_referenced(vm_page_t m) pmap_t pmap; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -3732,7 +3731,7 @@ pmap_remove_write(vm_page_t m) pmap_t pmap; pt_entry_t oldpte, *pte; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* @@ -3798,7 +3797,7 @@ pmap_ts_referenced(vm_page_t m) pt_entry_t *pte; int rtval = 0; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); vm_page_lock_queues(); sched_pin(); @@ -3840,7 +3839,7 @@ pmap_clear_modify(vm_page_t m) pmap_t pmap; pt_entry_t *pte; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -3886,7 +3885,7 @@ pmap_clear_reference(vm_page_t m) pmap_t pmap; pt_entry_t *pte; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); sched_pin(); Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/ia64/ia64/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -1442,7 +1442,7 @@ pmap_remove_all(vm_page_t m) pmap_t oldpmap; pv_entry_t pv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); vm_page_lock_queues(); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { @@ -1548,8 +1548,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va &= ~PAGE_MASK; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0, ("pmap_enter: page %p is not busy", m)); /* @@ -1619,7 +1618,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); pmap_insert_entry(pmap, va, m); @@ -1720,7 +1719,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ boolean_t managed; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, + (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1730,7 +1729,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ if (!pmap_present(pte)) { /* Enter on the PV list if the page is managed. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { if (!pmap_try_insert_pv_entry(pmap, va, m)) { pmap_free_pte(pte, va); return; @@ -1900,7 +1899,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -1932,7 +1931,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2010,7 +2009,7 @@ pmap_ts_referenced(vm_page_t m) pv_entry_t pv; int count = 0; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2044,7 +2043,7 @@ pmap_is_modified(vm_page_t m) pv_entry_t pv; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; @@ -2104,7 +2103,7 @@ pmap_is_referenced(vm_page_t m) pv_entry_t pv; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -2133,7 +2132,7 @@ pmap_clear_modify(vm_page_t m) pmap_t oldpmap; pv_entry_t pv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -2174,7 +2173,7 @@ pmap_clear_reference(vm_page_t m) pmap_t oldpmap; pv_entry_t pv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2203,7 +2202,7 @@ pmap_remove_write(vm_page_t m) pv_entry_t pv; vm_prot_t prot; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/mips/mips/pmap.c Tue Aug 9 21:01:36 2011 (r224746) @@ -1708,7 +1708,7 @@ pmap_remove_all(vm_page_t m) pv_entry_t pv; pt_entry_t *pte, tpte; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); vm_page_lock_queues(); @@ -1863,8 +1863,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, va &= ~PAGE_MASK; KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0, + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0, ("pmap_enter: page %p is not busy", m)); mpte = NULL; @@ -1952,7 +1951,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * raise IPL while manipulating pv_table since pmap_enter can be * called at interrupt time. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + if ((m->oflags & VPO_UNMANAGED) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); if (pv == NULL) @@ -2067,7 +2066,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ vm_paddr_t pa; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0, + (m->oflags & VPO_UNMANAGED) != 0, ("pmap_enter_quick_locked: managed mapping within the clean submap")); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -2129,7 +2128,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Enter on the PV list if part of our managed memory. */ - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0 && + if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, mpte, va, m)) { if (mpte != NULL) { pmap_unwire_pte_hold(pmap, va, mpte); @@ -2464,7 +2463,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; vm_page_lock_queues(); @@ -2558,7 +2557,7 @@ pmap_testbit(vm_page_t m, int bit) pt_entry_t *pte; boolean_t rv = FALSE; - if (m->flags & PG_FICTITIOUS) + if (m->oflags & VPO_UNMANAGED) return (rv); if (TAILQ_FIRST(&m->md.pv_list) == NULL) @@ -2585,7 +2584,7 @@ pmap_changebit(vm_page_t m, int bit, boo pv_entry_t pv; pt_entry_t *pte; - if (m->flags & PG_FICTITIOUS) + if (m->oflags & VPO_UNMANAGED) return; mtx_assert(&vm_page_queue_mtx, MA_OWNED); @@ -2634,7 +2633,7 @@ pmap_page_wired_mappings(vm_page_t m) int count; count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) + if ((m->oflags & VPO_UNMANAGED) != 0) return (count); vm_page_lock_queues(); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2659,7 +2658,7 @@ pmap_remove_write(vm_page_t m) vm_offset_t va; pt_entry_t *pte; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); /* @@ -2699,7 +2698,7 @@ int pmap_ts_referenced(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); if (m->md.pv_flags & PV_TABLE_REF) { vm_page_lock_queues(); @@ -2721,7 +2720,7 @@ pmap_is_modified(vm_page_t m) { boolean_t rv; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); /* @@ -2775,7 +2774,7 @@ void pmap_clear_modify(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -2806,7 +2805,7 @@ boolean_t pmap_is_referenced(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); return ((m->md.pv_flags & PV_TABLE_REF) != 0); } @@ -2820,7 +2819,7 @@ void pmap_clear_reference(vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_reference: page %p is not managed", m)); vm_page_lock_queues(); if (m->md.pv_flags & PV_TABLE_REF) { @@ -3168,7 +3167,7 @@ page_is_managed(vm_paddr_t pa) m = PHYS_TO_VM_PAGE(pa); if (m == NULL) return (0); - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) return (1); } return (0); @@ -3181,7 +3180,7 @@ init_pte_prot(vm_offset_t va, vm_page_t if (!(prot & VM_PROT_WRITE)) rw = PTE_V | PTE_RO | PTE_C_CACHE; - else if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { + else if ((m->oflags & VPO_UNMANAGED) == 0) { if ((m->md.pv_flags & PV_TABLE_MOD) != 0) rw = PTE_V | PTE_D | PTE_C_CACHE; else Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Aug 9 20:55:54 2011 (r224745) +++ head/sys/powerpc/aim/mmu_oea.c Tue Aug 9 21:01:36 2011 (r224746) @@ -1073,12 +1073,12 @@ moea_enter_locked(pmap_t pmap, vm_offset if (pmap_bootstrapped) mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 || - (m->oflags & VPO_BUSY) != 0 || VM_OBJECT_LOCKED(m->object), + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || + VM_OBJECT_LOCKED(m->object), ("moea_enter_locked: page %p is not busy", m)); /* XXX change the pvo head for fake pages */ - if ((m->flags & PG_FICTITIOUS) == PG_FICTITIOUS) { + if ((m->oflags & VPO_UNMANAGED) != 0) { pvo_flags &= ~PVO_MANAGED; pvo_head = &moea_pvo_kunmanaged; zone = moea_upvo_zone; @@ -1088,7 +1088,7 @@ moea_enter_locked(pmap_t pmap, vm_offset * If this is a managed page, and it's the first reference to the page, * clear the execness of the page. Otherwise fetch the execness. */ - if ((pg != NULL) && ((m->flags & PG_FICTITIOUS) == 0)) { + if ((pg != NULL) && ((m->oflags & VPO_UNMANAGED) == 0)) { if (LIST_EMPTY(pvo_head)) { moea_attr_clear(pg, PTE_EXEC); } else { @@ -1101,7 +1101,7 @@ moea_enter_locked(pmap_t pmap, vm_offset if (prot & VM_PROT_WRITE) { pte_lo |= PTE_BW; if (pmap_bootstrapped && - (m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) + (m->oflags & VPO_UNMANAGED) == 0) vm_page_flag_set(m, PG_WRITEABLE); } else pte_lo |= PTE_BR; @@ -1112,9 +1112,6 @@ moea_enter_locked(pmap_t pmap, vm_offset if (wired) pvo_flags |= PVO_WIRED; - if ((m->flags & PG_FICTITIOUS) != 0) - pvo_flags |= PVO_FAKE; - error = moea_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); @@ -1245,7 +1242,7 @@ boolean_t moea_is_referenced(mmu_t mmu, vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_referenced: page %p is not managed", m)); return (moea_query_bit(m, PTE_REF)); } @@ -1254,7 +1251,7 @@ boolean_t moea_is_modified(mmu_t mmu, vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_is_modified: page %p is not managed", m)); /* @@ -1286,7 +1283,7 @@ void moea_clear_reference(mmu_t mmu, vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_clear_reference: page %p is not managed", m)); moea_clear_bit(m, PTE_REF); } @@ -1295,7 +1292,7 @@ void moea_clear_modify(mmu_t mmu, vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_clear_modify: page %p is not managed", m)); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); KASSERT((m->oflags & VPO_BUSY) == 0, @@ -1322,7 +1319,7 @@ moea_remove_write(mmu_t mmu, vm_page_t m pmap_t pmap; u_int lo; - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_remove_write: page %p is not managed", m)); /* @@ -1379,7 +1376,7 @@ boolean_t moea_ts_referenced(mmu_t mmu, vm_page_t m) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("moea_ts_referenced: page %p is not managed", m)); return (moea_clear_bit(m, PTE_REF)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 06:17:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7331065673; Wed, 10 Aug 2011 06:17:06 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C2BB8FC1B; Wed, 10 Aug 2011 06:17: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 p7A6H6Fs028272; Wed, 10 Aug 2011 06:17:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A6H68p028270; Wed, 10 Aug 2011 06:17:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201108100617.p7A6H68p028270@svn.freebsd.org> From: Kevin Lo Date: Wed, 10 Aug 2011 06:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224747 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 06:17:06 -0000 Author: kevlo Date: Wed Aug 10 06:17:06 2011 New Revision: 224747 URL: http://svn.freebsd.org/changeset/base/224747 Log: If RTF_HOST flag is specified, then we are interested in destination address. PR: kern/159600 Submitted by: Svatopluk Kraus Approved by: re (hrs) Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Aug 9 21:01:36 2011 (r224746) +++ head/sys/netinet/in.c Wed Aug 10 06:17:06 2011 (r224747) @@ -1037,7 +1037,7 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { - p = ia->ia_addr.sin_addr; + p = ia->ia_dstaddr.sin_addr; if (prefix.s_addr != p.s_addr) continue; From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:21:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F53D1065675; Wed, 10 Aug 2011 08:21:39 +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 6ECC78FC17; Wed, 10 Aug 2011 08:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7A8LdQH032071; Wed, 10 Aug 2011 08:21:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8LdJo032069; Wed, 10 Aug 2011 08:21:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100821.p7A8LdJo032069@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:21: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: r224748 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:21:39 -0000 Author: mm Date: Wed Aug 10 08:21:39 2011 New Revision: 224748 URL: http://svn.freebsd.org/changeset/base/224748 Log: MFC r224690: Fix NetBSD PR bin/44114: makefs with -t cd9660 -o rockridge against directories with deep structure creates a corrupted cd9660 image. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114 Fix NetBSD PR bin/45217: makefs creates ISO9660 images that violate the ECMA-119 (ISO9660) specification. This is caused by erroneously writing 32 bytes with value 0x20 to the volume_set_id field and 128 bytes with value 0x20 to the the following 37-byte fields in the PVD: copyright_file_id, abstract_file_id, bibliographic_file_id This causes, among other unwanted results the reserved4 field to be overwritten with the value 0x20. To comply with the specification, this field muse be zero. As a result, all FreeBSD distribution ISO images created with makefs have not been 100% valid ISO9660 files. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217 Reviewed by: kientzle Obtained from: NetBSD Modified: stable/8/usr.sbin/makefs/cd9660.c Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660.c Wed Aug 10 06:17:06 2011 (r224747) +++ stable/8/usr.sbin/makefs/cd9660.c Wed Aug 10 08:21:39 2011 (r224748) @@ -223,13 +223,12 @@ cd9660_set_defaults(void) /* Make sure the PVD is clear */ memset(&diskStructure.primaryDescriptor, 0, 2048); - memset(diskStructure.primaryDescriptor.volume_set_id, 0x20,32); memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); memset(diskStructure.primaryDescriptor.application_id, 0x20,128); - memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); @@ -669,11 +668,11 @@ cd9660_finalize_PVD(void) cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, 128); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.copyright_file_id, 128); + diskStructure.primaryDescriptor.copyright_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.abstract_file_id, 128); + diskStructure.primaryDescriptor.abstract_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.bibliographic_file_id, 128); + diskStructure.primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ time(&tim); @@ -1307,6 +1306,8 @@ cd9660_rrip_move_directory(cd9660node *d /* Set the new name */ memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); strncpy(dir->isoDirRecord->name, newname, 8); + dir->isoDirRecord->length[0] = 34 + 8; + dir->isoDirRecord->name_len[0] = 8; return dir; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:28:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472491065680; Wed, 10 Aug 2011 08:28:38 +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 3663B8FC17; Wed, 10 Aug 2011 08:28:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7A8Sc7d032304; Wed, 10 Aug 2011 08:28:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8ScCp032302; Wed, 10 Aug 2011 08:28:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100828.p7A8ScCp032302@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:28:38 +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: r224749 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:28:38 -0000 Author: mm Date: Wed Aug 10 08:28:37 2011 New Revision: 224749 URL: http://svn.freebsd.org/changeset/base/224749 Log: MFC r224690: Fix NetBSD PR bin/44114: makefs with -t cd9660 -o rockridge against directories with deep structure creates a corrupted cd9660 image. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114 Fix NetBSD PR bin/45217: makefs creates ISO9660 images that violate the ECMA-119 (ISO9660) specification. This is caused by erroneously writing 32 bytes with value 0x20 to the volume_set_id field and 128 bytes with value 0x20 to the the following 37-byte fields in the PVD: copyright_file_id, abstract_file_id, bibliographic_file_id This causes, among other unwanted results the reserved4 field to be overwritten with the value 0x20. To comply with the specification, this field muse be zero. As a result, all FreeBSD distribution ISO images created with makefs have not been 100% valid ISO9660 files. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217 Reviewed by: kientzle Obtained from: NetBSD Modified: stable/7/usr.sbin/makefs/cd9660.c Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660.c Wed Aug 10 08:21:39 2011 (r224748) +++ stable/7/usr.sbin/makefs/cd9660.c Wed Aug 10 08:28:37 2011 (r224749) @@ -223,13 +223,12 @@ cd9660_set_defaults(void) /* Make sure the PVD is clear */ memset(&diskStructure.primaryDescriptor, 0, 2048); - memset(diskStructure.primaryDescriptor.volume_set_id, 0x20,32); memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); memset(diskStructure.primaryDescriptor.application_id, 0x20,128); - memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); @@ -669,11 +668,11 @@ cd9660_finalize_PVD(void) cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, 128); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.copyright_file_id, 128); + diskStructure.primaryDescriptor.copyright_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.abstract_file_id, 128); + diskStructure.primaryDescriptor.abstract_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.bibliographic_file_id, 128); + diskStructure.primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ time(&tim); @@ -1307,6 +1306,8 @@ cd9660_rrip_move_directory(cd9660node *d /* Set the new name */ memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); strncpy(dir->isoDirRecord->name, newname, 8); + dir->isoDirRecord->length[0] = 34 + 8; + dir->isoDirRecord->name_len[0] = 8; return dir; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:33:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A73106566C; Wed, 10 Aug 2011 08:33:46 +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 1C5638FC15; Wed, 10 Aug 2011 08:33:46 +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 p7A8XkCN032499; Wed, 10 Aug 2011 08:33:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8XjSu032498; Wed, 10 Aug 2011 08:33:45 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100833.p7A8XjSu032498@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224750 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:33:46 -0000 Author: mm Date: Wed Aug 10 08:33:45 2011 New Revision: 224750 URL: http://svn.freebsd.org/changeset/base/224750 Log: Remove svn:mergeinfo from files under usr.sbin/makefs This is a direct commit to stable/8 Modified: Directory Properties: stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:34:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F691065709; Wed, 10 Aug 2011 08:34:00 +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 BE7B48FC17; Wed, 10 Aug 2011 08:34: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 p7A8Y05M032540; Wed, 10 Aug 2011 08:34:00 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8Y0HV032539; Wed, 10 Aug 2011 08:34:00 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100834.p7A8Y0HV032539@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:34: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: r224751 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:34:01 -0000 Author: mm Date: Wed Aug 10 08:34:00 2011 New Revision: 224751 URL: http://svn.freebsd.org/changeset/base/224751 Log: Remove svn:mergeinfo from files under usr.sbin/makefs This is a direct commit to stable/7 Modified: Directory Properties: stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:40:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75C2A1065676; Wed, 10 Aug 2011 08:40:59 +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 6426C8FC1C; Wed, 10 Aug 2011 08:40: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 p7A8exYU032805; Wed, 10 Aug 2011 08:40:59 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8exid032790; Wed, 10 Aug 2011 08:40:59 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100840.p7A8exid032790@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:40: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: r224752 - in stable/8/lib/libarchive: . test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:40:59 -0000 Author: mm Date: Wed Aug 10 08:40:59 2011 New Revision: 224752 URL: http://svn.freebsd.org/changeset/base/224752 Log: MFC r224691, r224700 [1]: MFC r224961: Add compatibility for ISO images created with unfixed makefs that violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD. This allows tar to read FreeBSD distribution ISO images created with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1). In addition, merge following important bugfixes from libarchive's release/2.8 branch: Revision 2812: Merge 2811 from trunk: Don't try to verify that compression-level=0 produces larger results than the default compression, since this isn't true for all versions of liblzma. Revision 2817: Merge 2814 from trunk: Fix Issue 121 (mtree parser error) http://code.google.com/p/libarchive/issues/detail?id=121 Revision 2820: Fix issue 119. Change the file location check that a file location does not exceed volume block. New one is that a file content does not exceed volume block(end of an ISO image). It is better than previous check even if the issue did not happen. While reading an ISO image generated by an older version of mkisofs utility, a file location indicates the end the ISO image if its file size is zero and it is the last file of all files of the ISO image, so it is possible that the location value is the same as the number of the total block of the ISO image. http://code.google.com/p/libarchive/issues/detail?id=119 Revision 2955: Issue 134: Fix libarchive 2.8 crashing in archive_write_finish() when the open has failed and we're trying to write Zip format. http://code.google.com/p/libarchive/issues/detail?id=134 Revision 2958: Followup on Issue 134: 1) Port test_open_failure to libarchive 2.8 branch to test the problem reported in Issue 134. This test also shows that archive_read_open() sometimes fails to report open errors correctly. 2) Fix the bug in archive_read.c 3) Comment out the tests that close functions are invoked promptly when open fails; that's fully fixed in libarchive 3.0, but I don't think it's worth fixing here. Revision 3484: Use uintmax_t with %ju Revision 3487: Fix issue 163. Correctly allocate enough memory for a input buffer saved. http://code.google.com/p/libarchive/issues/detail?id=163 Revision 3542: Merge 2516, 2536 from trunk: Allow path table offset values of 0 and 18, which are used by some ISO writers. MFC r224700 [1]: Merge revision 3554 from libarchive's release/2.8 branch: Partial merge of 2431 from trunk: Retry writes on EINTR. This should fix the SIGINT handler in bsdtar. Note: The rest of r2431 can't be merged, since it interacts with a big write-side rearchitecture. PR: bin/149409 [1] Reviewed by: kientzle Added: stable/8/lib/libarchive/test/test_open_failure.c - copied unchanged from r224691, head/lib/libarchive/test/test_open_failure.c Modified: stable/8/lib/libarchive/archive_read.c stable/8/lib/libarchive/archive_read_support_compression_uu.c stable/8/lib/libarchive/archive_read_support_format_iso9660.c stable/8/lib/libarchive/archive_read_support_format_mtree.c stable/8/lib/libarchive/archive_write_open_fd.c stable/8/lib/libarchive/archive_write_open_file.c stable/8/lib/libarchive/archive_write_open_filename.c stable/8/lib/libarchive/archive_write_set_compression_xz.c stable/8/lib/libarchive/archive_write_set_format_zip.c stable/8/lib/libarchive/test/Makefile stable/8/lib/libarchive/test/test_read_format_mtree.c stable/8/lib/libarchive/test/test_write_compress_lzma.c stable/8/lib/libarchive/test/test_write_compress_xz.c Directory Properties: stable/8/lib/libarchive/ (props changed) Modified: stable/8/lib/libarchive/archive_read.c ============================================================================== --- stable/8/lib/libarchive/archive_read.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_read.c Wed Aug 10 08:40:59 2011 (r224752) @@ -377,6 +377,12 @@ build_stream(struct archive_read *a) /* If no bidder, we're done. */ if (best_bidder == NULL) { + /* Verify the final pipelin by asking it for some data. */ + __archive_read_filter_ahead(a->filter, 1, &avail); + if (avail < 0) { + cleanup_filters(a); + return (ARCHIVE_FATAL); + } a->archive.compression_name = a->filter->name; a->archive.compression_code = a->filter->code; return (ARCHIVE_OK); @@ -389,17 +395,11 @@ build_stream(struct archive_read *a) filter->bidder = best_bidder; filter->archive = a; filter->upstream = a->filter; - r = (best_bidder->init)(filter); - if (r != ARCHIVE_OK) { - free(filter); - return (r); - } a->filter = filter; - /* Verify the filter by asking it for some data. */ - __archive_read_filter_ahead(filter, 1, &avail); - if (avail < 0) { + r = (best_bidder->init)(a->filter); + if (r != ARCHIVE_OK) { cleanup_filters(a); - return (ARCHIVE_FATAL); + return (r); } } } Modified: stable/8/lib/libarchive/archive_read_support_compression_uu.c ============================================================================== --- stable/8/lib/libarchive/archive_read_support_compression_uu.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_read_support_compression_uu.c Wed Aug 10 08:40:59 2011 (r224752) @@ -381,7 +381,17 @@ ensure_in_buff_size(struct archive_read_ unsigned char *ptr; size_t newsize; - newsize = uudecode->in_allocated << 1; + /* + * Calculate a new buffer size for in_buff. + * Increase its value until it has enough size we need. + */ + newsize = uudecode->in_allocated; + do { + if (newsize < IN_BUFF_SIZE*32) + newsize <<= 1; + else + newsize += IN_BUFF_SIZE; + } while (size > newsize); ptr = malloc(newsize); if (ptr == NULL || newsize < uudecode->in_allocated) { Modified: stable/8/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- stable/8/lib/libarchive/archive_read_support_format_iso9660.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_read_support_format_iso9660.c Wed Aug 10 08:40:59 2011 (r224752) @@ -709,16 +709,18 @@ isSVD(struct iso9660 *iso9660, const uns /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+SVD_type_L_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must be at a valid location (WinISO + * and probably other programs omit this, so we allow zero) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+SVD_type_M_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Read Root Directory Record in Volume Descriptor. */ @@ -781,16 +783,17 @@ isEVD(struct iso9660 *iso9660, const uns /* Location of Occurrence of Type L Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); /* Location of Occurrence of Type M Path Table must be * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ @@ -862,19 +865,24 @@ isPVD(struct iso9660 *iso9660, const uns * available location, * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_le32dec(h+PVD_type_1_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block) return (0); - /* Location of Occurrence of Type M Path Table must be - * available location, - * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ + /* The Type M Path Table must also be at a valid location + * (although ECMA 119 requires a Type M Path Table, WinISO and + * probably other programs omit it, so we permit a zero here) + * + * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */ location = archive_be32dec(h+PVD_type_m_path_table_offset); - if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block) + if ((location > 0 && location < SYSTEM_AREA_BLOCK+2) + || location >= volume_block) return (0); /* Reserved field must be 0. */ + /* FreeBSD: makefs erroneously created images with 0x20 */ for (i = 0; i < PVD_reserved4_size; ++i) - if (h[PVD_reserved4_offset + i] != 0) + if (h[PVD_reserved4_offset + i] != 0 && + h[PVD_reserved4_offset + i] != 32) return (0); /* Reserved field must be 0. */ @@ -1677,6 +1685,7 @@ parse_file_info(struct archive_read *a, const unsigned char *rr_start, *rr_end; const unsigned char *p; size_t dr_len; + uint64_t fsize; int32_t location; int flags; @@ -1685,6 +1694,7 @@ parse_file_info(struct archive_read *a, dr_len = (size_t)isodirrec[DR_length_offset]; name_len = (size_t)isodirrec[DR_name_len_offset]; location = archive_le32dec(isodirrec + DR_extent_offset); + fsize = toi(isodirrec + DR_size_offset, DR_size_size); /* Sanity check that dr_len needs at least 34. */ if (dr_len < 34) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -1703,7 +1713,10 @@ parse_file_info(struct archive_read *a, * link or file size is zero. As far as I know latest mkisofs * do that. */ - if (location >= iso9660->volume_block) { + if (location > 0 && + (location + ((fsize + iso9660->logical_block_size -1) + / iso9660->logical_block_size)) > + (unsigned int)iso9660->volume_block) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid location of extent of file"); return (NULL); @@ -1719,7 +1732,7 @@ parse_file_info(struct archive_read *a, memset(file, 0, sizeof(*file)); file->parent = parent; file->offset = iso9660->logical_block_size * (uint64_t)location; - file->size = toi(isodirrec + DR_size_offset, DR_size_size); + file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; Modified: stable/8/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/8/lib/libarchive/archive_read_support_format_mtree.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_read_support_format_mtree.c Wed Aug 10 08:40:59 2011 (r224752) @@ -525,6 +525,7 @@ parse_file(struct archive_read *a, struc /* Initialize reasonable defaults. */ mtree->filetype = AE_IFREG; archive_entry_set_size(entry, 0); + archive_string_empty(&mtree->contents_name); /* Parse options from this line. */ parsed_kws = 0; @@ -613,9 +614,8 @@ parse_file(struct archive_read *a, struc } /* - * If there is a contents file on disk, use that size; - * otherwise leave it as-is (it might have been set from - * the mtree size= keyword). + * Check for a mismatch between the type in the specification and + * the type of the contents object on disk. */ if (st != NULL) { mismatched_type = 0; @@ -660,6 +660,11 @@ parse_file(struct archive_read *a, struc } } + /* + * If there is a contents file on disk, pick some of the metadata + * from that file. For most of these, we only set it from the contents + * if it wasn't already parsed from the specification. + */ if (st != NULL) { if ((parsed_kws & MTREE_HAS_DEVICE) == 0 && (archive_entry_filetype(entry) == AE_IFCHR || Modified: stable/8/lib/libarchive/archive_write_open_fd.c ============================================================================== --- stable/8/lib/libarchive/archive_write_open_fd.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_write_open_fd.c Wed Aug 10 08:40:59 2011 (r224752) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include "archive.h" struct write_fd_data { - off_t offset; int fd; }; @@ -122,12 +121,16 @@ file_write(struct archive *a, void *clie ssize_t bytesWritten; mine = (struct write_fd_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int Modified: stable/8/lib/libarchive/archive_write_open_file.c ============================================================================== --- stable/8/lib/libarchive/archive_write_open_file.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_write_open_file.c Wed Aug 10 08:40:59 2011 (r224752) @@ -86,12 +86,16 @@ file_write(struct archive *a, void *clie size_t bytesWritten; mine = client_data; - bytesWritten = fwrite(buff, 1, length, mine->f); - if (bytesWritten < length) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = fwrite(buff, 1, length, mine->f); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int Modified: stable/8/lib/libarchive/archive_write_open_filename.c ============================================================================== --- stable/8/lib/libarchive/archive_write_open_filename.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_write_open_filename.c Wed Aug 10 08:40:59 2011 (r224752) @@ -142,12 +142,16 @@ file_write(struct archive *a, void *clie ssize_t bytesWritten; mine = (struct write_file_data *)client_data; - bytesWritten = write(mine->fd, buff, length); - if (bytesWritten <= 0) { - archive_set_error(a, errno, "Write error"); - return (-1); + for (;;) { + bytesWritten = write(mine->fd, buff, length); + if (bytesWritten <= 0) { + if (errno == EINTR) + continue; + archive_set_error(a, errno, "Write error"); + return (-1); + } + return (bytesWritten); } - return (bytesWritten); } static int Modified: stable/8/lib/libarchive/archive_write_set_compression_xz.c ============================================================================== --- stable/8/lib/libarchive/archive_write_set_compression_xz.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_write_set_compression_xz.c Wed Aug 10 08:40:59 2011 (r224752) @@ -421,8 +421,8 @@ drive_compressor(struct archive_write *a archive_set_error(&a->archive, ENOMEM, "lzma compression error: " "%ju MiB would have been needed", - (lzma_memusage(&(state->stream)) + 1024 * 1024 -1) - / (1024 * 1024)); + (uintmax_t)((lzma_memusage(&(state->stream)) + 1024 * 1024 -1) + / (1024 * 1024))); return (ARCHIVE_FATAL); default: /* Any other return value indicates an error. */ Modified: stable/8/lib/libarchive/archive_write_set_format_zip.c ============================================================================== --- stable/8/lib/libarchive/archive_write_set_format_zip.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/archive_write_set_format_zip.c Wed Aug 10 08:40:59 2011 (r224752) @@ -502,6 +502,9 @@ archive_write_zip_finish(struct archive_ int entries; int ret; + if (a->compressor.write == NULL) + return (ARCHIVE_OK); + zip = a->format_data; l = zip->central_directory; Modified: stable/8/lib/libarchive/test/Makefile ============================================================================== --- stable/8/lib/libarchive/test/Makefile Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/test/Makefile Wed Aug 10 08:40:59 2011 (r224752) @@ -25,6 +25,7 @@ TESTS= \ test_fuzz.c \ test_link_resolver.c \ test_open_fd.c \ + test_open_failure.c \ test_open_file.c \ test_open_filename.c \ test_pax_filename_encoding.c \ Copied: stable/8/lib/libarchive/test/test_open_failure.c (from r224691, head/lib/libarchive/test/test_open_failure.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libarchive/test/test_open_failure.c Wed Aug 10 08:40:59 2011 (r224752, copy of r224691, head/lib/libarchive/test/test_open_failure.c) @@ -0,0 +1,198 @@ +/*- + * Copyright (c) 2003-2010 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define MAGIC 123456789 +struct my_data { + int magic; + int read_return; + int read_called; + int write_return; + int write_called; + int open_return; + int open_called; + int close_return; + int close_called; +}; + +static ssize_t +my_read(struct archive *a, void *_private, const void **buff) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->read_called; + return (private->read_return); +} + +static ssize_t +my_write(struct archive *a, void *_private, const void *buff, size_t s) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->write_called; + return (private->write_return); +} + +static int +my_open(struct archive *a, void *_private) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->open_called; + return (private->open_return); +} + +static int +my_close(struct archive *a, void *_private) +{ + struct my_data *private = (struct my_data *)_private; + assertEqualInt(MAGIC, private->magic); + ++private->close_called; + return (private->close_return); +} + + +DEFINE_TEST(test_open_failure) +{ + struct archive *a; + struct my_data private; + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FATAL, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FAILED; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FAILED, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_WARN; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_WARN, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_OK; + private.read_return = ARCHIVE_FATAL; + a = archive_read_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_OK, + archive_read_support_compression_compress(a)); + assertEqualInt(ARCHIVE_OK, archive_read_support_format_tar(a)); + assertEqualInt(ARCHIVE_FATAL, + archive_read_open(a, &private, my_open, my_read, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(1, private.read_called); + assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(1, private.read_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + archive_write_set_compression_compress(a); + archive_write_set_format_zip(a); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + + memset(&private, 0, sizeof(private)); + private.magic = MAGIC; + private.open_return = ARCHIVE_FATAL; + a = archive_write_new(); + assert(a != NULL); + archive_write_set_compression_gzip(a); + assertEqualInt(ARCHIVE_FATAL, + archive_write_open(a, &private, my_open, my_write, my_close)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + // Broken in 2.8, fixed in 3.0 + //assertEqualInt(1, private.close_called); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(1, private.open_called); + assertEqualInt(0, private.write_called); + assertEqualInt(1, private.close_called); + +} Modified: stable/8/lib/libarchive/test/test_read_format_mtree.c ============================================================================== --- stable/8/lib/libarchive/test/test_read_format_mtree.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/test/test_read_format_mtree.c Wed Aug 10 08:40:59 2011 (r224752) @@ -134,10 +134,53 @@ test_read_format_mtree2(void) assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +/* + * Reported to libarchive.googlecode.com as Issue 121. + */ +static void +test_read_format_mtree3(void) +{ + static char archive[] = + "#mtree\n" + "a type=file contents=file\n" + "b type=link link=a\n" + "c type=file contents=file\n"; + struct archive_entry *ae; + struct archive *a; + + assertMakeDir("mtree3", 0777); + assertChdir("mtree3"); + assertMakeFile("file", 0644, "file contents"); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "a"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "b"); + assertEqualInt(archive_entry_filetype(ae), AE_IFLNK); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "c"); + assertEqualInt(archive_entry_filetype(ae), AE_IFREG); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + + assertChdir(".."); +} + DEFINE_TEST(test_read_format_mtree) { test_read_format_mtree1(); test_read_format_mtree2(); + test_read_format_mtree3(); } Modified: stable/8/lib/libarchive/test/test_write_compress_lzma.c ============================================================================== --- stable/8/lib/libarchive/test/test_write_compress_lzma.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/test/test_write_compress_lzma.c Wed Aug 10 08:40:59 2011 (r224752) @@ -185,10 +185,15 @@ DEFINE_TEST(test_write_compress_lzma) archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* It would be nice to assert that compression-level=0 produced + * consistently larger/smaller results than the default compression, + * but the results here vary a lot depending on the version of liblzma + * being used. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); Modified: stable/8/lib/libarchive/test/test_write_compress_xz.c ============================================================================== --- stable/8/lib/libarchive/test/test_write_compress_xz.c Wed Aug 10 08:34:00 2011 (r224751) +++ stable/8/lib/libarchive/test/test_write_compress_xz.c Wed Aug 10 08:40:59 2011 (r224752) @@ -193,10 +193,14 @@ DEFINE_TEST(test_write_compress_xz) archive_write_close(a); assert(0 == archive_write_finish(a)); - /* Level 0 really does result in larger data. */ + /* I would like to assert that compression-level=0 results in + * larger data than the default compression, but that's not true + * for all versions of liblzma. */ + /* failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + */ assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_format_all(a)); From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:52:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DECFC106566B; Wed, 10 Aug 2011 08:52:27 +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 CED798FC18; Wed, 10 Aug 2011 08:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7A8qRha033187; Wed, 10 Aug 2011 08:52:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8qRDt033185; Wed, 10 Aug 2011 08:52:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108100852.p7A8qRDt033185@svn.freebsd.org> From: Xin LI Date: Wed, 10 Aug 2011 08:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224753 - stable/8/usr.bin/rpcgen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:52:28 -0000 Author: delphij Date: Wed Aug 10 08:52:27 2011 New Revision: 224753 URL: http://svn.freebsd.org/changeset/base/224753 Log: MFC r223922: Use strlcpy(). Modified: stable/8/usr.bin/rpcgen/rpc_scan.c Directory Properties: stable/8/usr.bin/rpcgen/ (props changed) Modified: stable/8/usr.bin/rpcgen/rpc_scan.c ============================================================================== --- stable/8/usr.bin/rpcgen/rpc_scan.c Wed Aug 10 08:40:59 2011 (r224752) +++ stable/8/usr.bin/rpcgen/rpc_scan.c Wed Aug 10 08:52:27 2011 (r224753) @@ -329,10 +329,9 @@ findstrconst(char **str, const char **va error("unterminated string constant"); } p++; - size = p - *str; - tmp = xmalloc(size + 1); - (void) strncpy(tmp, *str, size); - tmp[size] = 0; + size = p - *str + 1; + tmp = xmalloc(size); + (void) strlcpy(tmp, *str, size); *val = tmp; *str = p; } @@ -352,13 +351,12 @@ findchrconst(char **str, const char **va error("unterminated string constant"); } p++; - size = p - *str; - if (size != 3) { + size = p - *str + 1; + if (size != 4) { error("empty char string"); } - tmp = xmalloc(size + 1); - (void) strncpy(tmp, *str, size); - tmp[size] = 0; + tmp = xmalloc(size); + (void) strlcpy(tmp, *str, size); *val = tmp; *str = p; } @@ -381,10 +379,9 @@ findconst(char **str, const char **val) p++; } while (isdigit(*p)); } - size = p - *str; - tmp = xmalloc(size + 1); - (void) strncpy(tmp, *str, size); - tmp[size] = 0; + size = p - *str + 1; + tmp = xmalloc(size); + (void) strlcpy(tmp, *str, size); *val = tmp; *str = p; } @@ -438,8 +435,7 @@ findkind(char **mark, token *tokp) tokp->kind = TOK_IDENT; for (len = 0; isalnum(str[len]) || str[len] == '_'; len++); tmp = xmalloc(len + 1); - (void) strncpy(tmp, str, len); - tmp[len] = 0; + (void) strlcpy(tmp, str, len + 1); tokp->str = tmp; *mark = str + len; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:53:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C59106566B; Wed, 10 Aug 2011 08:53:34 +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 33C288FC18; Wed, 10 Aug 2011 08:53: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 p7A8rYPY033321; Wed, 10 Aug 2011 08:53:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8rYKN033319; Wed, 10 Aug 2011 08:53:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108100853.p7A8rYKN033319@svn.freebsd.org> From: Xin LI Date: Wed, 10 Aug 2011 08:53: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: r224754 - stable/8/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:53:34 -0000 Author: delphij Date: Wed Aug 10 08:53:33 2011 New Revision: 224754 URL: http://svn.freebsd.org/changeset/base/224754 Log: MFC r223924: Match size_t and ssize_t by using %zu and %zd instead of %d. Modified: stable/8/usr.bin/gcore/elfcore.c Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/elfcore.c ============================================================================== --- stable/8/usr.bin/gcore/elfcore.c Wed Aug 10 08:52:27 2011 (r224753) +++ stable/8/usr.bin/gcore/elfcore.c Wed Aug 10 08:53:33 2011 (r224754) @@ -183,7 +183,7 @@ elf_coredump(int efd __unused, int fd, p ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); ngot = iorequest.piod_len; if ((size_t)ngot < nwant) - errx(1, "short read wanted %d, got %d", + errx(1, "short read wanted %zu, got %zd", nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:54:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA380106566B; Wed, 10 Aug 2011 08:54:35 +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 9A4958FC08; Wed, 10 Aug 2011 08:54: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 p7A8sZBj033397; Wed, 10 Aug 2011 08:54:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8sZlL033395; Wed, 10 Aug 2011 08:54:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108100854.p7A8sZlL033395@svn.freebsd.org> From: Xin LI Date: Wed, 10 Aug 2011 08:54: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: r224755 - stable/8/usr.bin/ipcs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:54:35 -0000 Author: delphij Date: Wed Aug 10 08:54:35 2011 New Revision: 224755 URL: http://svn.freebsd.org/changeset/base/224755 Log: MFC r223925: Use %zu when printing size_t. Modified: stable/8/usr.bin/ipcs/ipc.c Directory Properties: stable/8/usr.bin/ipcs/ (props changed) Modified: stable/8/usr.bin/ipcs/ipc.c ============================================================================== --- stable/8/usr.bin/ipcs/ipc.c Wed Aug 10 08:53:33 2011 (r224754) +++ stable/8/usr.bin/ipcs/ipc.c Wed Aug 10 08:54:35 2011 (r224755) @@ -120,7 +120,7 @@ sysctlgatherstruct(void *addr, size_t si if (rv == -1) err(1, "sysctlbyname: %s", xp->sysctl); if (tsiz != xp->size) - errx(1, "%s size mismatch (expected %d, got %d)", + errx(1, "%s size mismatch (expected %zu, got %zu)", xp->sysctl, xp->size, tsiz); } } @@ -199,7 +199,7 @@ kget(int idx, void *addr, size_t size) err(1, "sysctlbyname: %s", sym2sysctl[idx]); if (tsiz != size) errx(1, "%s size mismatch " - "(expected %d, got %d)", + "(expected %zu, got %zu)", sym2sysctl[idx], size, tsiz); break; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:55:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC1F1065677; Wed, 10 Aug 2011 08:55:46 +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 CDFA08FC15; Wed, 10 Aug 2011 08:55:46 +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 p7A8tkRX033489; Wed, 10 Aug 2011 08:55:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8tkQt033487; Wed, 10 Aug 2011 08:55:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108100855.p7A8tkQt033487@svn.freebsd.org> From: Xin LI Date: Wed, 10 Aug 2011 08:55:46 +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: r224756 - stable/8/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:55:47 -0000 Author: delphij Date: Wed Aug 10 08:55:46 2011 New Revision: 224756 URL: http://svn.freebsd.org/changeset/base/224756 Log: MFC r223926: peeraddr is only used in sizeof() evaluations, so instead of declaring it a variable, use typedef. Modified: stable/8/usr.bin/tftp/main.c Directory Properties: stable/8/usr.bin/tftp/ (props changed) Modified: stable/8/usr.bin/tftp/main.c ============================================================================== --- stable/8/usr.bin/tftp/main.c Wed Aug 10 08:54:35 2011 (r224755) +++ stable/8/usr.bin/tftp/main.c Wed Aug 10 08:55:46 2011 (r224756) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); #define MAXLINE 200 #define TIMEOUT 5 /* secs between rexmt's */ -static struct sockaddr_storage peeraddr; +typedef struct sockaddr_storage peeraddr; static int connected; static char mode[32]; jmp_buf toplevel; From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 10:38:31 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 95CD41065672; Wed, 10 Aug 2011 10:38:31 +0000 (UTC) Date: Wed, 10 Aug 2011 10:38:31 +0000 From: Alexander Best To: Bruce Evans Message-ID: <20110810103831.GA60858@freebsd.org> References: <201108082036.p78KarlR062810@svn.freebsd.org> <20110809105824.P896@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110809105824.P896@besplex.bde.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jonathan Anderson Subject: Re: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 10:38:31 -0000 On Tue Aug 9 11, Bruce Evans wrote: > On Mon, 8 Aug 2011, Jonathan Anderson wrote: > > >Log: > > Create timeval2timespec() and timespec2timeval(). > > > > These functions will be used by process descriptors to convert process > > creation time into process descriptor [acm]time. > > These were intentionally left out. > > What is wrong with the existing APIs TIMEVAL_TO_TIMESPEC() and > TIMESPEC_TO_TIMEVAL(), which are used for these conversions by almost > everything now? Well, quite a bit is wrong with them, starting with > the loudness of their names, but not including a twee spelling of "to" > in their names. The main bugs in them is that they give undocumented > APIs and namespace pollution in userland and undocumented APIs in the > kernel. any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed in a do { ... } while (0) conditional loop? both macros are also defined in crypto/openssh/defines.h and don't seem to need that extra one-time-loop. cheers. alex > > > Approved by: re (kib), mentor (rwatson) > > Suggested by: jhb > > Should know better. > > >Modified: head/sys/sys/time.h > >============================================================================== > >--- head/sys/sys/time.h Mon Aug 8 19:03:26 2011 (r224720) > >+++ head/sys/sys/time.h Mon Aug 8 20:36:52 2011 (r224721) > >@@ -195,6 +195,24 @@ timeval2bintime(const struct timeval *tv > > ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ > > ((tvp)->tv_sec cmp (uvp)->tv_sec)) > > > >+/* Conversion between timespec and timeval. */ > >+ > >+static __inline void > >+timeval2timespec(const struct timeval *tv, struct timespec *ts) > >+{ > >+ > >+ ts->tv_sec = tv->tv_sec; > >+ ts->tv_nsec = 1000 * tv->tv_usec; > >+} > >+ > >+static __inline void > >+timespec2timeval(const struct timespec *ts, struct timeval *tv) > >+{ > >+ > >+ tv->tv_sec = ts->tv_sec; > >+ tv->tv_usec = ts->tv_nsec / 1000; > >+} > >+ > >/* timevaladd and timevalsub are not inlined */ > > > >#endif /* _KERNEL */ > > These are in the _KERNEL section, so they don't pollute userland. > Otherwise, the pollution would consist of 2 function names, 2 parameter > names and possibly 1 struct member names (I think tv_sec and tv_usec > are reserved in , but perhaps timespecs and tv_nsec are > not, since is mainly for old timeval interfaces. This > is another reason why the implementation of timespec conversions belongs > in where they already are and not in ). > > Style bugs in these include: > - use of inline functions instead of macros. Macros are used for all the > other APIs in this section. Using macros would limit the namespace > pollution. E.g., it keeps parameter names out of other namespaces. > - not using Hungrarian notation for pointers. Names of pointers are spelled > with a trailing p in all other APIs in this section. > > sys/time.h has mounds of older implementation bugs. The bintime section > is especially bad. The following is mostly about buigs in the non-_KERNEL > sections. > > 1) Userland pollution in starts with everything in > . > 2) Then there is everything in . The only pollution is > the undocumented TIMEPSEC conversion macros mentioned above (these > are conditional on __BSD_VISIBLE). > 4) Then there is struct timezone and its members. > 5) Then there is DST_* for using tz_dsttime. > 6) Then there is mounds of pollution from struct bintime and its APIs. > This is conditional on __BSD_VISIBLE. Most of the bintime APIs are > undocumented. (zgrep -r bintime in /usr/share/man gives many hits, > while zgrep -r TIMESPEC in /usr/share/man gives zero hits, but most > of the hits for bintime are in peripheral man pages and bintime(9); > bintime(9) only documents the highest level of bintime APIs, leaving > all of the arithmetic and conversion APIs undocumented.) > > Inlines instead of macros are used to implement most of the bintime > APIs. This gives the following undocumented pollution: > - bintime struct tag name 'bintime' > - bintime struct member names 'sec' and 'frac'. These are especially > bad since they are missing a prefix. > - all the API names > - all the parameter names: bt, x, bt2, ts, tv. Of course, these are > also missing Hungrarian notation. > - all the local variable names: u. > 7) Then there is mounds of documented pollution for the NetBSD/OpenBSD > compatibility APIs. These are not under __BSD_VISIBLE, so they are > pure pollution. These were obsolete before they were born, since they > are only for timevals. The kernel has always had equivalent interfaces, > but they were intentionally left out of userland. Then they came back > :-(. > But they are documented, and they implemented using macros so they are > missing the namespace pollution for parameter and local variable names, > and their parameter names are spelled in Hungrarian notations, so they > are missing most of the bugs described in this mail. > > FreeBSD still doesn't have the corresponding mistakes for manipulating > timespecs. You just have to manipulate timespecs for yourself, like > you should have to do for timevals too. I prefer to convert everything > to floating point (int64_t has been usable too, ever since C99 > standardized it). It is easier to multiply by 1e-6 to convert seconds > to microseconds than to remember the nonstandard APIs that manipulate > timespecs as timespecs. The timespec manipulation APIs may or may > not be faster than floating point calculations, depending on whether > the branches in them are faster than non-branchy FP code, but it is > hard to think if situations where the efficiency matters. Most uses > of the NetBSD APIs are for manipulating timeouts for things like > setitimer(2) where the syscall overcall dominates. > 8) Then there is the itimer section. This is POSIX, so it is actually > permitted in this file! > 9) Then there is the clockinfo section. This is pure nonstandard pollution. > It is only partially documented (in sysctl(3)). > 10) Then there is the POSIX timer section (CLOCK_REALTIME... and > TIMER_ABSTIME...). This is POSIX, but is not properly ifdefed for the > versions of POSIX that support it. > 11) Then there is everything in . The structure of vs > is still sort of backwards. This bug became more serious when > POSIX started specifying in 2001 (old versions of POSIX > didn't have timevals. Then in 2001, POSIX specified all the old timeval > APIs that it had intentionally left out in 1988, and is the > home for them in POSIX. But POSIX doesn't specifiy all of the other > pollution that is traditional or has accrufted in ). > 12) Finally, there is a section that declares prototypes of user APIs. This > is mostly correct (properly ifdefed). > > Bruce From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 13:19:53 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E474B106566B; Wed, 10 Aug 2011 13:19:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A3C078FC0C; Wed, 10 Aug 2011 13:19:53 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4cdf:3c74:f81e:a1a7] (unknown [IPv6:2001:7b8:3a7:0:4cdf:3c74:f81e:a1a7]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 96B965C59; Wed, 10 Aug 2011 15:19:52 +0200 (CEST) Message-ID: <4E428581.4050803@FreeBSD.org> Date: Wed, 10 Aug 2011 15:20:01 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Alexander Best References: <201108082036.p78KarlR062810@svn.freebsd.org> <20110809105824.P896@besplex.bde.org> <20110810103831.GA60858@freebsd.org> In-Reply-To: <20110810103831.GA60858@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jonathan Anderson , Bruce Evans Subject: Re: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 13:19:54 -0000 On 2011-08-10 12:38, Alexander Best wrote: ... > any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed > in a > > do { ... } while (0) > > conditional loop? both macros are also defined in crypto/openssh/defines.h and > don't seem to need that extra one-time-loop. It's a very common C idiom. See: http://stackoverflow.com/questions/154136/why-are-there-sometimes-meaningless-do-while-and-if-else-statements-in-c-c-macr From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 13:37:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0544106564A; Wed, 10 Aug 2011 13:37:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id 546498FC18; Wed, 10 Aug 2011 13:37:37 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p7ADbZRW007809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Aug 2011 23:37:35 +1000 Date: Wed, 10 Aug 2011 23:37:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Best In-Reply-To: <20110810103831.GA60858@freebsd.org> Message-ID: <20110810230856.M2222@besplex.bde.org> References: <201108082036.p78KarlR062810@svn.freebsd.org> <20110809105824.P896@besplex.bde.org> <20110810103831.GA60858@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jonathan Anderson , Bruce Evans Subject: Re: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 13:37:38 -0000 On Wed, 10 Aug 2011, Alexander Best wrote: > On Tue Aug 9 11, Bruce Evans wrote: >> ... >> What is wrong with the existing APIs TIMEVAL_TO_TIMESPEC() and >> TIMESPEC_TO_TIMEVAL(), which are used for these conversions by almost >> everything now? Well, quite a bit is wrong with them, starting with >> ... > > any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being executed > in a > > do { ... } while (0) > > conditional loop? Just the usual syntactical trick for making large macros that look like function calls almost usable like function calls. Without the do-while trick, code like if (foo) TIMEVAL_TO_TIMESPEC(&tv, &ts); would be fragile at best. With an else clause added to it, it would expand to either if (foo) first_statement_of_macro; second_statement_of_macro; ; else ... which is obviously broken (3 statements between the 'if' and the 'else' give a syntax error). We partially fix this by putting outer braces in the macro: if (foo) /* * Here I attempt to duplicate the ugly indentation, * that tends to be preserved on expansion, which is * given by style bugs in the macro definition. See * sys/queue.h for similar definitions without these * style bugs. */ { first_statement_of_macro; second_statement_of_macro; } ; else ... This might work without the else clause, but with the else clause it is still a syntax error, since there are still too many statements between the 'if' and the 'else' -- we want to add the semicolon after the macro invocation, since the macro invocation looks like a function call, but this semicolon gives an extra statement and thus defeats the reduction to a single statement in the macro be using braces. With the trick, and without the style bugs, the above expands to: if (foo) do { first_statement_of_macro; second_statement_of_macro; } while (0) ; else ... Now there is only 1 statement between the 'if' and the 'else', since we trickily made the macro a non-statement that works after adding a semicolon to it -- the semicolon completes the statement, and the do-while is a trick that works (I don't know of any other). > both macros are also defined in crypto/openssh/defines.h and > don't seem to need that extra one-time-loop. Macros that are only used locally can be sloppier, but shouldn't be. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 15:49:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCD591065673; Wed, 10 Aug 2011 15:49:24 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3A38FC0A; Wed, 10 Aug 2011 15:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7AFnOFd051612; Wed, 10 Aug 2011 15:49:24 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7AFnOS5051610; Wed, 10 Aug 2011 15:49:24 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <201108101549.p7AFnOS5051610@svn.freebsd.org> From: Rong-En Fan Date: Wed, 10 Aug 2011 15:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224759 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 15:49:25 -0000 Author: rafan Date: Wed Aug 10 15:49:24 2011 New Revision: 224759 URL: http://svn.freebsd.org/changeset/base/224759 Log: - Remove myself from ncurses maintainer due to ENOTIME Approved by: re (kib@) Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Aug 10 15:19:14 2011 (r224758) +++ head/MAINTAINERS Wed Aug 10 15:49:24 2011 (r224759) @@ -115,7 +115,6 @@ lib/libsdp emax Pre-commit review prefe usr.bin/bluetooth emax Pre-commit review preferred. usr.sbin/bluetooth emax Pre-commit review preferred. gnu/usr.bin/send-pr bugmaster Pre-commit review requested. -ncurses rafan Heads-up appreciated, try not to break it. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. share/zoneinfo edwin Heads-up appreciated, since our data is coming From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 15:49:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 9D70D1065693; Wed, 10 Aug 2011 15:49:56 +0000 (UTC) Date: Wed, 10 Aug 2011 15:49:56 +0000 From: Alexander Best To: Bruce Evans Message-ID: <20110810154956.GA4034@freebsd.org> References: <201108082036.p78KarlR062810@svn.freebsd.org> <20110809105824.P896@besplex.bde.org> <20110810103831.GA60858@freebsd.org> <20110810230856.M2222@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110810230856.M2222@besplex.bde.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric , Jonathan Anderson Subject: Re: svn commit: r224721 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 15:49:56 -0000 On Wed Aug 10 11, Bruce Evans wrote: > On Wed, 10 Aug 2011, Alexander Best wrote: > > >On Tue Aug 9 11, Bruce Evans wrote: > >>... > >>What is wrong with the existing APIs TIMEVAL_TO_TIMESPEC() and > >>TIMESPEC_TO_TIMEVAL(), which are used for these conversions by almost > >>everything now? Well, quite a bit is wrong with them, starting with > >>... > > > >any reason {TIMEVAL,TIMESPEC}_TO_{TIMESPEC,TIMEVAL}()s code is being > >executed > >in a > > > >do { ... } while (0) > > > >conditional loop? > > Just the usual syntactical trick for making large macros that look > like function calls almost usable like function calls. Without the > do-while trick, code like > > if (foo) > TIMEVAL_TO_TIMESPEC(&tv, &ts); > > would be fragile at best. With an else clause added to it, it would expand > to either > > if (foo) > first_statement_of_macro; > second_statement_of_macro; ; > else > ... > > which is obviously broken (3 statements between the 'if' and the 'else' > give a syntax error). We partially fix this by putting outer braces in > the macro: > > if (foo) > /* > * Here I attempt to duplicate the ugly indentation, > * that tends to be preserved on expansion, which is > * given by style bugs in the macro definition. See > * sys/queue.h for similar definitions without these > * style bugs. > */ > { > first_statement_of_macro; > second_statement_of_macro; > } ; > else > ... > > This might work without the else clause, but with the else clause it > is still a syntax error, since there are still too many statements > between the 'if' and the 'else' -- we want to add the semicolon after > the macro invocation, since the macro invocation looks like a function > call, but this semicolon gives an extra statement and thus defeats the > reduction to a single statement in the macro be using braces. > > With the trick, and without the style bugs, the above expands to: > > if (foo) > do { > first_statement_of_macro; > second_statement_of_macro; > } while (0) ; > else > ... > > Now there is only 1 statement between the 'if' and the 'else', since we > trickily made the macro a non-statement that works after adding a semicolon > to it -- the semicolon completes the statement, and the do-while is a > trick that works (I don't know of any other). > > >both macros are also defined in crypto/openssh/defines.h and > >don't seem to need that extra one-time-loop. > > Macros that are only used locally can be sloppier, but shouldn't be. thanks a lot for the in depth information. :) any reason, back in the days, it was decided that the functionality of converting a timespec to a timeval and vice versa should be implemented as a macro and not a function? cheers. alex > > Bruce From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 19:05:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F227106564A; Wed, 10 Aug 2011 19:05:23 +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 1FB7A8FC0C; Wed, 10 Aug 2011 19:05: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 p7AJ5NVv057562; Wed, 10 Aug 2011 19:05:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7AJ5Mbp057559; Wed, 10 Aug 2011 19:05:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108101905.p7AJ5Mbp057559@svn.freebsd.org> From: Marius Strobl Date: Wed, 10 Aug 2011 19:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224761 - in head/sys/dev/mpt: . mpilib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 19:05:23 -0000 Author: marius Date: Wed Aug 10 19:05:22 2011 New Revision: 224761 URL: http://svn.freebsd.org/changeset/base/224761 Log: o Improve 224494: - Ignore some more internal SAS device status change events. - Correct inverted Bus and TargetID arguments in a warning. o Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help identifying broken disks. Submitted by: Andrew Boyer Approved by: re (kib) Committed from: Chaos Communication Camp 2011 Modified: head/sys/dev/mpt/mpilib/mpi_ioc.h head/sys/dev/mpt/mpt_cam.c Modified: head/sys/dev/mpt/mpilib/mpi_ioc.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_ioc.h Wed Aug 10 16:13:43 2011 (r224760) +++ head/sys/dev/mpt/mpilib/mpi_ioc.h Wed Aug 10 19:05:22 2011 (r224761) @@ -33,7 +33,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.14 + * mpi_ioc.h Version: 01.05.16 * * Version History * --------------- @@ -140,6 +140,16 @@ * added _MULTI_PORT_DOMAIN. * 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request. * Added Common Boot Block type to FWUpload Request. + * 08-07-07 01.05.15 Added MPI_EVENT_SAS_INIT_RC_REMOVED define. + * Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and + * MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data. + * Added SASAddress field to SAS Initiator Device Table + * Overflow event data structure. + * 03-28-08 01.05.16 Added two new ReasonCode values to SAS Device Status + * Change Event data to indicate completion of internally + * generated task management. + * Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define. + * Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define. * -------------------------------------------------------------------------- */ @@ -639,6 +649,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_ST #define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) #define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) #define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET (0x0E) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL (0x0F) /* SCSI Event data for Queue Full event */ @@ -735,6 +747,8 @@ typedef struct _MPI_EVENT_DATA_IR2 #define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) +#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED (0x08) +#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED (0x09) /* defines for logical disk states */ #define MPI_LD_STATE_OPTIMAL (0x00) @@ -894,6 +908,7 @@ typedef struct _EVENT_DATA_DISCOVERY_ERR #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN (0x00002000) +#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE (0x00004000) /* SAS SMP Error Event data */ @@ -929,6 +944,8 @@ typedef struct _EVENT_DATA_SAS_INIT_DEV_ /* defines for the ReasonCode field of the SAS Initiator Device Status Change event */ #define MPI_EVENT_SAS_INIT_RC_ADDED (0x01) +#define MPI_EVENT_SAS_INIT_RC_REMOVED (0x02) +#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE (0x03) /* SAS Initiator Device Table Overflow Event data */ @@ -937,6 +954,7 @@ typedef struct _EVENT_DATA_SAS_INIT_TABL U8 MaxInit; /* 00h */ U8 CurrentInit; /* 01h */ U16 Reserved1; /* 02h */ + U64 SASAddress; /* 04h */ } EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MpiEventDataSasInitTableOverflow_t, Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Wed Aug 10 16:13:43 2011 (r224760) +++ head/sys/dev/mpt/mpt_cam.c Wed Aug 10 19:05:22 2011 (r224761) @@ -2620,17 +2620,30 @@ mpt_cam_event(struct mpt_softc *mpt, req xpt_free_path(tmppath); CAMLOCK_2_MPTLOCK(mpt); break; + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: break; default: mpt_lprt(mpt, MPT_PRT_WARN, "SAS device status change: Bus: 0x%02x TargetID: " - "0x%02x ReasonCode: 0x%02x\n", psdsc->TargetID, - psdsc->Bus, psdsc->ReasonCode); + "0x%02x ReasonCode: 0x%02x\n", psdsc->Bus, + psdsc->TargetID, psdsc->ReasonCode); break; } break; } + case MPI_EVENT_SAS_DISCOVERY_ERROR: + { + PTR_EVENT_DATA_DISCOVERY_ERROR pde; + + pde = (PTR_EVENT_DATA_DISCOVERY_ERROR)msg->Data; + pde->DiscoveryStatus = le32toh(pde->DiscoveryStatus); + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS discovery error: Port: 0x%02x Status: 0x%08x\n", + pde->Port, pde->DiscoveryStatus); + break; + } case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: case MPI_EVENT_IR2: From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 19:12:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68D01065672; Wed, 10 Aug 2011 19:12:21 +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 C492E8FC15; Wed, 10 Aug 2011 19:12:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7AJCL0h057817; Wed, 10 Aug 2011 19:12:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7AJCLhZ057810; Wed, 10 Aug 2011 19:12:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108101912.p7AJCLhZ057810@svn.freebsd.org> From: Marius Strobl Date: Wed, 10 Aug 2011 19:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224762 - in head/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 19:12:22 -0000 Author: marius Date: Wed Aug 10 19:12:21 2011 New Revision: 224762 URL: http://svn.freebsd.org/changeset/base/224762 Log: Sync makefs(8) ISO 9660 support with NetBSD: o cd9960 -> cd9660 o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h since actual user is not cd9660_eltorito.c but iso.h and cd9660_eltorito.h. Actually, include order/place of sys/endian.h doesn't matter on netbsd since it is always included by sys/types.h but it's not true on other system. This should fix cross build breakage on freebsd introduced by rev. 1.16 of cd9660_eltorito.c. Problem reported and fix suggested on twitter. o Fix fd leaks in error cases. Found by cppcheck. o RRIP RE length should be 4, not 0 o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates corrupted cd9660fs), iso9660_rrip.c part: - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent, not in node itself in RRIP_PL case - cd9660_rrip_initialize_node() should update only node passed as arg so handle RRIP_PL in DOTDOT case Fixes malformed dotdot entries in deep (more than 8 level) directories moved into .rr_moved dir. Should be pulled up to netbsd-5. (no official ISO has such deep dirs, but cobalt restorecd is affected) Reviewed by: mm Approved by: re (kib) Obtained from: NetBSD MFC after: 3 days Modified: head/usr.sbin/makefs/cd9660.c head/usr.sbin/makefs/cd9660.h head/usr.sbin/makefs/cd9660/cd9660_conversion.c head/usr.sbin/makefs/cd9660/cd9660_eltorito.c head/usr.sbin/makefs/cd9660/cd9660_write.c head/usr.sbin/makefs/cd9660/iso9660_rrip.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660.c Wed Aug 10 19:12:21 2011 (r224762) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.c,v 1.27 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.c,v 1.31 2011/08/06 23:25:19 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -127,7 +127,7 @@ static int cd9660_setup_volume_descripto static int cd9660_fill_extended_attribute_record(cd9660node *); #endif static void cd9660_sort_nodes(cd9660node *); -static int cd9960_translate_node_common(cd9660node *); +static int cd9660_translate_node_common(cd9660node *); static int cd9660_translate_node(fsnode *, cd9660node *); static int cd9660_compare_filename(const char *, const char *); static void cd9660_sorted_child_insert(cd9660node *, cd9660node *); @@ -809,7 +809,7 @@ cd9660_fill_extended_attribute_record(cd #endif static int -cd9960_translate_node_common(cd9660node *newnode) +cd9660_translate_node_common(cd9660node *newnode) { time_t tim; int test; @@ -846,7 +846,7 @@ cd9960_translate_node_common(cd9660node } /* - * Translate fsnode to cd9960node + * Translate fsnode to cd9660node * Translate filenames and other metadata, including dates, sizes, * permissions, etc * @param struct fsnode * The node generated by makefs @@ -875,7 +875,7 @@ cd9660_translate_node(fsnode *node, cd96 if (!(S_ISDIR(node->type))) newnode->fileDataLength = node->inode->st.st_size; - if (cd9960_translate_node_common(newnode) == 0) + if (cd9660_translate_node_common(newnode) == 0) return 0; /* Finally, overwrite some of the values that are set by default */ @@ -2042,7 +2042,7 @@ cd9660_create_file(const char * name, cd return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } @@ -2069,7 +2069,7 @@ cd9660_create_directory(const char *name return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } Modified: head/usr.sbin/makefs/cd9660.h ============================================================================== --- head/usr.sbin/makefs/cd9660.h Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660.h Wed Aug 10 19:12:21 2011 (r224762) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.h,v 1.15 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.h,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -50,6 +50,7 @@ #include #include #include +#include #include "makefs.h" #include "iso.h" Modified: head/usr.sbin/makefs/cd9660/cd9660_conversion.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_conversion.c Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660/cd9660_conversion.c Wed Aug 10 19:12:21 2011 (r224762) @@ -36,8 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#include - static char cd9660_compute_gm_offset(time_t); #if 0 Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Aug 10 19:12:21 2011 (r224762) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.14 2010/10/27 18:51:35 christos Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -32,8 +32,6 @@ * OF SUCH DAMAGE. */ -#include - #include "cd9660.h" #include "cd9660_eltorito.h" @@ -501,13 +499,14 @@ cd9660_setup_boot_volume_descriptor(volu } static int -cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, +cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start, off_t nsectors, int type) { uint8_t val; uint32_t lba; - fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1) + err(1, "fseeko"); val = 0x80; /* Bootable */ fwrite(&val, sizeof(val), 1, fd); @@ -531,18 +530,19 @@ cd9660_write_mbr_partition_entry(FILE *f lba = htole32(nsectors); fwrite(&lba, sizeof(lba), 1, fd); - return (0); + return 0; } static int -cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, +cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions, off_t sector_start, off_t nsectors, off_t sector_size, const char *part_name, const char *part_type) { uint32_t apm32; uint16_t apm16; - fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1) + err(1, "fseeko"); /* Signature */ apm16 = htobe16(0x504d); Modified: head/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_write.c Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660/cd9660_write.c Wed Aug 10 19:12:21 2011 (r224762) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_write.c,v 1.13 2010/10/22 00:49:15 christos Exp $ */ +/* $NetBSD: cd9660_write.c,v 1.14 2011/01/04 09:48:21 wiz Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -460,6 +460,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(rf)) { warn("%s: fread", __func__); free(buf); + (void)fclose(rf); return 0; } @@ -467,6 +468,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(fd)) { warn("%s: fwrite", __func__); free(buf); + (void)fclose(rf); return 0; } sector++; Modified: head/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- head/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Aug 10 19:05:22 2011 (r224761) +++ head/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Aug 10 19:12:21 2011 (r224762) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.8 2009/01/10 22:06:29 bjh21 Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.10 2011/05/29 17:07:58 tsutsui Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -183,10 +183,11 @@ cd9660_rrip_finalize_node(cd9660node *no break; case SUSP_ENTRY_RRIP_PL: /* Look at rr_real_parent */ - if (node->rr_real_parent == NULL) + if (node->parent == NULL || + node->parent->rr_real_parent == NULL) return -1; cd9660_bothendian_dword( - node->rr_real_parent->fileDataSector, + node->parent->rr_real_parent->fileDataSector, (unsigned char *) t->attr.rr_entry.PL.dir_loc); break; @@ -396,6 +397,13 @@ cd9660_rrip_initialize_node(cd9660node * cd9660node_rrip_px(current, grandparent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } + /* Handle PL */ + if (parent != NULL && parent->rr_real_parent != NULL) { + current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, + SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); + cd9660_rrip_PL(current,node); + TAILQ_INSERT_TAIL(&node->head, current, rr_ll); + } } else { cd9660_rrip_initialize_inode(node); @@ -435,14 +443,6 @@ cd9660_rrip_initialize_node(cd9660node * SUSP_ENTRY_RRIP_RE, "RE", SUSP_LOC_ENTRY); cd9660_rrip_RE(current,node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); - - /* Handle PL */ - current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, - SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); - cd9660_rrip_PL(current,node->dot_dot_record); - TAILQ_INSERT_TAIL(&node->dot_dot_record->head, current, - rr_ll); - TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } } return 1; @@ -496,7 +496,7 @@ cd9660_rrip_CL(struct ISO_SUSP_ATTRIBUTE int cd9660_rrip_RE(struct ISO_SUSP_ATTRIBUTES *p, cd9660node *node __unused) { - p->attr.rr_entry.RE.h.length[0] = 0; + p->attr.rr_entry.RE.h.length[0] = 4; p->attr.rr_entry.RE.h.version[0] = 1; return 1; } From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 20:52:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733371065673; Wed, 10 Aug 2011 20:52:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6342F8FC15; Wed, 10 Aug 2011 20:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7AKq2vQ060988; Wed, 10 Aug 2011 20:52:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7AKq2XS060985; Wed, 10 Aug 2011 20:52:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108102052.p7AKq2XS060985@svn.freebsd.org> From: Doug Barton Date: Wed, 10 Aug 2011 20:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224765 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 20:52:02 -0000 Author: dougb Date: Wed Aug 10 20:52:02 2011 New Revision: 224765 URL: http://svn.freebsd.org/changeset/base/224765 Log: Revert r224760, and enhance the sed patterns from r224659 to comment out the _compat entries in the WITHOUT_NIS case rather then delete them. Approved by: re (kib) Modified: head/etc/Makefile head/etc/nsswitch.conf Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Aug 10 19:40:23 2011 (r224764) +++ head/etc/Makefile Wed Aug 10 20:52:02 2011 (r224765) @@ -256,6 +256,10 @@ distribution: ${DESTDIR}/boot/device.hints .endif .endif +.if ${MK_NIS} == "no" + sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ + ${DESTDIR}/etc/nsswitch.conf +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ Modified: head/etc/nsswitch.conf ============================================================================== --- head/etc/nsswitch.conf Wed Aug 10 19:40:23 2011 (r224764) +++ head/etc/nsswitch.conf Wed Aug 10 20:52:02 2011 (r224765) @@ -1,23 +1,15 @@ # +# nsswitch.conf(5) - name service switch configuration file # $FreeBSD$ # -# To enable NIS the commented entries should replace their uncommented -# equivalents. See nsswitch.conf(5) for more information. -# -group: files -#group_compat: nis -#group: compat - -passwd: files -#passwd_compat: nis -#passwd: compat - -services: files -#services_compat: nis -#services: compat - +group: compat +group_compat: nis hosts: files dns networks: files +passwd: compat +passwd_compat: nis shells: files +services: compat +services_compat: nis protocols: files rpc: files From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 22:03:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB9E4106566C; Wed, 10 Aug 2011 22:03:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA8DF8FC1B; Wed, 10 Aug 2011 22:03: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 p7AM3Y3a063210; Wed, 10 Aug 2011 22:03:34 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7AM3YhV063207; Wed, 10 Aug 2011 22:03:34 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201108102203.p7AM3YhV063207@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 10 Aug 2011 22:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224768 - in head: tools/tools tools/tools/cxgbtool usr.sbin/cxgbtool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 22:03:35 -0000 Author: np Date: Wed Aug 10 22:03:34 2011 New Revision: 224768 URL: http://svn.freebsd.org/changeset/base/224768 Log: Move cxgbtool from usr.sbin to tools/tools. Approved by: re (kib) MFC after: 1 month Added: head/tools/tools/cxgbtool/ - copied from r224760, head/usr.sbin/cxgbtool/ Deleted: head/usr.sbin/cxgbtool/ Modified: head/tools/tools/README head/tools/tools/cxgbtool/Makefile Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Wed Aug 10 21:39:47 2011 (r224767) +++ head/tools/tools/README Wed Aug 10 22:03:34 2011 (r224768) @@ -17,6 +17,7 @@ commitsdb A tool for reconstructing comm checksums of the commit logs. crypto Test and exercise tools related to the crypto framework cxgbetool A tool for the cxgbe(4) driver. +cxgbtool A tool for the cxgb(4) driver. diffburst OBSOLETE: equivalent functionality is available via split -p. For example: "split -p ^diff < patchfile". See split(1). editing Editor modes and the like to help editing FreeBSD code. Modified: head/tools/tools/cxgbtool/Makefile ============================================================================== --- head/usr.sbin/cxgbtool/Makefile Wed Aug 10 16:13:43 2011 (r224760) +++ head/tools/tools/cxgbtool/Makefile Wed Aug 10 22:03:34 2011 (r224768) @@ -3,9 +3,8 @@ PROG= cxgbtool SRCS= cxgbtool.c NO_MAN= -CFLAGS+= -I${.CURDIR}/../../sys/dev/cxgb -I. +CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgb -I. CFLAGS+= -DCONFIG_T3_REGS -DCHELSIO_INTERNAL - -install: +BINDIR?= /usr/sbin .include From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 02:50:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625B8106564A; Thu, 11 Aug 2011 02:50:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 374328FC0C; Thu, 11 Aug 2011 02:50:19 +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 p7B2oJA8071689; Thu, 11 Aug 2011 02:50:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7B2oJeJ071687; Thu, 11 Aug 2011 02:50:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201108110250.p7B2oJeJ071687@svn.freebsd.org> From: Ed Maste Date: Thu, 11 Aug 2011 02:50: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: r224771 - stable/8/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 02:50:19 -0000 Author: emaste Date: Thu Aug 11 02:50:18 2011 New Revision: 224771 URL: http://svn.freebsd.org/changeset/base/224771 Log: MFC r224650: Don't try to free() an address returned by mmap(). This appears to be triggered by the same .o being included twice on the command line. Modified: stable/8/usr.bin/ar/write.c Directory Properties: stable/8/usr.bin/ar/ (props changed) Modified: stable/8/usr.bin/ar/write.c ============================================================================== --- stable/8/usr.bin/ar/write.c Thu Aug 11 02:08:02 2011 (r224770) +++ stable/8/usr.bin/ar/write.c Thu Aug 11 02:50:18 2011 (r224771) @@ -58,6 +58,7 @@ static struct ar_obj *create_obj_from_fi const char *name, time_t mtime); static void create_symtab_entry(struct bsdar *bsdar, void *maddr, size_t size); +static void free_obj(struct bsdar *bsdar, struct ar_obj *obj); static void insert_obj(struct bsdar *bsdar, struct ar_obj *obj, struct ar_obj *pos); static void read_objs(struct bsdar *bsdar, const char *archive, @@ -210,6 +211,22 @@ giveup: } /* + * Free object itself and its associated allocations. + */ +static void +free_obj(struct bsdar *bsdar, struct ar_obj *obj) +{ + if (obj->fd == -1) + free(obj->maddr); + else + if (obj->maddr != NULL && munmap(obj->maddr, obj->size)) + bsdar_warnc(bsdar, errno, + "can't munmap file: %s", obj->name); + free(obj->name); + free(obj); +} + +/* * Insert obj to the tail, or before/after the pos obj. */ static void @@ -474,11 +491,8 @@ write_archive(struct bsdar *bsdar, char *av); TAILQ_REMOVE(&bsdar->v_obj, obj, objs); - if (mode == 'd' || mode == 'r') { - free(obj->maddr); - free(obj->name); - free(obj); - } + if (mode == 'd' || mode == 'r') + free_obj(bsdar, obj); if (mode == 'm') insert_obj(bsdar, obj, pos); @@ -525,15 +539,8 @@ write_cleanup(struct bsdar *bsdar) struct ar_obj *obj, *obj_temp; TAILQ_FOREACH_SAFE(obj, &bsdar->v_obj, objs, obj_temp) { - if (obj->fd == -1) - free(obj->maddr); - else - if (obj->maddr != NULL && munmap(obj->maddr, obj->size)) - bsdar_warnc(bsdar, errno, - "can't munmap file: %s", obj->name); TAILQ_REMOVE(&bsdar->v_obj, obj, objs); - free(obj->name); - free(obj); + free_obj(bsdar, obj); } free(bsdar->as); From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 04:58:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20F82106566B; Thu, 11 Aug 2011 04:58:21 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1408FC08; Thu, 11 Aug 2011 04:58: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 p7B4wKac076891; Thu, 11 Aug 2011 04:58:20 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7B4wKaa076887; Thu, 11 Aug 2011 04:58:20 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108110458.p7B4wKaa076887@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 11 Aug 2011 04:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224772 - vendor/one-true-awk/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 04:58:21 -0000 Author: ru Date: Thu Aug 11 04:58:20 2011 New Revision: 224772 URL: http://svn.freebsd.org/changeset/base/224772 Log: Vendor import of bwk's 10-Aug-2011 release. Modified: vendor/one-true-awk/dist/FIXES vendor/one-true-awk/dist/lib.c vendor/one-true-awk/dist/main.c Modified: vendor/one-true-awk/dist/FIXES ============================================================================== --- vendor/one-true-awk/dist/FIXES Thu Aug 11 02:50:18 2011 (r224771) +++ vendor/one-true-awk/dist/FIXES Thu Aug 11 04:58:20 2011 (r224772) @@ -25,6 +25,10 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 10, 2011: + another fix to avoid core dump with -v; again, many thanks + to ruslan ermilov. + Aug 7, 2011: split(s, a, //) now behaves the same as split(s, a, "") Modified: vendor/one-true-awk/dist/lib.c ============================================================================== --- vendor/one-true-awk/dist/lib.c Thu Aug 11 02:50:18 2011 (r224771) +++ vendor/one-true-awk/dist/lib.c Thu Aug 11 04:58:20 2011 (r224772) @@ -89,8 +89,13 @@ void initgetrec(void) char *p; for (i = 1; i < *ARGC; i++) { - if (!isclvar(p = getargv(i))) { /* find 1st real filename */ - setsval(lookup("FILENAME", symtab), getargv(i)); + p = getargv(i); /* find 1st real filename */ + if (p == NULL || *p == '\0') { /* deleted or zapped */ + argno++; + continue; + } + if (!isclvar(p)) { + setsval(lookup("FILENAME", symtab), p); return; } setclvar(p); /* a commandline assignment before filename */ Modified: vendor/one-true-awk/dist/main.c ============================================================================== --- vendor/one-true-awk/dist/main.c Thu Aug 11 02:50:18 2011 (r224771) +++ vendor/one-true-awk/dist/main.c Thu Aug 11 04:58:20 2011 (r224772) @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20110807"; +const char *version = "version 20110810"; #define DEBUG #include From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 10:24:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6D0106566C; Thu, 11 Aug 2011 10:24:09 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC118FC18; Thu, 11 Aug 2011 10:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7BAO9gm088937; Thu, 11 Aug 2011 10:24:09 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BAO9fC088935; Thu, 11 Aug 2011 10:24:09 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108111024.p7BAO9fC088935@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 11 Aug 2011 10:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224775 - vendor/one-true-awk/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 10:24:09 -0000 Author: ru Date: Thu Aug 11 10:24:09 2011 New Revision: 224775 URL: http://svn.freebsd.org/changeset/base/224775 Log: Corrected description of the bugfix; distfile was updated. Modified: vendor/one-true-awk/dist/FIXES Modified: vendor/one-true-awk/dist/FIXES ============================================================================== --- vendor/one-true-awk/dist/FIXES Thu Aug 11 08:51:53 2011 (r224774) +++ vendor/one-true-awk/dist/FIXES Thu Aug 11 10:24:09 2011 (r224775) @@ -26,7 +26,7 @@ This file lists all bug fixes, changes, was sent to the printers in August, 1987. Aug 10, 2011: - another fix to avoid core dump with -v; again, many thanks + another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Aug 7, 2011: From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 10:29:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08950106566C; Thu, 11 Aug 2011 10:29:11 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D280D8FC08; Thu, 11 Aug 2011 10:29: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 p7BATA5t089131; Thu, 11 Aug 2011 10:29:10 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BATA72089126; Thu, 11 Aug 2011 10:29:10 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201108111029.p7BATA72089126@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 11 Aug 2011 10:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224776 - in head: . contrib/one-true-awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 10:29:11 -0000 Author: ru Date: Thu Aug 11 10:29:10 2011 New Revision: 224776 URL: http://svn.freebsd.org/changeset/base/224776 Log: - Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk. - Provide a build aid for those who already have a buggy awk(1) installed. Approved by: re (kib) Modified: head/Makefile.inc1 head/contrib/one-true-awk/FIXES head/contrib/one-true-awk/lib.c head/contrib/one-true-awk/main.c Directory Properties: head/contrib/one-true-awk/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Aug 11 10:24:09 2011 (r224775) +++ head/Makefile.inc1 Thu Aug 11 10:29:10 2011 (r224776) @@ -1014,6 +1014,10 @@ _lex= usr.bin/lex _yacc= usr.bin/yacc .endif +.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 +_awk= usr.bin/awk +.endif + .if ${BOOTSTRAPPING} < 700018 _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif @@ -1052,6 +1056,7 @@ bootstrap-tools: ${_groff} \ ${_ar} \ ${_dtc} \ + ${_awk} \ usr.bin/lorder \ usr.bin/makewhatis \ ${_mklocale} \ Modified: head/contrib/one-true-awk/FIXES ============================================================================== --- head/contrib/one-true-awk/FIXES Thu Aug 11 10:24:09 2011 (r224775) +++ head/contrib/one-true-awk/FIXES Thu Aug 11 10:29:10 2011 (r224776) @@ -25,6 +25,10 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 10, 2011: + another fix to avoid core dump with delete(ARGV); again, many thanks + to ruslan ermilov. + Aug 7, 2011: split(s, a, //) now behaves the same as split(s, a, "") Modified: head/contrib/one-true-awk/lib.c ============================================================================== --- head/contrib/one-true-awk/lib.c Thu Aug 11 10:24:09 2011 (r224775) +++ head/contrib/one-true-awk/lib.c Thu Aug 11 10:29:10 2011 (r224776) @@ -89,8 +89,13 @@ void initgetrec(void) char *p; for (i = 1; i < *ARGC; i++) { - if (!isclvar(p = getargv(i))) { /* find 1st real filename */ - setsval(lookup("FILENAME", symtab), getargv(i)); + p = getargv(i); /* find 1st real filename */ + if (p == NULL || *p == '\0') { /* deleted or zapped */ + argno++; + continue; + } + if (!isclvar(p)) { + setsval(lookup("FILENAME", symtab), p); return; } setclvar(p); /* a commandline assignment before filename */ Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Thu Aug 11 10:24:09 2011 (r224775) +++ head/contrib/one-true-awk/main.c Thu Aug 11 10:29:10 2011 (r224776) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110807 (FreeBSD)"; +const char *version = "version 20110810 (FreeBSD)"; #define DEBUG #include From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 11:30:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B1D1065672; Thu, 11 Aug 2011 11:30:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52298FC1A; Thu, 11 Aug 2011 11:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7BBULad091006; Thu, 11 Aug 2011 11:30:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BBULUb091001; Thu, 11 Aug 2011 11:30:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201108111130.p7BBULUb091001@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 11 Aug 2011 11:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224777 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 11:30:22 -0000 Author: hselasky Date: Thu Aug 11 11:30:21 2011 New Revision: 224777 URL: http://svn.freebsd.org/changeset/base/224777 Log: Use synchronous device destruction instead of asynchronous, so that a new device having the same name like a previous one is not created before the old one is gone. This fixes some panics due to asserts in the devfs code which were added recently. Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Aug 11 10:29:10 2011 (r224776) +++ head/sys/dev/usb/usb_dev.c Thu Aug 11 11:30:21 2011 (r224777) @@ -1648,7 +1648,6 @@ usb_fifo_attach(struct usb_device *udev, struct usb_fifo *f_rx; char devname[32]; uint8_t n; - struct usb_fs_privdata* pd; f_sc->fp[USB_FIFO_TX] = NULL; f_sc->fp[USB_FIFO_RX] = NULL; @@ -1746,22 +1745,10 @@ usb_fifo_attach(struct usb_device *udev, usb_alloc_symlink(devname); } - /* - * Initialize device private data - this is used to find the - * actual USB device itself. - */ - pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV, M_WAITOK | M_ZERO); - pd->bus_index = device_get_unit(udev->bus->bdev); - pd->dev_index = udev->device_index; - pd->ep_addr = -1; /* not an endpoint */ - pd->fifo_index = f_tx->fifo_index & f_rx->fifo_index; - pd->mode = FREAD|FWRITE; - - /* Now, create the device itself */ - f_sc->dev = make_dev(&usb_devsw, 0, uid, gid, mode, - "%s", devname); - /* XXX setting si_drv1 and creating the device is not atomic! */ - f_sc->dev->si_drv1 = pd; + /* Create the device */ + f_sc->dev = usb_make_dev(udev, devname, -1, + f_tx->fifo_index & f_rx->fifo_index, + FREAD|FWRITE, uid, gid, mode); } DPRINTFN(2, "attached %p/%p\n", f_tx, f_rx); @@ -1814,12 +1801,6 @@ usb_fifo_free_buffer(struct usb_fifo *f) bzero(&f->used_q, sizeof(f->used_q)); } -static void -usb_fifo_cleanup(void* ptr) -{ - free(ptr, M_USBDEV); -} - void usb_fifo_detach(struct usb_fifo_sc *f_sc) { @@ -1832,11 +1813,9 @@ usb_fifo_detach(struct usb_fifo_sc *f_sc f_sc->fp[USB_FIFO_TX] = NULL; f_sc->fp[USB_FIFO_RX] = NULL; - if (f_sc->dev != NULL) { - destroy_dev_sched_cb(f_sc->dev, - usb_fifo_cleanup, f_sc->dev->si_drv1); - f_sc->dev = NULL; - } + usb_destroy_dev(f_sc->dev); + + f_sc->dev = NULL; DPRINTFN(2, "detached %p\n", f_sc); } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Aug 11 10:29:10 2011 (r224776) +++ head/sys/dev/usb/usb_device.c Thu Aug 11 11:30:21 2011 (r224777) @@ -102,10 +102,8 @@ static void usb_notify_addq(const char * #endif #if USB_HAVE_UGEN static void usb_fifo_free_wrap(struct usb_device *, uint8_t, uint8_t); -static struct cdev *usb_make_dev(struct usb_device *, int, int); static void usb_cdev_create(struct usb_device *); static void usb_cdev_free(struct usb_device *); -static void usb_cdev_cleanup(void *); #endif /* This variable is global to allow easy access to it: */ @@ -1626,10 +1624,12 @@ usb_alloc_device(device_t parent_dev, st LIST_INIT(&udev->pd_list); /* Create the control endpoint device */ - udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE); + udev->ctrl_dev = usb_make_dev(udev, NULL, 0, 0, + FREAD|FWRITE, UID_ROOT, GID_OPERATOR, 0600); /* Create a link from /dev/ugenX.X to the default endpoint */ - make_dev_alias(udev->ctrl_dev, "%s", udev->ugen_name); + if (udev->ctrl_dev != NULL) + make_dev_alias(udev->ctrl_dev->cdev, "%s", udev->ugen_name); #endif /* Initialise device */ if (bus->methods->device_init != NULL) { @@ -1884,11 +1884,12 @@ done: } #if USB_HAVE_UGEN -static struct cdev * -usb_make_dev(struct usb_device *udev, int ep, int mode) +struct usb_fs_privdata * +usb_make_dev(struct usb_device *udev, const char *devname, int ep, + int fi, int rwmode, uid_t uid, gid_t gid, int mode) { struct usb_fs_privdata* pd; - char devname[20]; + char buffer[32]; /* Store information to locate ourselves again later */ pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV, @@ -1896,16 +1897,39 @@ usb_make_dev(struct usb_device *udev, in pd->bus_index = device_get_unit(udev->bus->bdev); pd->dev_index = udev->device_index; pd->ep_addr = ep; - pd->mode = mode; + pd->fifo_index = fi; + pd->mode = rwmode; /* Now, create the device itself */ - snprintf(devname, sizeof(devname), "%u.%u.%u", - pd->bus_index, pd->dev_index, pd->ep_addr); - pd->cdev = make_dev(&usb_devsw, 0, UID_ROOT, - GID_OPERATOR, 0600, USB_DEVICE_DIR "/%s", devname); + if (devname == NULL) { + devname = buffer; + snprintf(buffer, sizeof(buffer), USB_DEVICE_DIR "/%u.%u.%u", + pd->bus_index, pd->dev_index, pd->ep_addr); + } + + pd->cdev = make_dev(&usb_devsw, 0, uid, gid, mode, "%s", devname); + + if (pd->cdev == NULL) { + DPRINTFN(0, "Failed to create device %s\n", devname); + free(pd, M_USBDEV); + return (NULL); + } + + /* XXX setting si_drv1 and creating the device is not atomic! */ pd->cdev->si_drv1 = pd; - return (pd->cdev); + return (pd); +} + +void +usb_destroy_dev(struct usb_fs_privdata *pd) +{ + if (pd == NULL) + return; + + destroy_dev(pd->cdev); + + free(pd, M_USBDEV); } static void @@ -1915,7 +1939,6 @@ usb_cdev_create(struct usb_device *udev) struct usb_endpoint_descriptor *ed; struct usb_descriptor *desc; struct usb_fs_privdata* pd; - struct cdev *dev; int inmode, outmode, inmask, outmask, mode; uint8_t ep; @@ -1957,14 +1980,16 @@ usb_cdev_create(struct usb_device *udev) /* Create all available endpoints except EP0 */ for (ep = 1; ep < 16; ep++) { - mode = inmask & (1 << ep) ? inmode : 0; - mode |= outmask & (1 << ep) ? outmode : 0; + mode = (inmask & (1 << ep)) ? inmode : 0; + mode |= (outmask & (1 << ep)) ? outmode : 0; if (mode == 0) continue; /* no IN or OUT endpoint */ - dev = usb_make_dev(udev, ep, mode); - pd = dev->si_drv1; - LIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); + pd = usb_make_dev(udev, NULL, ep, 0, + mode, UID_ROOT, GID_OPERATOR, 0600); + + if (pd != NULL) + LIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); } } @@ -1972,25 +1997,16 @@ static void usb_cdev_free(struct usb_device *udev) { struct usb_fs_privdata* pd; - struct cdev* pcdev; DPRINTFN(2, "Freeing device nodes\n"); while ((pd = LIST_FIRST(&udev->pd_list)) != NULL) { KASSERT(pd->cdev->si_drv1 == pd, ("privdata corrupt")); - pcdev = pd->cdev; - pd->cdev = NULL; LIST_REMOVE(pd, pd_next); - if (pcdev != NULL) - destroy_dev_sched_cb(pcdev, usb_cdev_cleanup, pd); - } -} -static void -usb_cdev_cleanup(void* arg) -{ - free(arg, M_USBDEV); + usb_destroy_dev(pd); + } } #endif @@ -2046,8 +2062,7 @@ usb_free_device(struct usb_device *udev, } mtx_unlock(&usb_ref_lock); - destroy_dev_sched_cb(udev->ctrl_dev, usb_cdev_cleanup, - udev->ctrl_dev->si_drv1); + usb_destroy_dev(udev->ctrl_dev); #endif if (udev->flags.usb_mode == USB_MODE_DEVICE) { Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Thu Aug 11 10:29:10 2011 (r224776) +++ head/sys/dev/usb/usb_device.h Thu Aug 11 11:30:21 2011 (r224777) @@ -29,6 +29,7 @@ struct usb_symlink; /* UGEN */ struct usb_device; /* linux compat */ +struct usb_fs_privdata; #define USB_CTRL_XFER_MAX 2 @@ -135,7 +136,7 @@ struct usb_device { #if USB_HAVE_UGEN struct usb_fifo *fifo[USB_FIFO_MAX]; struct usb_symlink *ugen_symlink; /* our generic symlink */ - struct cdev *ctrl_dev; /* Control Endpoint 0 device node */ + struct usb_fs_privdata *ctrl_dev; /* Control Endpoint 0 device node */ LIST_HEAD(,usb_fs_privdata) pd_list; char ugen_name[20]; /* name of ugenX.X device */ #endif @@ -202,6 +203,11 @@ struct usb_device *usb_alloc_device(devi struct usb_device *parent_hub, uint8_t depth, uint8_t port_index, uint8_t port_no, enum usb_dev_speed speed, enum usb_hc_mode mode); +#if USB_HAVE_UGEN +struct usb_fs_privdata *usb_make_dev(struct usb_device *, const char *, + int, int, int, uid_t, gid_t, int); +void usb_destroy_dev(struct usb_fs_privdata *); +#endif usb_error_t usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index); void usb_detach_device(struct usb_device *, uint8_t, uint8_t); Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Aug 11 10:29:10 2011 (r224776) +++ head/sys/dev/usb/usbdi.h Thu Aug 11 11:30:21 2011 (r224777) @@ -37,6 +37,7 @@ struct usb_page_search; struct usb_process; struct usb_proc_msg; struct usb_mbuf; +struct usb_fs_privdata; struct mbuf; typedef enum { /* keep in sync with usb_errstr_table */ @@ -449,7 +450,7 @@ struct usb_fifo_methods { struct usb_fifo_sc { struct usb_fifo *fp[2]; - struct cdev* dev; + struct usb_fs_privdata *dev; }; const char *usbd_errstr(usb_error_t error); From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 12:30:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29E7E106568C; Thu, 11 Aug 2011 12:30:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 152118FC0C; Thu, 11 Aug 2011 12:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7BCUOY2092865; Thu, 11 Aug 2011 12:30:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BCUNnS092831; Thu, 11 Aug 2011 12:30:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108111230.p7BCUNnS092831@svn.freebsd.org> From: Robert Watson Date: Thu, 11 Aug 2011 12:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224778 - in head: sys/amd64/linux32 sys/cddl/compat/opensolaris/sys sys/compat/freebsd32 sys/compat/linux sys/compat/svr4 sys/dev/aac sys/dev/amr sys/dev/hwpmc sys/dev/ipmi sys/dev/isc... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 12:30:24 -0000 Author: rwatson Date: Thu Aug 11 12:30:23 2011 New Revision: 224778 URL: http://svn.freebsd.org/changeset/base/224778 Log: Second-to-last commit implementing Capsicum capabilities in the FreeBSD kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/cddl/compat/opensolaris/sys/file.h head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_stats.c head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/svr4_filio.c head/sys/compat/svr4/svr4_ioctl.c head/sys/compat/svr4/svr4_misc.c head/sys/compat/svr4/svr4_stream.c head/sys/dev/aac/aac_linux.c head/sys/dev/amr/amr_linux.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/ipmi/ipmi_linux.c head/sys/dev/iscsi/initiator/iscsi.c head/sys/dev/mfi/mfi_linux.c head/sys/dev/snp/snp.c head/sys/dev/tdfx/tdfx_linux.c head/sys/fs/coda/coda_psdev.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/portalfs/portal_vfsops.c head/sys/fs/portalfs/portal_vnops.c head/sys/gnu/fs/xfs/xfs_dfrag.c head/sys/i386/ibcs2/ibcs2_fcntl.c head/sys/i386/ibcs2/ibcs2_ioctl.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/i386/linux/linux_machdep.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/kern_exec.c head/sys/kern/sys_capability.c head/sys/kern/sys_generic.c head/sys/kern/tty.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/netgraph/ng_socket.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/security/audit/audit_arg.c head/sys/security/mac/mac_syscalls.c head/sys/sys/capability.h head/sys/sys/file.h head/sys/sys/filedesc.h head/sys/ufs/ffs/ffs_alloc.c head/sys/vm/vm_mmap.c head/tools/regression/security/cap_test/cap_test.c head/tools/regression/security/cap_test/cap_test_capabilities.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/amd64/linux32/linux32_machdep.c Thu Aug 11 12:30:23 2011 (r224778) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -566,7 +567,7 @@ linux_mmap_common(struct thread *td, l_u * protection options specified. */ - if ((error = fget(td, bsd_args.fd, &fp)) != 0) + if ((error = fget(td, bsd_args.fd, CAP_MMAP, &fp)) != 0) return (error); if (fp->f_type != DTYPE_VNODE) { fdrop(fp, td); Modified: head/sys/cddl/compat/opensolaris/sys/file.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/file.h Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/cddl/compat/opensolaris/sys/file.h Thu Aug 11 12:30:23 2011 (r224778) @@ -36,12 +36,18 @@ #ifdef _KERNEL typedef struct file file_t; +#include + static __inline file_t * getf(int fd) { struct file *fp; - if (fget(curthread, fd, &fp) == 0) + /* + * We wouldn't need all of these rights on every invocation + * if we had more information about intent. + */ + if (fget(curthread, fd, CAP_READ | CAP_WRITE | CAP_SEEK, &fp) == 0) return (fp); return (NULL); } @@ -51,7 +57,8 @@ releasef(int fd) { struct file *fp; - if (fget(curthread, fd, &fp) == 0) { + /* No CAP_ rights required, as we're only releasing. */ + if (fget(curthread, fd, 0, &fp) == 0) { fdrop(fp, curthread); fdrop(fp, curthread); } Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include +#include #include #include #include @@ -354,7 +355,7 @@ freebsd32_ioctl(struct thread *td, struc struct file *fp; int error; - if ((error = fget(td, uap->fd, &fp)) != 0) + if ((error = fget(td, uap->fd, CAP_IOCTL, &fp)) != 0) return (error); if ((fp->f_flag & (FREAD | FWRITE)) == 0) { fdrop(fp, td); Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/linux/linux_file.c Thu Aug 11 12:30:23 2011 (r224778) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -141,7 +142,7 @@ linux_common_open(struct thread *td, int * having the same filedesc could use that fd without * checking below. */ - error = fget(td, fd, &fp); + error = fget(td, fd, CAP_IOCTL, &fp); if (!error) { sx_slock(&proctree_lock); PROC_LOCK(p); @@ -345,7 +346,7 @@ getdents_common(struct thread *td, struc } else justone = 0; - if ((error = getvnode(td->td_proc->p_fd, args->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, args->fd, CAP_READ, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -1041,7 +1042,7 @@ linux_pread(td, uap) if (error == 0) { /* This seems to violate POSIX but linux does it */ - if ((error = fgetvp(td, uap->fd, &vp)) != 0) + if ((error = fgetvp(td, uap->fd, CAP_READ, &vp)) != 0) return (error); if (vp->v_type == VDIR) { vrele(vp); @@ -1390,7 +1391,7 @@ fcntl_common(struct thread *td, struct l * significant effect for pipes (SIGIO is not delivered for * pipes under Linux-2.2.35 at least). */ - error = fget(td, args->fd, &fp); + error = fget(td, args->fd, CAP_FCNTL, &fp); if (error) return (error); if (fp->f_type == DTYPE_PIPE) { Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/linux/linux_ioctl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -193,7 +194,7 @@ linux_ioctl_hdio(struct thread *td, stru u_int sectorsize, fwcylinders, fwheads, fwsectors; off_t mediasize, bytespercyl; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); switch (args->cmd & 0xffff) { case LINUX_HDIO_GET_GEO: @@ -274,7 +275,7 @@ linux_ioctl_disk(struct thread *td, stru u_int sectorsize; off_t mediasize; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); switch (args->cmd & 0xffff) { case LINUX_BLKGETSIZE: @@ -700,7 +701,7 @@ linux_ioctl_termio(struct thread *td, st struct file *fp; int error; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); switch (args->cmd & 0xffff) { @@ -1440,7 +1441,7 @@ linux_ioctl_cdrom(struct thread *td, str struct file *fp; int error; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); switch (args->cmd & 0xffff) { @@ -1965,7 +1966,7 @@ linux_ioctl_console(struct thread *td, s struct file *fp; int error; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); switch (args->cmd & 0xffff) { @@ -2356,7 +2357,7 @@ linux_ioctl_socket(struct thread *td, st ifp = NULL; error = 0; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); type = fp->f_type; fdrop(fp, td); @@ -2582,7 +2583,7 @@ linux_ioctl_private(struct thread *td, s struct file *fp; int error, type; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); type = fp->f_type; fdrop(fp, td); @@ -2608,7 +2609,7 @@ linux_ioctl_sg(struct thread *td, struct u_long cmd; int error; - if ((error = fget(td, args->fd, &fp)) != 0) { + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) { printf("sg_linux_ioctl: fget returned %d\n", error); return (error); } @@ -2843,7 +2844,7 @@ linux_ioctl_v4l(struct thread *td, struc case LINUX_VIDIOCSCHAN: args->cmd = VIDIOCSCHAN; break; case LINUX_VIDIOCGTUNER: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = copyin((void *) args->arg, &l_vtun, sizeof(l_vtun)); if (error) { @@ -2861,7 +2862,7 @@ linux_ioctl_v4l(struct thread *td, struc return (error); case LINUX_VIDIOCSTUNER: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = copyin((void *) args->arg, &l_vtun, sizeof(l_vtun)); if (error) { @@ -2878,7 +2879,7 @@ linux_ioctl_v4l(struct thread *td, struc case LINUX_VIDIOCCAPTURE: args->cmd = VIDIOCCAPTURE; break; case LINUX_VIDIOCGWIN: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, td); if (!error) { @@ -2890,7 +2891,7 @@ linux_ioctl_v4l(struct thread *td, struc return (error); case LINUX_VIDIOCSWIN: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = copyin((void *) args->arg, &l_vwin, sizeof(l_vwin)); if (error) { @@ -2913,7 +2914,7 @@ linux_ioctl_v4l(struct thread *td, struc return (error); case LINUX_VIDIOCGFBUF: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, td); if (!error) { @@ -2925,7 +2926,7 @@ linux_ioctl_v4l(struct thread *td, struc return (error); case LINUX_VIDIOCSFBUF: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = copyin((void *) args->arg, &l_vbuf, sizeof(l_vbuf)); if (error) { @@ -2953,7 +2954,7 @@ linux_ioctl_v4l(struct thread *td, struc case LINUX_VIDIOCGPLAYINFO: args->cmd = VIDIOCGPLAYINFO; break; case LINUX_VIDIOCSMICROCODE: - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = copyin((void *) args->arg, &l_vcode, sizeof(l_vcode)); if (error) { @@ -3197,7 +3198,7 @@ linux_ioctl_v4l2(struct thread *td, stru error = copyin((void *)args->arg, &l_vformat, sizeof(l_vformat)); if (error) return (error); - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != 0) error = EINVAL; @@ -3220,7 +3221,7 @@ linux_ioctl_v4l2(struct thread *td, stru if (error) return (error); linux_to_bsd_v4l2_standard(&l_vstd, &vstd); - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, td->td_ucred, td); @@ -3242,7 +3243,7 @@ linux_ioctl_v4l2(struct thread *td, stru sizeof(struct l_v4l2_input)); if (error != 0) return (error); - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, td->td_ucred, td); @@ -3261,7 +3262,7 @@ linux_ioctl_v4l2(struct thread *td, stru error = copyin((void *)args->arg, &l_vbuf, sizeof(l_vbuf)); if (error) return (error); - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); if ((args->cmd & 0xffff) == LINUX_VIDIOC_QUERYBUF) @@ -3431,7 +3432,7 @@ linux_ioctl(struct thread *td, struct li (unsigned long)args->cmd); #endif - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); if ((fp->f_flag & (FREAD|FWRITE)) == 0) { fdrop(fp, td); Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/linux/linux_socket.c Thu Aug 11 12:30:23 2011 (r224778) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -743,7 +744,7 @@ linux_connect(struct thread *td, struct * socket and use the file descriptor reference instead of * creating a new one. */ - error = fgetsock(td, args->s, &so, &fflag); + error = fgetsock(td, args->s, CAP_CONNECT, &so, &fflag); if (error == 0) { error = EISCONN; if (fflag & FNONBLOCK) { Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/linux/linux_stats.c Thu Aug 11 12:30:23 2011 (r224778) @@ -141,8 +141,11 @@ translate_fd_major_minor(struct thread * struct vnode *vp; int major, minor; + /* + * No capability rights required here. + */ if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || - fget(td, fd, &fp) != 0) + fget(td, fd, 0, &fp) != 0) return; vp = fp->f_vnode; if (vp != NULL && vp->v_rdev != NULL && Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/svr4/svr4_fcntl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -261,7 +262,17 @@ fd_revoke(td, fd) int error, *retval; retval = td->td_retval; - if ((error = fgetvp(td, fd, &vp)) != 0) + /* + * If we ever want to support Capsicum on SVR4 processes (unlikely) + * or FreeBSD grows a native frevoke() (more likely), we will need a + * CAP_REVOKE here. + * + * In the meantime, use CAP_MASK_VALID: if a SVR4 process wants to + * do an frevoke(), it needs to do it on either a regular file + * descriptor or a fully-privileged capability (which is effectively + * the same as a non-capability-restricted file descriptor). + */ + if ((error = fgetvp(td, fd, CAP_MASK_VALID, &vp)) != 0) return (error); if (vp->v_type != VCHR && vp->v_type != VBLK) { @@ -313,7 +324,7 @@ fd_truncate(td, fd, flp) /* * We only support truncating the file. */ - if ((error = fget(td, fd, &fp)) != 0) + if ((error = fget(td, fd, CAP_FTRUNCATE, &fp)) != 0) return (error); vp = fp->f_vnode; @@ -392,7 +403,7 @@ svr4_sys_open(td, uap) #if defined(NOTYET) struct file *fp; - error = fget(td, retval, &fp); + error = fget(td, retval, CAP_IOCTL, &fp); PROC_UNLOCK(p); /* * we may have lost a race the above open() and Modified: head/sys/compat/svr4/svr4_filio.c ============================================================================== --- head/sys/compat/svr4/svr4_filio.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/svr4/svr4_filio.c Thu Aug 11 12:30:23 2011 (r224778) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,7 +114,7 @@ svr4_sys_read(td, uap) ra.buf = uap->buf; ra.nbyte = uap->nbyte; - if (fget(td, uap->fd, &fp) != 0) { + if (fget(td, uap->fd, CAP_READ, &fp) != 0) { DPRINTF(("Something fishy with the user-supplied file descriptor...\n")); return EBADF; } Modified: head/sys/compat/svr4/svr4_ioctl.c ============================================================================== --- head/sys/compat/svr4/svr4_ioctl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/svr4/svr4_ioctl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -102,7 +103,7 @@ svr4_sys_ioctl(td, uap) retval = td->td_retval; cmd = uap->com; - if ((error = fget(td, uap->fd, &fp)) != 0) + if ((error = fget(td, uap->fd, CAP_IOCTL, &fp)) != 0) return (error); if ((fp->f_flag & (FREAD | FWRITE)) == 0) { Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/svr4/svr4_misc.c Thu Aug 11 12:30:23 2011 (r224778) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -246,7 +247,8 @@ svr4_sys_getdents64(td, uap) DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", uap->fd, uap->nbytes)); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) { + if ((error = getvnode(td->td_proc->p_fd, uap->fd, + CAP_READ | CAP_SEEK, &fp)) != 0) { return (error); } @@ -427,7 +429,8 @@ svr4_sys_getdents(td, uap) if (uap->nbytes < 0) return (EINVAL); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, + CAP_READ | CAP_SEEK, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -615,7 +618,8 @@ svr4_sys_fchroot(td, uap) if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0) return error; - if ((error = getvnode(fdp, uap->fd, &fp)) != 0) + /* XXX: we have the chroot priv... what cap might we need? all? */ + if ((error = getvnode(fdp, uap->fd, 0, &fp)) != 0) return error; vp = fp->f_vnode; VREF(vp); Modified: head/sys/compat/svr4/svr4_stream.c ============================================================================== --- head/sys/compat/svr4/svr4_stream.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/compat/svr4/svr4_stream.c Thu Aug 11 12:30:23 2011 (r224778) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1448,7 +1449,7 @@ svr4_sys_putmsg(td, uap) struct file *fp; int error; - if ((error = fget(td, uap->fd, &fp)) != 0) { + if ((error = fget(td, uap->fd, CAP_WRITE, &fp)) != 0) { #ifdef DEBUG_SVR4 uprintf("putmsg: bad fp\n"); #endif @@ -1620,7 +1621,7 @@ svr4_sys_getmsg(td, uap) struct file *fp; int error; - if ((error = fget(td, uap->fd, &fp)) != 0) { + if ((error = fget(td, uap->fd, CAP_READ, &fp)) != 0) { #ifdef DEBUG_SVR4 uprintf("getmsg: bad fp\n"); #endif Modified: head/sys/dev/aac/aac_linux.c ============================================================================== --- head/sys/dev/aac/aac_linux.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/aac/aac_linux.c Thu Aug 11 12:30:23 2011 (r224778) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,7 +79,7 @@ aac_linux_ioctl(struct thread *td, struc u_long cmd; int error; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); cmd = args->cmd; Modified: head/sys/dev/amr/amr_linux.c ============================================================================== --- head/sys/dev/amr/amr_linux.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/amr/amr_linux.c Thu Aug 11 12:30:23 2011 (r224778) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -74,7 +75,7 @@ amr_linux_ioctl(struct thread *p, struct struct file *fp; int error; - if ((error = fget(p, args->fd, &fp)) != 0) + if ((error = fget(p, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, args->cmd, (caddr_t)args->arg, p->td_ucred, p); fdrop(fp, p); Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/hwpmc/hwpmc_logging.c Thu Aug 11 12:30:23 2011 (r224778) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -589,7 +590,7 @@ pmclog_configure_log(struct pmc_mdep *md po->po_file)); /* get a reference to the file state */ - error = fget_write(curthread, logfd, &po->po_file); + error = fget_write(curthread, logfd, CAP_WRITE, &po->po_file); if (error) goto error; Modified: head/sys/dev/ipmi/ipmi_linux.c ============================================================================== --- head/sys/dev/ipmi/ipmi_linux.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/ipmi/ipmi_linux.c Thu Aug 11 12:30:23 2011 (r224778) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -92,7 +93,7 @@ ipmi_linux_ioctl(struct thread *td, stru u_long cmd; int error; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); cmd = args->cmd; Modified: head/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/iscsi/initiator/iscsi.c Thu Aug 11 12:30:23 2011 (r224778) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_iscsi_initiator.h" #include +#include #include #include #include @@ -387,11 +388,11 @@ i_setsoc(isc_session_t *sp, int fd, stru if(sp->soc != NULL) isc_stop_receiver(sp); - error = fget(td, fd, &sp->fp); + error = fget(td, fd, CAP_SOCK_ALL, &sp->fp); if(error) return error; - if((error = fgetsock(td, fd, &sp->soc, 0)) == 0) { + if((error = fgetsock(td, fd, CAP_SOCK_ALL, &sp->soc, 0)) == 0) { sp->td = td; isc_start_receiver(sp); } Modified: head/sys/dev/mfi/mfi_linux.c ============================================================================== --- head/sys/dev/mfi/mfi_linux.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/mfi/mfi_linux.c Thu Aug 11 12:30:23 2011 (r224778) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -95,7 +96,7 @@ mfi_linux_ioctl(struct thread *p, struct break; } - if ((error = fget(p, args->fd, &fp)) != 0) + if ((error = fget(p, args->fd, CAP_IOCTL, &fp)) != 0) return (error); error = fo_ioctl(fp, cmd, (caddr_t)args->arg, p->td_ucred, p); fdrop(fp, p); Modified: head/sys/dev/snp/snp.c ============================================================================== --- head/sys/dev/snp/snp.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/snp/snp.c Thu Aug 11 12:30:23 2011 (r224778) @@ -252,6 +252,9 @@ snp_ioctl(struct cdev *dev, u_long cmd, SNP_UNLOCK(); return (EBUSY); } + /* + * XXXRW / XXXJA: no capability check here. + */ error = ttyhook_register(&ss->snp_tty, td->td_proc, *(int *)data, &snp_hook, ss); SNP_UNLOCK(); Modified: head/sys/dev/tdfx/tdfx_linux.c ============================================================================== --- head/sys/dev/tdfx/tdfx_linux.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/dev/tdfx/tdfx_linux.c Thu Aug 11 12:30:23 2011 (r224778) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -53,7 +54,7 @@ linux_ioctl_tdfx(struct thread *td, stru struct file *fp; - if ((error = fget(td, args->fd, &fp)) != 0) + if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0) return (error); /* We simply copy the data and send it right to ioctl */ copyin((caddr_t)args->arg, &d_pio, sizeof(d_pio)); Modified: head/sys/fs/coda/coda_psdev.c ============================================================================== --- head/sys/fs/coda/coda_psdev.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/coda/coda_psdev.c Thu Aug 11 12:30:23 2011 (r224778) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -371,7 +372,7 @@ vc_write(struct cdev *dev, struct uio *u struct vnode *vp = NULL; if (tmp->oh.result == 0) { - error = getvnode(uiop->uio_td->td_proc->p_fd, + error = getvnode(uiop->uio_td->td_proc->p_fd, CAP_WRITE, tmp->fd, &fp); if (!error) { /* Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/fdescfs/fdesc_vnops.c Thu Aug 11 12:30:23 2011 (r224778) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -305,7 +306,10 @@ fdesc_lookup(ap) fd = fd1; } - if ((error = fget(td, fd, &fp)) != 0) + /* + * No rights to check since 'fp' isn't actually used. + */ + if ((error = fget(td, fd, 0, &fp)) != 0) goto bad; /* Check if we're looking up ourselves. */ @@ -455,7 +459,7 @@ fdesc_setattr(ap) /* * Allow setattr where there is an underlying vnode. */ - error = getvnode(td->td_proc->p_fd, fd, &fp); + error = getvnode(td->td_proc->p_fd, fd, CAP_EXTATTR_SET, &fp); if (error) { /* * getvnode() returns EINVAL if the file descriptor is not Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/nfsclient/nfs_clport.c Thu Aug 11 12:30:23 2011 (r224778) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include "opt_kdtrace.h" +#include + /* * generally, I don't like #includes inside .h files, but it seems to * be the easiest way to handle the port. @@ -1231,7 +1233,13 @@ nfssvc_nfscl(struct thread *td, struct n error = copyin(uap->argp, (caddr_t)&nfscbdarg, sizeof(nfscbdarg)); if (error) return (error); - if ((error = fget(td, nfscbdarg.sock, &fp)) != 0) { + /* + * Since we don't know what rights might be required, + * pretend that we need them all. It is better to be too + * careful than too reckless. + */ + if ((error = fget(td, nfscbdarg.sock, CAP_SOCK_ALL, &fp)) + != 0) { return (error); } if (fp->f_type != DTYPE_SOCKET) { Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Aug 11 12:30:23 2011 (r224778) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include + /* * Functions that perform the vfs operations required by the routines in * nfsd_serv.c. It is hoped that this change will make the server more @@ -3027,8 +3029,14 @@ nfssvc_nfsd(struct thread *td, struct nf error = copyin(uap->argp, (caddr_t)&sockarg, sizeof (sockarg)); if (error) goto out; - if ((error = fget(td, sockarg.sock, &fp)) != 0) + /* + * Since we don't know what rights might be required, + * pretend that we need them all. It is better to be too + * careful than too reckless. + */ + if ((error = fget(td, sockarg.sock, CAP_SOCK_ALL, &fp)) != 0) goto out; + return (error); if (fp->f_type != DTYPE_SOCKET) { fdrop(fp, td); error = EPERM; Modified: head/sys/fs/portalfs/portal_vfsops.c ============================================================================== --- head/sys/fs/portalfs/portal_vfsops.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/portalfs/portal_vfsops.c Thu Aug 11 12:30:23 2011 (r224778) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -112,7 +113,12 @@ portal_mount(struct mount *mp) if (error) return (error); - if ((error = fget(td, v, &fp)) != 0) + /* + * Capsicum is not incompatible with portalfs, but we don't really + * know what rights are required. In the spirit of "better safe than + * sorry", pretend that all rights are required for now. + */ + if ((error = fget(td, v, CAP_MASK_VALID, &fp)) != 0) return (error); if (fp->f_type != DTYPE_SOCKET) { fdrop(fp, td); Modified: head/sys/fs/portalfs/portal_vnops.c ============================================================================== --- head/sys/fs/portalfs/portal_vnops.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/fs/portalfs/portal_vnops.c Thu Aug 11 12:30:23 2011 (r224778) @@ -38,7 +38,10 @@ * Portal Filesystem */ +#include "opt_capsicum.h" + #include +#include #include #include #include @@ -232,6 +235,15 @@ portal_open(ap) struct file *fp; struct portal_cred pcred; +#ifdef CAPABILITY_MODE + /* + * This may require access to a global namespace (e.g. an IP address); + * disallow it entirely, as we do open(2). + */ + if (IN_CAPABILITY_MODE(td)) + return (ECAPMODE); +#endif + /* * Nothing to do when opening the root node. */ @@ -414,7 +426,7 @@ portal_open(ap) * Check that the mode the file is being opened for is a subset * of the mode of the existing descriptor. */ - if ((error = fget(td, fd, &fp)) != 0) + if ((error = fget(td, fd, 0, &fp)) != 0) goto bad; if (((ap->a_mode & (FREAD|FWRITE)) | fp->f_flag) != fp->f_flag) { fdrop(fp, td); Modified: head/sys/gnu/fs/xfs/xfs_dfrag.c ============================================================================== --- head/sys/gnu/fs/xfs/xfs_dfrag.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/gnu/fs/xfs/xfs_dfrag.c Thu Aug 11 12:30:23 2011 (r224778) @@ -46,6 +46,7 @@ #include "xfs_mac.h" #include "xfs_rw.h" +#include #include /* @@ -79,7 +80,8 @@ xfs_swapext( } /* Pull information for the target fd */ - if (fgetvp(td, (int)sxp->sx_fdtarget, &bvp) != 0) { + if (fgetvp(td, (int)sxp->sx_fdtarget, CAP_READ | CAP_WRITE, &bvp) + != 0) { error = XFS_ERROR(EINVAL); goto error0; } @@ -91,7 +93,7 @@ xfs_swapext( goto error0; } - if (fgetvp(td, (int)sxp->sx_fdtmp, &btvp) != 0) { + if (fgetvp(td, (int)sxp->sx_fdtmp, CAP_READ | CAP_WRITE, &btvp) != 0) { error = XFS_ERROR(EINVAL); goto error0; } Modified: head/sys/i386/ibcs2/ibcs2_fcntl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_fcntl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/i386/ibcs2/ibcs2_fcntl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -203,7 +204,7 @@ ibcs2_open(td, uap) struct file *fp; int error; - error = fget(td, td->td_retval[0], &fp); + error = fget(td, td->td_retval[0], CAP_IOCTL, &fp); PROC_UNLOCK(p); if (error) return (EBADF); Modified: head/sys/i386/ibcs2/ibcs2_ioctl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_ioctl.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/i386/ibcs2/ibcs2_ioctl.c Thu Aug 11 12:30:23 2011 (r224778) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -333,7 +334,7 @@ ibcs2_ioctl(td, uap) struct file *fp; int error; - if ((error = fget(td, uap->fd, &fp)) != 0) { + if ((error = fget(td, uap->fd, CAP_IOCTL, &fp)) != 0) { DPRINTF(("ibcs2_ioctl(%d): bad fd %d ", p->p_pid, uap->fd)); return EBADF; Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/i386/ibcs2/ibcs2_misc.c Thu Aug 11 12:30:23 2011 (r224778) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); */ #include #include +#include #include #include #include @@ -336,7 +337,8 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, + CAP_READ | CAP_SEEK, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -492,7 +494,8 @@ ibcs2_read(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) { + if ((error = getvnode(td->td_proc->p_fd, uap->fd, + CAP_READ | CAP_SEEK, &fp)) != 0) { if (error == EINVAL) return read(td, (struct read_args *)uap); else Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/i386/linux/linux_machdep.c Thu Aug 11 12:30:23 2011 (r224778) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -467,9 +468,12 @@ linux_mmap_common(struct thread *td, l_u * The file descriptor fildes is opened with * read permission, regardless of the * protection options specified. + * + * Checking just CAP_MMAP is fine here, since the real work + * is done in the FreeBSD mmap(). */ - if ((error = fget(td, bsd_args.fd, &fp)) != 0) + if ((error = fget(td, bsd_args.fd, CAP_MMAP, &fp)) != 0) return (error); if (fp->f_type != DTYPE_VNODE) { fdrop(fp, td); Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Aug 11 11:30:21 2011 (r224777) +++ head/sys/kern/kern_descrip.c Thu Aug 11 12:30:23 2011 (r224778) @@ -431,6 +431,26 @@ fdtofp(int fd, struct filedesc *fdp) return (fp); } +static inline int +fdunwrap(int fd, cap_rights_t rights, struct filedesc *fdp, struct file **fpp) +{ + + *fpp = fdtofp(fd, fdp); + if (*fpp == NULL) + return (EBADF); + +#ifdef CAPABILITIES + if ((*fpp)->f_type == DTYPE_CAPABILITY) { + int err = cap_funwrap(*fpp, rights, fpp); + if (err != 0) { + *fpp = NULL; + return (err); + } + } +#endif /* CAPABILITIES */ + return (0); +} + int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) { @@ -489,9 +509,9 @@ kern_fcntl(struct thread *td, int fd, in case F_GETFL: FILEDESC_SLOCK(fdp); - if ((fp = fdtofp(fd, fdp)) == NULL) { + error = fdunwrap(fd, CAP_FCNTL, fdp, &fp); + if (error != 0) { FILEDESC_SUNLOCK(fdp); - error = EBADF; break; } td->td_retval[0] = OFLAGS(fp->f_flag); @@ -500,9 +520,9 @@ kern_fcntl(struct thread *td, int fd, in case F_SETFL: FILEDESC_SLOCK(fdp); - if ((fp = fdtofp(fd, fdp)) == NULL) { + error = fdunwrap(fd, CAP_FCNTL, fdp, &fp); + if (error != 0) { FILEDESC_SUNLOCK(fdp); - error = EBADF; break; } fhold(fp); @@ -532,9 +552,9 @@ kern_fcntl(struct thread *td, int fd, in case F_GETOWN: FILEDESC_SLOCK(fdp); - if ((fp = fdtofp(fd, fdp)) == NULL) { + error = fdunwrap(fd, CAP_FCNTL, fdp, &fp); + if (error != 0) { FILEDESC_SUNLOCK(fdp); - error = EBADF; break; } fhold(fp); @@ -547,9 +567,9 @@ kern_fcntl(struct thread *td, int fd, in case F_SETOWN: FILEDESC_SLOCK(fdp); - if ((fp = fdtofp(fd, fdp)) == NULL) { + error = fdunwrap(fd, CAP_FCNTL, fdp, &fp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 13:13:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EA03106564A; Thu, 11 Aug 2011 13:13:08 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DBB28FC1B; Thu, 11 Aug 2011 13:13:08 +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 p7BDD8QH094156; Thu, 11 Aug 2011 13:13:08 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BDD8q7094154; Thu, 11 Aug 2011 13:13:08 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201108111313.p7BDD8q7094154@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 11 Aug 2011 13:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224779 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 13:13:08 -0000 Author: nyan Date: Thu Aug 11 13:13:08 2011 New Revision: 224779 URL: http://svn.freebsd.org/changeset/base/224779 Log: Fix building a release with old release scheme. This catches up with renaming from Makefile to Makefile.sysinstall. Approved by: re (hrs) Modified: head/release/Makefile.sysinstall Modified: head/release/Makefile.sysinstall ============================================================================== --- head/release/Makefile.sysinstall Thu Aug 11 12:30:23 2011 (r224778) +++ head/release/Makefile.sysinstall Thu Aug 11 13:13:08 2011 (r224779) @@ -363,6 +363,8 @@ WMAKEENV!= cd ${.CURDIR}/..; \ WMAKE= ${WMAKEENV} ${BINMAKE} .endif +SMAKE= ${MAKE} -f ${MAKEFILE} + CVS_SRCARGS= -P .if defined(RELEASETAG) CVS_SRCARGS+= -r ${RELEASETAG} @@ -479,7 +481,7 @@ release rerelease: mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \ fi .if !defined(NO_PREFETCHDISTFILES) - @cd ${.CURDIR} && ${MAKE} fetch-distfiles + @cd ${.CURDIR} && ${SMAKE} fetch-distfiles .endif .endif .endif @@ -719,7 +721,7 @@ release.6: @for i in ${DISTRIBUTIONS} ; \ do \ if [ -d ${RD}/trees/$${i} ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ + cd ${.CURDIR} && $(SMAKE) doTARBALL \ SD=${RD}/trees/$${i} \ TN=$$i TD=$$i ARG="." && \ echo "$${i} distribution is finished."; \ @@ -728,7 +730,7 @@ release.6: @for i in ${KERNELS_BASE} ${KERNELS} ; \ do \ if [ -d ${RD}/kernels/$${i} ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ + cd ${.CURDIR} && $(SMAKE) doTARBALL \ SD=${RD}/kernels \ TN=$$i TD=kernels ARG="$$i" && \ echo "$${i} distribution is finished."; \ @@ -758,11 +760,11 @@ release.6: # release.7: .if !defined(NOSRC) - @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ + @cd ${.CURDIR} && $(SMAKE) doTARBALL SD=/usr/src \ TD=src TN=sbase ARG="[A-Z]*" @for i in `cd /usr/src && echo [a-z]*` ; do \ if [ -d /usr/src/$$i ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ + cd ${.CURDIR} && $(SMAKE) doTARBALL \ TN=`echo s$$i | tr -d '.' | \ sed -e 's/usr/u/' \ -e 's/kerberos5/krb5/'` \ @@ -773,7 +775,7 @@ release.7: @set ${EXTRA_SRC} && \ while [ $$# -ge 2 ] ; do \ if [ -d /usr/src/$$1 ] ; then \ - cd ${.CURDIR} && $(MAKE) doTARBALL \ + cd ${.CURDIR} && $(SMAKE) doTARBALL \ SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ fi && shift && shift ; \ done @@ -796,7 +798,7 @@ release.8: cd ${RD}/mfsfd && \ mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \ var/empty - @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ + @cd ${.CURDIR} && $(SMAKE) installCRUNCH CRUNCH=boot \ DIR=${RD}/mfsfd/stand ZIP=false ( cd ${RD}/mfsfd && \ for dir in bin sbin ; do \ @@ -862,39 +864,39 @@ SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/m floppies.1: @${ZIPPER} -c ${RD}/kernels/${KERN_GENERIC}/kernel > ${RD}/kernels/kernel.gz @echo "Making the kernel boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \ + @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=kern \ FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz .if defined(SMALLFLOPPYSIZE) @echo "Making the small kernel boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \ + @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=kern-small \ FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \ FDSIZE="SMALL" .endif .if defined(SPLIT_MFSROOT) @echo "Making the mfsroot boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \ + @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=mfsroot \ FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz .if defined(SMALLFLOPPYSIZE) @echo "Making the small mfsroot boot floppies..." - @cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \ + @cd ${.CURDIR} && ${SMAKE} makeFloppySet FLOPPYBASE=mfsroot-small \ FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \ FDSIZE="SMALL" .endif - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ + @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot" \ KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot" .if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ + @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot-small" \ KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \ FDSIZE="SMALL" .endif .else # !SPLIT_MFSROOT - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ + @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot" \ KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ MFSROOTFILE=${RD}/mfsroot/mfsroot.gz .if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ + @cd ${.CURDIR} && ${SMAKE} buildBootFloppy FSIMAGE="boot-small" \ KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \ FDSIZE="SMALL" @@ -921,14 +923,14 @@ floppies.2: @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar @chmod 555 ${RD}/fixitfd/stand/tar .if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \ + @cd ${.CURDIR} && ${SMAKE} installCRUNCH CRUNCH=fixit-small \ DIR=${RD}/fixitfd/stand ZIP=false @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \ ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL} @rm -rf ${RD}/fixitfd/stand @mkdir ${RD}/fixitfd/stand .endif - @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \ + @cd ${.CURDIR} && ${SMAKE} installCRUNCH CRUNCH=fixit \ DIR=${RD}/fixitfd/stand ZIP=false @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \ ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL} @@ -1245,7 +1247,7 @@ doRELEASE: release.1 release.2 ${DOCREL} floppies: @rm -f release.4 release.8 floppies.[123] - @cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \ + @cd ${.CURDIR} && ${SMAKE} release.4 release.8 floppies.1 floppies.2 \ floppies.3 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 13:15:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03DF5106564A; Thu, 11 Aug 2011 13:15:12 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E81838FC1A; Thu, 11 Aug 2011 13:15:11 +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 p7BDFBKF094259; Thu, 11 Aug 2011 13:15:11 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BDFBfv094257; Thu, 11 Aug 2011 13:15:11 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201108111315.p7BDFBfv094257@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 11 Aug 2011 13:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224780 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 13:15:12 -0000 Author: nyan Date: Thu Aug 11 13:15:11 2011 New Revision: 224780 URL: http://svn.freebsd.org/changeset/base/224780 Log: Allow to build a release for stable/[78] on a current box and vise versa. Approved by: re (hrs) MFC after: 1 week Modified: head/release/Makefile.sysinstall Modified: head/release/Makefile.sysinstall ============================================================================== --- head/release/Makefile.sysinstall Thu Aug 11 13:13:08 2011 (r224779) +++ head/release/Makefile.sysinstall Thu Aug 11 13:15:11 2011 (r224780) @@ -600,7 +600,11 @@ release rerelease: echo "fi" >> ${_MK} echo "cd /usr/src/release" >> ${_MK} echo "make obj" >> ${_MK} - echo "make -f Makefile.sysinstall \$${_RELTARGET}" >> ${_MK} + echo "if [ -f Makefile.sysinstall ]; then" >> ${_MK} + echo " make -f Makefile.sysinstall \$${_RELTARGET}" >> ${_MK} + echo "else" >> ${_MK} + echo " make \$${_RELTARGET}" >> ${_MK} + echo "fi" >> ${_MK} echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK} chmod 755 ${_MK} .if defined(NOPORTS) From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 13:30:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4D41065673; Thu, 11 Aug 2011 13:30:00 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0995C8FC14; Thu, 11 Aug 2011 13:30: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 p7BDTxxb094721; Thu, 11 Aug 2011 13:29:59 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BDTxVN094719; Thu, 11 Aug 2011 13:29:59 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108111329.p7BDTxVN094719@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 11 Aug 2011 13:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224781 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 13:30:00 -0000 Author: jonathan Date: Thu Aug 11 13:29:59 2011 New Revision: 224781 URL: http://svn.freebsd.org/changeset/base/224781 Log: Only call fdclose() on successfully-opened FDs. Since kern_openat() now uses falloc_noinstall() and finstall() separately, there are cases where we could get to cleanup code without ever creating a file descriptor. In those cases, we should not call fdclose() on FD -1. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Aug 11 13:15:11 2011 (r224780) +++ head/sys/kern/vfs_syscalls.c Thu Aug 11 13:29:59 2011 (r224781) @@ -1116,7 +1116,8 @@ kern_openat(struct thread *td, int fd, c * Clean up the descriptor, but only if another thread hadn't * replaced or closed it. */ - fdclose(fdp, fp, indx, td); + if (indx != -1) + fdclose(fdp, fp, indx, td); fdrop(fp, td); if (error == ERESTART) @@ -1185,7 +1186,8 @@ success: bad: VFS_UNLOCK_GIANT(vfslocked); bad_unlocked: - fdclose(fdp, fp, indx, td); + if (indx != -1) + fdclose(fdp, fp, indx, td); fdrop(fp, td); td->td_retval[0] = -1; return (error); From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 14:17:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 755B1106566C; Thu, 11 Aug 2011 14:17:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1808FC17; Thu, 11 Aug 2011 14:17: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 p7BEH5c2096177; Thu, 11 Aug 2011 14:17:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BEH5Oo096175; Thu, 11 Aug 2011 14:17:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201108111417.p7BEH5Oo096175@svn.freebsd.org> From: Brooks Davis Date: Thu, 11 Aug 2011 14:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224782 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 14:17:05 -0000 Author: brooks Date: Thu Aug 11 14:17:04 2011 New Revision: 224782 URL: http://svn.freebsd.org/changeset/base/224782 Log: Take Kirill's commit bit into safe keeping per his request to core@. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Aug 11 13:29:59 2011 (r224781) +++ svnadmin/conf/access Thu Aug 11 14:17:04 2011 (r224782) @@ -136,7 +136,6 @@ kevlo kib kientzle kmacy -krion kris kuriyama le From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 15:22:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB23106566C; Thu, 11 Aug 2011 15:22:46 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69FCC8FC16; Thu, 11 Aug 2011 15:22:46 +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 p7BFMkXe098165; Thu, 11 Aug 2011 15:22:46 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BFMkoV098163; Thu, 11 Aug 2011 15:22:46 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201108111522.p7BFMkoV098163@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 11 Aug 2011 15:22:46 +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: r224783 - stable/7/usr.sbin/kbdmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 15:22:46 -0000 Author: jh Date: Thu Aug 11 15:22:46 2011 New Revision: 224783 URL: http://svn.freebsd.org/changeset/base/224783 Log: MFC r216047 by kevlo: Fix fd leak in get_font MFC r222568: Don't try to close the stream if fopen(3) fails. PR: bin/155349 Modified: stable/7/usr.sbin/kbdmap/kbdmap.c Directory Properties: stable/7/usr.sbin/kbdmap/ (props changed) Modified: stable/7/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- stable/7/usr.sbin/kbdmap/kbdmap.c Thu Aug 11 14:17:04 2011 (r224782) +++ stable/7/usr.sbin/kbdmap/kbdmap.c Thu Aug 11 15:22:46 2011 (r224783) @@ -226,6 +226,7 @@ get_font(void) } } } + fclose(fp); } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 15:52:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA04106566C; Thu, 11 Aug 2011 15:52:07 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE0F8FC13; Thu, 11 Aug 2011 15:52: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 p7BFq7hv099067; Thu, 11 Aug 2011 15:52:07 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7BFq73l099065; Thu, 11 Aug 2011 15:52:07 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108111552.p7BFq73l099065@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 11 Aug 2011 15:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224784 - head/tools/regression/security/cap_test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 15:52:07 -0000 Author: jonathan Date: Thu Aug 11 15:52:06 2011 New Revision: 224784 URL: http://svn.freebsd.org/changeset/base/224784 Log: Use the right printf() format string without a cast to maxint_t. As per kib's suggestion, we also change test_count from a size_t to an int; its value at the moment is 4, and we only expect it to go up to 7. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/tools/regression/security/cap_test/cap_test.c Modified: head/tools/regression/security/cap_test/cap_test.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test.c Thu Aug 11 15:22:46 2011 (r224783) +++ head/tools/regression/security/cap_test/cap_test.c Thu Aug 11 15:52:06 2011 (r224784) @@ -51,7 +51,7 @@ struct test all_tests[] = { TEST_INIT(fcntl), TEST_INIT(sysctl), }; -size_t test_count = sizeof(all_tests) / sizeof(struct test); +int test_count = sizeof(all_tests) / sizeof(struct test); int main(int argc, char *argv[]) @@ -61,9 +61,9 @@ main(int argc, char *argv[]) * If no tests have been specified at the command line, run them all. */ if (argc == 1) { - printf("1..%ju\n", (uintmax_t)test_count); + printf("1..%d\n", test_count); - for (size_t i = 0; i < test_count; i++) + for (int i = 0; i < test_count; i++) execute(i + 1, all_tests + i); return (0); } @@ -75,7 +75,7 @@ main(int argc, char *argv[]) for (int i = 1; i < argc; i++) { int found = 0; - for (size_t j = 0; j < test_count; j++) { + for (int j = 0; j < test_count; j++) { if (strncmp(argv[i], all_tests[j].t_name, strlen(argv[i])) == 0) { found = 1; From owner-svn-src-all@FreeBSD.ORG Thu Aug 11 21:01:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F406106564A; Thu, 11 Aug 2011 21:01:25 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D0D128FC08; Thu, 11 Aug 2011 21:01:24 +0000 (UTC) Received: by ewy1 with SMTP id 1so1408719ewy.13 for ; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=6xZoOTu4EEKWHmwmk0mr3hdXN3SAFiNYov7SELzsKy0=; b=dXo1HU+IBkpaKBLDcuWJsDUZ7ka0YMUull3jpnrhlg1S4VozKiNzmagh1TsLeJEs3y B5/+Hga8dOb1qsjIR3FQyVtNuwgHUv4ZuAPNvKsqvOAb1KLyJnE8iOYbMvQacly+L7yS up1a+Q2YpAiWjkC5PFGrGbCdIv0Qsmij5VPS8= MIME-Version: 1.0 Received: by 10.213.16.77 with SMTP id n13mr310167eba.135.1313096483583; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) Received: by 10.213.2.148 with HTTP; Thu, 11 Aug 2011 14:01:23 -0700 (PDT) In-Reply-To: <201106080812.p588CFjb021267@svn.freebsd.org> References: <201106080812.p588CFjb021267@svn.freebsd.org> Date: Thu, 11 Aug 2011 17:01:23 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222853 - in head: . sys/amd64/amd64 sys/amd64/include sys/i386/i386 sys/i386/include sys/pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 21:01:26 -0000 On Wed, Jun 8, 2011 at 4:12 AM, Andriy Gapon wrote: > Author: avg > Date: Wed Jun =A08 08:12:15 2011 > New Revision: 222853 > URL: http://svn.freebsd.org/changeset/base/222853 > > Log: > =A0remove code for dynamic offlining/onlining of CPUs on x86 > > =A0The code has definitely been broken for SCHED_ULE, which is a default > =A0scheduler. =A0It may have been broken for SCHED_4BSD in more subtle wa= ys, > =A0e.g. with manually configured CPU affinities and for interrupt deviler= y > =A0purposes. I can confirm that this was very broken for SCHED_4BSD. The softclock threads are kicked off from hardclock_cpu(). When you offline a CPU, hardclock_cpu() never runs for that CPU so its softclock thread is never run. If you happen to have any callouts scheduled on that softclock thread they will never run unless the corresponding CPU is brought online again. In a particular case that I've been looking at, the hyperthreading_allowed tunable was set to 0 on a system running a derivative of 8.2-RELEASE. Unfortunately it seems that there is a window in SCHED_4BSD during which the hyperthreads run even if you disable them via tunable. It seems that bufdaemon ran on one of the hyperthreads and then went to sleep. It's thread's td_slpcallout was scheduled on the hyperthread's softclock thread, and then 4BSD finally got around to disabling the hyperthreads. Hilarity ensues as bufdaemon never wakes up. In short, there's currently no safe way to disable hyperthreading on stable/8. I know that you and Attilio originally decided not to MFC this as these sysctls were considered a part of the ABI, but seeing as the functionality that this ABI is intended to present is completely broken, I'm wondering if an MFC is the lesser evil. From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 07:04:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 064031065670; Fri, 12 Aug 2011 07:04:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9ABF8FC0C; Fri, 12 Aug 2011 07:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7C74GTU026748; Fri, 12 Aug 2011 07:04:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7C74GTR026743; Fri, 12 Aug 2011 07:04:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201108120704.p7C74GTR026743@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 12 Aug 2011 07:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224791 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 07:04:17 -0000 Author: pjd Date: Fri Aug 12 07:04:16 2011 New Revision: 224791 URL: http://svn.freebsd.org/changeset/base/224791 Log: Eliminate the zfsdev_state_lock entirely and replace it with the spa_namespace_lock. This fixes LOR between the spa_namespace_lock and spa_config lock. LOR can cause deadlock on vdevs removal/insertion. Reported by: gibbs, delphij Tested by: delphij Approved by: re (kib) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Aug 12 04:06:43 2011 (r224790) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Aug 12 07:04:16 2011 (r224791) @@ -353,7 +353,6 @@ extern void *zfsdev_get_soft_state(minor extern minor_t zfsdev_minor_alloc(void); extern void *zfsdev_state; -extern kmutex_t zfsdev_state_lock; #endif /* _KERNEL */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Aug 12 04:06:43 2011 (r224790) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Aug 12 07:04:16 2011 (r224791) @@ -410,7 +410,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi struct g_provider *pp; struct g_consumer *cp; size_t bufsize; - int error, lock; + int error; /* * We must have a pathname, and it must be absolute. @@ -422,12 +422,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi vd->vdev_tsd = NULL; - if (mutex_owned(&spa_namespace_lock)) { - mutex_exit(&spa_namespace_lock); - lock = 1; - } else { - lock = 0; - } DROP_GIANT(); g_topology_lock(); error = 0; @@ -459,11 +453,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi !ISP2(cp->provider->sectorsize)) { ZFS_LOG(1, "Provider %s has unsupported sectorsize.", vd->vdev_path); - - g_topology_lock(); vdev_geom_detach(cp, 0); - g_topology_unlock(); - error = EINVAL; cp = NULL; } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) { @@ -486,8 +476,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi } g_topology_unlock(); PICKUP_GIANT(); - if (lock) - mutex_enter(&spa_namespace_lock); if (cp == NULL) { vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (error); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 12 04:06:43 2011 (r224790) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Aug 12 07:04:16 2011 (r224791) @@ -4813,7 +4813,7 @@ zfsdev_minor_alloc(void) static minor_t last_minor; minor_t m; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); for (m = last_minor + 1; m != last_minor; m++) { if (m > ZFSDEV_MAX_MINOR) @@ -4833,7 +4833,7 @@ zfs_ctldev_init(struct cdev *devp) minor_t minor; zfs_soft_state_t *zs; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); minor = zfsdev_minor_alloc(); if (minor == 0) @@ -4854,7 +4854,7 @@ zfs_ctldev_init(struct cdev *devp) static void zfs_ctldev_destroy(zfs_onexit_t *zo, minor_t minor) { - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); zfs_onexit_destroy(zo); ddi_soft_state_free(zfsdev_state, minor); @@ -4884,9 +4884,9 @@ zfsdev_open(struct cdev *devp, int flag, /* This is the control device. Allocate a new minor if requested. */ if (flag & FEXCL) { - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); error = zfs_ctldev_init(devp); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); } return (error); @@ -4901,14 +4901,14 @@ zfsdev_close(void *data) if (minor == 0) return; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zo = zfsdev_get_soft_state(minor, ZSST_CTLDEV); if (zo == NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return; } zfs_ctldev_destroy(zo, minor); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Aug 12 04:06:43 2011 (r224790) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri Aug 12 07:04:16 2011 (r224791) @@ -94,12 +94,11 @@ static char *zvol_tag = "zvol_tag"; #define ZVOL_DUMPSIZE "dumpsize" /* - * This lock protects the zfsdev_state structure from being modified - * while it's being used, e.g. an open that comes in before a create - * finishes. It also protects temporary opens of the dataset so that, + * The spa_namespace_lock protects the zfsdev_state structure from being + * modified while it's being used, e.g. an open that comes in before a + * create finishes. It also protects temporary opens of the dataset so that, * e.g., an open doesn't get a spurious EBUSY. */ -kmutex_t zfsdev_state_lock; static uint32_t zvol_minors; typedef struct zvol_extent { @@ -246,7 +245,7 @@ zvol_minor_lookup(const char *name) struct g_geom *gp; zvol_state_t *zv = NULL; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); g_topology_lock(); LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { @@ -462,11 +461,11 @@ zvol_name2minor(const char *name, minor_ { zvol_state_t *zv; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zv = zvol_minor_lookup(name); if (minor && zv) *minor = zv->zv_minor; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (zv ? 0 : -1); } #endif /* sun */ @@ -485,10 +484,10 @@ zvol_create_minor(const char *name) ZFS_LOG(1, "Creating ZVOL %s...", name); - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); if (zvol_minor_lookup(name) != NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (EEXIST); } @@ -496,20 +495,20 @@ zvol_create_minor(const char *name) error = dmu_objset_own(name, DMU_OST_ZVOL, B_TRUE, FTAG, &os); if (error) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (error); } #ifdef sun if ((minor = zfsdev_minor_alloc()) == 0) { dmu_objset_disown(os, FTAG); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (ENXIO); } if (ddi_soft_state_zalloc(zfsdev_state, minor) != DDI_SUCCESS) { dmu_objset_disown(os, FTAG); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (EAGAIN); } (void) ddi_prop_update_string(minor, zfs_dip, ZVOL_PROP_NAME, @@ -521,7 +520,7 @@ zvol_create_minor(const char *name) minor, DDI_PSEUDO, 0) == DDI_FAILURE) { ddi_soft_state_free(zfsdev_state, minor); dmu_objset_disown(os, FTAG); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (EAGAIN); } @@ -532,7 +531,7 @@ zvol_create_minor(const char *name) ddi_remove_minor_node(zfs_dip, chrbuf); ddi_soft_state_free(zfsdev_state, minor); dmu_objset_disown(os, FTAG); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (EAGAIN); } @@ -572,7 +571,7 @@ zvol_create_minor(const char *name) zvol_minors++; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); zvol_geom_run(zv); @@ -594,7 +593,7 @@ zvol_remove_zv(zvol_state_t *zv) minor_t minor = zv->zv_minor; #endif - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); if (zv->zv_total_opens != 0) return (EBUSY); @@ -620,15 +619,15 @@ zvol_remove_minor(const char *name) zvol_state_t *zv; int rc; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); if ((zv = zvol_minor_lookup(name)) == NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (ENXIO); } g_topology_lock(); rc = zvol_remove_zv(zv); g_topology_unlock(); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (rc); } @@ -730,7 +729,7 @@ zvol_update_volsize(objset_t *os, uint64 dmu_tx_t *tx; int error; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); @@ -761,7 +760,7 @@ zvol_remove_minors(const char *name) namelen = strlen(name); DROP_GIANT(); - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); g_topology_lock(); LIST_FOREACH_SAFE(gp, &zfs_zvol_class.geom, geom, gptmp) { @@ -779,7 +778,7 @@ zvol_remove_minors(const char *name) } g_topology_unlock(); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } @@ -793,10 +792,10 @@ zvol_set_volsize(const char *name, major uint64_t old_volsize = 0ULL; uint64_t readonly; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zv = zvol_minor_lookup(name); if ((error = dmu_objset_hold(name, FTAG, &os)) != 0) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (error); } @@ -863,7 +862,7 @@ zvol_set_volsize(const char *name, major out: dmu_objset_rele(os, FTAG); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (error); } @@ -875,18 +874,18 @@ zvol_open(struct g_provider *pp, int fla zvol_state_t *zv; int err = 0; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zv = pp->private; if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (ENXIO); } if (zv->zv_total_opens == 0) err = zvol_first_open(zv); if (err) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (err); } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { @@ -908,13 +907,13 @@ zvol_open(struct g_provider *pp, int fla #endif zv->zv_total_opens += count; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (err); out: if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (err); } @@ -925,11 +924,11 @@ zvol_close(struct g_provider *pp, int fl zvol_state_t *zv; int error = 0; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zv = pp->private; if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (ENXIO); } @@ -952,7 +951,7 @@ zvol_close(struct g_provider *pp, int fl if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (error); } @@ -1571,12 +1570,12 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t int error = 0; rl_t *rl; - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); zv = zfsdev_get_soft_state(getminor(dev), ZSST_ZVOL); if (zv == NULL) { - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (ENXIO); } ASSERT(zv->zv_total_opens > 0); @@ -1590,7 +1589,7 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t dki.dki_ctype = DKC_UNKNOWN; dki.dki_unit = getminor(dev); dki.dki_maxtransfer = 1 << (SPA_MAXBLOCKSHIFT - zv->zv_min_bs); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); if (ddi_copyout(&dki, (void *)arg, sizeof (dki), flag)) error = EFAULT; return (error); @@ -1600,7 +1599,7 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t dkm.dki_lbsize = 1U << zv->zv_min_bs; dkm.dki_capacity = zv->zv_volsize >> zv->zv_min_bs; dkm.dki_media_type = DK_UNKNOWN; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); if (ddi_copyout(&dkm, (void *)arg, sizeof (dkm), flag)) error = EFAULT; return (error); @@ -1610,14 +1609,14 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t uint64_t vs = zv->zv_volsize; uint8_t bs = zv->zv_min_bs; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); error = zvol_getefi((void *)arg, flag, vs, bs); return (error); } case DKIOCFLUSHWRITECACHE: dkc = (struct dk_callback *)arg; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); zil_commit(zv->zv_zilog, ZVOL_OBJ); if ((flag & FKIOCTL) && dkc != NULL && dkc->dkc_callback) { (*dkc->dkc_callback)(dkc->dkc_cookie, error); @@ -1643,10 +1642,10 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t } if (wce) { zv->zv_flags |= ZVOL_WCE; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); } else { zv->zv_flags &= ~ZVOL_WCE; - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); zil_commit(zv->zv_zilog, ZVOL_OBJ); } return (0); @@ -1682,7 +1681,7 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t break; } - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); return (error); } #endif /* sun */ @@ -1698,14 +1697,12 @@ zvol_init(void) { VERIFY(ddi_soft_state_init(&zfsdev_state, sizeof (zfs_soft_state_t), 1) == 0); - mutex_init(&zfsdev_state_lock, NULL, MUTEX_DEFAULT, NULL); ZFS_LOG(1, "ZVOL Initialized."); } void zvol_fini(void) { - mutex_destroy(&zfsdev_state_lock); ddi_soft_state_fini(&zfsdev_state); ZFS_LOG(1, "ZVOL Deinitialized."); } @@ -1720,7 +1717,7 @@ zvol_dump_init(zvol_state_t *zv, boolean nvlist_t *nv = NULL; uint64_t version = spa_version(dmu_objset_spa(zv->zv_objset)); - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); /* wait for dmu_free_long_range to actually free the blocks */ @@ -2230,7 +2227,7 @@ zvol_rename_minor(struct g_geom *gp, con struct g_provider *pp; zvol_state_t *zv; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&spa_namespace_lock)); g_topology_assert(); pp = LIST_FIRST(&gp->provider); @@ -2264,7 +2261,7 @@ zvol_rename_minors(const char *oldname, newnamelen = strlen(newname); DROP_GIANT(); - mutex_enter(&zfsdev_state_lock); + mutex_enter(&spa_namespace_lock); g_topology_lock(); LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { @@ -2287,6 +2284,6 @@ zvol_rename_minors(const char *oldname, } g_topology_unlock(); - mutex_exit(&zfsdev_state_lock); + mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 10:52:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 204261065670; Fri, 12 Aug 2011 10:52:47 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DDBE8FC0C; Fri, 12 Aug 2011 10:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7CAqkva033649; Fri, 12 Aug 2011 10:52:46 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CAqkoe033644; Fri, 12 Aug 2011 10:52:46 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108121052.p7CAqkoe033644@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 12 Aug 2011 10:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224793 - head/tools/regression/security/cap_test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 10:52:47 -0000 Author: jonathan Date: Fri Aug 12 10:52:46 2011 New Revision: 224793 URL: http://svn.freebsd.org/changeset/base/224793 Log: Test *at(2) calls with capability-mode lookup. This commit adds regression testing for openat(), fstatat(), etc. with capability scoping ("strict relative" lookup), which applies: - in capability mode - when performing any *at() lookup relative to a capability These tests will fail until the *at() code is committed; on my local instance, with the *at() changes, they all pass. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Added: head/tools/regression/security/cap_test/cap_test_relative.c (contents, props changed) Modified: head/tools/regression/security/cap_test/Makefile head/tools/regression/security/cap_test/cap_test.c head/tools/regression/security/cap_test/cap_test.h Modified: head/tools/regression/security/cap_test/Makefile ============================================================================== --- head/tools/regression/security/cap_test/Makefile Fri Aug 12 09:18:02 2011 (r224792) +++ head/tools/regression/security/cap_test/Makefile Fri Aug 12 10:52:46 2011 (r224793) @@ -5,7 +5,9 @@ SRCS= cap_test.c \ cap_test_capmode.c \ cap_test_capabilities.c \ cap_test_fcntl.c \ - cap_test_sysctl.c + cap_test_relative.c \ + cap_test_sysctl.c \ + WARNS= 3 NO_MAN= Modified: head/tools/regression/security/cap_test/cap_test.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test.c Fri Aug 12 09:18:02 2011 (r224792) +++ head/tools/regression/security/cap_test/cap_test.c Fri Aug 12 10:52:46 2011 (r224793) @@ -49,6 +49,7 @@ struct test all_tests[] = { TEST_INIT(capmode), TEST_INIT(capabilities), TEST_INIT(fcntl), + TEST_INIT(relative), TEST_INIT(sysctl), }; int test_count = sizeof(all_tests) / sizeof(struct test); Modified: head/tools/regression/security/cap_test/cap_test.h ============================================================================== --- head/tools/regression/security/cap_test/cap_test.h Fri Aug 12 09:18:02 2011 (r224792) +++ head/tools/regression/security/cap_test/cap_test.h Fri Aug 12 10:52:46 2011 (r224793) @@ -148,8 +148,8 @@ int execute(int id, struct test*); int test_capmode(void); int test_capabilities(void); -int test_syscalls(void); -int test_sysctl(void); int test_fcntl(void); +int test_relative(void); +int test_sysctl(void); #endif /* CAP_TEST_H */ Added: head/tools/regression/security/cap_test/cap_test_relative.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/security/cap_test/cap_test_relative.c Fri Aug 12 10:52:46 2011 (r224793) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2009-2011 Robert N. M. Watson + * Copyright (c) 2011 Jonathan Anderson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "cap_test.h" + +/* + * Test openat(2) in a variety of sitations to ensure that it obeys Capsicum + * "strict relative" rules: + * + * 1. Use strict relative lookups in capability mode or when operating + * relative to a capability. + * 2. When performing strict relative lookups, absolute paths (including + * symlinks to absolute paths) are not allowed, nor are paths containing + * '..' components. + */ +int +test_relative(void) +{ + int success = PASSED; + int fd, etc, etc_cap, etc_cap_ro, etc_cap_base, etc_cap_all; + cap_rights_t baserights = CAP_READ | CAP_WRITE | CAP_SEEK | CAP_LOOKUP; + cap_rights_t rights; + + REQUIRE(etc = open("/etc/", O_RDONLY)); + CHECK_SYSCALL_FAILS(EINVAL, cap_getrights, etc, &rights); + + MAKE_CAPABILITY(etc_cap, etc, CAP_READ); + MAKE_CAPABILITY(etc_cap_ro, etc, CAP_READ | CAP_LOOKUP); + MAKE_CAPABILITY(etc_cap_base, etc, baserights); + MAKE_CAPABILITY(etc_cap_all, etc, CAP_MASK_VALID); + + /* + * openat(2) with regular file descriptors in non-capability mode + * should Just Work (tm). + */ + CHECK_SYSCALL_SUCCEEDS(openat, etc, "/etc/passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, AT_FDCWD, "/etc/passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc, "../etc/passwd", O_RDONLY); + + /* + * Lookups relative to capabilities should be strictly relative. + * + * When not in capability mode, we don't actually require CAP_LOOKUP. + */ + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_ro, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_base, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "passwd", O_RDONLY); + + CHECK_NOTCAPABLE(openat, etc_cap_ro, "../etc/passwd", O_RDONLY); + CHECK_NOTCAPABLE(openat, etc_cap_base, "../etc/passwd", O_RDONLY); + + /* + * This requires discussion: do we treat a capability with + * CAP_MASK_VALID *exactly* like a non-capability file descriptor + * (currently, the implementation says yes)? + */ + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "../etc/passwd", O_RDONLY); + + /* + * A file opened relative to a capability should itself be a capability. + */ + CHECK_SYSCALL_SUCCEEDS(cap_getrights, etc_cap_base, &rights); + + REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY)); + CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights); + CHECK_RIGHTS(rights, baserights); + + /* + * Enter capability mode; now ALL lookups are strictly relative. + */ + REQUIRE(cap_enter()); + + /* + * Relative lookups on regular files or capabilities with CAP_LOOKUP + * ought to succeed. + */ + CHECK_SYSCALL_SUCCEEDS(openat, etc, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_ro, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_base, "passwd", O_RDONLY); + CHECK_SYSCALL_SUCCEEDS(openat, etc_cap_all, "passwd", O_RDONLY); + + /* + * Lookup relative to capabilities without CAP_LOOKUP should fail. + */ + CHECK_NOTCAPABLE(openat, etc_cap, "passwd", O_RDONLY); + + /* + * Absolute lookups should fail. + */ + CHECK_CAPMODE(openat, AT_FDCWD, "/etc/passwd", O_RDONLY); + CHECK_NOTCAPABLE(openat, etc, "/etc/passwd", O_RDONLY); + + /* + * Lookups containing '..' should fail in capability mode. + */ + CHECK_NOTCAPABLE(openat, etc, "../etc/passwd", O_RDONLY); + CHECK_NOTCAPABLE(openat, etc_cap_ro, "../etc/passwd", O_RDONLY); + CHECK_NOTCAPABLE(openat, etc_cap_base, "../etc/passwd", O_RDONLY); + + REQUIRE(fd = openat(etc, "passwd", O_RDONLY)); + CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights); + + /* + * A file opened relative to a capability should itself be a capability. + */ + REQUIRE(fd = openat(etc_cap_base, "passwd", O_RDONLY)); + CHECK_SYSCALL_SUCCEEDS(cap_getrights, fd, &rights); + CHECK_RIGHTS(rights, baserights); + + return success; +} From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 11:43:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A43D210656D3; Fri, 12 Aug 2011 11:43:56 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8927F8FC1F; Fri, 12 Aug 2011 11:43: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 p7CBhutW052059; Fri, 12 Aug 2011 11:43:56 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CBhudc052057; Fri, 12 Aug 2011 11:43:56 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108121143.p7CBhudc052057@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 12 Aug 2011 11:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224794 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 11:43:56 -0000 Author: jonathan Date: Fri Aug 12 11:43:56 2011 New Revision: 224794 URL: http://svn.freebsd.org/changeset/base/224794 Log: Reorder and renumber capability rights. This patch does three things: - puts capability rights in a more pleasing declaration order - changes mask values to match the new declaration order - declare new rights which will be used soon (e.g. CAP_LOOKUP, CAP_MKDIR) Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Fri Aug 12 10:52:46 2011 (r224793) +++ head/sys/sys/capability.h Fri Aug 12 11:43:56 2011 (r224794) @@ -76,30 +76,38 @@ #define CAP_FSTAT 0x0000000000010000ULL #define CAP_FSTATFS 0x0000000000020000ULL #define CAP_FUTIMES 0x0000000000040000ULL +#define CAP_CREATE 0x0000000000080000ULL +#define CAP_DELETE 0x0000000000100000ULL +#define CAP_MKDIR 0x0000000000200000ULL +#define CAP_RMDIR 0x0000000000400000ULL +#define CAP_MKFIFO 0x0000000000800000ULL + +/* Lookups - used to constrain *at() calls. */ +#define CAP_LOOKUP 0x0000000001000000ULL /* Extended attributes. */ -#define CAP_EXTATTR_DELETE 0x0000000000080000ULL -#define CAP_EXTATTR_GET 0x0000000000100000ULL -#define CAP_EXTATTR_LIST 0x0000000000200000ULL -#define CAP_EXTATTR_SET 0x0000000000400000ULL +#define CAP_EXTATTR_DELETE 0x0000000002000000ULL +#define CAP_EXTATTR_GET 0x0000000004000000ULL +#define CAP_EXTATTR_LIST 0x0000000008000000ULL +#define CAP_EXTATTR_SET 0x0000000010000000ULL /* Access Control Lists. */ -#define CAP_ACL_CHECK 0x0000000000800000ULL -#define CAP_ACL_DELETE 0x0000000001000000ULL -#define CAP_ACL_GET 0x0000000002000000ULL -#define CAP_ACL_SET 0x0000000004000000ULL +#define CAP_ACL_CHECK 0x0000000020000000ULL +#define CAP_ACL_DELETE 0x0000000040000000ULL +#define CAP_ACL_GET 0x0000000080000000ULL +#define CAP_ACL_SET 0x0000000100000000ULL /* Socket operations. */ -#define CAP_ACCEPT 0x0000000008000000ULL -#define CAP_BIND 0x0000000010000000ULL -#define CAP_CONNECT 0x0000000020000000ULL -#define CAP_GETPEERNAME 0x0000000040000000ULL -#define CAP_GETSOCKNAME 0x0000000080000000ULL -#define CAP_GETSOCKOPT 0x0000000100000000ULL -#define CAP_LISTEN 0x0000000200000000ULL -#define CAP_PEELOFF 0x0000000400000000ULL -#define CAP_SETSOCKOPT 0x0000000800000000ULL -#define CAP_SHUTDOWN 0x0000001000000000ULL +#define CAP_ACCEPT 0x0000000200000000ULL +#define CAP_BIND 0x0000000400000000ULL +#define CAP_CONNECT 0x0000000800000000ULL +#define CAP_GETPEERNAME 0x0000001000000000ULL +#define CAP_GETSOCKNAME 0x0000002000000000ULL +#define CAP_GETSOCKOPT 0x0000004000000000ULL +#define CAP_LISTEN 0x0000008000000000ULL +#define CAP_PEELOFF 0x0000010000000000ULL +#define CAP_SETSOCKOPT 0x0000020000000000ULL +#define CAP_SHUTDOWN 0x0000040000000000ULL #define CAP_SOCK_ALL \ (CAP_ACCEPT | CAP_BIND | CAP_CONNECT \ @@ -107,24 +115,24 @@ | CAP_LISTEN | CAP_PEELOFF | CAP_SETSOCKOPT | CAP_SHUTDOWN) /* Mandatory Access Control. */ -#define CAP_MAC_GET 0x0000002000000000ULL -#define CAP_MAC_SET 0x0000004000000000ULL +#define CAP_MAC_GET 0x0000080000000000ULL +#define CAP_MAC_SET 0x0000100000000000ULL /* Methods on semaphores. */ -#define CAP_SEM_GETVALUE 0x0000008000000000ULL -#define CAP_SEM_POST 0x0000010000000000ULL -#define CAP_SEM_WAIT 0x0000020000000000ULL +#define CAP_SEM_GETVALUE 0x0000200000000000ULL +#define CAP_SEM_POST 0x0000400000000000ULL +#define CAP_SEM_WAIT 0x0000800000000000ULL /* kqueue events. */ -#define CAP_POLL_KEVENT 0x0000040000000000ULL -#define CAP_POST_KEVENT 0x0000080000000000ULL +#define CAP_POLL_KEVENT 0x0001000000000000ULL +#define CAP_POST_KEVENT 0x0002000000000000ULL /* Strange and powerful rights that should not be given lightly. */ -#define CAP_IOCTL 0x0000100000000000ULL -#define CAP_TTYHOOK 0x0000200000000000ULL +#define CAP_IOCTL 0x0004000000000000ULL +#define CAP_TTYHOOK 0x0008000000000000ULL /* The mask of all valid method rights. */ -#define CAP_MASK_VALID 0x00003fffffffffffULL +#define CAP_MASK_VALID 0x000fffffffffffffULL #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 14:26:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83FC9106566B; Fri, 12 Aug 2011 14:26:47 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6890A8FC19; Fri, 12 Aug 2011 14:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7CEQltS067454; Fri, 12 Aug 2011 14:26:47 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CEQlEm067448; Fri, 12 Aug 2011 14:26:47 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108121426.p7CEQlEm067448@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 12 Aug 2011 14:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224797 - in head: sys/kern sys/sys tools/regression/security/cap_test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 14:26:47 -0000 Author: jonathan Date: Fri Aug 12 14:26:47 2011 New Revision: 224797 URL: http://svn.freebsd.org/changeset/base/224797 Log: Rename CAP_*_KEVENT to CAP_*_EVENT. Change the names of a couple of capability rights to be less FreeBSD-specific. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/kern/kern_event.c head/sys/kern/sys_generic.c head/sys/kern/uipc_mqueue.c head/sys/sys/capability.h head/tools/regression/security/cap_test/cap_test_capabilities.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Aug 12 14:16:45 2011 (r224796) +++ head/sys/kern/kern_event.c Fri Aug 12 14:26:47 2011 (r224797) @@ -817,7 +817,7 @@ kern_kevent(struct thread *td, int fd, i struct file *fp; int i, n, nerrors, error; - if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto done_norel; @@ -973,7 +973,7 @@ kqueue_register(struct kqueue *kq, struc findkn: if (fops->f_isfd) { KASSERT(td != NULL, ("td is NULL")); - error = fget(td, kev->ident, CAP_POLL_KEVENT, &fp); + error = fget(td, kev->ident, CAP_POLL_EVENT, &fp); if (error) goto done; @@ -2182,7 +2182,7 @@ kqfd_register(int fd, struct kevent *kev struct file *fp; int error; - if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Fri Aug 12 14:16:45 2011 (r224796) +++ head/sys/kern/sys_generic.c Fri Aug 12 14:26:47 2011 (r224797) @@ -1072,7 +1072,7 @@ getselfd_cap(struct filedesc *fdp, int f * If the file descriptor is for a capability, test rights and use * the file descriptor references by the capability. */ - error = cap_funwrap(fp, CAP_POLL_KEVENT, &fp_fromcap); + error = cap_funwrap(fp, CAP_POLL_EVENT, &fp_fromcap); if (error) { fdrop(fp, curthread); return (error); Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Aug 12 14:16:45 2011 (r224796) +++ head/sys/kern/uipc_mqueue.c Fri Aug 12 14:26:47 2011 (r224797) @@ -2119,7 +2119,7 @@ static __inline int getmq(struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq) { - return _getmq(td, fd, CAP_POLL_KEVENT, fget, fpp, ppn, pmq); + return _getmq(td, fd, CAP_POLL_EVENT, fget, fpp, ppn, pmq); } static __inline int @@ -2274,7 +2274,7 @@ again: error = EBADF; goto out; } - error = cap_funwrap(fp2, CAP_POLL_KEVENT, &fp2); + error = cap_funwrap(fp2, CAP_POLL_EVENT, &fp2); if (error) { FILEDESC_SUNLOCK(fdp); goto out; Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Fri Aug 12 14:16:45 2011 (r224796) +++ head/sys/sys/capability.h Fri Aug 12 14:26:47 2011 (r224797) @@ -124,8 +124,8 @@ #define CAP_SEM_WAIT 0x0000800000000000ULL /* kqueue events. */ -#define CAP_POLL_KEVENT 0x0001000000000000ULL -#define CAP_POST_KEVENT 0x0002000000000000ULL +#define CAP_POLL_EVENT 0x0001000000000000ULL +#define CAP_POST_EVENT 0x0002000000000000ULL /* Strange and powerful rights that should not be given lightly. */ #define CAP_IOCTL 0x0004000000000000ULL Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capabilities.c Fri Aug 12 14:16:45 2011 (r224796) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Fri Aug 12 14:26:47 2011 (r224797) @@ -237,8 +237,8 @@ test_capabilities(void) TRY(fd, CAP_MMAP | CAP_MAPEXEC | CAP_WRITE); TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC); TRY(fd, CAP_FCNTL); - TRY(fd, CAP_POST_KEVENT); - TRY(fd, CAP_POLL_KEVENT); + TRY(fd, CAP_POST_EVENT); + TRY(fd, CAP_POLL_EVENT); TRY(fd, CAP_FSYNC); TRY(fd, CAP_FCHOWN); TRY(fd, CAP_FCHMOD); From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 19:51:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAD981065673; Fri, 12 Aug 2011 19:51:28 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2AD8FC0C; Fri, 12 Aug 2011 19:51: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 p7CJpSAv080376; Fri, 12 Aug 2011 19:51:28 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CJpSnn080373; Fri, 12 Aug 2011 19:51:28 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201108121951.p7CJpSnn080373@svn.freebsd.org> From: Matt Jacob Date: Fri, 12 Aug 2011 19:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224804 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 19:51:28 -0000 Author: mjacob Date: Fri Aug 12 19:51:28 2011 New Revision: 224804 URL: http://svn.freebsd.org/changeset/base/224804 Log: Fixes zombie device and loop down timers so that they work more than once. Use taskqueues to do the actual work. Fix an offset line. Fix isp_prt so that prints from just one buffer, which makes it appear cleanly cleanly in logs on SMP systems. Approved by: re (kib) MFC after: 1 month Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri Aug 12 16:21:05 2011 (r224803) +++ head/sys/dev/isp/isp_freebsd.c Fri Aug 12 19:51:28 2011 (r224804) @@ -67,7 +67,10 @@ static void isp_intr_enable(void *); static void isp_cam_async(void *, uint32_t, struct cam_path *, void *); static void isp_poll(struct cam_sim *); static timeout_t isp_watchdog; +static timeout_t isp_gdt; +static task_fn_t isp_gdt_task; static timeout_t isp_ldt; +static task_fn_t isp_ldt_task; static void isp_kthread(void *); static void isp_action(struct cam_sim *, union ccb *); #ifdef ISP_INTERNAL_TARGET @@ -141,8 +144,11 @@ isp_attach_chan(ispsoftc_t *isp, struct fc->path = path; fc->isp = isp; fc->ready = 1; + callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); + TASK_INIT(&fc->ltask, 1, isp_ldt_task, fc); + TASK_INIT(&fc->gtask, 1, isp_gdt_task, fc); /* * We start by being "loop down" if we have an initiator role @@ -3937,12 +3943,20 @@ static void isp_gdt(void *arg) { struct isp_fc *fc = arg; + taskqueue_enqueue(taskqueue_thread, &fc->gtask); +} + +static void +isp_gdt_task(void *arg, int pending) +{ + struct isp_fc *fc = arg; ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; fcportdb_t *lp; int dbidx, tgt, more_to_do = 0; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d GDT timer expired @ %lu", chan, (unsigned long) time_uptime); + ISP_LOCK(isp); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d GDT timer expired", chan); for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &FCPARAM(isp, chan)->portdb[dbidx]; @@ -3953,6 +3967,7 @@ isp_gdt(void *arg) continue; } if (lp->gone_timer != 0) { + isp_prt(isp, ISP_LOGSANCFG, "%s: Chan %d more to do for target %u (timer=%u)", __func__, chan, lp->dev_map_idx - 1, lp->gone_timer); lp->gone_timer -= 1; more_to_do++; continue; @@ -3968,9 +3983,11 @@ isp_gdt(void *arg) if (more_to_do) { callout_reset(&fc->gdt, hz, isp_gdt, fc); } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Stopping Gone Device Timer", chan); + callout_deactivate(&fc->gdt); + isp_prt(isp, ISP_LOGSANCFG, "Chan %d Stopping Gone Device Timer @ %lu", chan, (unsigned long) time_uptime); } } + ISP_UNLOCK(isp); } /* @@ -3986,12 +4003,21 @@ static void isp_ldt(void *arg) { struct isp_fc *fc = arg; + taskqueue_enqueue(taskqueue_thread, &fc->ltask); +} + +static void +isp_ldt_task(void *arg, int pending) +{ + struct isp_fc *fc = arg; ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; fcportdb_t *lp; int dbidx, tgt; + ISP_LOCK(isp); isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Loop Down Timer expired @ %lu", chan, (unsigned long) time_uptime); + callout_deactivate(&fc->ldt); /* * Notify to the OS all targets who we now consider have departed. @@ -4631,7 +4657,7 @@ isp_action(struct cam_sim *sim, union cc if (kp->xport_specific.fc.valid & KNOB_VALID_ADDRESS) { fcp->isp_wwnn = ISP_FC_PC(isp, bus)->def_wwnn = kp->xport_specific.fc.wwnn; fcp->isp_wwpn = ISP_FC_PC(isp, bus)->def_wwpn = kp->xport_specific.fc.wwpn; -isp_prt(isp, ISP_LOGALL, "Setting Channel %d wwns to 0x%jx 0x%jx", bus, fcp->isp_wwnn, fcp->isp_wwpn); + isp_prt(isp, ISP_LOGALL, "Setting Channel %d wwns to 0x%jx 0x%jx", bus, fcp->isp_wwnn, fcp->isp_wwpn); } ccb->ccb_h.status = CAM_REQ_CMP; if (kp->xport_specific.fc.valid & KNOB_VALID_ROLE) { @@ -5423,15 +5449,19 @@ isp_default_wwn(ispsoftc_t * isp, int ch void isp_prt(ispsoftc_t *isp, int level, const char *fmt, ...) { + int loc; + char lbuf[128]; va_list ap; + if (level != ISP_LOGALL && (level & isp->isp_dblev) == 0) { return; } - printf("%s: ", device_get_nameunit(isp->isp_dev)); + sprintf(lbuf, "%s: ", device_get_nameunit(isp->isp_dev)); + loc = strlen(lbuf); va_start(ap, fmt); - vprintf(fmt, ap); + vsnprintf(&lbuf[loc], sizeof (lbuf) - loc - 1, fmt, ap); va_end(ap); - printf("\n"); + printf("%s\n", lbuf); } void Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Fri Aug 12 16:21:05 2011 (r224803) +++ head/sys/dev/isp/isp_freebsd.h Fri Aug 12 19:51:28 2011 (r224804) @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -182,6 +183,8 @@ struct isp_fc { ready : 1; struct callout ldt; /* loop down timer */ struct callout gdt; /* gone device timer */ + struct task ltask; + struct task gtask; #ifdef ISP_TARGET_MODE struct tslist lun_hash[LUN_HASH_SIZE]; #ifdef ISP_INTERNAL_TARGET From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 20:09:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A157F1065672; Fri, 12 Aug 2011 20:09:38 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90BAA8FC19; Fri, 12 Aug 2011 20:09:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7CK9cEg081054; Fri, 12 Aug 2011 20:09:38 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CK9cgo081051; Fri, 12 Aug 2011 20:09:38 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201108122009.p7CK9cgo081051@svn.freebsd.org> From: Matt Jacob Date: Fri, 12 Aug 2011 20:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224806 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 20:09:38 -0000 Author: mjacob Date: Fri Aug 12 20:09:38 2011 New Revision: 224806 URL: http://svn.freebsd.org/changeset/base/224806 Log: Fixes for sure bus reference miscounting and potential device and target reference miscounts. It also adds a helper function to get the current reference counts for components of cam_path for debug aid. One minor style(9) change. Partially Obtained from: Chuck Tuffli (Emulex) Reviewed by: scsi@ (ken) Approved by: re (kib) MFC after: 1 month Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Aug 12 20:02:47 2011 (r224805) +++ head/sys/cam/cam_xpt.c Fri Aug 12 20:09:38 2011 (r224806) @@ -3336,8 +3336,10 @@ xpt_create_path_unlocked(struct cam_path } } status = xpt_compile_path(path, periph, path_id, target_id, lun_id); - if (need_unlock) + if (need_unlock) { CAM_SIM_UNLOCK(bus->sim); + xpt_release_bus(bus); + } if (status != CAM_REQ_CMP) { free(path, M_CAMXPT); path = NULL; @@ -3445,6 +3447,38 @@ xpt_free_path(struct cam_path *path) free(path, M_CAMXPT); } +void +xpt_path_counts(struct cam_path *path, uint32_t *bus_ref, + uint32_t *periph_ref, uint32_t *target_ref, uint32_t *device_ref) +{ + + mtx_lock(&xsoftc.xpt_topo_lock); + if (bus_ref) { + if (path->bus) + *bus_ref = path->bus->refcount; + else + *bus_ref = 0; + } + mtx_unlock(&xsoftc.xpt_topo_lock); + if (periph_ref) { + if (path->periph) + *periph_ref = path->periph->refcount; + else + *periph_ref = 0; + } + if (target_ref) { + if (path->target) + *target_ref = path->target->refcount; + else + *target_ref = 0; + } + if (device_ref) { + if (path->device) + *device_ref = path->device->refcount; + else + *device_ref = 0; + } +} /* * Return -1 for failure, 0 for exact match, 1 for match with wildcards @@ -4264,15 +4298,17 @@ static void xpt_release_bus(struct cam_eb *bus) { + mtx_lock(&xsoftc.xpt_topo_lock); + KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); if ((--bus->refcount == 0) && (TAILQ_FIRST(&bus->et_entries) == NULL)) { - mtx_lock(&xsoftc.xpt_topo_lock); TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); xsoftc.bus_generation++; mtx_unlock(&xsoftc.xpt_topo_lock); cam_sim_release(bus->sim); free(bus, M_CAMXPT); - } + } else + mtx_unlock(&xsoftc.xpt_topo_lock); } static struct cam_et * @@ -4296,7 +4332,9 @@ xpt_alloc_target(struct cam_eb *bus, tar * Hold a reference to our parent bus so it * will not go away before we do. */ + mtx_lock(&xsoftc.xpt_topo_lock); bus->refcount++; + mtx_unlock(&xsoftc.xpt_topo_lock); /* Insertion sort into our bus's target list */ cur_target = TAILQ_FIRST(&bus->et_entries); @@ -4317,15 +4355,17 @@ static void xpt_release_target(struct cam_et *target) { - if ((--target->refcount == 0) - && (TAILQ_FIRST(&target->ed_entries) == NULL)) { - TAILQ_REMOVE(&target->bus->et_entries, target, links); - target->bus->generation++; - xpt_release_bus(target->bus); - if (target->luns) - free(target->luns, M_CAMXPT); - free(target, M_CAMXPT); - } + if (target->refcount == 1) { + if (TAILQ_FIRST(&target->ed_entries) == NULL) { + TAILQ_REMOVE(&target->bus->et_entries, target, links); + target->bus->generation++; + xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); + free(target, M_CAMXPT); + } + } else + target->refcount--; } static struct cam_ed * @@ -4422,7 +4462,7 @@ void xpt_release_device(struct cam_ed *device) { - if (--device->refcount == 0) { + if (device->refcount == 1) { struct cam_devq *devq; if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX @@ -4430,7 +4470,7 @@ xpt_release_device(struct cam_ed *device panic("Removing device while still queued for ccbs"); if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) - callout_stop(&device->callout); + callout_stop(&device->callout); TAILQ_REMOVE(&device->target->ed_entries, device,links); device->target->generation++; @@ -4442,7 +4482,8 @@ xpt_release_device(struct cam_ed *device cam_ccbq_fini(&device->ccbq); xpt_release_target(device->target); free(device, M_CAMXPT); - } + } else + device->refcount--; } u_int32_t Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Fri Aug 12 20:02:47 2011 (r224805) +++ head/sys/cam/cam_xpt.h Fri Aug 12 20:09:38 2011 (r224806) @@ -106,6 +106,9 @@ cam_status xpt_create_path_unlocked(str int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path); void xpt_free_path(struct cam_path *path); +void xpt_path_counts(struct cam_path *path, uint32_t *bus_ref, + uint32_t *periph_ref, uint32_t *target_ref, + uint32_t *device_ref); int xpt_path_comp(struct cam_path *path1, struct cam_path *path2); void xpt_print_path(struct cam_path *path); @@ -138,4 +141,3 @@ void xpt_release_path(struct cam_path #endif /* _KERNEL */ #endif /* _CAM_CAM_XPT_H */ - From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 21:40:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F386106564A; Fri, 12 Aug 2011 21:40:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC918FC1F; Fri, 12 Aug 2011 21:40:25 +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 p7CLePbE084072; Fri, 12 Aug 2011 21:40:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CLeOq8084069; Fri, 12 Aug 2011 21:40:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108122140.p7CLeOq8084069@svn.freebsd.org> From: Doug Barton Date: Fri, 12 Aug 2011 21:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224807 - stable/8/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 21:40:25 -0000 Author: dougb Date: Fri Aug 12 21:40:24 2011 New Revision: 224807 URL: http://svn.freebsd.org/changeset/base/224807 Log: MFC r224726: Make clear that the -U option can be dangerous. In -p mode install the group file with the same permissions as normally done in etc/Makefile. Update the copyright. Modified: stable/8/usr.sbin/mergemaster/mergemaster.8 stable/8/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/8/usr.sbin/mergemaster/ (props changed) Modified: stable/8/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.8 Fri Aug 12 20:09:38 2011 (r224806) +++ stable/8/usr.sbin/mergemaster/mergemaster.8 Fri Aug 12 21:40:24 2011 (r224807) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2010 Douglas Barton +.\" Copyright (c) 1998-2011 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2010 +.Dd August 9, 2011 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -244,6 +244,8 @@ or another directory you specify in your rc file. .It Fl U Attempt to auto upgrade files that have not been user modified. +This option can be dangerous when there are critical changes +in the new versions that affect your running system. .It Fl m Ar /path/to/sources Specify the path to the directory where you want to do the .Xr make 1 . @@ -361,6 +363,7 @@ with all values commented out: #AUTO_INSTALL= # # Automatically upgrade files that have not been user modified (-U) +# ***DANGEROUS*** #AUTO_UPGRADE= # # Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) @@ -462,7 +465,7 @@ temporary root environment comes from Ni make world tutorial which is referenced above. .Sh AUTHORS This manual page and the script itself were written by -.An Douglas Barton Aq DougB@FreeBSD.org . +.An Douglas Barton Aq dougb@FreeBSD.org . .Sh BUGS There are no known bugs. Please report any problems, Modified: stable/8/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/8/usr.sbin/mergemaster/mergemaster.sh Fri Aug 12 20:09:38 2011 (r224806) +++ stable/8/usr.sbin/mergemaster/mergemaster.sh Fri Aug 12 21:40:24 2011 (r224807) @@ -5,8 +5,8 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2010 Douglas Barton -# DougB@FreeBSD.org +# Copyright 1998-2011 Douglas Barton +# dougb@FreeBSD.org # $FreeBSD$ @@ -30,6 +30,7 @@ display_usage () { echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' echo " -U Attempt to auto upgrade files that have not been user modified" + echo ' ***DANGEROUS***' echo '' echo " -m /path/directory Specify location of source to do the make in" echo " -t /path/directory Specify temp root directory" @@ -635,7 +636,7 @@ case "${RERUN}" in # Only set up files that are crucial to {build|install}world { mkdir -p ${TEMPROOT}/etc && cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && - cp -p ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || + install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; From owner-svn-src-all@FreeBSD.ORG Fri Aug 12 21:41:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961341065672; Fri, 12 Aug 2011 21:41:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84A7E8FC20; Fri, 12 Aug 2011 21:41: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 p7CLfKQs084155; Fri, 12 Aug 2011 21:41:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7CLfKsl084152; Fri, 12 Aug 2011 21:41:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108122141.p7CLfKsl084152@svn.freebsd.org> From: Doug Barton Date: Fri, 12 Aug 2011 21:41:20 +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: r224808 - stable/7/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2011 21:41:20 -0000 Author: dougb Date: Fri Aug 12 21:41:20 2011 New Revision: 224808 URL: http://svn.freebsd.org/changeset/base/224808 Log: MFC r224726: Make clear that the -U option can be dangerous. In -p mode install the group file with the same permissions as normally done in etc/Makefile. Update the copyright. Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 stable/7/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/7/usr.sbin/mergemaster/ (props changed) Modified: stable/7/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Aug 12 21:40:24 2011 (r224807) +++ stable/7/usr.sbin/mergemaster/mergemaster.8 Fri Aug 12 21:41:20 2011 (r224808) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2010 Douglas Barton +.\" Copyright (c) 1998-2011 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2010 +.Dd August 9, 2011 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -244,6 +244,8 @@ or another directory you specify in your rc file. .It Fl U Attempt to auto upgrade files that have not been user modified. +This option can be dangerous when there are critical changes +in the new versions that affect your running system. .It Fl m Ar /path/to/sources Specify the path to the directory where you want to do the .Xr make 1 . @@ -361,6 +363,7 @@ with all values commented out: #AUTO_INSTALL= # # Automatically upgrade files that have not been user modified (-U) +# ***DANGEROUS*** #AUTO_UPGRADE= # # Compare /etc/rc.conf[.local] to /etc/defaults/rc.conf (-C) @@ -462,7 +465,7 @@ temporary root environment comes from Ni make world tutorial which is referenced above. .Sh AUTHORS This manual page and the script itself were written by -.An Douglas Barton Aq DougB@FreeBSD.org . +.An Douglas Barton Aq dougb@FreeBSD.org . .Sh BUGS There are no known bugs. Please report any problems, Modified: stable/7/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Aug 12 21:40:24 2011 (r224807) +++ stable/7/usr.sbin/mergemaster/mergemaster.sh Fri Aug 12 21:41:20 2011 (r224808) @@ -5,8 +5,8 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2010 Douglas Barton -# DougB@FreeBSD.org +# Copyright 1998-2011 Douglas Barton +# dougb@FreeBSD.org # $FreeBSD$ @@ -30,6 +30,7 @@ display_usage () { echo ' -C Compare local rc.conf variables to the defaults' echo ' -P Preserve files that are overwritten' echo " -U Attempt to auto upgrade files that have not been user modified" + echo ' ***DANGEROUS***' echo '' echo " -m /path/directory Specify location of source to do the make in" echo " -t /path/directory Specify temp root directory" @@ -635,7 +636,7 @@ case "${RERUN}" in # Only set up files that are crucial to {build|install}world { mkdir -p ${TEMPROOT}/etc && cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && - cp -p ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || + install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 00:56:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807931065673; Sat, 13 Aug 2011 00:56:42 +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 66B9E8FC14; Sat, 13 Aug 2011 00:56:42 +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 p7D0ug0B089953; Sat, 13 Aug 2011 00:56:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7D0ugmR089946; Sat, 13 Aug 2011 00:56:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201108130056.p7D0ugmR089946@svn.freebsd.org> From: Xin LI Date: Sat, 13 Aug 2011 00:56:42 +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: r224809 - stable/8/usr.sbin/rpcbind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 00:56:42 -0000 Author: delphij Date: Sat Aug 13 00:56:42 2011 New Revision: 224809 URL: http://svn.freebsd.org/changeset/base/224809 Log: MFC r224001: Use prototype. While I'm there, add a pair of parenthesis to mark an if statment's border. Modified: stable/8/usr.sbin/rpcbind/rpcb_stat.c stable/8/usr.sbin/rpcbind/rpcb_svc_com.c stable/8/usr.sbin/rpcbind/rpcbind.c stable/8/usr.sbin/rpcbind/util.c stable/8/usr.sbin/rpcbind/warmstart.c Directory Properties: stable/8/usr.sbin/rpcbind/ (props changed) Modified: stable/8/usr.sbin/rpcbind/rpcb_stat.c ============================================================================== --- stable/8/usr.sbin/rpcbind/rpcb_stat.c Fri Aug 12 21:41:20 2011 (r224808) +++ stable/8/usr.sbin/rpcbind/rpcb_stat.c Sat Aug 13 00:56:42 2011 (r224809) @@ -54,7 +54,7 @@ static rpcb_stat_byvers inf; void -rpcbs_init() +rpcbs_init(void) { } Modified: stable/8/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- stable/8/usr.sbin/rpcbind/rpcb_svc_com.c Fri Aug 12 21:41:20 2011 (r224808) +++ stable/8/usr.sbin/rpcbind/rpcb_svc_com.c Sat Aug 13 00:56:42 2011 (r224809) @@ -1076,7 +1076,7 @@ netbuffree(struct netbuf *ap) extern bool_t __svc_clean_idle(fd_set *, int, bool_t); void -my_svc_run() +my_svc_run(void) { size_t nfds; struct pollfd pollfds[FD_SETSIZE]; Modified: stable/8/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- stable/8/usr.sbin/rpcbind/rpcbind.c Fri Aug 12 21:41:20 2011 (r224808) +++ stable/8/usr.sbin/rpcbind/rpcbind.c Sat Aug 13 00:56:42 2011 (r224809) @@ -178,12 +178,13 @@ main(int argc, char *argv[]) init_transport(nconf); while ((nconf = getnetconfig(nc_handle))) { - if (nconf->nc_flag & NC_VISIBLE) + if (nconf->nc_flag & NC_VISIBLE) { if (ipv6_only == 1 && strcmp(nconf->nc_protofmly, "inet") == 0) { /* DO NOTHING */ } else init_transport(nconf); + } } endnetconfig(nc_handle); @@ -766,7 +767,7 @@ terminate(int dummy __unused) } void -rpcbind_abort() +rpcbind_abort(void) { #ifdef WARMSTART write_warmstart(); /* Dump yourself */ Modified: stable/8/usr.sbin/rpcbind/util.c ============================================================================== --- stable/8/usr.sbin/rpcbind/util.c Fri Aug 12 21:41:20 2011 (r224808) +++ stable/8/usr.sbin/rpcbind/util.c Sat Aug 13 00:56:42 2011 (r224809) @@ -290,7 +290,7 @@ freeit: } void -network_init() +network_init(void) { #ifdef INET6 struct ifaddrs *ifap, *ifp; Modified: stable/8/usr.sbin/rpcbind/warmstart.c ============================================================================== --- stable/8/usr.sbin/rpcbind/warmstart.c Fri Aug 12 21:41:20 2011 (r224808) +++ stable/8/usr.sbin/rpcbind/warmstart.c Sat Aug 13 00:56:42 2011 (r224809) @@ -142,7 +142,7 @@ error: fprintf(stderr, "rpcbind: will st } void -write_warmstart() +write_warmstart(void) { (void) write_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &list_rbl); #ifdef PORTMAP @@ -152,7 +152,7 @@ write_warmstart() } void -read_warmstart() +read_warmstart(void) { rpcblist_ptr tmp_rpcbl = NULL; #ifdef PORTMAP From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 09:21:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12F15106566C; Sat, 13 Aug 2011 09:21:17 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 002CD8FC13; Sat, 13 Aug 2011 09:21:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7D9LGPx005251; Sat, 13 Aug 2011 09:21:16 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7D9LGIK005244; Sat, 13 Aug 2011 09:21:16 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108130921.p7D9LGIK005244@svn.freebsd.org> From: Jonathan Anderson Date: Sat, 13 Aug 2011 09:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224810 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 09:21:17 -0000 Author: jonathan Date: Sat Aug 13 09:21:16 2011 New Revision: 224810 URL: http://svn.freebsd.org/changeset/base/224810 Log: Allow Capsicum capabilities to delegate constrained access to file system subtrees to sandboxed processes. - Use of absolute paths and '..' are limited in capability mode. - Use of absolute paths and '..' are limited when looking up relative to a capability. - When a name lookup is performed, identify what operation is to be performed (such as CAP_MKDIR) as well as check for CAP_LOOKUP. With these constraints, openat() and friends are now safe in capability mode, and can then be used by code such as the capability-mode runtime linker. Approved by: re (bz), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_capability.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/sys/capability.h head/sys/sys/namei.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/kern/kern_descrip.c Sat Aug 13 09:21:16 2011 (r224810) @@ -2336,6 +2336,16 @@ _fget(struct thread *td, int fd, struct #ifdef CAPABILITIES /* + * If this is a capability, what rights does it have? + */ + if (haverightsp != NULL) { + if (fp->f_type == DTYPE_CAPABILITY) + *haverightsp = cap_rights(fp); + else + *haverightsp = CAP_MASK_VALID; + } + + /* * If a capability has been requested, return the capability directly. * Otherwise, check capability rights, extract the underlying object, * and check its access flags. Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/kern/sys_capability.c Sat Aug 13 09:21:16 2011 (r224810) @@ -220,7 +220,7 @@ cap_new(struct thread *td, struct cap_ne { int error, capfd; int fd = uap->fd; - struct file *fp, *fcapp; + struct file *fp; cap_rights_t rights = uap->rights; AUDIT_ARG_FD(fd); @@ -229,7 +229,7 @@ cap_new(struct thread *td, struct cap_ne if (error) return (error); AUDIT_ARG_FILE(td->td_proc, fp); - error = kern_capwrap(td, fp, rights, &fcapp, &capfd); + error = kern_capwrap(td, fp, rights, &capfd); if (error) return (error); @@ -267,10 +267,10 @@ cap_getrights(struct thread *td, struct */ int kern_capwrap(struct thread *td, struct file *fp, cap_rights_t rights, - struct file **fcappp, int *capfdp) + int *capfdp) { struct capability *cp, *cp_old; - struct file *fp_object; + struct file *fp_object, *fcapp; int error; if ((rights | CAP_MASK_VALID) != CAP_MASK_VALID) @@ -290,7 +290,7 @@ kern_capwrap(struct thread *td, struct f /* * Allocate a new file descriptor to hang the capability off of. */ - error = falloc(td, fcappp, capfdp, fp->f_flag); + error = falloc(td, &fcapp, capfdp, fp->f_flag); if (error) return (error); @@ -309,18 +309,18 @@ kern_capwrap(struct thread *td, struct f cp = uma_zalloc(capability_zone, M_WAITOK | M_ZERO); cp->cap_rights = rights; cp->cap_object = fp_object; - cp->cap_file = *fcappp; + cp->cap_file = fcapp; if (fp->f_flag & DFLAG_PASSABLE) - finit(*fcappp, fp->f_flag, DTYPE_CAPABILITY, cp, + finit(fcapp, fp->f_flag, DTYPE_CAPABILITY, cp, &capability_ops); else - finit(*fcappp, fp->f_flag, DTYPE_CAPABILITY, cp, + finit(fcapp, fp->f_flag, DTYPE_CAPABILITY, cp, &capability_ops_unpassable); /* * Release our private reference (the proc filedesc still has one). */ - fdrop(*fcappp, td); + fdrop(fcapp, td); return (0); } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/kern/vfs_lookup.c Sat Aug 13 09:21:16 2011 (r224810) @@ -180,6 +180,18 @@ namei(struct nameidata *ndp) if (!error && *cnp->cn_pnbuf == '\0') error = ENOENT; +#ifdef CAPABILITY_MODE + /* + * In capability mode, lookups must be "strictly relative" (i.e. + * not an absolute path, and not containing '..' components) to + * a real file descriptor, not the pseudo-descriptor AT_FDCWD. + */ + if (IN_CAPABILITY_MODE(td)) { + ndp->ni_strictrelative = 1; + if (ndp->ni_dirfd == AT_FDCWD) + error = ECAPMODE; + } +#endif if (error) { uma_zfree(namei_zone, cnp->cn_pnbuf); #ifdef DIAGNOSTIC @@ -214,12 +226,20 @@ namei(struct nameidata *ndp) AUDIT_ARG_ATFD1(ndp->ni_dirfd); if (cnp->cn_flags & AUDITVNODE2) AUDIT_ARG_ATFD2(ndp->ni_dirfd); -#ifdef CAPABILITY_MODE - KASSERT(!IN_CAPABILITY_MODE(td), - ("%s: reached %s:%d in capability mode", - __func__, __FILE__, __LINE__)); + error = fgetvp_rights(td, ndp->ni_dirfd, + ndp->ni_rightsneeded | CAP_LOOKUP, + &(ndp->ni_baserights), &dp); +#ifdef CAPABILITIES + /* + * Lookups relative to a capability must also be + * strictly relative. + * + * Note that a capability with rights CAP_MASK_VALID + * is treated exactly like a regular file descriptor. + */ + if (ndp->ni_baserights != CAP_MASK_VALID) + ndp->ni_strictrelative = 1; #endif - error = fgetvp(td, ndp->ni_dirfd, 0, &dp); } if (error != 0 || dp != NULL) { FILEDESC_SUNLOCK(fdp); @@ -261,6 +281,8 @@ namei(struct nameidata *ndp) if (*(cnp->cn_nameptr) == '/') { vrele(dp); VFS_UNLOCK_GIANT(vfslocked); + if (ndp->ni_strictrelative != 0) + return (ENOTCAPABLE); while (*(cnp->cn_nameptr) == '/') { cnp->cn_nameptr++; ndp->ni_pathlen--; @@ -604,7 +626,10 @@ dirloop: } /* - * Handle "..": four special cases. + * Handle "..": five special cases. + * 0. If doing a capability lookup, return ENOTCAPABLE (this is a + * fairly conservative design choice, but it's the only one that we + * are satisfied guarantees the property we're looking for). * 1. Return an error if this is the last component of * the name and the operation is DELETE or RENAME. * 2. If at root directory (e.g. after chroot) @@ -618,6 +643,10 @@ dirloop: * the jail or chroot, don't let them out. */ if (cnp->cn_flags & ISDOTDOT) { + if (ndp->ni_strictrelative != 0) { + error = ENOTCAPABLE; + goto bad; + } if ((cnp->cn_flags & ISLASTCN) != 0 && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) { error = EINVAL; Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/kern/vfs_syscalls.c Sat Aug 13 09:21:16 2011 (r224810) @@ -993,6 +993,41 @@ change_root(vp, td) return (0); } +static __inline cap_rights_t +flags_to_rights(int flags) +{ + cap_rights_t rights = 0; + + switch ((flags & O_ACCMODE)) { + case O_RDONLY: + rights |= CAP_READ; + break; + + case O_RDWR: + rights |= CAP_READ; + /* fall through */ + + case O_WRONLY: + rights |= CAP_WRITE; + break; + + case O_EXEC: + rights |= CAP_FEXECVE; + break; + } + + if (flags & O_CREAT) + rights |= CAP_CREATE; + + if (flags & O_TRUNC) + rights |= CAP_FTRUNCATE; + + if ((flags & O_EXLOCK) || (flags & O_SHLOCK)) + rights |= CAP_FLOCK; + + return (rights); +} + /* * Check permissions, allocate an open file structure, and call the device * open routine if any. @@ -1055,10 +1090,12 @@ kern_openat(struct thread *td, int fd, c struct flock lf; struct nameidata nd; int vfslocked; + cap_rights_t rights_needed = CAP_LOOKUP; AUDIT_ARG_FFLAGS(flags); AUDIT_ARG_MODE(mode); /* XXX: audit dirfd */ + rights_needed |= flags_to_rights(flags); /* * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags * may be specified. @@ -1082,8 +1119,8 @@ kern_openat(struct thread *td, int fd, c /* Set the flags early so the finit in devfs can pick them up. */ fp->f_flag = flags & FMASK; cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; - NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, fd, - td); + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, + path, fd, rights_needed, td); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open(&nd, &flags, cmode, fp); if (error) { @@ -1092,18 +1129,20 @@ kern_openat(struct thread *td, int fd, c * wonderous happened deep below and we just pass it up * pretending we know what we do. */ - if (error == ENXIO && fp->f_ops != &badfileops) { - fdrop(fp, td); - td->td_retval[0] = indx; - return (0); - } + if (error == ENXIO && fp->f_ops != &badfileops) + goto success; /* * handle special fdopen() case. bleh. dupfdopen() is * responsible for dropping the old contents of ofiles[indx] * if it succeeds. + * + * Don't do this for relative (capability) lookups; we don't + * understand exactly what would happen, and we don't think + * that it ever should. */ - if ((error == ENODEV || error == ENXIO) && + if ((nd.ni_strictrelative == 0) && + (error == ENODEV || error == ENXIO) && (td->td_dupfd >= 0)) { /* XXX from fdopen */ if ((error = finstall(td, fp, &indx, flags)) != 0) @@ -1172,9 +1211,22 @@ success: /* * If we haven't already installed the FD (for dupfdopen), do so now. */ - if (indx == -1) - if ((error = finstall(td, fp, &indx, flags)) != 0) - goto bad_unlocked; + if (indx == -1) { +#ifdef CAPABILITIES + if (nd.ni_strictrelative == 1) { + /* + * We are doing a strict relative lookup; wrap the + * result in a capability. + */ + if ((error = kern_capwrap(td, fp, nd.ni_baserights, + &indx)) != 0) + goto bad_unlocked; + } else +#endif + if ((error = finstall(td, fp, &indx, flags)) != 0) + goto bad_unlocked; + + } /* * Release our private reference, leaving the one associated with @@ -1301,8 +1353,9 @@ kern_mknodat(struct thread *td, int fd, return (error); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, - pathseg, path, fd, td); + NDINIT_ATRIGHTS(&nd, CREATE, + LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, pathseg, path, fd, + CAP_MKFIFO, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); @@ -2153,8 +2206,8 @@ kern_accessat(struct thread *td, int fd, } else cred = tmpcred = td->td_ucred; AUDIT_ARG_VALUE(mode); - NDINIT_AT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | - AUDITVNODE1, pathseg, path, fd, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, fd, CAP_FSTAT, td); if ((error = namei(&nd)) != 0) goto out1; vfslocked = NDHASGIANT(&nd); @@ -2363,9 +2416,9 @@ kern_statat_vnhook(struct thread *td, in if (flag & ~AT_SYMLINK_NOFOLLOW) return (EINVAL); - NDINIT_AT(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : + NDINIT_ATRIGHTS(&nd, LOOKUP, ((flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW) | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | MPSAFE, pathseg, - path, fd, td); + path, fd, CAP_FSTAT, td); if ((error = namei(&nd)) != 0) return (error); @@ -2920,8 +2973,8 @@ kern_fchmodat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, - fd, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, + path, fd, CAP_FCHMOD, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); @@ -3063,8 +3116,8 @@ kern_fchownat(struct thread *td, int fd, AUDIT_ARG_OWNER(uid, gid); follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW; - NDINIT_AT(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, path, - fd, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, follow | MPSAFE | AUDITVNODE1, pathseg, + path, fd, CAP_FCHOWN, td); if ((error = namei(&nd)) != 0) return (error); @@ -3279,8 +3332,8 @@ kern_utimesat(struct thread *td, int fd, if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - NDINIT_AT(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, pathseg, path, - fd, td); + NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | MPSAFE | AUDITVNODE1, pathseg, + path, fd, CAP_FUTIMES, td); if ((error = namei(&nd)) != 0) return (error); @@ -3610,11 +3663,11 @@ kern_renameat(struct thread *td, int old bwillwrite(); #ifdef MAC - NDINIT_AT(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | MPSAFE | - AUDITVNODE1, pathseg, old, oldfd, td); + NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | + MPSAFE | AUDITVNODE1, pathseg, old, oldfd, CAP_DELETE, td); #else - NDINIT_AT(&fromnd, DELETE, WANTPARENT | SAVESTART | MPSAFE | - AUDITVNODE1, pathseg, old, oldfd, td); + NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | MPSAFE | + AUDITVNODE1, pathseg, old, oldfd, CAP_DELETE, td); #endif if ((error = namei(&fromnd)) != 0) @@ -3637,8 +3690,9 @@ kern_renameat(struct thread *td, int old vrele(fvp); goto out1; } - NDINIT_AT(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | - MPSAFE | AUDITVNODE2, pathseg, new, newfd, td); + NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | + SAVESTART | MPSAFE | AUDITVNODE2, pathseg, new, newfd, CAP_CREATE, + td); if (fromnd.ni_vp->v_type == VDIR) tond.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&tond)) != 0) { @@ -3764,8 +3818,8 @@ kern_mkdirat(struct thread *td, int fd, AUDIT_ARG_MODE(mode); restart: bwillwrite(); - NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, - segflg, path, fd, td); + NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | + AUDITVNODE1, segflg, path, fd, CAP_MKDIR, td); nd.ni_cnd.cn_flags |= WILLBEDIR; if ((error = namei(&nd)) != 0) return (error); @@ -3853,8 +3907,8 @@ kern_rmdirat(struct thread *td, int fd, restart: bwillwrite(); - NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1, - pathseg, path, fd, td); + NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | + AUDITVNODE1, pathseg, path, fd, CAP_RMDIR, td); if ((error = namei(&nd)) != 0) return (error); vfslocked = NDHASGIANT(&nd); Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/sys/capability.h Sat Aug 13 09:21:16 2011 (r224810) @@ -142,7 +142,7 @@ * Create a capability to wrap a file object. */ int kern_capwrap(struct thread *td, struct file *fp, cap_rights_t rights, - struct file **cap, int *capfd); + int *capfd); /* * Unwrap a capability if its rights mask is a superset of 'rights'. Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Aug 13 00:56:42 2011 (r224809) +++ head/sys/sys/namei.h Sat Aug 13 09:21:16 2011 (r224810) @@ -63,6 +63,7 @@ struct nameidata { */ const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ + cap_rights_t ni_rightsneeded; /* rights required to look up vnode */ /* * Arguments to lookup. */ @@ -70,6 +71,11 @@ struct nameidata { struct vnode *ni_rootdir; /* logical root directory */ struct vnode *ni_topdir; /* logical top directory */ int ni_dirfd; /* starting directory for *at functions */ + int ni_strictrelative; /* relative lookup only; no '..' */ + /* + * Results: returned from namei + */ + cap_rights_t ni_baserights; /* rights the *at base has (or -1) */ /* * Results: returned from/manipulated by lookup */ @@ -151,11 +157,13 @@ struct nameidata { * Initialization of a nameidata structure. */ #define NDINIT(ndp, op, flags, segflg, namep, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, 0, td) #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, 0, td) +#define NDINIT_ATRIGHTS(ndp, op, flags, segflg, namep, dirfd, rights, td) \ + NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, rights, td) #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, 0, td) static __inline void NDINIT_ALL(struct nameidata *ndp, @@ -164,6 +172,7 @@ NDINIT_ALL(struct nameidata *ndp, const char *namep, int dirfd, struct vnode *startdir, + cap_rights_t rights, struct thread *td) { ndp->ni_cnd.cn_nameiop = op; @@ -172,6 +181,9 @@ NDINIT_ALL(struct nameidata *ndp, ndp->ni_dirp = namep; ndp->ni_dirfd = dirfd; ndp->ni_startdir = startdir; + ndp->ni_strictrelative = 0; + ndp->ni_rightsneeded = rights; + ndp->ni_baserights = 0; ndp->ni_cnd.cn_thread = td; } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 10:43:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF204106566C; Sat, 13 Aug 2011 10:43:21 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3D1B8FC20; Sat, 13 Aug 2011 10:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DAhLho010293; Sat, 13 Aug 2011 10:43:21 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DAhLtP010291; Sat, 13 Aug 2011 10:43:21 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201108131043.p7DAhLtP010291@svn.freebsd.org> From: Jonathan Anderson Date: Sat, 13 Aug 2011 10:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224812 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 10:43:22 -0000 Author: jonathan Date: Sat Aug 13 10:43:21 2011 New Revision: 224812 URL: http://svn.freebsd.org/changeset/base/224812 Log: Allow openat(2), fstatat(2), etc. in capability mode. namei() and lookup() can now perform "strictly relative" lookups. Such lookups, performed when in capability mode or when looking up relative to a directory capability, enforce two policies: - absolute paths are disallowed (including symlinks to absolute paths) - paths containing '..' components are disallowed These constraints make it safe to enable openat() and friends. These system calls are instrumental in supporting Capsicum components such as the capability-mode-aware runtime linker. Finally, adjust comments in capabilities.conf to reflect the actual state of the world (e.g. shm_open(2) already has the appropriate constraints, getdents(2) already requires CAP_SEEK). Approved by: re (bz), mentor (rwatson) Sponsored by: Google Inc. Modified: head/sys/kern/capabilities.conf Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Sat Aug 13 10:23:52 2011 (r224811) +++ head/sys/kern/capabilities.conf Sat Aug 13 10:43:21 2011 (r224812) @@ -239,9 +239,7 @@ getcontext ## Allow directory I/O on a file descriptor, subject to capability rights. ## Originally we had separate capabilities for directory-specific read ## operations, but on BSD we allow reading the raw directory data, so we just -## rely on CAP_READ (etc) now. -## -## XXXRW: Possibly these should also use CAP_SEEK. +## rely on CAP_READ and CAP_SEEK now. ## getdents getdirentries @@ -447,28 +445,26 @@ obreak olio_listio ## -## Once Capsicum is fully merged, some of the *at(2) calls which can be -## semantically constrained will be permitted in capability mode. For now, -## we will simply not allow them to be called. -## -#faccessat -#fstatat -#fchmodat -#futimesat -#mkdirat -#rmdirat -#mkfifoat -#mknodat -#openat -#renameat - -## -## ONCE CAPSICUM IS FULLY MERGED: -## Allow entry into open(2). This system call will fail, since access to the global -## file namespace has been disallowed, but allowing entry into the syscall means -## that an audit trail will be generated (which is also very useful for debugging), +## Operations relative to directory capabilities. +## +faccessat +fstatat +fchmodat +futimesat +mkdirat +rmdirat +mkfifoat +mknodat +openat +renameat + +## +## Allow entry into open(2). This system call will fail, since access to the +## global file namespace has been disallowed, but allowing entry into the +## syscall means that an audit trail will be generated (which is also very +## useful for debugging). ## -#open +open ## ## Allow poll(2), which will be scoped by capability rights. @@ -648,11 +644,9 @@ setsockopt setuid ## -## ONCE CAPSICUM IS FULLY MERGED: -## Allow shm_open(2), which is scoped so as to allow only access to new -## anonymous objects. +## shm_open(2) is scoped so as to allow only access to new anonymous objects. ## -#shm_open +shm_open ## ## Allow I/O-related file descriptors, subject to capability rights. From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 10:58:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 935A9106566C; Sat, 13 Aug 2011 10:58:53 +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 81F548FC16; Sat, 13 Aug 2011 10:58:53 +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 p7DAwrlX010961; Sat, 13 Aug 2011 10:58:53 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DAwrUU010959; Sat, 13 Aug 2011 10:58:53 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108131058.p7DAwrUU010959@svn.freebsd.org> From: Martin Matuska Date: Sat, 13 Aug 2011 10:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224814 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 10:58:53 -0000 Author: mm Date: Sat Aug 13 10:58:53 2011 New Revision: 224814 URL: http://svn.freebsd.org/changeset/base/224814 Log: Fix race between dmu_objset_prefetch() invoked from zfs_ioc_dataset_list_next() and dsl_dir_destroy_check() indirectly invoked from dmu_recv_existing_end() via dsl_dataset_destroy() by not prefetching temporary clones, as these count as always inconsistent. In addition, do not prefetch hidden datasets at all as we are not going to process these later. Filed as Illumos Bug #1346 PR: kern/157728 Tested by: Borja Marcos , mm Reviewed by: pjd Approved by: re (kib) MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 13 10:43:56 2011 (r224813) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 13 10:58:53 2011 (r224814) @@ -1964,7 +1964,8 @@ top: int len = sizeof (zc->zc_name) - (p - zc->zc_name); while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) - (void) dmu_objset_prefetch(zc->zc_name, NULL); + if (dataset_name_hidden(zc->zc_name) == B_FALSE) + (void) dmu_objset_prefetch(zc->zc_name, NULL); } do { From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:14:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331701065670; Sat, 13 Aug 2011 12:14:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184DC8FC0A; Sat, 13 Aug 2011 12:14:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCEe85014786; Sat, 13 Aug 2011 12:14:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCEe38014780; Sat, 13 Aug 2011 12:14:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131214.p7DCEe38014780@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 12:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224815 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:14:41 -0000 Author: rwatson Date: Sat Aug 13 12:14:40 2011 New Revision: 224815 URL: http://svn.freebsd.org/changeset/base/224815 Log: Regenerate system call files following r224812 changes to capabilities.conf. A no-op for non-Capsicum kernels; for Capsicum kernels, completes the enabling of fooat(2) system calls using capabilities. With this change, and subject to bug fixes, Capsicum capability support is now complete for 9.0. Approved by: re (kib) Submitted by: jonathan Sponsored by: Google Inc Modified: head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sat Aug 13 10:58:53 2011 (r224814) +++ head/sys/kern/init_sysent.c Sat Aug 13 12:14:40 2011 (r224815) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 224066 2011-07-15 18:26:19Z jonathan */ #include "opt_compat.h" @@ -39,7 +39,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = fork */ { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = read */ { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = write */ - { AS(open_args), (sy_call_t *)open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = open */ + { AS(open_args), (sy_call_t *)open, AUE_OPEN_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = open */ { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = close */ { AS(wait_args), (sy_call_t *)wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ { compat(AS(ocreat_args),creat), AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = old creat */ @@ -516,26 +516,26 @@ struct sysent sysent[] = { { AS(truncate_args), (sy_call_t *)truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = truncate */ { AS(ftruncate_args), (sy_call_t *)ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 480 = ftruncate */ { AS(thr_kill2_args), (sy_call_t *)thr_kill2, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ - { AS(shm_open_args), (sy_call_t *)shm_open, AUE_SHMOPEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 482 = shm_open */ + { AS(shm_open_args), (sy_call_t *)shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */ { AS(shm_unlink_args), (sy_call_t *)shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ { AS(cpuset_args), (sy_call_t *)cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ { AS(cpuset_setid_args), (sy_call_t *)cpuset_setid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 485 = cpuset_setid */ { AS(cpuset_getid_args), (sy_call_t *)cpuset_getid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 486 = cpuset_getid */ { AS(cpuset_getaffinity_args), (sy_call_t *)cpuset_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 487 = cpuset_getaffinity */ { AS(cpuset_setaffinity_args), (sy_call_t *)cpuset_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 488 = cpuset_setaffinity */ - { AS(faccessat_args), (sy_call_t *)faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 489 = faccessat */ - { AS(fchmodat_args), (sy_call_t *)fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 490 = fchmodat */ + { AS(faccessat_args), (sy_call_t *)faccessat, AUE_FACCESSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 489 = faccessat */ + { AS(fchmodat_args), (sy_call_t *)fchmodat, AUE_FCHMODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 490 = fchmodat */ { AS(fchownat_args), (sy_call_t *)fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 491 = fchownat */ { AS(fexecve_args), (sy_call_t *)fexecve, AUE_FEXECVE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 492 = fexecve */ - { AS(fstatat_args), (sy_call_t *)fstatat, AUE_FSTATAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 493 = fstatat */ - { AS(futimesat_args), (sy_call_t *)futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 494 = futimesat */ + { AS(fstatat_args), (sy_call_t *)fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 493 = fstatat */ + { AS(futimesat_args), (sy_call_t *)futimesat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 494 = futimesat */ { AS(linkat_args), (sy_call_t *)linkat, AUE_LINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 495 = linkat */ - { AS(mkdirat_args), (sy_call_t *)mkdirat, AUE_MKDIRAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 496 = mkdirat */ - { AS(mkfifoat_args), (sy_call_t *)mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 497 = mkfifoat */ - { AS(mknodat_args), (sy_call_t *)mknodat, AUE_MKNODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 498 = mknodat */ - { AS(openat_args), (sy_call_t *)openat, AUE_OPENAT_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 499 = openat */ + { AS(mkdirat_args), (sy_call_t *)mkdirat, AUE_MKDIRAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 496 = mkdirat */ + { AS(mkfifoat_args), (sy_call_t *)mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 497 = mkfifoat */ + { AS(mknodat_args), (sy_call_t *)mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 498 = mknodat */ + { AS(openat_args), (sy_call_t *)openat, AUE_OPENAT_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 499 = openat */ { AS(readlinkat_args), (sy_call_t *)readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 500 = readlinkat */ - { AS(renameat_args), (sy_call_t *)renameat, AUE_RENAMEAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 501 = renameat */ + { AS(renameat_args), (sy_call_t *)renameat, AUE_RENAMEAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 501 = renameat */ { AS(symlinkat_args), (sy_call_t *)symlinkat, AUE_SYMLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 502 = symlinkat */ { AS(unlinkat_args), (sy_call_t *)unlinkat, AUE_UNLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 503 = unlinkat */ { AS(posix_openpt_args), (sy_call_t *)posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 504 = posix_openpt */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Sat Aug 13 10:58:53 2011 (r224814) +++ head/sys/kern/syscalls.c Sat Aug 13 12:14:40 2011 (r224815) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 224066 2011-07-15 18:26:19Z jonathan */ const char *syscallnames[] = { Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Sat Aug 13 10:58:53 2011 (r224814) +++ head/sys/sys/syscall.h Sat Aug 13 12:14:40 2011 (r224815) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 224066 2011-07-15 18:26:19Z jonathan */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Sat Aug 13 10:58:53 2011 (r224814) +++ head/sys/sys/syscall.mk Sat Aug 13 12:14:40 2011 (r224815) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD +# created from FreeBSD: head/sys/kern/syscalls.master 224066 2011-07-15 18:26:19Z jonathan MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Sat Aug 13 10:58:53 2011 (r224814) +++ head/sys/sys/sysproto.h Sat Aug 13 12:14:40 2011 (r224815) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/kern/syscalls.master 224066 2011-07-15 18:26:19Z jonathan */ #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:28:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A8B106566C; Sat, 13 Aug 2011 12:28:58 +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 D6A4D8FC0A; Sat, 13 Aug 2011 12:28:58 +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 p7DCSwVG015353; Sat, 13 Aug 2011 12:28:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCSws2015350; Sat, 13 Aug 2011 12:28:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131228.p7DCSws2015350@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:28:58 +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: r224816 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:28:59 -0000 Author: marius Date: Sat Aug 13 12:28:58 2011 New Revision: 224816 URL: http://svn.freebsd.org/changeset/base/224816 Log: MFC: r223985 - For SAS but neither FC nor SPI controllers default to using MSI/MSI-X (still allowing their use to be disabled via device hints though). This matches what the corresponding Linux driver provided by LSI does. Tested with SAS1064. - There's no need to keep track of the RIDs used. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Remove a comment which no longer applies since r209599 (MFC'ed to stable/8 in r210376). - Assign NULL rather than 0 to pointers. Modified: stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_pci.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/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sat Aug 13 12:14:40 2011 (r224815) +++ stable/8/sys/dev/mpt/mpt.h Sat Aug 13 12:28:58 2011 (r224816) @@ -721,11 +721,9 @@ struct mpt_softc { * DMA Mapping Stuff */ struct resource * pci_reg; /* Register map for chip */ - int pci_mem_rid; /* Resource ID */ bus_space_tag_t pci_st; /* Bus tag for registers */ bus_space_handle_t pci_sh; /* Bus handle for registers */ /* PIO versions of above. */ - int pci_pio_rid; struct resource * pci_pio_reg; bus_space_tag_t pci_pio_st; bus_space_handle_t pci_pio_sh; Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:14:40 2011 (r224815) +++ stable/8/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:28:58 2011 (r224816) @@ -362,9 +362,11 @@ mpt_set_options(struct mpt_softc *mpt) } tval = 0; mpt->msi_enable = 0; - if (resource_int_value(device_get_name(mpt->dev), - device_get_unit(mpt->dev), "msi_enable", &tval) == 0 && tval == 1) { + if (mpt->is_sas) mpt->msi_enable = 1; + if (resource_int_value(device_get_name(mpt->dev), + device_get_unit(mpt->dev), "msi_enable", &tval) == 0) { + mpt->msi_enable = tval; } } #endif @@ -517,9 +519,9 @@ mpt_pci_attach(device_t dev) * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); + mpt_io_bar = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, RF_ACTIVE); + &mpt_io_bar, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -528,9 +530,9 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); + mpt_mem_bar = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, RF_ACTIVE); + &mpt_mem_bar, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { @@ -570,7 +572,7 @@ mpt_pci_attach(device_t dev) } } mpt->pci_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, - RF_ACTIVE | RF_SHAREABLE); + RF_ACTIVE | (mpt->pci_msi_count ? 0 : RF_SHAREABLE)); if (mpt->pci_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; @@ -589,7 +591,6 @@ mpt_pci_attach(device_t dev) } /* Allocate dma memory */ -/* XXX JGibbs -Should really be done based on IOCFacts. */ if (mpt_dma_mem_alloc(mpt)) { mpt_prt(mpt, "Could not allocate DMA memory\n"); goto bad; @@ -655,13 +656,13 @@ mpt_free_bus_resources(struct mpt_softc { if (mpt->ih) { bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih); - mpt->ih = 0; + mpt->ih = NULL; } if (mpt->pci_irq) { bus_release_resource(mpt->dev, SYS_RES_IRQ, - mpt->pci_msi_count ? 1 : 0, mpt->pci_irq); - mpt->pci_irq = 0; + rman_get_rid(mpt->pci_irq), mpt->pci_irq); + mpt->pci_irq = NULL; } if (mpt->pci_msi_count) { @@ -670,14 +671,14 @@ mpt_free_bus_resources(struct mpt_softc } if (mpt->pci_pio_reg) { - bus_release_resource(mpt->dev, SYS_RES_IOPORT, mpt->pci_pio_rid, - mpt->pci_pio_reg); - mpt->pci_pio_reg = 0; + bus_release_resource(mpt->dev, SYS_RES_IOPORT, + rman_get_rid(mpt->pci_pio_reg), mpt->pci_pio_reg); + mpt->pci_pio_reg = NULL; } if (mpt->pci_reg) { - bus_release_resource(mpt->dev, SYS_RES_MEMORY, mpt->pci_mem_rid, - mpt->pci_reg); - mpt->pci_reg = 0; + bus_release_resource(mpt->dev, SYS_RES_MEMORY, + rman_get_rid(mpt->pci_reg), mpt->pci_reg); + mpt->pci_reg = NULL; } MPT_LOCK_DESTROY(mpt); } @@ -817,10 +818,9 @@ mpt_dma_mem_free(struct mpt_softc *mpt) bus_dmamem_free(mpt->reply_dmat, mpt->reply, mpt->reply_dmap); bus_dma_tag_destroy(mpt->reply_dmat); bus_dma_tag_destroy(mpt->parent_dmat); - mpt->reply_dmat = 0; + mpt->reply_dmat = NULL; free(mpt->request_pool, M_DEVBUF); - mpt->request_pool = 0; - + mpt->request_pool = NULL; } /* Reads modifiable (via PCI transactions) config registers */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:29:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6581065673; Sat, 13 Aug 2011 12:29:50 +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 DA8D88FC17; Sat, 13 Aug 2011 12:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCToH3015424; Sat, 13 Aug 2011 12:29:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCTobs015421; Sat, 13 Aug 2011 12:29:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131229.p7DCTobs015421@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:29:50 +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: r224817 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:29:51 -0000 Author: marius Date: Sat Aug 13 12:29:50 2011 New Revision: 224817 URL: http://svn.freebsd.org/changeset/base/224817 Log: MFC: r223985 - For SAS but neither FC nor SPI controllers default to using MSI/MSI-X (still allowing their use to be disabled via device hints though). This matches what the corresponding Linux driver provided by LSI does. Tested with SAS1064. - There's no need to keep track of the RIDs used. - Don't allocate MSI/MSI-X as RF_SHAREABLE. - Remove a comment which no longer applies since r209599 (MFC'ed to stable/7 in r224332). - Assign NULL rather than 0 to pointers. Modified: stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_pci.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/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sat Aug 13 12:28:58 2011 (r224816) +++ stable/7/sys/dev/mpt/mpt.h Sat Aug 13 12:29:50 2011 (r224817) @@ -721,11 +721,9 @@ struct mpt_softc { * DMA Mapping Stuff */ struct resource * pci_reg; /* Register map for chip */ - int pci_mem_rid; /* Resource ID */ bus_space_tag_t pci_st; /* Bus tag for registers */ bus_space_handle_t pci_sh; /* Bus handle for registers */ /* PIO versions of above. */ - int pci_pio_rid; struct resource * pci_pio_reg; bus_space_tag_t pci_pio_st; bus_space_handle_t pci_pio_sh; Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:28:58 2011 (r224816) +++ stable/7/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:29:50 2011 (r224817) @@ -362,9 +362,11 @@ mpt_set_options(struct mpt_softc *mpt) } tval = 0; mpt->msi_enable = 0; - if (resource_int_value(device_get_name(mpt->dev), - device_get_unit(mpt->dev), "msi_enable", &tval) == 0 && tval == 1) { + if (mpt->is_sas) mpt->msi_enable = 1; + if (resource_int_value(device_get_name(mpt->dev), + device_get_unit(mpt->dev), "msi_enable", &tval) == 0) { + mpt->msi_enable = tval; } } #endif @@ -517,9 +519,9 @@ mpt_pci_attach(device_t dev) * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); + mpt_io_bar = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, RF_ACTIVE); + &mpt_io_bar, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -528,9 +530,9 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); + mpt_mem_bar = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, RF_ACTIVE); + &mpt_mem_bar, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { @@ -570,7 +572,7 @@ mpt_pci_attach(device_t dev) } } mpt->pci_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, - RF_ACTIVE | RF_SHAREABLE); + RF_ACTIVE | (mpt->pci_msi_count ? 0 : RF_SHAREABLE)); if (mpt->pci_irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; @@ -589,7 +591,6 @@ mpt_pci_attach(device_t dev) } /* Allocate dma memory */ -/* XXX JGibbs -Should really be done based on IOCFacts. */ if (mpt_dma_mem_alloc(mpt)) { mpt_prt(mpt, "Could not allocate DMA memory\n"); goto bad; @@ -655,13 +656,13 @@ mpt_free_bus_resources(struct mpt_softc { if (mpt->ih) { bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih); - mpt->ih = 0; + mpt->ih = NULL; } if (mpt->pci_irq) { bus_release_resource(mpt->dev, SYS_RES_IRQ, - mpt->pci_msi_count ? 1 : 0, mpt->pci_irq); - mpt->pci_irq = 0; + rman_get_rid(mpt->pci_irq), mpt->pci_irq); + mpt->pci_irq = NULL; } if (mpt->pci_msi_count) { @@ -670,14 +671,14 @@ mpt_free_bus_resources(struct mpt_softc } if (mpt->pci_pio_reg) { - bus_release_resource(mpt->dev, SYS_RES_IOPORT, mpt->pci_pio_rid, - mpt->pci_pio_reg); - mpt->pci_pio_reg = 0; + bus_release_resource(mpt->dev, SYS_RES_IOPORT, + rman_get_rid(mpt->pci_pio_reg), mpt->pci_pio_reg); + mpt->pci_pio_reg = NULL; } if (mpt->pci_reg) { - bus_release_resource(mpt->dev, SYS_RES_MEMORY, mpt->pci_mem_rid, - mpt->pci_reg); - mpt->pci_reg = 0; + bus_release_resource(mpt->dev, SYS_RES_MEMORY, + rman_get_rid(mpt->pci_reg), mpt->pci_reg); + mpt->pci_reg = NULL; } MPT_LOCK_DESTROY(mpt); } @@ -817,10 +818,9 @@ mpt_dma_mem_free(struct mpt_softc *mpt) bus_dmamem_free(mpt->reply_dmat, mpt->reply, mpt->reply_dmap); bus_dma_tag_destroy(mpt->reply_dmat); bus_dma_tag_destroy(mpt->parent_dmat); - mpt->reply_dmat = 0; + mpt->reply_dmat = NULL; free(mpt->request_pool, M_DEVBUF); - mpt->request_pool = 0; - + mpt->request_pool = NULL; } /* Reads modifiable (via PCI transactions) config registers */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:33:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA6001065672; Sat, 13 Aug 2011 12:33:06 +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 A79F48FC16; Sat, 13 Aug 2011 12:33: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 p7DCX6O3015599; Sat, 13 Aug 2011 12:33:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCX67j015590; Sat, 13 Aug 2011 12:33:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131233.p7DCX67j015590@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:33: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: r224818 - stable/8/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:33:06 -0000 Author: marius Date: Sat Aug 13 12:33:06 2011 New Revision: 224818 URL: http://svn.freebsd.org/changeset/base/224818 Log: MFC: r224493 - Staticize functions as appropriate and comment out unused ones. - Sprinkle some const where appropriate. - Consistently use target_id_t for the target parameter of mpt_map_physdisk() and mpt_is_raid_volume(). - Fix some whitespace bugs. Modified: stable/8/sys/dev/mpt/mpt.c stable/8/sys/dev/mpt/mpt.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_debug.c stable/8/sys/dev/mpt/mpt_pci.c stable/8/sys/dev/mpt/mpt_raid.c stable/8/sys/dev/mpt/mpt_raid.h stable/8/sys/dev/mpt/mpt_user.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/mpt/mpt.c ============================================================================== --- stable/8/sys/dev/mpt/mpt.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt.c Sat Aug 13 12:33:06 2011 (r224818) @@ -301,66 +301,75 @@ mpt_modevent(module_t mod, int type, voi return (error); } -int +static int mpt_stdload(struct mpt_personality *pers) { + /* Load is always successful. */ return (0); } -int +static int mpt_stdprobe(struct mpt_softc *mpt) { + /* Probe is always successful. */ return (0); } -int +static int mpt_stdattach(struct mpt_softc *mpt) { + /* Attach is always successful. */ return (0); } -int +static int mpt_stdenable(struct mpt_softc *mpt) { + /* Enable is always successful. */ return (0); } -void +static void mpt_stdready(struct mpt_softc *mpt) { -} +} -int +static int mpt_stdevent(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%x\n", msg->Event & 0xFF); /* Event was not for us. */ return (0); } -void +static void mpt_stdreset(struct mpt_softc *mpt, int type) { + } -void +static void mpt_stdshutdown(struct mpt_softc *mpt) { + } -void +static void mpt_stddetach(struct mpt_softc *mpt) { + } -int +static int mpt_stdunload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -383,7 +392,6 @@ mpt_postattach(void *unused) } SYSINIT(mptdev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, mpt_postattach, NULL); - /******************************* Bus DMA Support ******************************/ void mpt_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -478,6 +486,7 @@ static int mpt_default_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Default Handler Called: req=%p:%u reply_descriptor=%x frame=%p\n", req, req->serno, reply_desc, reply_frame); @@ -494,8 +503,8 @@ static int mpt_config_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { MSG_CONFIG *cfgp; MSG_CONFIG_REPLY *reply; @@ -528,6 +537,7 @@ static int mpt_handshake_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + /* Nothing to be done. */ return (TRUE); } @@ -650,6 +660,7 @@ static int mpt_core_event(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_core_event: 0x%x\n", msg->Event & 0xFF); switch(msg->Event & 0xFF) { @@ -870,6 +881,7 @@ mpt_complete_request_chain(struct mpt_so void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Address Reply:\n"); mpt_print_reply(reply_frame); } @@ -881,12 +893,14 @@ static __inline uint32_t mpt_rd_intr(st static __inline uint32_t mpt_rd_db(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_DOORBELL); } static __inline uint32_t mpt_rd_intr(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_INTR_STATUS); } @@ -895,6 +909,7 @@ static int mpt_wait_db_ack(struct mpt_softc *mpt) { int i; + for (i=0; i < MPT_MAX_WAIT; i++) { if (!MPT_DB_IS_BUSY(mpt_rd_intr(mpt))) { maxwait_ack = i > maxwait_ack ? i : maxwait_ack; @@ -910,6 +925,7 @@ static int mpt_wait_db_int(struct mpt_softc *mpt) { int i; + for (i = 0; i < MPT_MAX_WAIT; i++) { if (MPT_DB_INTR(mpt_rd_intr(mpt))) { maxwait_int = i > maxwait_int ? i : maxwait_int; @@ -925,6 +941,7 @@ void mpt_check_doorbell(struct mpt_softc *mpt) { uint32_t db = mpt_rd_db(mpt); + if (MPT_STATE(db) != MPT_DB_STATE_RUNNING) { mpt_prt(mpt, "Device not running\n"); mpt_print_db(db); @@ -956,6 +973,7 @@ static int mpt_download_fw(struct mpt_so static int mpt_soft_reset(struct mpt_softc *mpt) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "soft reset\n"); /* Have to use hard reset if we are not in Running state */ @@ -1019,6 +1037,7 @@ mpt_enable_diag_mode(struct mpt_softc *m static void mpt_disable_diag_mode(struct mpt_softc *mpt) { + mpt_write(mpt, MPT_OFFSET_SEQUENCE, 0xFFFFFFFF); } @@ -1094,6 +1113,7 @@ mpt_hard_reset(struct mpt_softc *mpt) static void mpt_core_ioc_reset(struct mpt_softc *mpt, int type) { + /* * Complete all pending requests with a status * appropriate for an IOC reset. @@ -1102,7 +1122,6 @@ mpt_core_ioc_reset(struct mpt_softc *mpt MPI_IOCSTATUS_INVALID_STATE); } - /* * Reset the IOC when needed. Try software command first then if needed * poke at the magic diagnostic reset. Note that a hard reset resets @@ -1263,6 +1282,7 @@ retry: void mpt_send_cmd(struct mpt_softc *mpt, request_t *req) { + if (mpt->verbose > MPT_PRT_DEBUG2) { mpt_dump_request(mpt, req); } @@ -2110,6 +2130,7 @@ mpt_send_event_request(struct mpt_softc void mpt_enable_ints(struct mpt_softc *mpt) { + /* Unmask every thing except door bell int */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_DB_MASK); } @@ -2120,6 +2141,7 @@ mpt_enable_ints(struct mpt_softc *mpt) void mpt_disable_ints(struct mpt_softc *mpt) { + /* Mask all interrupts */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_REPLY_MASK | MPT_INTR_DB_MASK); @@ -2219,7 +2241,7 @@ mpt_detach(struct mpt_softc *mpt) return (0); } -int +static int mpt_core_load(struct mpt_personality *pers) { int i; @@ -2245,7 +2267,7 @@ mpt_core_load(struct mpt_personality *pe * Initialize per-instance driver data and perform * initial controller configuration. */ -int +static int mpt_core_attach(struct mpt_softc *mpt) { int val, error; @@ -2276,9 +2298,10 @@ mpt_core_attach(struct mpt_softc *mpt) return (error); } -int +static int mpt_core_enable(struct mpt_softc *mpt) { + /* * We enter with the IOC enabled, but async events * not enabled, ports not enabled and interrupts @@ -2326,13 +2349,14 @@ mpt_core_enable(struct mpt_softc *mpt) return (0); } -void +static void mpt_core_shutdown(struct mpt_softc *mpt) { + mpt_disable_ints(mpt); } -void +static void mpt_core_detach(struct mpt_softc *mpt) { int val; @@ -2351,9 +2375,10 @@ mpt_core_detach(struct mpt_softc *mpt) mpt_dma_buf_free(mpt); } -int +static int mpt_core_unload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -2575,6 +2600,7 @@ static void mpt_dma_buf_free(struct mpt_softc *mpt) { int i; + if (mpt->request_dmat == 0) { mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); return; Modified: stable/8/sys/dev/mpt/mpt.h ============================================================================== --- stable/8/sys/dev/mpt/mpt.h Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt.h Sat Aug 13 12:33:06 2011 (r224818) @@ -1075,16 +1075,6 @@ mpt_complete_request_chain(struct mpt_so int mpt_reset(struct mpt_softc *, int /*reinit*/); /****************************** Debugging ************************************/ -typedef struct mpt_decode_entry { - char *name; - u_int value; - u_int mask; -} mpt_decode_entry_t; - -int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, - const char *name, u_int value, u_int *cur_column, - u_int wrap_point); - void mpt_dump_data(struct mpt_softc *, const char *, void *, int); void mpt_dump_request(struct mpt_softc *, request_t *); @@ -1110,17 +1100,21 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) +#if 0 #define mpt_lprtc(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) +#endif #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); +#if 0 void mpt_lprtc(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); #endif +#endif void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) @@ -1277,7 +1271,6 @@ void mpt_check_doorbell(struct mpt_soft void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame); -void mpt_set_config_regs(struct mpt_softc *); int mpt_issue_cfg_req(struct mpt_softc */*mpt*/, request_t */*req*/, cfgparms_t *params, bus_addr_t /*addr*/, bus_size_t/*len*/, @@ -1331,6 +1324,5 @@ char *mpt_ioc_diag(uint32_t diag); void mpt_req_state(mpt_req_state_t state); void mpt_print_config_request(void *vmsg); void mpt_print_request(void *vmsg); -void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *msg); void mpt_dump_sgl(SGE_IO_UNION *se, int offset); #endif /* _MPT_H_ */ Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:33:06 2011 (r224818) @@ -193,7 +193,7 @@ MODULE_DEPEND(mpt_cam, cam, 1, 1, 1); int mpt_enable_sata_wc = -1; TUNABLE_INT("hw.mpt.enable_sata_wc", &mpt_enable_sata_wc); -int +static int mpt_cam_probe(struct mpt_softc *mpt) { int role; @@ -215,7 +215,7 @@ mpt_cam_probe(struct mpt_softc *mpt) return (ENODEV); } -int +static int mpt_cam_attach(struct mpt_softc *mpt) { struct cam_devq *devq; @@ -509,7 +509,6 @@ mpt_read_config_info_fc(struct mpt_softc static int mpt_set_initial_config_fc(struct mpt_softc *mpt) { - CONFIG_PAGE_FC_PORT_1 fc; U32 fl; int r, doit = 0; @@ -881,8 +880,8 @@ static int mpt_sata_pass_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { req->IOCStatus = le16toh(reply_frame->IOCStatus); } @@ -1114,7 +1113,7 @@ mpt_set_initial_config_spi(struct mpt_so return (0); } -int +static int mpt_cam_enable(struct mpt_softc *mpt) { int error; @@ -1151,9 +1150,10 @@ out: return (error); } -void +static void mpt_cam_ready(struct mpt_softc *mpt) { + /* * If we're in target mode, hang out resources now * so we don't cause the world to hang talking to us. @@ -1171,7 +1171,7 @@ mpt_cam_ready(struct mpt_softc *mpt) mpt->ready = 1; } -void +static void mpt_cam_detach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -1842,8 +1842,6 @@ bad: memset(se, 0,sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == first_lim - 1) { @@ -1958,9 +1956,6 @@ bad: memset(se, 0, sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == this_seg_lim - 1) { @@ -3045,6 +3040,7 @@ mpt_fc_els_reply_handler(struct mpt_soft static void mpt_cam_ioc_reset(struct mpt_softc *mpt, int type) { + /* * The pending list is already run down by * the generic handler. Perform the same @@ -3974,6 +3970,7 @@ mpt_spawn_recovery_thread(struct mpt_sof static void mpt_terminate_recovery_thread(struct mpt_softc *mpt) { + if (mpt->recovery_thread == NULL) { return; } @@ -4377,6 +4374,7 @@ mpt_add_target_commands(struct mpt_softc static int mpt_enable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 1; } else if (lun >= MPT_MAX_LUNS) { @@ -4402,6 +4400,7 @@ static int mpt_disable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { int i; + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 0; } else if (lun >= MPT_MAX_LUNS) { @@ -5286,6 +5285,7 @@ mpt_tgt_dump_tgt_state(struct mpt_softc static void mpt_tgt_dump_req_state(struct mpt_softc *mpt, request_t *req) { + mpt_prt(mpt, "req %p:%u index %u (%x) state %x\n", req, req->serno, req->index, req->index, req->state); mpt_tgt_dump_tgt_state(mpt, req); Modified: stable/8/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_debug.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_debug.c Sat Aug 13 12:33:06 2011 (r224818) @@ -285,6 +285,7 @@ mpt_scsi_state(int code) } return buf; } + static char * mpt_scsi_status(int code) { @@ -298,10 +299,11 @@ mpt_scsi_status(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * + +static const char * mpt_who(int who_init) { - char *who; + const char *who; switch (who_init) { case MPT_DB_INIT_NOONE: who = "No One"; break; @@ -315,10 +317,10 @@ mpt_who(int who_init) return who; } -static char * +static const char * mpt_state(u_int32_t mb) { - char *text; + const char *text; switch (MPT_STATE(mb)) { case MPT_DB_STATE_RESET: text = "Reset"; break; @@ -347,6 +349,7 @@ mpt_scsi_tm_type(int code) void mpt_print_db(u_int32_t mb) { + printf("mpt mailbox: (0x%x) State %s WhoInit %s\n", mb, mpt_state(mb), mpt_who(MPT_WHO(mb))); } @@ -357,6 +360,7 @@ mpt_print_db(u_int32_t mb) static void mpt_print_reply_hdr(MSG_DEFAULT_REPLY *msg) { + printf("%s Reply @ %p\n", mpt_ioc_function(msg->Function), msg); printf("\tIOC Status %s\n", mpt_ioc_status(msg->IOCStatus)); printf("\tIOCLogInfo 0x%08x\n", msg->IOCLogInfo); @@ -368,6 +372,7 @@ mpt_print_reply_hdr(MSG_DEFAULT_REPLY *m static void mpt_print_init_reply(MSG_IOC_INIT_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tWhoInit %s\n", mpt_who(msg->WhoInit)); printf("\tMaxDevices 0x%02x\n", msg->MaxDevices); @@ -377,6 +382,7 @@ mpt_print_init_reply(MSG_IOC_INIT_REPLY static void mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tIOCNumber %d\n", msg->IOCNumber); printf("\tMaxChainDepth %d\n", msg->MaxChainDepth); @@ -402,6 +408,7 @@ mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY static void mpt_print_enable_reply(MSG_PORT_ENABLE_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tPort: %d\n", msg->PortNumber); } @@ -409,6 +416,7 @@ mpt_print_enable_reply(MSG_PORT_ENABLE_R static void mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tBus: %d\n", msg->Bus); printf("\tTargetID %d\n", msg->TargetID); @@ -420,11 +428,10 @@ mpt_print_scsi_io_reply(MSG_SCSI_IO_REPL printf("\tResponseInfo 0x%08x\n", msg->ResponseInfo); } - - static void mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tEvent: %s\n", mpt_ioc_event(msg->Event)); printf("\tEventContext 0x%04x\n", msg->EventContext); @@ -517,7 +524,7 @@ mpt_print_request_hdr(MSG_REQUEST_HEADER printf("\tMsgContext 0x%08x\n", req->MsgContext); } -void +static void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *orig_msg) { MSG_SCSI_IO_REQUEST local, *msg = &local; @@ -575,6 +582,7 @@ mpt_print_scsi_io_request(MSG_SCSI_IO_RE static void mpt_print_scsi_tmf_request(MSG_SCSI_TASK_MGMT *msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tLun 0x%02x\n", msg->LUN[1]); printf("\tTaskType %s\n", mpt_scsi_tm_type(msg->TaskType)); @@ -585,6 +593,7 @@ mpt_print_scsi_tmf_request(MSG_SCSI_TASK static void mpt_print_scsi_target_assist_request(PTR_MSG_TARGET_ASSIST_REQUEST msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tTargetAssist 0x%02x\n", msg->TargetAssistFlags); @@ -600,6 +609,7 @@ static void mpt_print_scsi_target_status_send_request(MSG_TARGET_STATUS_SEND_REQUEST *msg) { SGE_IO_UNION x; + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tStatusFlags 0x%02x\n", msg->StatusFlags); @@ -637,7 +647,14 @@ mpt_print_request(void *vreq) } } -int +#if 0 +typedef struct mpt_decode_entry { + char *name; + u_int value; + u_int mask; +} mpt_decode_entry_t; + +static int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, const char *name, u_int value, u_int *cur_column, u_int wrap_point) @@ -689,7 +706,7 @@ mpt_decode_value(mpt_decode_entry_t *tab return (printed); } -static mpt_decode_entry_t req_state_parse_table[] = { +static const mpt_decode_entry_t req_state_parse_table[] = { { "REQ_FREE", 0x00, 0xff }, { "REQ_ALLOCATED", 0x01, 0x01 }, { "REQ_QUEUED", 0x02, 0x02 }, @@ -698,13 +715,15 @@ static mpt_decode_entry_t req_state_pars { "REQ_NEED_WAKEUP", 0x10, 0x10 } }; -void +static void mpt_req_state(mpt_req_state_t state) { + mpt_decode_value(req_state_parse_table, NUM_ELEMENTS(req_state_parse_table), "REQ_STATE", state, NULL, 80); } +#endif #define LAST_SGE ( \ MPI_SGE_FLAGS_END_OF_LIST | \ @@ -805,6 +824,7 @@ mpt_dump_data(struct mpt_softc *mpt, con { int offset; uint8_t *cp = addr; + mpt_prt(mpt, "%s:", msg); for (offset = 0; offset < len; offset++) { if ((offset & 0xf) == 0) { @@ -820,6 +840,7 @@ mpt_dump_request(struct mpt_softc *mpt, { uint32_t *pReq = req->req_vbuf; int o; + #if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); @@ -850,6 +871,7 @@ mpt_lprt(struct mpt_softc *mpt, int leve } } +#if 0 void mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) { @@ -861,6 +883,7 @@ mpt_lprtc(struct mpt_softc *mpt, int lev } } #endif +#endif void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:33:06 2011 (r224818) @@ -201,6 +201,9 @@ static int mpt_pci_shutdown(device_t); static int mpt_dma_mem_alloc(struct mpt_softc *mpt); static void mpt_dma_mem_free(struct mpt_softc *mpt); static void mpt_read_config_regs(struct mpt_softc *mpt); +#if 0 +static void mpt_set_config_regs(struct mpt_softc *mpt); +#endif static void mpt_pci_intr(void *); static device_method_t mpt_methods[] = { @@ -404,6 +407,7 @@ mpt_link_peer(struct mpt_softc *mpt) static void mpt_unlink_peer(struct mpt_softc *mpt) { + if (mpt->mpt2) { mpt->mpt2->mpt2 = NULL; } @@ -654,6 +658,7 @@ bad: static void mpt_free_bus_resources(struct mpt_softc *mpt) { + if (mpt->ih) { bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih); mpt->ih = NULL; @@ -827,6 +832,7 @@ mpt_dma_mem_free(struct mpt_softc *mpt) static void mpt_read_config_regs(struct mpt_softc *mpt) { + mpt->pci_cfg.Command = pci_read_config(mpt->dev, PCIR_COMMAND, 2); mpt->pci_cfg.LatencyTimer_LineSize = pci_read_config(mpt->dev, PCIR_CACHELNSZ, 2); @@ -840,8 +846,9 @@ mpt_read_config_regs(struct mpt_softc *m mpt->pci_cfg.PMCSR = pci_read_config(mpt->dev, 0x44, 4); } +#if 0 /* Sets modifiable config registers */ -void +static void mpt_set_config_regs(struct mpt_softc *mpt) { uint32_t val; @@ -880,6 +887,7 @@ mpt_set_config_regs(struct mpt_softc *mp pci_write_config(mpt->dev, PCIR_INTLINE, mpt->pci_cfg.IntLine, 1); pci_write_config(mpt->dev, 0x44, mpt->pci_cfg.PMCSR, 4); } +#endif static void mpt_pci_intr(void *arg) Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:33:06 2011 (r224818) @@ -81,7 +81,6 @@ struct mpt_raid_action_result #define REQ_IOCSTATUS(req) ((req)->IOCStatus & MPI_IOCSTATUS_MASK) - static mpt_probe_handler_t mpt_raid_probe; static mpt_attach_handler_t mpt_raid_attach; static mpt_enable_handler_t mpt_raid_enable; @@ -125,9 +124,25 @@ static void mpt_adjust_queue_depth(struc static void mpt_raid_sysctl_attach(struct mpt_softc *); #endif +static const char *mpt_vol_type(struct mpt_raid_volume *vol); +static const char *mpt_vol_state(struct mpt_raid_volume *vol); +static const char *mpt_disk_state(struct mpt_raid_disk *disk); +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, + const char *fmt, ...); +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, + const char *fmt, ...); + +static int mpt_issue_raid_req(struct mpt_softc *mpt, + struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, + u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, + int write, int wait); + +static int mpt_refresh_raid_data(struct mpt_softc *mpt); +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt); + static uint32_t raid_handler_id = MPT_HANDLER_ID_NONE; -const char * +static const char * mpt_vol_type(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeType) { @@ -142,7 +157,7 @@ mpt_vol_type(struct mpt_raid_volume *vol } } -const char * +static const char * mpt_vol_state(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeStatus.State) { @@ -157,7 +172,7 @@ mpt_vol_state(struct mpt_raid_volume *vo } } -const char * +static const char * mpt_disk_state(struct mpt_raid_disk *disk) { switch (disk->config_page.PhysDiskStatus.State) { @@ -182,7 +197,7 @@ mpt_disk_state(struct mpt_raid_disk *dis } } -void +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, const char *fmt, ...) { @@ -196,7 +211,7 @@ mpt_vol_prt(struct mpt_softc *mpt, struc va_end(ap); } -void +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, const char *fmt, ...) { @@ -254,16 +269,17 @@ mpt_raid_async(void *callback_arg, u_int } } -int +static int mpt_raid_probe(struct mpt_softc *mpt) { + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) { return (ENODEV); } return (0); } -int +static int mpt_raid_attach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -307,13 +323,14 @@ cleanup: return (error); } -int +static int mpt_raid_enable(struct mpt_softc *mpt) { + return (0); } -void +static void mpt_raid_detach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -338,6 +355,7 @@ mpt_raid_detach(struct mpt_softc *mpt) static void mpt_raid_ioc_reset(struct mpt_softc *mpt, int type) { + /* Nothing to do yet. */ } @@ -570,7 +588,7 @@ mpt_raid_reply_frame_handler(struct mpt_ /* * Utiltity routine to perform a RAID action command; */ -int +static int mpt_issue_raid_req(struct mpt_softc *mpt, struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, @@ -719,6 +737,7 @@ mpt_raid_thread(void *arg) static void mpt_raid_quiesce_timeout(void *arg) { + /* Complete the CCB with error */ /* COWWWW */ } @@ -776,7 +795,7 @@ mpt_raid_quiesce_disk(struct mpt_softc * /* XXX Ignores that there may be multiple busses/IOCs involved. */ cam_status -mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, u_int *tgt) +mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, target_id_t *tgt) { struct mpt_raid_disk *mpt_disk; @@ -793,7 +812,7 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int -mpt_is_raid_volume(struct mpt_softc *mpt, int tgt) +mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; CONFIG_PAGE_IOC_2_RAID_VOL *ioc_last_vol; @@ -1305,7 +1324,7 @@ mpt_refresh_raid_vol(struct mpt_softc *m * be updated by our event handler. Interesting changes are displayed * to the console. */ -int +static int mpt_refresh_raid_data(struct mpt_softc *mpt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; @@ -1565,9 +1584,10 @@ mpt_raid_timer(void *arg) #endif } -void +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt) { + callout_reset(&mpt->raid_timer, MPT_RAID_SYNC_REPORT_INTERVAL, mpt_raid_timer, mpt); } @@ -1719,7 +1739,8 @@ mpt_raid_set_vol_mwce(struct mpt_softc * MPT_UNLOCK(mpt); return (0); } -const char *mpt_vol_mwce_strs[] = + +static const char *mpt_vol_mwce_strs[] = { "On", "Off", Modified: stable/8/sys/dev/mpt/mpt_raid.h ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:33:06 2011 (r224818) @@ -53,29 +53,13 @@ typedef enum { MPT_RAID_MWCE_NC } mpt_raid_mwce_t; -const char *mpt_vol_type(struct mpt_raid_volume *); -const char *mpt_vol_state(struct mpt_raid_volume *); -const char *mpt_disk_state(struct mpt_raid_disk *); -void -mpt_vol_prt(struct mpt_softc *, struct mpt_raid_volume *, const char *fmt, ...); -void -mpt_disk_prt(struct mpt_softc *, struct mpt_raid_disk *, const char *, ...); - -int -mpt_issue_raid_req(struct mpt_softc *, struct mpt_raid_volume *, - struct mpt_raid_disk *, request_t *, u_int, uint32_t, bus_addr_t, - bus_size_t, int, int); - -cam_status -mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); -int mpt_is_raid_volume(struct mpt_softc *, int); +cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status mpt_raid_quiesce_disk(struct mpt_softc *, struct mpt_raid_disk *, request_t *); #endif -int mpt_refresh_raid_data(struct mpt_softc *); -void mpt_schedule_raid_refresh(struct mpt_softc *); void mpt_raid_free_mem(struct mpt_softc *); static __inline void Modified: stable/8/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_user.c Sat Aug 13 12:29:50 2011 (r224817) +++ stable/8/sys/dev/mpt/mpt_user.c Sat Aug 13 12:33:06 2011 (r224818) @@ -94,7 +94,7 @@ static MALLOC_DEFINE(M_MPTUSER, "mpt_use static uint32_t user_handler_id = MPT_HANDLER_ID_NONE; -int +static int mpt_user_probe(struct mpt_softc *mpt) { @@ -102,7 +102,7 @@ mpt_user_probe(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_attach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -131,19 +131,20 @@ mpt_user_attach(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_enable(struct mpt_softc *mpt) { return (0); } -void +static void mpt_user_ready(struct mpt_softc *mpt) { + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:33:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 225341065676; Sat, 13 Aug 2011 12:33:42 +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 0FD7C8FC1A; Sat, 13 Aug 2011 12:33:42 +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 p7DCXgEi015656; Sat, 13 Aug 2011 12:33:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCXf3p015647; Sat, 13 Aug 2011 12:33:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131233.p7DCXf3p015647@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:33:41 +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: r224819 - stable/7/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:33:42 -0000 Author: marius Date: Sat Aug 13 12:33:41 2011 New Revision: 224819 URL: http://svn.freebsd.org/changeset/base/224819 Log: MFC: r224493 - Staticize functions as appropriate and comment out unused ones. - Sprinkle some const where appropriate. - Consistently use target_id_t for the target parameter of mpt_map_physdisk() and mpt_is_raid_volume(). - Fix some whitespace bugs. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_pci.c stable/7/sys/dev/mpt/mpt_raid.c stable/7/sys/dev/mpt/mpt_raid.h stable/7/sys/dev/mpt/mpt_user.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/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt.c Sat Aug 13 12:33:41 2011 (r224819) @@ -301,66 +301,75 @@ mpt_modevent(module_t mod, int type, voi return (error); } -int +static int mpt_stdload(struct mpt_personality *pers) { + /* Load is always successful. */ return (0); } -int +static int mpt_stdprobe(struct mpt_softc *mpt) { + /* Probe is always successful. */ return (0); } -int +static int mpt_stdattach(struct mpt_softc *mpt) { + /* Attach is always successful. */ return (0); } -int +static int mpt_stdenable(struct mpt_softc *mpt) { + /* Enable is always successful. */ return (0); } -void +static void mpt_stdready(struct mpt_softc *mpt) { -} +} -int +static int mpt_stdevent(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%x\n", msg->Event & 0xFF); /* Event was not for us. */ return (0); } -void +static void mpt_stdreset(struct mpt_softc *mpt, int type) { + } -void +static void mpt_stdshutdown(struct mpt_softc *mpt) { + } -void +static void mpt_stddetach(struct mpt_softc *mpt) { + } -int +static int mpt_stdunload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -383,7 +392,6 @@ mpt_postattach(void *unused) } SYSINIT(mptdev, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, mpt_postattach, NULL); - /******************************* Bus DMA Support ******************************/ void mpt_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -478,6 +486,7 @@ static int mpt_default_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Default Handler Called: req=%p:%u reply_descriptor=%x frame=%p\n", req, req->serno, reply_desc, reply_frame); @@ -494,8 +503,8 @@ static int mpt_config_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { MSG_CONFIG *cfgp; MSG_CONFIG_REPLY *reply; @@ -528,6 +537,7 @@ static int mpt_handshake_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { + /* Nothing to be done. */ return (TRUE); } @@ -650,6 +660,7 @@ static int mpt_core_event(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_core_event: 0x%x\n", msg->Event & 0xFF); switch(msg->Event & 0xFF) { @@ -870,6 +881,7 @@ mpt_complete_request_chain(struct mpt_so void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame) { + mpt_prt(mpt, "Address Reply:\n"); mpt_print_reply(reply_frame); } @@ -881,12 +893,14 @@ static __inline uint32_t mpt_rd_intr(st static __inline uint32_t mpt_rd_db(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_DOORBELL); } static __inline uint32_t mpt_rd_intr(struct mpt_softc *mpt) { + return mpt_read(mpt, MPT_OFFSET_INTR_STATUS); } @@ -895,6 +909,7 @@ static int mpt_wait_db_ack(struct mpt_softc *mpt) { int i; + for (i=0; i < MPT_MAX_WAIT; i++) { if (!MPT_DB_IS_BUSY(mpt_rd_intr(mpt))) { maxwait_ack = i > maxwait_ack ? i : maxwait_ack; @@ -910,6 +925,7 @@ static int mpt_wait_db_int(struct mpt_softc *mpt) { int i; + for (i = 0; i < MPT_MAX_WAIT; i++) { if (MPT_DB_INTR(mpt_rd_intr(mpt))) { maxwait_int = i > maxwait_int ? i : maxwait_int; @@ -925,6 +941,7 @@ void mpt_check_doorbell(struct mpt_softc *mpt) { uint32_t db = mpt_rd_db(mpt); + if (MPT_STATE(db) != MPT_DB_STATE_RUNNING) { mpt_prt(mpt, "Device not running\n"); mpt_print_db(db); @@ -956,6 +973,7 @@ static int mpt_download_fw(struct mpt_so static int mpt_soft_reset(struct mpt_softc *mpt) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "soft reset\n"); /* Have to use hard reset if we are not in Running state */ @@ -1019,6 +1037,7 @@ mpt_enable_diag_mode(struct mpt_softc *m static void mpt_disable_diag_mode(struct mpt_softc *mpt) { + mpt_write(mpt, MPT_OFFSET_SEQUENCE, 0xFFFFFFFF); } @@ -1094,6 +1113,7 @@ mpt_hard_reset(struct mpt_softc *mpt) static void mpt_core_ioc_reset(struct mpt_softc *mpt, int type) { + /* * Complete all pending requests with a status * appropriate for an IOC reset. @@ -1102,7 +1122,6 @@ mpt_core_ioc_reset(struct mpt_softc *mpt MPI_IOCSTATUS_INVALID_STATE); } - /* * Reset the IOC when needed. Try software command first then if needed * poke at the magic diagnostic reset. Note that a hard reset resets @@ -1263,6 +1282,7 @@ retry: void mpt_send_cmd(struct mpt_softc *mpt, request_t *req) { + if (mpt->verbose > MPT_PRT_DEBUG2) { mpt_dump_request(mpt, req); } @@ -2110,6 +2130,7 @@ mpt_send_event_request(struct mpt_softc void mpt_enable_ints(struct mpt_softc *mpt) { + /* Unmask every thing except door bell int */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_DB_MASK); } @@ -2120,6 +2141,7 @@ mpt_enable_ints(struct mpt_softc *mpt) void mpt_disable_ints(struct mpt_softc *mpt) { + /* Mask all interrupts */ mpt_write(mpt, MPT_OFFSET_INTR_MASK, MPT_INTR_REPLY_MASK | MPT_INTR_DB_MASK); @@ -2219,7 +2241,7 @@ mpt_detach(struct mpt_softc *mpt) return (0); } -int +static int mpt_core_load(struct mpt_personality *pers) { int i; @@ -2245,7 +2267,7 @@ mpt_core_load(struct mpt_personality *pe * Initialize per-instance driver data and perform * initial controller configuration. */ -int +static int mpt_core_attach(struct mpt_softc *mpt) { int val, error; @@ -2276,9 +2298,10 @@ mpt_core_attach(struct mpt_softc *mpt) return (error); } -int +static int mpt_core_enable(struct mpt_softc *mpt) { + /* * We enter with the IOC enabled, but async events * not enabled, ports not enabled and interrupts @@ -2326,13 +2349,14 @@ mpt_core_enable(struct mpt_softc *mpt) return (0); } -void +static void mpt_core_shutdown(struct mpt_softc *mpt) { + mpt_disable_ints(mpt); } -void +static void mpt_core_detach(struct mpt_softc *mpt) { int val; @@ -2351,9 +2375,10 @@ mpt_core_detach(struct mpt_softc *mpt) mpt_dma_buf_free(mpt); } -int +static int mpt_core_unload(struct mpt_personality *pers) { + /* Unload is always successful. */ return (0); } @@ -2575,6 +2600,7 @@ static void mpt_dma_buf_free(struct mpt_softc *mpt) { int i; + if (mpt->request_dmat == 0) { mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); return; Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt.h Sat Aug 13 12:33:41 2011 (r224819) @@ -1075,16 +1075,6 @@ mpt_complete_request_chain(struct mpt_so int mpt_reset(struct mpt_softc *, int /*reinit*/); /****************************** Debugging ************************************/ -typedef struct mpt_decode_entry { - char *name; - u_int value; - u_int mask; -} mpt_decode_entry_t; - -int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, - const char *name, u_int value, u_int *cur_column, - u_int wrap_point); - void mpt_dump_data(struct mpt_softc *, const char *, void *, int); void mpt_dump_request(struct mpt_softc *, request_t *); @@ -1110,17 +1100,21 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) +#if 0 #define mpt_lprtc(mpt, level, ...) \ do { \ if (level <= (mpt)->verbose) \ mpt_prtc(mpt, __VA_ARGS__); \ } while (0) +#endif #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); +#if 0 void mpt_lprtc(struct mpt_softc *, int, const char *, ...) __printflike(3, 4); #endif +#endif void mpt_prt(struct mpt_softc *, const char *, ...) __printflike(2, 3); void mpt_prtc(struct mpt_softc *, const char *, ...) @@ -1277,7 +1271,6 @@ void mpt_check_doorbell(struct mpt_soft void mpt_dump_reply_frame(struct mpt_softc *mpt, MSG_DEFAULT_REPLY *reply_frame); -void mpt_set_config_regs(struct mpt_softc *); int mpt_issue_cfg_req(struct mpt_softc */*mpt*/, request_t */*req*/, cfgparms_t *params, bus_addr_t /*addr*/, bus_size_t/*len*/, @@ -1331,6 +1324,5 @@ char *mpt_ioc_diag(uint32_t diag); void mpt_req_state(mpt_req_state_t state); void mpt_print_config_request(void *vmsg); void mpt_print_request(void *vmsg); -void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *msg); void mpt_dump_sgl(SGE_IO_UNION *se, int offset); #endif /* _MPT_H_ */ Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:33:41 2011 (r224819) @@ -193,7 +193,7 @@ MODULE_DEPEND(mpt_cam, cam, 1, 1, 1); int mpt_enable_sata_wc = -1; TUNABLE_INT("hw.mpt.enable_sata_wc", &mpt_enable_sata_wc); -int +static int mpt_cam_probe(struct mpt_softc *mpt) { int role; @@ -215,7 +215,7 @@ mpt_cam_probe(struct mpt_softc *mpt) return (ENODEV); } -int +static int mpt_cam_attach(struct mpt_softc *mpt) { struct cam_devq *devq; @@ -509,7 +509,6 @@ mpt_read_config_info_fc(struct mpt_softc static int mpt_set_initial_config_fc(struct mpt_softc *mpt) { - CONFIG_PAGE_FC_PORT_1 fc; U32 fl; int r, doit = 0; @@ -881,8 +880,8 @@ static int mpt_sata_pass_reply_handler(struct mpt_softc *mpt, request_t *req, uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame) { - if (req != NULL) { + if (req != NULL) { if (reply_frame != NULL) { req->IOCStatus = le16toh(reply_frame->IOCStatus); } @@ -1114,7 +1113,7 @@ mpt_set_initial_config_spi(struct mpt_so return (0); } -int +static int mpt_cam_enable(struct mpt_softc *mpt) { int error; @@ -1151,9 +1150,10 @@ out: return (error); } -void +static void mpt_cam_ready(struct mpt_softc *mpt) { + /* * If we're in target mode, hang out resources now * so we don't cause the world to hang talking to us. @@ -1171,7 +1171,7 @@ mpt_cam_ready(struct mpt_softc *mpt) mpt->ready = 1; } -void +static void mpt_cam_detach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -1842,8 +1842,6 @@ bad: memset(se, 0,sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == first_lim - 1) { @@ -1958,9 +1956,6 @@ bad: memset(se, 0, sizeof (*se)); se->Address = htole32(dm_segs->ds_addr); - - - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; if (seg == this_seg_lim - 1) { @@ -3045,6 +3040,7 @@ mpt_fc_els_reply_handler(struct mpt_soft static void mpt_cam_ioc_reset(struct mpt_softc *mpt, int type) { + /* * The pending list is already run down by * the generic handler. Perform the same @@ -3976,6 +3972,7 @@ mpt_spawn_recovery_thread(struct mpt_sof static void mpt_terminate_recovery_thread(struct mpt_softc *mpt) { + if (mpt->recovery_thread == NULL) { return; } @@ -4379,6 +4376,7 @@ mpt_add_target_commands(struct mpt_softc static int mpt_enable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 1; } else if (lun >= MPT_MAX_LUNS) { @@ -4404,6 +4402,7 @@ static int mpt_disable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun) { int i; + if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) { mpt->twildcard = 0; } else if (lun >= MPT_MAX_LUNS) { @@ -5288,6 +5287,7 @@ mpt_tgt_dump_tgt_state(struct mpt_softc static void mpt_tgt_dump_req_state(struct mpt_softc *mpt, request_t *req) { + mpt_prt(mpt, "req %p:%u index %u (%x) state %x\n", req, req->serno, req->index, req->index, req->state); mpt_tgt_dump_tgt_state(mpt, req); Modified: stable/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_debug.c Sat Aug 13 12:33:41 2011 (r224819) @@ -285,6 +285,7 @@ mpt_scsi_state(int code) } return buf; } + static char * mpt_scsi_status(int code) { @@ -298,10 +299,11 @@ mpt_scsi_status(int code) snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } -static char * + +static const char * mpt_who(int who_init) { - char *who; + const char *who; switch (who_init) { case MPT_DB_INIT_NOONE: who = "No One"; break; @@ -315,10 +317,10 @@ mpt_who(int who_init) return who; } -static char * +static const char * mpt_state(u_int32_t mb) { - char *text; + const char *text; switch (MPT_STATE(mb)) { case MPT_DB_STATE_RESET: text = "Reset"; break; @@ -347,6 +349,7 @@ mpt_scsi_tm_type(int code) void mpt_print_db(u_int32_t mb) { + printf("mpt mailbox: (0x%x) State %s WhoInit %s\n", mb, mpt_state(mb), mpt_who(MPT_WHO(mb))); } @@ -357,6 +360,7 @@ mpt_print_db(u_int32_t mb) static void mpt_print_reply_hdr(MSG_DEFAULT_REPLY *msg) { + printf("%s Reply @ %p\n", mpt_ioc_function(msg->Function), msg); printf("\tIOC Status %s\n", mpt_ioc_status(msg->IOCStatus)); printf("\tIOCLogInfo 0x%08x\n", msg->IOCLogInfo); @@ -368,6 +372,7 @@ mpt_print_reply_hdr(MSG_DEFAULT_REPLY *m static void mpt_print_init_reply(MSG_IOC_INIT_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tWhoInit %s\n", mpt_who(msg->WhoInit)); printf("\tMaxDevices 0x%02x\n", msg->MaxDevices); @@ -377,6 +382,7 @@ mpt_print_init_reply(MSG_IOC_INIT_REPLY static void mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tIOCNumber %d\n", msg->IOCNumber); printf("\tMaxChainDepth %d\n", msg->MaxChainDepth); @@ -402,6 +408,7 @@ mpt_print_ioc_facts(MSG_IOC_FACTS_REPLY static void mpt_print_enable_reply(MSG_PORT_ENABLE_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tPort: %d\n", msg->PortNumber); } @@ -409,6 +416,7 @@ mpt_print_enable_reply(MSG_PORT_ENABLE_R static void mpt_print_scsi_io_reply(MSG_SCSI_IO_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tBus: %d\n", msg->Bus); printf("\tTargetID %d\n", msg->TargetID); @@ -420,11 +428,10 @@ mpt_print_scsi_io_reply(MSG_SCSI_IO_REPL printf("\tResponseInfo 0x%08x\n", msg->ResponseInfo); } - - static void mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *msg) { + mpt_print_reply_hdr((MSG_DEFAULT_REPLY *)msg); printf("\tEvent: %s\n", mpt_ioc_event(msg->Event)); printf("\tEventContext 0x%04x\n", msg->EventContext); @@ -517,7 +524,7 @@ mpt_print_request_hdr(MSG_REQUEST_HEADER printf("\tMsgContext 0x%08x\n", req->MsgContext); } -void +static void mpt_print_scsi_io_request(MSG_SCSI_IO_REQUEST *orig_msg) { MSG_SCSI_IO_REQUEST local, *msg = &local; @@ -575,6 +582,7 @@ mpt_print_scsi_io_request(MSG_SCSI_IO_RE static void mpt_print_scsi_tmf_request(MSG_SCSI_TASK_MGMT *msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tLun 0x%02x\n", msg->LUN[1]); printf("\tTaskType %s\n", mpt_scsi_tm_type(msg->TaskType)); @@ -585,6 +593,7 @@ mpt_print_scsi_tmf_request(MSG_SCSI_TASK static void mpt_print_scsi_target_assist_request(PTR_MSG_TARGET_ASSIST_REQUEST msg) { + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tTargetAssist 0x%02x\n", msg->TargetAssistFlags); @@ -600,6 +609,7 @@ static void mpt_print_scsi_target_status_send_request(MSG_TARGET_STATUS_SEND_REQUEST *msg) { SGE_IO_UNION x; + mpt_print_request_hdr((MSG_REQUEST_HEADER *)msg); printf("\tStatusCode 0x%02x\n", msg->StatusCode); printf("\tStatusFlags 0x%02x\n", msg->StatusFlags); @@ -637,7 +647,14 @@ mpt_print_request(void *vreq) } } -int +#if 0 +typedef struct mpt_decode_entry { + char *name; + u_int value; + u_int mask; +} mpt_decode_entry_t; + +static int mpt_decode_value(mpt_decode_entry_t *table, u_int num_entries, const char *name, u_int value, u_int *cur_column, u_int wrap_point) @@ -689,7 +706,7 @@ mpt_decode_value(mpt_decode_entry_t *tab return (printed); } -static mpt_decode_entry_t req_state_parse_table[] = { +static const mpt_decode_entry_t req_state_parse_table[] = { { "REQ_FREE", 0x00, 0xff }, { "REQ_ALLOCATED", 0x01, 0x01 }, { "REQ_QUEUED", 0x02, 0x02 }, @@ -698,13 +715,15 @@ static mpt_decode_entry_t req_state_pars { "REQ_NEED_WAKEUP", 0x10, 0x10 } }; -void +static void mpt_req_state(mpt_req_state_t state) { + mpt_decode_value(req_state_parse_table, NUM_ELEMENTS(req_state_parse_table), "REQ_STATE", state, NULL, 80); } +#endif #define LAST_SGE ( \ MPI_SGE_FLAGS_END_OF_LIST | \ @@ -805,6 +824,7 @@ mpt_dump_data(struct mpt_softc *mpt, con { int offset; uint8_t *cp = addr; + mpt_prt(mpt, "%s:", msg); for (offset = 0; offset < len; offset++) { if ((offset & 0xf) == 0) { @@ -820,6 +840,7 @@ mpt_dump_request(struct mpt_softc *mpt, { uint32_t *pReq = req->req_vbuf; int o; + #if __FreeBSD_version >= 500000 mpt_prt(mpt, "Send Request %d (%jx):", req->index, (uintmax_t) req->req_pbuf); @@ -850,6 +871,7 @@ mpt_lprt(struct mpt_softc *mpt, int leve } } +#if 0 void mpt_lprtc(struct mpt_softc *mpt, int level, const char *fmt, ...) { @@ -861,6 +883,7 @@ mpt_lprtc(struct mpt_softc *mpt, int lev } } #endif +#endif void mpt_prt(struct mpt_softc *mpt, const char *fmt, ...) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_pci.c Sat Aug 13 12:33:41 2011 (r224819) @@ -201,6 +201,9 @@ static int mpt_pci_shutdown(device_t); static int mpt_dma_mem_alloc(struct mpt_softc *mpt); static void mpt_dma_mem_free(struct mpt_softc *mpt); static void mpt_read_config_regs(struct mpt_softc *mpt); +#if 0 +static void mpt_set_config_regs(struct mpt_softc *mpt); +#endif static void mpt_pci_intr(void *); static device_method_t mpt_methods[] = { @@ -404,6 +407,7 @@ mpt_link_peer(struct mpt_softc *mpt) static void mpt_unlink_peer(struct mpt_softc *mpt) { + if (mpt->mpt2) { mpt->mpt2->mpt2 = NULL; } @@ -654,6 +658,7 @@ bad: static void mpt_free_bus_resources(struct mpt_softc *mpt) { + if (mpt->ih) { bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih); mpt->ih = NULL; @@ -827,6 +832,7 @@ mpt_dma_mem_free(struct mpt_softc *mpt) static void mpt_read_config_regs(struct mpt_softc *mpt) { + mpt->pci_cfg.Command = pci_read_config(mpt->dev, PCIR_COMMAND, 2); mpt->pci_cfg.LatencyTimer_LineSize = pci_read_config(mpt->dev, PCIR_CACHELNSZ, 2); @@ -840,8 +846,9 @@ mpt_read_config_regs(struct mpt_softc *m mpt->pci_cfg.PMCSR = pci_read_config(mpt->dev, 0x44, 4); } +#if 0 /* Sets modifiable config registers */ -void +static void mpt_set_config_regs(struct mpt_softc *mpt) { uint32_t val; @@ -880,6 +887,7 @@ mpt_set_config_regs(struct mpt_softc *mp pci_write_config(mpt->dev, PCIR_INTLINE, mpt->pci_cfg.IntLine, 1); pci_write_config(mpt->dev, 0x44, mpt->pci_cfg.PMCSR, 4); } +#endif static void mpt_pci_intr(void *arg) Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:33:41 2011 (r224819) @@ -82,7 +82,6 @@ struct mpt_raid_action_result #define REQ_IOCSTATUS(req) ((req)->IOCStatus & MPI_IOCSTATUS_MASK) - static mpt_probe_handler_t mpt_raid_probe; static mpt_attach_handler_t mpt_raid_attach; static mpt_enable_handler_t mpt_raid_enable; @@ -126,9 +125,25 @@ static void mpt_adjust_queue_depth(struc static void mpt_raid_sysctl_attach(struct mpt_softc *); #endif +static const char *mpt_vol_type(struct mpt_raid_volume *vol); +static const char *mpt_vol_state(struct mpt_raid_volume *vol); +static const char *mpt_disk_state(struct mpt_raid_disk *disk); +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, + const char *fmt, ...); +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, + const char *fmt, ...); + +static int mpt_issue_raid_req(struct mpt_softc *mpt, + struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, + u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, + int write, int wait); + +static int mpt_refresh_raid_data(struct mpt_softc *mpt); +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt); + static uint32_t raid_handler_id = MPT_HANDLER_ID_NONE; -const char * +static const char * mpt_vol_type(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeType) { @@ -143,7 +158,7 @@ mpt_vol_type(struct mpt_raid_volume *vol } } -const char * +static const char * mpt_vol_state(struct mpt_raid_volume *vol) { switch (vol->config_page->VolumeStatus.State) { @@ -158,7 +173,7 @@ mpt_vol_state(struct mpt_raid_volume *vo } } -const char * +static const char * mpt_disk_state(struct mpt_raid_disk *disk) { switch (disk->config_page.PhysDiskStatus.State) { @@ -183,7 +198,7 @@ mpt_disk_state(struct mpt_raid_disk *dis } } -void +static void mpt_vol_prt(struct mpt_softc *mpt, struct mpt_raid_volume *vol, const char *fmt, ...) { @@ -197,7 +212,7 @@ mpt_vol_prt(struct mpt_softc *mpt, struc va_end(ap); } -void +static void mpt_disk_prt(struct mpt_softc *mpt, struct mpt_raid_disk *disk, const char *fmt, ...) { @@ -255,16 +270,17 @@ mpt_raid_async(void *callback_arg, u_int } } -int +static int mpt_raid_probe(struct mpt_softc *mpt) { + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) { return (ENODEV); } return (0); } -int +static int mpt_raid_attach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -308,13 +324,14 @@ cleanup: return (error); } -int +static int mpt_raid_enable(struct mpt_softc *mpt) { + return (0); } -void +static void mpt_raid_detach(struct mpt_softc *mpt) { struct ccb_setasync csa; @@ -339,6 +356,7 @@ mpt_raid_detach(struct mpt_softc *mpt) static void mpt_raid_ioc_reset(struct mpt_softc *mpt, int type) { + /* Nothing to do yet. */ } @@ -571,7 +589,7 @@ mpt_raid_reply_frame_handler(struct mpt_ /* * Utiltity routine to perform a RAID action command; */ -int +static int mpt_issue_raid_req(struct mpt_softc *mpt, struct mpt_raid_volume *vol, struct mpt_raid_disk *disk, request_t *req, u_int Action, uint32_t ActionDataWord, bus_addr_t addr, bus_size_t len, @@ -735,6 +753,7 @@ mpt_raid_thread(void *arg) static void mpt_raid_quiesce_timeout(void *arg) { + /* Complete the CCB with error */ /* COWWWW */ } @@ -792,7 +811,7 @@ mpt_raid_quiesce_disk(struct mpt_softc * /* XXX Ignores that there may be multiple busses/IOCs involved. */ cam_status -mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, u_int *tgt) +mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, target_id_t *tgt) { struct mpt_raid_disk *mpt_disk; @@ -809,7 +828,7 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int -mpt_is_raid_volume(struct mpt_softc *mpt, int tgt) +mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; CONFIG_PAGE_IOC_2_RAID_VOL *ioc_last_vol; @@ -1321,7 +1340,7 @@ mpt_refresh_raid_vol(struct mpt_softc *m * be updated by our event handler. Interesting changes are displayed * to the console. */ -int +static int mpt_refresh_raid_data(struct mpt_softc *mpt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; @@ -1581,9 +1600,10 @@ mpt_raid_timer(void *arg) #endif } -void +static void mpt_schedule_raid_refresh(struct mpt_softc *mpt) { + callout_reset(&mpt->raid_timer, MPT_RAID_SYNC_REPORT_INTERVAL, mpt_raid_timer, mpt); } @@ -1735,7 +1755,8 @@ mpt_raid_set_vol_mwce(struct mpt_softc * MPT_UNLOCK(mpt); return (0); } -const char *mpt_vol_mwce_strs[] = + +static const char *mpt_vol_mwce_strs[] = { "On", "Off", Modified: stable/7/sys/dev/mpt/mpt_raid.h ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:33:41 2011 (r224819) @@ -53,29 +53,13 @@ typedef enum { MPT_RAID_MWCE_NC } mpt_raid_mwce_t; -const char *mpt_vol_type(struct mpt_raid_volume *); -const char *mpt_vol_state(struct mpt_raid_volume *); -const char *mpt_disk_state(struct mpt_raid_disk *); -void -mpt_vol_prt(struct mpt_softc *, struct mpt_raid_volume *, const char *fmt, ...); -void -mpt_disk_prt(struct mpt_softc *, struct mpt_raid_disk *, const char *, ...); - -int -mpt_issue_raid_req(struct mpt_softc *, struct mpt_raid_volume *, - struct mpt_raid_disk *, request_t *, u_int, uint32_t, bus_addr_t, - bus_size_t, int, int); - -cam_status -mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); -int mpt_is_raid_volume(struct mpt_softc *, int); +cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status mpt_raid_quiesce_disk(struct mpt_softc *, struct mpt_raid_disk *, request_t *); #endif -int mpt_refresh_raid_data(struct mpt_softc *); -void mpt_schedule_raid_refresh(struct mpt_softc *); void mpt_raid_free_mem(struct mpt_softc *); static __inline void Modified: stable/7/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_user.c Sat Aug 13 12:33:06 2011 (r224818) +++ stable/7/sys/dev/mpt/mpt_user.c Sat Aug 13 12:33:41 2011 (r224819) @@ -94,7 +94,7 @@ static MALLOC_DEFINE(M_MPTUSER, "mpt_use static uint32_t user_handler_id = MPT_HANDLER_ID_NONE; -int +static int mpt_user_probe(struct mpt_softc *mpt) { @@ -102,7 +102,7 @@ mpt_user_probe(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_attach(struct mpt_softc *mpt) { mpt_handler_t handler; @@ -131,19 +131,20 @@ mpt_user_attach(struct mpt_softc *mpt) return (0); } -int +static int mpt_user_enable(struct mpt_softc *mpt) { return (0); } -void +static void mpt_user_ready(struct mpt_softc *mpt) { + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:37:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 418EA106564A; Sat, 13 Aug 2011 12:37:23 +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 2F2BB8FC16; Sat, 13 Aug 2011 12:37: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 p7DCbNa1015865; Sat, 13 Aug 2011 12:37:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCbMn8015852; Sat, 13 Aug 2011 12:37:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131237.p7DCbMn8015852@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224820 - in stable/8/sys/dev/mpt: . mpilib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:37:23 -0000 Author: marius Date: Sat Aug 13 12:37:22 2011 New Revision: 224820 URL: http://svn.freebsd.org/changeset/base/224820 Log: MFC: r224494, r224761 - Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL using the right SIM in case the HBA is RAID-capable but the target in question is not a hot spare or member of a RAID volume. - Report the loss and addition of SAS and SATA targets detected via PHY link status changes and signalled by MPI_EVENT_SAS_DEVICE_STATUS_CHANGE to cam(4) as lost devices and trigger rescans as appropriate. Without this it can take quite some time until a lost device actually is no longer tried to be used, if it ever stops. [1] - Handle MPI_EVENT_IR2, MPI_EVENT_LOG_ENTRY_ADDED, MPI_EVENT_SAS_DISCOVERY and MPI_EVENT_SAS_PHY_LINK_STATUS silently as these serve no additional purpose beyond adding cryptic entries to logs. - Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help identifying broken disks. [2] Thanks to Hans-Joerg Sirtl for providing one of the HBAs these changes were developed with and RIP to the mainboard that didn't survive testing them. PR: 157534 [1] Submitted by: Andrew Boyer [2] Modified: stable/8/sys/dev/mpt/mpilib/mpi_ioc.h stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c stable/8/sys/dev/mpt/mpt_raid.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mpt/mpilib/mpi_ioc.h ============================================================================== --- stable/8/sys/dev/mpt/mpilib/mpi_ioc.h Sat Aug 13 12:33:41 2011 (r224819) +++ stable/8/sys/dev/mpt/mpilib/mpi_ioc.h Sat Aug 13 12:37:22 2011 (r224820) @@ -33,7 +33,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.14 + * mpi_ioc.h Version: 01.05.16 * * Version History * --------------- @@ -140,6 +140,16 @@ * added _MULTI_PORT_DOMAIN. * 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request. * Added Common Boot Block type to FWUpload Request. + * 08-07-07 01.05.15 Added MPI_EVENT_SAS_INIT_RC_REMOVED define. + * Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and + * MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data. + * Added SASAddress field to SAS Initiator Device Table + * Overflow event data structure. + * 03-28-08 01.05.16 Added two new ReasonCode values to SAS Device Status + * Change Event data to indicate completion of internally + * generated task management. + * Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define. + * Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define. * -------------------------------------------------------------------------- */ @@ -639,6 +649,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_ST #define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) #define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) #define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET (0x0E) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL (0x0F) /* SCSI Event data for Queue Full event */ @@ -735,6 +747,8 @@ typedef struct _MPI_EVENT_DATA_IR2 #define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) +#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED (0x08) +#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED (0x09) /* defines for logical disk states */ #define MPI_LD_STATE_OPTIMAL (0x00) @@ -894,6 +908,7 @@ typedef struct _EVENT_DATA_DISCOVERY_ERR #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN (0x00002000) +#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE (0x00004000) /* SAS SMP Error Event data */ @@ -929,6 +944,8 @@ typedef struct _EVENT_DATA_SAS_INIT_DEV_ /* defines for the ReasonCode field of the SAS Initiator Device Status Change event */ #define MPI_EVENT_SAS_INIT_RC_ADDED (0x01) +#define MPI_EVENT_SAS_INIT_RC_REMOVED (0x02) +#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE (0x03) /* SAS Initiator Device Table Overflow Event data */ @@ -937,6 +954,7 @@ typedef struct _EVENT_DATA_SAS_INIT_TABL U8 MaxInit; /* 00h */ U8 CurrentInit; /* 01h */ U16 Reserved1; /* 02h */ + U64 SASAddress; /* 04h */ } EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MpiEventDataSasInitTableOverflow_t, Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:33:41 2011 (r224819) +++ stable/8/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:37:22 2011 (r224820) @@ -2538,7 +2538,8 @@ mpt_cam_event(struct mpt_softc *mpt, req pqf->CurrentDepth = le16toh(pqf->CurrentDepth); mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); - if (mpt->phydisk_sim) { + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + pqf->TargetID) != 0) { sim = mpt->phydisk_sim; } else { sim = mpt->sim; @@ -2570,9 +2571,85 @@ mpt_cam_event(struct mpt_softc *mpt, req mpt_prt(mpt, "IR resync update %d completed\n", (data0 >> 16) & 0xff); break; + case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + { + union ccb *ccb; + struct cam_sim *sim; + struct cam_path *tmppath; + PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE psdsc; + + psdsc = (PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE)msg->Data; + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + psdsc->TargetID) != 0) + sim = mpt->phydisk_sim; + else + sim = mpt->sim; + switch(psdsc->ReasonCode) { + case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: + MPTLOCK_2_CAMLOCK(mpt); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mpt_prt(mpt, + "unable to alloc CCB for rescan\n"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(sim), psdsc->TargetID, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + CAMLOCK_2_MPTLOCK(mpt); + mpt_prt(mpt, + "unable to create path for rescan\n"); + xpt_free_ccb(ccb); + break; + } + xpt_rescan(ccb); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: + MPTLOCK_2_CAMLOCK(mpt); + if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), + psdsc->TargetID, CAM_LUN_WILDCARD) != + CAM_REQ_CMP) { + mpt_prt(mpt, + "unable to create path for async event"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + xpt_async(AC_LOST_DEVICE, tmppath, NULL); + xpt_free_path(tmppath); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: + case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: + break; + default: + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS device status change: Bus: 0x%02x TargetID: " + "0x%02x ReasonCode: 0x%02x\n", psdsc->Bus, + psdsc->TargetID, psdsc->ReasonCode); + break; + } + break; + } + case MPI_EVENT_SAS_DISCOVERY_ERROR: + { + PTR_EVENT_DATA_DISCOVERY_ERROR pde; + + pde = (PTR_EVENT_DATA_DISCOVERY_ERROR)msg->Data; + pde->DiscoveryStatus = le32toh(pde->DiscoveryStatus); + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS discovery error: Port: 0x%02x Status: 0x%08x\n", + pde->Port, pde->DiscoveryStatus); + break; + } case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: - case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + case MPI_EVENT_IR2: + case MPI_EVENT_LOG_ENTRY_ADDED: + case MPI_EVENT_SAS_DISCOVERY: + case MPI_EVENT_SAS_PHY_LINK_STATUS: case MPI_EVENT_SAS_SES: break; default: Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:33:41 2011 (r224819) +++ stable/8/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:37:22 2011 (r224820) @@ -812,6 +812,25 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int +mpt_is_raid_member(struct mpt_softc *mpt, target_id_t tgt) +{ + struct mpt_raid_disk *mpt_disk; + int i; + + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) + return (0); + for (i = 0; i < mpt->ioc_page2->MaxPhysDisks; i++) { + mpt_disk = &mpt->raid_disks[i]; + if ((mpt_disk->flags & MPT_RDF_ACTIVE) != 0 && + mpt_disk->config_page.PhysDiskID == tgt) + return (1); + } + return (0); + +} + +/* XXX Ignores that there may be multiple busses/IOCs involved. */ +int mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; Modified: stable/8/sys/dev/mpt/mpt_raid.h ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:33:41 2011 (r224819) +++ stable/8/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:37:22 2011 (r224820) @@ -54,6 +54,7 @@ typedef enum { } mpt_raid_mwce_t; cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_member(struct mpt_softc *, target_id_t); int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:37:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 177E31065679; Sat, 13 Aug 2011 12:37:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F03CC8FC17; Sat, 13 Aug 2011 12:37: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 p7DCbNJa015890; Sat, 13 Aug 2011 12:37:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCbNmo015885; Sat, 13 Aug 2011 12:37:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131237.p7DCbNmo015885@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:37: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: r224821 - in stable/7/sys/dev/mpt: . mpilib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:37:24 -0000 Author: marius Date: Sat Aug 13 12:37:23 2011 New Revision: 224821 URL: http://svn.freebsd.org/changeset/base/224821 Log: MFC: r224494, r224761 - Send the RELSIM_ADJUST_OPENINGS in response to a MPI_EVENT_QUEUE_FULL using the right SIM in case the HBA is RAID-capable but the target in question is not a hot spare or member of a RAID volume. - Report the loss and addition of SAS and SATA targets detected via PHY link status changes and signalled by MPI_EVENT_SAS_DEVICE_STATUS_CHANGE to cam(4) as lost devices and trigger rescans as appropriate. Without this it can take quite some time until a lost device actually is no longer tried to be used, if it ever stops. [1] - Handle MPI_EVENT_IR2, MPI_EVENT_LOG_ENTRY_ADDED, MPI_EVENT_SAS_DISCOVERY and MPI_EVENT_SAS_PHY_LINK_STATUS silently as these serve no additional purpose beyond adding cryptic entries to logs. - Add a warning for MPI_EVENT_SAS_DISCOVERY_ERROR events, which can help identifying broken disks. [2] Thanks to Hans-Joerg Sirtl for providing one of the HBAs these changes were developed with and RIP to the mainboard that didn't survive testing them. PR: 157534 [1] Submitted by: Andrew Boyer [2] Modified: stable/7/sys/dev/mpt/mpilib/mpi_ioc.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c stable/7/sys/dev/mpt/mpt_raid.h 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/mpt/mpilib/mpi_ioc.h ============================================================================== --- stable/7/sys/dev/mpt/mpilib/mpi_ioc.h Sat Aug 13 12:37:22 2011 (r224820) +++ stable/7/sys/dev/mpt/mpilib/mpi_ioc.h Sat Aug 13 12:37:23 2011 (r224821) @@ -33,7 +33,7 @@ * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: August 11, 2000 * - * mpi_ioc.h Version: 01.05.14 + * mpi_ioc.h Version: 01.05.16 * * Version History * --------------- @@ -140,6 +140,16 @@ * added _MULTI_PORT_DOMAIN. * 05-24-07 01.05.14 Added Common Boot Block type to FWDownload Request. * Added Common Boot Block type to FWUpload Request. + * 08-07-07 01.05.15 Added MPI_EVENT_SAS_INIT_RC_REMOVED define. + * Added MPI_EVENT_IR2_RC_DUAL_PORT_ADDED and + * MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED for IR2 event data. + * Added SASAddress field to SAS Initiator Device Table + * Overflow event data structure. + * 03-28-08 01.05.16 Added two new ReasonCode values to SAS Device Status + * Change Event data to indicate completion of internally + * generated task management. + * Added MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE define. + * Added MPI_EVENT_SAS_INIT_RC_INACCESSIBLE define. * -------------------------------------------------------------------------- */ @@ -639,6 +649,8 @@ typedef struct _EVENT_DATA_SAS_DEVICE_ST #define MPI_EVENT_SAS_DEV_STAT_RC_CLEAR_TASK_SET_INTERNAL (0x0B) #define MPI_EVENT_SAS_DEV_STAT_RC_QUERY_TASK_INTERNAL (0x0C) #define MPI_EVENT_SAS_DEV_STAT_RC_ASYNC_NOTIFICATION (0x0D) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET (0x0E) +#define MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL (0x0F) /* SCSI Event data for Queue Full event */ @@ -735,6 +747,8 @@ typedef struct _MPI_EVENT_DATA_IR2 #define MPI_EVENT_IR2_RC_PD_REMOVED (0x05) #define MPI_EVENT_IR2_RC_FOREIGN_CFG_DETECTED (0x06) #define MPI_EVENT_IR2_RC_REBUILD_MEDIUM_ERROR (0x07) +#define MPI_EVENT_IR2_RC_DUAL_PORT_ADDED (0x08) +#define MPI_EVENT_IR2_RC_DUAL_PORT_REMOVED (0x09) /* defines for logical disk states */ #define MPI_LD_STATE_OPTIMAL (0x00) @@ -894,6 +908,7 @@ typedef struct _EVENT_DATA_DISCOVERY_ERR #define MPI_EVENT_DSCVRY_ERR_DS_UNSUPPORTED_DEVICE (0x00000800) #define MPI_EVENT_DSCVRY_ERR_DS_MAX_SATA_TARGETS (0x00001000) #define MPI_EVENT_DSCVRY_ERR_DS_MULTI_PORT_DOMAIN (0x00002000) +#define MPI_EVENT_DSCVRY_ERR_DS_SATA_INIT_FAILURE (0x00004000) /* SAS SMP Error Event data */ @@ -929,6 +944,8 @@ typedef struct _EVENT_DATA_SAS_INIT_DEV_ /* defines for the ReasonCode field of the SAS Initiator Device Status Change event */ #define MPI_EVENT_SAS_INIT_RC_ADDED (0x01) +#define MPI_EVENT_SAS_INIT_RC_REMOVED (0x02) +#define MPI_EVENT_SAS_INIT_RC_INACCESSIBLE (0x03) /* SAS Initiator Device Table Overflow Event data */ @@ -937,6 +954,7 @@ typedef struct _EVENT_DATA_SAS_INIT_TABL U8 MaxInit; /* 00h */ U8 CurrentInit; /* 01h */ U16 Reserved1; /* 02h */ + U64 SASAddress; /* 04h */ } EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MPI_POINTER PTR_EVENT_DATA_SAS_INIT_TABLE_OVERFLOW, MpiEventDataSasInitTableOverflow_t, Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:37:22 2011 (r224820) +++ stable/7/sys/dev/mpt/mpt_cam.c Sat Aug 13 12:37:23 2011 (r224821) @@ -2538,7 +2538,8 @@ mpt_cam_event(struct mpt_softc *mpt, req pqf->CurrentDepth = le16toh(pqf->CurrentDepth); mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth " "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth); - if (mpt->phydisk_sim) { + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + pqf->TargetID) != 0) { sim = mpt->phydisk_sim; } else { sim = mpt->sim; @@ -2570,9 +2571,85 @@ mpt_cam_event(struct mpt_softc *mpt, req mpt_prt(mpt, "IR resync update %d completed\n", (data0 >> 16) & 0xff); break; + case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + { + union ccb *ccb; + struct cam_sim *sim; + struct cam_path *tmppath; + PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE psdsc; + + psdsc = (PTR_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE)msg->Data; + if (mpt->phydisk_sim && mpt_is_raid_member(mpt, + psdsc->TargetID) != 0) + sim = mpt->phydisk_sim; + else + sim = mpt->sim; + switch(psdsc->ReasonCode) { + case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: + MPTLOCK_2_CAMLOCK(mpt); + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + mpt_prt(mpt, + "unable to alloc CCB for rescan\n"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + cam_sim_path(sim), psdsc->TargetID, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + CAMLOCK_2_MPTLOCK(mpt); + mpt_prt(mpt, + "unable to create path for rescan\n"); + xpt_free_ccb(ccb); + break; + } + xpt_rescan(ccb); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: + MPTLOCK_2_CAMLOCK(mpt); + if (xpt_create_path(&tmppath, NULL, cam_sim_path(sim), + psdsc->TargetID, CAM_LUN_WILDCARD) != + CAM_REQ_CMP) { + mpt_prt(mpt, + "unable to create path for async event"); + CAMLOCK_2_MPTLOCK(mpt); + break; + } + xpt_async(AC_LOST_DEVICE, tmppath, NULL); + xpt_free_path(tmppath); + CAMLOCK_2_MPTLOCK(mpt); + break; + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_INTERNAL_DEV_RESET: + case MPI_EVENT_SAS_DEV_STAT_RC_CMPL_TASK_ABORT_INTERNAL: + case MPI_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET: + break; + default: + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS device status change: Bus: 0x%02x TargetID: " + "0x%02x ReasonCode: 0x%02x\n", psdsc->Bus, + psdsc->TargetID, psdsc->ReasonCode); + break; + } + break; + } + case MPI_EVENT_SAS_DISCOVERY_ERROR: + { + PTR_EVENT_DATA_DISCOVERY_ERROR pde; + + pde = (PTR_EVENT_DATA_DISCOVERY_ERROR)msg->Data; + pde->DiscoveryStatus = le32toh(pde->DiscoveryStatus); + mpt_lprt(mpt, MPT_PRT_WARN, + "SAS discovery error: Port: 0x%02x Status: 0x%08x\n", + pde->Port, pde->DiscoveryStatus); + break; + } case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: - case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: + case MPI_EVENT_IR2: + case MPI_EVENT_LOG_ENTRY_ADDED: + case MPI_EVENT_SAS_DISCOVERY: + case MPI_EVENT_SAS_PHY_LINK_STATUS: case MPI_EVENT_SAS_SES: break; default: Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:37:22 2011 (r224820) +++ stable/7/sys/dev/mpt/mpt_raid.c Sat Aug 13 12:37:23 2011 (r224821) @@ -828,6 +828,25 @@ mpt_map_physdisk(struct mpt_softc *mpt, /* XXX Ignores that there may be multiple busses/IOCs involved. */ int +mpt_is_raid_member(struct mpt_softc *mpt, target_id_t tgt) +{ + struct mpt_raid_disk *mpt_disk; + int i; + + if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) + return (0); + for (i = 0; i < mpt->ioc_page2->MaxPhysDisks; i++) { + mpt_disk = &mpt->raid_disks[i]; + if ((mpt_disk->flags & MPT_RDF_ACTIVE) != 0 && + mpt_disk->config_page.PhysDiskID == tgt) + return (1); + } + return (0); + +} + +/* XXX Ignores that there may be multiple busses/IOCs involved. */ +int mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol; Modified: stable/7/sys/dev/mpt/mpt_raid.h ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:37:22 2011 (r224820) +++ stable/7/sys/dev/mpt/mpt_raid.h Sat Aug 13 12:37:23 2011 (r224821) @@ -54,6 +54,7 @@ typedef enum { } mpt_raid_mwce_t; cam_status mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *); +int mpt_is_raid_member(struct mpt_softc *, target_id_t); int mpt_is_raid_volume(struct mpt_softc *, target_id_t); #if 0 cam_status From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:43:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 718BD1065672; Sat, 13 Aug 2011 12:43:33 +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 5FF6C8FC14; Sat, 13 Aug 2011 12:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DChXj2016145; Sat, 13 Aug 2011 12:43:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DChXsN016143; Sat, 13 Aug 2011 12:43:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131243.p7DChXsN016143@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224822 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:43:33 -0000 Author: marius Date: Sat Aug 13 12:43:33 2011 New Revision: 224822 URL: http://svn.freebsd.org/changeset/base/224822 Log: MFC: r224682 - Merge from r147740: When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. - Use __FBSDID. - Wrap a too long line. Modified: stable/8/sys/sparc64/sparc64/dump_machdep.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/sparc64/dump_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/dump_machdep.c Sat Aug 13 12:37:23 2011 (r224821) +++ stable/8/sys/sparc64/sparc64/dump_machdep.c Sat Aug 13 12:43:33 2011 (r224822) @@ -23,10 +23,11 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -92,6 +93,7 @@ buf_flush(struct dumperinfo *di) error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); dumplo += DEV_BSIZE; + fragsz = 0; return (error); } @@ -169,7 +171,8 @@ dumpsys(struct dumperinfo *di) /* Determine dump offset on device. */ dumplo = di->mediaoffset + di->mediasize - totsize; - mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, + di->blocksize); printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:43:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8667F106564A; Sat, 13 Aug 2011 12:43:35 +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 74EA78FC0C; Sat, 13 Aug 2011 12:43: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 p7DChZp0016179; Sat, 13 Aug 2011 12:43:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DChZ6t016177; Sat, 13 Aug 2011 12:43:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131243.p7DChZ6t016177@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:43:35 +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: r224823 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:43:35 -0000 Author: marius Date: Sat Aug 13 12:43:35 2011 New Revision: 224823 URL: http://svn.freebsd.org/changeset/base/224823 Log: MFC: r224682 (partial) - Merge from r147740: When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. - Use __FBSDID. Modified: stable/7/sys/sparc64/sparc64/dump_machdep.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/sparc64/dump_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/dump_machdep.c Sat Aug 13 12:43:33 2011 (r224822) +++ stable/7/sys/sparc64/sparc64/dump_machdep.c Sat Aug 13 12:43:35 2011 (r224823) @@ -23,10 +23,11 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -113,6 +114,7 @@ buf_flush(struct dumperinfo *di) error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); dumplo += DEV_BSIZE; + fragsz = 0; return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:47:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A8E7106564A; Sat, 13 Aug 2011 12:47:09 +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 5FA298FC08; Sat, 13 Aug 2011 12:47:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCl9F4016381; Sat, 13 Aug 2011 12:47:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCl9l2016379; Sat, 13 Aug 2011 12:47:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131247.p7DCl9l2016379@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224824 - stable/8/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:47:09 -0000 Author: marius Date: Sat Aug 13 12:47:09 2011 New Revision: 224824 URL: http://svn.freebsd.org/changeset/base/224824 Log: MFC: r224683, r224693 The tid member of struct pthread actually is long so read it as such. Accessing it as an int causes failure on big-endian LP64, i.e. mips64be, powerpc64 and sparc64. Reviewed by: marcel Modified: stable/8/lib/libthread_db/libthr_db.c Directory Properties: stable/8/lib/libthread_db/ (props changed) Modified: stable/8/lib/libthread_db/libthr_db.c ============================================================================== --- stable/8/lib/libthread_db/libthr_db.c Sat Aug 13 12:43:35 2011 (r224823) +++ stable/8/lib/libthread_db/libthr_db.c Sat Aug 13 12:47:09 2011 (r224824) @@ -202,7 +202,7 @@ static td_err_e pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) { psaddr_t pt; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -214,7 +214,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta return (TD_ERR); /* Iterate through thread list to find pthread */ while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp == id) @@ -245,7 +245,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, { td_thrhandle_t th; psaddr_t pt; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -254,7 +254,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, if (ret != 0) return (TD_ERR); while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp != 0 && lwp != TERMINATED) { @@ -368,7 +368,7 @@ pt_ta_event_getmsg(const td_thragent_t * psaddr_t pt; td_thr_events_e tmp; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -395,7 +395,7 @@ pt_ta_event_getmsg(const td_thragent_t * ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; @@ -672,7 +672,7 @@ pt_thr_event_getmsg(const td_thrhandle_t static td_thrhandle_t handle; const td_thragent_t *ta = th->th_ta; psaddr_t pt, pt_temp; - int32_t lwp; + int64_t lwp; int ret; td_thr_events_e tmp; @@ -699,7 +699,7 @@ pt_thr_event_getmsg(const td_thrhandle_t ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:47:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56CF8106566B; Sat, 13 Aug 2011 12:47:11 +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 2C0068FC0A; Sat, 13 Aug 2011 12:47:11 +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 p7DClBpl016416; Sat, 13 Aug 2011 12:47:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DClB68016414; Sat, 13 Aug 2011 12:47:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131247.p7DClB68016414@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:47:11 +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: r224825 - stable/7/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:47:11 -0000 Author: marius Date: Sat Aug 13 12:47:10 2011 New Revision: 224825 URL: http://svn.freebsd.org/changeset/base/224825 Log: MFC: r224683, r224693 The tid member of struct pthread actually is long so read it as such. Accessing it as an int causes failure on big-endian LP64, i.e. mips64be, powerpc64 and sparc64. Reviewed by: marcel Modified: stable/7/lib/libthread_db/libthr_db.c Directory Properties: stable/7/lib/libthread_db/ (props changed) Modified: stable/7/lib/libthread_db/libthr_db.c ============================================================================== --- stable/7/lib/libthread_db/libthr_db.c Sat Aug 13 12:47:09 2011 (r224824) +++ stable/7/lib/libthread_db/libthr_db.c Sat Aug 13 12:47:10 2011 (r224825) @@ -202,7 +202,7 @@ static td_err_e pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th) { psaddr_t pt; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -214,7 +214,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta return (TD_ERR); /* Iterate through thread list to find pthread */ while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp == id) @@ -245,7 +245,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, { td_thrhandle_t th; psaddr_t pt; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -254,7 +254,7 @@ pt_ta_thr_iter(const td_thragent_t *ta, if (ret != 0) return (TD_ERR); while (pt != 0) { - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); if (lwp != 0 && lwp != TERMINATED) { @@ -368,7 +368,7 @@ pt_ta_event_getmsg(const td_thragent_t * psaddr_t pt; td_thr_events_e tmp; - int32_t lwp; + int64_t lwp; int ret; TDBG_FUNC(); @@ -395,7 +395,7 @@ pt_ta_event_getmsg(const td_thragent_t * ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; @@ -651,7 +651,7 @@ pt_thr_event_getmsg(const td_thrhandle_t static td_thrhandle_t handle; const td_thragent_t *ta = th->th_ta; psaddr_t pt, pt_temp; - int32_t lwp; + int64_t lwp; int ret; td_thr_events_e tmp; @@ -678,7 +678,7 @@ pt_thr_event_getmsg(const td_thrhandle_t ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp)); /* Convert event */ pt = msg->th_p; - ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp); + ret = thr_pread_long(ta, pt + ta->thread_off_tid, &lwp); if (ret != 0) return (TD_ERR); handle.th_ta = ta; From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:49:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32CF9106566B; Sat, 13 Aug 2011 12:49:01 +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 214E68FC16; Sat, 13 Aug 2011 12:49:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCn1ui016529; Sat, 13 Aug 2011 12:49:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCn1O5016527; Sat, 13 Aug 2011 12:49:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131249.p7DCn1O5016527@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224826 - stable/8/lib/libthread_db/arch/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:49:01 -0000 Author: marius Date: Sat Aug 13 12:49:00 2011 New Revision: 224826 URL: http://svn.freebsd.org/changeset/base/224826 Log: MFC: r224684 Use the size of struct fpreg rather than of the pointer to it when copying the FPU state. Reviewed by: marcel Modified: stable/8/lib/libthread_db/arch/amd64/libpthread_md.c Directory Properties: stable/8/lib/libthread_db/ (props changed) Modified: stable/8/lib/libthread_db/arch/amd64/libpthread_md.c ============================================================================== --- stable/8/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 13 12:47:10 2011 (r224825) +++ stable/8/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 13 12:49:00 2011 (r224826) @@ -92,18 +92,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, void pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { - memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(r)); + + memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(*r)); } void pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { - memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(r)); + + memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(*r)); } void pt_md_init(void) { + /* Nothing to do */ } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:49:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFB951065672; Sat, 13 Aug 2011 12:49:02 +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 CE5A68FC17; Sat, 13 Aug 2011 12:49:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCn2Ct016566; Sat, 13 Aug 2011 12:49:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCn2Mw016564; Sat, 13 Aug 2011 12:49:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131249.p7DCn2Mw016564@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:49:02 +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: r224827 - stable/7/lib/libthread_db/arch/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:49:03 -0000 Author: marius Date: Sat Aug 13 12:49:02 2011 New Revision: 224827 URL: http://svn.freebsd.org/changeset/base/224827 Log: MFC: r224684 Use the size of struct fpreg rather than of the pointer to it when copying the FPU state. Reviewed by: marcel Modified: stable/7/lib/libthread_db/arch/amd64/libpthread_md.c Directory Properties: stable/7/lib/libthread_db/ (props changed) Modified: stable/7/lib/libthread_db/arch/amd64/libpthread_md.c ============================================================================== --- stable/7/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 13 12:49:00 2011 (r224826) +++ stable/7/lib/libthread_db/arch/amd64/libpthread_md.c Sat Aug 13 12:49:02 2011 (r224827) @@ -92,18 +92,21 @@ pt_ucontext_to_reg(const ucontext_t *uc, void pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { - memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(r)); + + memcpy(&uc->uc_mcontext.mc_fpstate, r, sizeof(*r)); } void pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { - memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(r)); + + memcpy(r, &uc->uc_mcontext.mc_fpstate, sizeof(*r)); } void pt_md_init(void) { + /* Nothing to do */ } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:50:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E18E106564A; Sat, 13 Aug 2011 12:50:39 +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 D73C98FC15; Sat, 13 Aug 2011 12:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCocum016684; Sat, 13 Aug 2011 12:50:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCocV8016682; Sat, 13 Aug 2011 12:50:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131250.p7DCocV8016682@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:50:38 +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: r224828 - stable/8/lib/libthread_db/arch/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:50:39 -0000 Author: marius Date: Sat Aug 13 12:50:38 2011 New Revision: 224828 URL: http://svn.freebsd.org/changeset/base/224828 Log: MFC: r224685 Implement Reviewed by: marcel Modified: stable/8/lib/libthread_db/arch/sparc64/libpthread_md.c Directory Properties: stable/8/lib/libthread_db/ (props changed) Modified: stable/8/lib/libthread_db/arch/sparc64/libpthread_md.c ============================================================================== --- stable/8/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:49:02 2011 (r224827) +++ stable/8/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:50:38 2011 (r224828) @@ -1,5 +1,6 @@ /* * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,39 +28,63 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include +#include #include "libpthread_db.h" void -pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused) +pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) { + + memcpy(&uc->uc_mcontext, r, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused) +pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) { + + memcpy(r, &uc->uc_mcontext, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused) +pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + mc->mc_fsr = r->fr_fsr; + mc->mc_gsr = r->fr_gsr; + mc->mc_fprs |= FPRS_FEF; } void -pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) +pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + if ((mc->mc_fprs & FPRS_FEF) != 0) { + memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + r->fr_fsr = mc->mc_fsr; + r->fr_gsr = mc->mc_gsr; + } else + memset(r, 0, sizeof(*r)); } void pt_md_init(void) { + } int pt_reg_sstep(struct reg *reg __unused, int step __unused) { + return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:50:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF631106566B; Sat, 13 Aug 2011 12:50:39 +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 A43488FC19; Sat, 13 Aug 2011 12:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCodQj016717; Sat, 13 Aug 2011 12:50:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCodFi016715; Sat, 13 Aug 2011 12:50:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131250.p7DCodFi016715@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:50:39 +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: r224829 - stable/7/lib/libthread_db/arch/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:50:39 -0000 Author: marius Date: Sat Aug 13 12:50:39 2011 New Revision: 224829 URL: http://svn.freebsd.org/changeset/base/224829 Log: MFC: r224685 Implement Reviewed by: marcel Modified: stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Directory Properties: stable/7/lib/libthread_db/ (props changed) Modified: stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c ============================================================================== --- stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:50:38 2011 (r224828) +++ stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c Sat Aug 13 12:50:39 2011 (r224829) @@ -1,5 +1,6 @@ /* * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,39 +28,63 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include +#include #include "libpthread_db.h" void -pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused) +pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) { + + memcpy(&uc->uc_mcontext, r, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused) +pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) { + + memcpy(r, &uc->uc_mcontext, MIN(sizeof(uc->uc_mcontext), sizeof(*r))); } void -pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused) +pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + mc->mc_fsr = r->fr_fsr; + mc->mc_gsr = r->fr_gsr; + mc->mc_fprs |= FPRS_FEF; } void -pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused) +pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + if ((mc->mc_fprs & FPRS_FEF) != 0) { + memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp), + sizeof(r->fr_regs))); + r->fr_fsr = mc->mc_fsr; + r->fr_gsr = mc->mc_gsr; + } else + memset(r, 0, sizeof(*r)); } void pt_md_init(void) { + } int pt_reg_sstep(struct reg *reg __unused, int step __unused) { + return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:57:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA42D106564A; Sat, 13 Aug 2011 12:57:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF4568FC16; Sat, 13 Aug 2011 12:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DCvmrY016985; Sat, 13 Aug 2011 12:57:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCvmWH016982; Sat, 13 Aug 2011 12:57:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131257.p7DCvmWH016982@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:57:48 +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: r224830 - in stable/8/contrib/gdb: . gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:57:49 -0000 Author: marius Date: Sat Aug 13 12:57:48 2011 New Revision: 224830 URL: http://svn.freebsd.org/changeset/base/224830 Log: MFC: r224686 Implement functions necessary for compiling fbsd-threads.c. Reviewed by: marcel Modified: stable/8/contrib/gdb/FREEBSD-diffs stable/8/contrib/gdb/gdb/sparc64fbsd-tdep.c Directory Properties: stable/8/contrib/gdb/ (props changed) Modified: stable/8/contrib/gdb/FREEBSD-diffs ============================================================================== --- stable/8/contrib/gdb/FREEBSD-diffs Sat Aug 13 12:50:39 2011 (r224829) +++ stable/8/contrib/gdb/FREEBSD-diffs Sat Aug 13 12:57:48 2011 (r224830) @@ -927,3 +927,39 @@ diff -N gdb/config/ia64/tm-fbsd.h +#include "ia64/tm-ia64.h" + +#endif /* TM_FBSD_H */ +Index: gdb/sparc64fbsd-tdep.c +=================================================================== +--- gdb/sparc64fbsd-tdep.c (revision 223862) ++++ gdb/sparc64fbsd-tdep.c (working copy) +@@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struct regset * + { + sparc64_supply_fpregset (regcache, regnum, fpregs); + } ++ ++void ++supply_gregset (const void *gregs) ++{ ++ sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); ++} ++ ++void ++supply_fpregset (const void *fpregs) ++{ ++ sparc64_supply_fpregset (current_regcache, -1, fpregs); ++} ++ ++void ++fill_gregset (void *gregs, int regnum) ++{ ++ sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, ++ gregs); ++} ++ ++void ++fill_fpregset (void *fpregs, int regnum) ++{ ++ sparc64_collect_fpregset (current_regcache, regnum, fpregs); ++} + + + /* Signal trampolines. */ Modified: stable/8/contrib/gdb/gdb/sparc64fbsd-tdep.c ============================================================================== --- stable/8/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 13 12:50:39 2011 (r224829) +++ stable/8/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 13 12:57:48 2011 (r224830) @@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struc { sparc64_supply_fpregset (regcache, regnum, fpregs); } + +void +supply_gregset (const void *gregs) +{ + sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); +} + +void +supply_fpregset (const void *fpregs) +{ + sparc64_supply_fpregset (current_regcache, -1, fpregs); +} + +void +fill_gregset (void *gregs, int regnum) +{ + sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, + gregs); +} + +void +fill_fpregset (void *fpregs, int regnum) +{ + sparc64_collect_fpregset (current_regcache, regnum, fpregs); +} /* Signal trampolines. */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 12:57:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BDA1106566B; Sat, 13 Aug 2011 12:57:52 +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 30F228FC08; Sat, 13 Aug 2011 12:57: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 p7DCvqrb017023; Sat, 13 Aug 2011 12:57:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DCvqIJ017021; Sat, 13 Aug 2011 12:57:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131257.p7DCvqIJ017021@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 12:57:52 +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: r224831 - in stable/7/contrib/gdb: . gdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 12:57:52 -0000 Author: marius Date: Sat Aug 13 12:57:51 2011 New Revision: 224831 URL: http://svn.freebsd.org/changeset/base/224831 Log: MFC: r224686 Implement functions necessary for compiling fbsd-threads.c. Reviewed by: marcel Added: stable/7/contrib/gdb/FREEBSD-diffs Modified: stable/7/contrib/gdb/gdb/sparc64fbsd-tdep.c Directory Properties: stable/7/contrib/gdb/ (props changed) Added: stable/7/contrib/gdb/FREEBSD-diffs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/contrib/gdb/FREEBSD-diffs Sat Aug 13 12:57:51 2011 (r224831) @@ -0,0 +1,36 @@ +Index: gdb/sparc64fbsd-tdep.c +=================================================================== +--- gdb/sparc64fbsd-tdep.c (revision 223862) ++++ gdb/sparc64fbsd-tdep.c (working copy) +@@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struct regset * + { + sparc64_supply_fpregset (regcache, regnum, fpregs); + } ++ ++void ++supply_gregset (const void *gregs) ++{ ++ sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); ++} ++ ++void ++supply_fpregset (const void *fpregs) ++{ ++ sparc64_supply_fpregset (current_regcache, -1, fpregs); ++} ++ ++void ++fill_gregset (void *gregs, int regnum) ++{ ++ sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, ++ gregs); ++} ++ ++void ++fill_fpregset (void *fpregs, int regnum) ++{ ++ sparc64_collect_fpregset (current_regcache, regnum, fpregs); ++} + + + /* Signal trampolines. */ Modified: stable/7/contrib/gdb/gdb/sparc64fbsd-tdep.c ============================================================================== --- stable/7/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 13 12:57:48 2011 (r224830) +++ stable/7/contrib/gdb/gdb/sparc64fbsd-tdep.c Sat Aug 13 12:57:51 2011 (r224831) @@ -64,6 +64,31 @@ sparc64fbsd_supply_fpregset (const struc { sparc64_supply_fpregset (regcache, regnum, fpregs); } + +void +supply_gregset (const void *gregs) +{ + sparc64_supply_gregset (&sparc64fbsd_gregset, current_regcache, -1, gregs); +} + +void +supply_fpregset (const void *fpregs) +{ + sparc64_supply_fpregset (current_regcache, -1, fpregs); +} + +void +fill_gregset (void *gregs, int regnum) +{ + sparc64_collect_gregset (&sparc64fbsd_gregset, current_regcache, regnum, + gregs); +} + +void +fill_fpregset (void *fpregs, int regnum) +{ + sparc64_collect_fpregset (current_regcache, regnum, fpregs); +} /* Signal trampolines. */ From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:09:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB13106564A; Sat, 13 Aug 2011 13:09:44 +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 2D1B58FC0A; Sat, 13 Aug 2011 13:09:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DD9iJG017457; Sat, 13 Aug 2011 13:09:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DD9i0n017454; Sat, 13 Aug 2011 13:09:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131309.p7DD9i0n017454@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224832 - stable/8/gnu/usr.bin/gdb/arch/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:09:44 -0000 Author: marius Date: Sat Aug 13 13:09:43 2011 New Revision: 224832 URL: http://svn.freebsd.org/changeset/base/224832 Log: MFC: r224687 Compile fbsd-threads.c. Amongst others this is necessary for a working kgdb(1). PR: 158719 Reviewed by: marcel Modified: stable/8/gnu/usr.bin/gdb/arch/sparc64/Makefile stable/8/gnu/usr.bin/gdb/arch/sparc64/init.c Directory Properties: stable/8/gnu/usr.bin/gdb/arch/sparc64/ (props changed) Modified: stable/8/gnu/usr.bin/gdb/arch/sparc64/Makefile ============================================================================== --- stable/8/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 13 12:57:51 2011 (r224831) +++ stable/8/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 13 13:09:43 2011 (r224832) @@ -1,6 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) +LIBSRCS+= fbsd-threads.c LIBSRCS+= solib.c solib-legacy.c solib-svr4.c LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c .endif Modified: stable/8/gnu/usr.bin/gdb/arch/sparc64/init.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 13 12:57:51 2011 (r224831) +++ stable/8/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 13 13:09:43 2011 (r224832) @@ -11,6 +11,7 @@ extern initialize_file_ftype _initialize extern initialize_file_ftype _initialize_ser_hardwire; extern initialize_file_ftype _initialize_ser_pipe; extern initialize_file_ftype _initialize_ser_tcp; +extern initialize_file_ftype _initialize_thread_db; extern initialize_file_ftype _initialize_sparc64fbsd_nat; extern initialize_file_ftype _initialize_sparc64_nat; extern initialize_file_ftype _initialize_sparc_nat; @@ -124,6 +125,7 @@ initialize_all_files (void) _initialize_ser_pipe (); _initialize_ser_tcp (); #ifndef CROSS_DEBUGGER + _initialize_thread_db (); _initialize_sparc64fbsd_nat (); _initialize_sparc64_nat (); _initialize_sparc_nat (); From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:09:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53B9106566B; Sat, 13 Aug 2011 13:09:46 +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 D3C668FC0C; Sat, 13 Aug 2011 13:09:46 +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 p7DD9ks8017495; Sat, 13 Aug 2011 13:09:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DD9keS017492; Sat, 13 Aug 2011 13:09:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131309.p7DD9keS017492@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:09:46 +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: r224833 - stable/7/gnu/usr.bin/gdb/arch/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:09:47 -0000 Author: marius Date: Sat Aug 13 13:09:46 2011 New Revision: 224833 URL: http://svn.freebsd.org/changeset/base/224833 Log: MFC: r224687 Compile fbsd-threads.c. Amongst others this is necessary for a working kgdb(1). PR: 158719 Reviewed by: marcel Modified: stable/7/gnu/usr.bin/gdb/arch/sparc64/Makefile stable/7/gnu/usr.bin/gdb/arch/sparc64/init.c Directory Properties: stable/7/gnu/usr.bin/gdb/arch/sparc64/ (props changed) Modified: stable/7/gnu/usr.bin/gdb/arch/sparc64/Makefile ============================================================================== --- stable/7/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 13 13:09:43 2011 (r224832) +++ stable/7/gnu/usr.bin/gdb/arch/sparc64/Makefile Sat Aug 13 13:09:46 2011 (r224833) @@ -1,6 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) +LIBSRCS+= fbsd-threads.c LIBSRCS+= solib.c solib-legacy.c solib-svr4.c LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c .endif Modified: stable/7/gnu/usr.bin/gdb/arch/sparc64/init.c ============================================================================== --- stable/7/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 13 13:09:43 2011 (r224832) +++ stable/7/gnu/usr.bin/gdb/arch/sparc64/init.c Sat Aug 13 13:09:46 2011 (r224833) @@ -11,6 +11,7 @@ extern initialize_file_ftype _initialize extern initialize_file_ftype _initialize_ser_hardwire; extern initialize_file_ftype _initialize_ser_pipe; extern initialize_file_ftype _initialize_ser_tcp; +extern initialize_file_ftype _initialize_thread_db; extern initialize_file_ftype _initialize_sparc64fbsd_nat; extern initialize_file_ftype _initialize_sparc64_nat; extern initialize_file_ftype _initialize_sparc_nat; @@ -124,6 +125,7 @@ initialize_all_files (void) _initialize_ser_pipe (); _initialize_ser_tcp (); #ifndef CROSS_DEBUGGER + _initialize_thread_db (); _initialize_sparc64fbsd_nat (); _initialize_sparc64_nat (); _initialize_sparc_nat (); From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:11:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23CF7106566C; Sat, 13 Aug 2011 13:11:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 134848FC1A; Sat, 13 Aug 2011 13:11: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 p7DDBSUq017600; Sat, 13 Aug 2011 13:11:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDBSCW017598; Sat, 13 Aug 2011 13:11:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131311.p7DDBSCW017598@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 13:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224834 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:11:29 -0000 Author: rwatson Date: Sat Aug 13 13:11:28 2011 New Revision: 224834 URL: http://svn.freebsd.org/changeset/base/224834 Log: Bump __FreeBSD_version to reflect the availability of capabilities, but also capability-related changes to fget(9). This is likely not part of a formal KPI, but the nvidia driver (at least) uses it. Approved by: re (bz, kib) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Aug 13 13:09:46 2011 (r224833) +++ head/sys/sys/param.h Sat Aug 13 13:11:28 2011 (r224834) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900040 /* Master, propagated to newvers */ +#define __FreeBSD_version 900041 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:15:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E9531065670; Sat, 13 Aug 2011 13:15:28 +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 EFDA38FC1A; Sat, 13 Aug 2011 13:15:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DDFRW3017821; Sat, 13 Aug 2011 13:15:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDFRSc017814; Sat, 13 Aug 2011 13:15:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131315.p7DDFRSc017814@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224835 - in stable/8/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:15:28 -0000 Author: marius Date: Sat Aug 13 13:15:27 2011 New Revision: 224835 URL: http://svn.freebsd.org/changeset/base/224835 Log: MFC: r224762 Sync makefs(8) ISO 9660 support with NetBSD: o cd9960 -> cd9660 o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h since actual user is not cd9660_eltorito.c but iso.h and cd9660_eltorito.h. Actually, include order/place of sys/endian.h doesn't matter on netbsd since it is always included by sys/types.h but it's not true on other system. This should fix cross build breakage on freebsd introduced by rev. 1.16 of cd9660_eltorito.c. Problem reported and fix suggested on twitter. o Fix fd leaks in error cases. Found by cppcheck. o RRIP RE length should be 4, not 0 o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates corrupted cd9660fs), iso9660_rrip.c part: - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent, not in node itself in RRIP_PL case - cd9660_rrip_initialize_node() should update only node passed as arg so handle RRIP_PL in DOTDOT case Fixes malformed dotdot entries in deep (more than 8 level) directories moved into .rr_moved dir. Should be pulled up to netbsd-5. (no official ISO has such deep dirs, but cobalt restorecd is affected) Reviewed by: mm Obtained from: NetBSD Modified: stable/8/usr.sbin/makefs/cd9660.c stable/8/usr.sbin/makefs/cd9660.h stable/8/usr.sbin/makefs/cd9660/cd9660_conversion.c stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/8/usr.sbin/makefs/cd9660/cd9660_write.c stable/8/usr.sbin/makefs/cd9660/iso9660_rrip.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 Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660.c Sat Aug 13 13:15:27 2011 (r224835) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.c,v 1.27 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.c,v 1.31 2011/08/06 23:25:19 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -127,7 +127,7 @@ static int cd9660_setup_volume_descripto static int cd9660_fill_extended_attribute_record(cd9660node *); #endif static void cd9660_sort_nodes(cd9660node *); -static int cd9960_translate_node_common(cd9660node *); +static int cd9660_translate_node_common(cd9660node *); static int cd9660_translate_node(fsnode *, cd9660node *); static int cd9660_compare_filename(const char *, const char *); static void cd9660_sorted_child_insert(cd9660node *, cd9660node *); @@ -809,7 +809,7 @@ cd9660_fill_extended_attribute_record(cd #endif static int -cd9960_translate_node_common(cd9660node *newnode) +cd9660_translate_node_common(cd9660node *newnode) { time_t tim; int test; @@ -846,7 +846,7 @@ cd9960_translate_node_common(cd9660node } /* - * Translate fsnode to cd9960node + * Translate fsnode to cd9660node * Translate filenames and other metadata, including dates, sizes, * permissions, etc * @param struct fsnode * The node generated by makefs @@ -875,7 +875,7 @@ cd9660_translate_node(fsnode *node, cd96 if (!(S_ISDIR(node->type))) newnode->fileDataLength = node->inode->st.st_size; - if (cd9960_translate_node_common(newnode) == 0) + if (cd9660_translate_node_common(newnode) == 0) return 0; /* Finally, overwrite some of the values that are set by default */ @@ -2042,7 +2042,7 @@ cd9660_create_file(const char * name, cd return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } @@ -2069,7 +2069,7 @@ cd9660_create_directory(const char *name return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } Modified: stable/8/usr.sbin/makefs/cd9660.h ============================================================================== --- stable/8/usr.sbin/makefs/cd9660.h Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660.h Sat Aug 13 13:15:27 2011 (r224835) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.h,v 1.15 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.h,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -50,6 +50,7 @@ #include #include #include +#include #include "makefs.h" #include "iso.h" Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_conversion.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660/cd9660_conversion.c Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_conversion.c Sat Aug 13 13:15:27 2011 (r224835) @@ -36,8 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#include - static char cd9660_compute_gm_offset(time_t); #if 0 Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sat Aug 13 13:15:27 2011 (r224835) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.14 2010/10/27 18:51:35 christos Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -32,8 +32,6 @@ * OF SUCH DAMAGE. */ -#include - #include "cd9660.h" #include "cd9660_eltorito.h" @@ -501,13 +499,14 @@ cd9660_setup_boot_volume_descriptor(volu } static int -cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, +cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start, off_t nsectors, int type) { uint8_t val; uint32_t lba; - fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1) + err(1, "fseeko"); val = 0x80; /* Bootable */ fwrite(&val, sizeof(val), 1, fd); @@ -531,18 +530,19 @@ cd9660_write_mbr_partition_entry(FILE *f lba = htole32(nsectors); fwrite(&lba, sizeof(lba), 1, fd); - return (0); + return 0; } static int -cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, +cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions, off_t sector_start, off_t nsectors, off_t sector_size, const char *part_name, const char *part_type) { uint32_t apm32; uint16_t apm16; - fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1) + err(1, "fseeko"); /* Signature */ apm16 = htobe16(0x504d); Modified: stable/8/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660/cd9660_write.c Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660/cd9660_write.c Sat Aug 13 13:15:27 2011 (r224835) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_write.c,v 1.13 2010/10/22 00:49:15 christos Exp $ */ +/* $NetBSD: cd9660_write.c,v 1.14 2011/01/04 09:48:21 wiz Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -458,6 +458,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(rf)) { warn("%s: fread", __func__); free(buf); + (void)fclose(rf); return 0; } @@ -465,6 +466,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(fd)) { warn("%s: fwrite", __func__); free(buf); + (void)fclose(rf); return 0; } sector++; Modified: stable/8/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Aug 13 13:11:28 2011 (r224834) +++ stable/8/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Aug 13 13:15:27 2011 (r224835) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.8 2009/01/10 22:06:29 bjh21 Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.10 2011/05/29 17:07:58 tsutsui Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -183,10 +183,11 @@ cd9660_rrip_finalize_node(cd9660node *no break; case SUSP_ENTRY_RRIP_PL: /* Look at rr_real_parent */ - if (node->rr_real_parent == NULL) + if (node->parent == NULL || + node->parent->rr_real_parent == NULL) return -1; cd9660_bothendian_dword( - node->rr_real_parent->fileDataSector, + node->parent->rr_real_parent->fileDataSector, (unsigned char *) t->attr.rr_entry.PL.dir_loc); break; @@ -396,6 +397,13 @@ cd9660_rrip_initialize_node(cd9660node * cd9660node_rrip_px(current, grandparent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } + /* Handle PL */ + if (parent != NULL && parent->rr_real_parent != NULL) { + current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, + SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); + cd9660_rrip_PL(current,node); + TAILQ_INSERT_TAIL(&node->head, current, rr_ll); + } } else { cd9660_rrip_initialize_inode(node); @@ -435,14 +443,6 @@ cd9660_rrip_initialize_node(cd9660node * SUSP_ENTRY_RRIP_RE, "RE", SUSP_LOC_ENTRY); cd9660_rrip_RE(current,node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); - - /* Handle PL */ - current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, - SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); - cd9660_rrip_PL(current,node->dot_dot_record); - TAILQ_INSERT_TAIL(&node->dot_dot_record->head, current, - rr_ll); - TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } } return 1; @@ -496,7 +496,7 @@ cd9660_rrip_CL(struct ISO_SUSP_ATTRIBUTE int cd9660_rrip_RE(struct ISO_SUSP_ATTRIBUTES *p, cd9660node *node __unused) { - p->attr.rr_entry.RE.h.length[0] = 0; + p->attr.rr_entry.RE.h.length[0] = 4; p->attr.rr_entry.RE.h.version[0] = 1; return 1; } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:15:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A831065673; Sat, 13 Aug 2011 13:15:39 +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 E20678FC08; Sat, 13 Aug 2011 13:15:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DDFcsJ017867; Sat, 13 Aug 2011 13:15:38 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDFcPY017860; Sat, 13 Aug 2011 13:15:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131315.p7DDFcPY017860@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:15:38 +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: r224836 - in stable/7/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:15:39 -0000 Author: marius Date: Sat Aug 13 13:15:38 2011 New Revision: 224836 URL: http://svn.freebsd.org/changeset/base/224836 Log: MFC: r224762 Sync makefs(8) ISO 9660 support with NetBSD: o cd9960 -> cd9660 o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h since actual user is not cd9660_eltorito.c but iso.h and cd9660_eltorito.h. Actually, include order/place of sys/endian.h doesn't matter on netbsd since it is always included by sys/types.h but it's not true on other system. This should fix cross build breakage on freebsd introduced by rev. 1.16 of cd9660_eltorito.c. Problem reported and fix suggested on twitter. o Fix fd leaks in error cases. Found by cppcheck. o RRIP RE length should be 4, not 0 o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates corrupted cd9660fs), iso9660_rrip.c part: - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent, not in node itself in RRIP_PL case - cd9660_rrip_initialize_node() should update only node passed as arg so handle RRIP_PL in DOTDOT case Fixes malformed dotdot entries in deep (more than 8 level) directories moved into .rr_moved dir. Should be pulled up to netbsd-5. (no official ISO has such deep dirs, but cobalt restorecd is affected) Reviewed by: mm Obtained from: NetBSD Modified: stable/7/usr.sbin/makefs/cd9660.c stable/7/usr.sbin/makefs/cd9660.h stable/7/usr.sbin/makefs/cd9660/cd9660_conversion.c stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/7/usr.sbin/makefs/cd9660/cd9660_write.c stable/7/usr.sbin/makefs/cd9660/iso9660_rrip.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 Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660.c Sat Aug 13 13:15:38 2011 (r224836) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.c,v 1.27 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.c,v 1.31 2011/08/06 23:25:19 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -127,7 +127,7 @@ static int cd9660_setup_volume_descripto static int cd9660_fill_extended_attribute_record(cd9660node *); #endif static void cd9660_sort_nodes(cd9660node *); -static int cd9960_translate_node_common(cd9660node *); +static int cd9660_translate_node_common(cd9660node *); static int cd9660_translate_node(fsnode *, cd9660node *); static int cd9660_compare_filename(const char *, const char *); static void cd9660_sorted_child_insert(cd9660node *, cd9660node *); @@ -809,7 +809,7 @@ cd9660_fill_extended_attribute_record(cd #endif static int -cd9960_translate_node_common(cd9660node *newnode) +cd9660_translate_node_common(cd9660node *newnode) { time_t tim; int test; @@ -846,7 +846,7 @@ cd9960_translate_node_common(cd9660node } /* - * Translate fsnode to cd9960node + * Translate fsnode to cd9660node * Translate filenames and other metadata, including dates, sizes, * permissions, etc * @param struct fsnode * The node generated by makefs @@ -875,7 +875,7 @@ cd9660_translate_node(fsnode *node, cd96 if (!(S_ISDIR(node->type))) newnode->fileDataLength = node->inode->st.st_size; - if (cd9960_translate_node_common(newnode) == 0) + if (cd9660_translate_node_common(newnode) == 0) return 0; /* Finally, overwrite some of the values that are set by default */ @@ -2042,7 +2042,7 @@ cd9660_create_file(const char * name, cd return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } @@ -2069,7 +2069,7 @@ cd9660_create_directory(const char *name return NULL; *temp->node->inode = *me->node->inode; - if (cd9960_translate_node_common(temp) == 0) + if (cd9660_translate_node_common(temp) == 0) return NULL; return temp; } Modified: stable/7/usr.sbin/makefs/cd9660.h ============================================================================== --- stable/7/usr.sbin/makefs/cd9660.h Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660.h Sat Aug 13 13:15:38 2011 (r224836) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.h,v 1.15 2010/10/27 18:51:34 christos Exp $ */ +/* $NetBSD: cd9660.h,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -50,6 +50,7 @@ #include #include #include +#include #include "makefs.h" #include "iso.h" Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_conversion.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660/cd9660_conversion.c Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_conversion.c Sat Aug 13 13:15:38 2011 (r224836) @@ -36,8 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#include - static char cd9660_compute_gm_offset(time_t); #if 0 Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sat Aug 13 13:15:38 2011 (r224836) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.14 2010/10/27 18:51:35 christos Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -32,8 +32,6 @@ * OF SUCH DAMAGE. */ -#include - #include "cd9660.h" #include "cd9660_eltorito.h" @@ -501,13 +499,14 @@ cd9660_setup_boot_volume_descriptor(volu } static int -cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, +cd9660_write_mbr_partition_entry(FILE *fd, int idx, off_t sector_start, off_t nsectors, int type) { uint8_t val; uint32_t lba; - fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + if (fseeko(fd, (off_t)(idx) * 16 + 0x1be, SEEK_SET) == -1) + err(1, "fseeko"); val = 0x80; /* Bootable */ fwrite(&val, sizeof(val), 1, fd); @@ -531,18 +530,19 @@ cd9660_write_mbr_partition_entry(FILE *f lba = htole32(nsectors); fwrite(&lba, sizeof(lba), 1, fd); - return (0); + return 0; } static int -cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, +cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions, off_t sector_start, off_t nsectors, off_t sector_size, const char *part_name, const char *part_type) { uint32_t apm32; uint16_t apm16; - fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1) + err(1, "fseeko"); /* Signature */ apm16 = htobe16(0x504d); Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660/cd9660_write.c Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_write.c Sat Aug 13 13:15:38 2011 (r224836) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_write.c,v 1.13 2010/10/22 00:49:15 christos Exp $ */ +/* $NetBSD: cd9660_write.c,v 1.14 2011/01/04 09:48:21 wiz Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -458,6 +458,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(rf)) { warn("%s: fread", __func__); free(buf); + (void)fclose(rf); return 0; } @@ -465,6 +466,7 @@ cd9660_copy_file(FILE *fd, off_t start_s if (ferror(fd)) { warn("%s: fwrite", __func__); free(buf); + (void)fclose(rf); return 0; } sector++; Modified: stable/7/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/7/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Aug 13 13:15:27 2011 (r224835) +++ stable/7/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat Aug 13 13:15:38 2011 (r224836) @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.8 2009/01/10 22:06:29 bjh21 Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.10 2011/05/29 17:07:58 tsutsui Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -183,10 +183,11 @@ cd9660_rrip_finalize_node(cd9660node *no break; case SUSP_ENTRY_RRIP_PL: /* Look at rr_real_parent */ - if (node->rr_real_parent == NULL) + if (node->parent == NULL || + node->parent->rr_real_parent == NULL) return -1; cd9660_bothendian_dword( - node->rr_real_parent->fileDataSector, + node->parent->rr_real_parent->fileDataSector, (unsigned char *) t->attr.rr_entry.PL.dir_loc); break; @@ -396,6 +397,13 @@ cd9660_rrip_initialize_node(cd9660node * cd9660node_rrip_px(current, grandparent->node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } + /* Handle PL */ + if (parent != NULL && parent->rr_real_parent != NULL) { + current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, + SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); + cd9660_rrip_PL(current,node); + TAILQ_INSERT_TAIL(&node->head, current, rr_ll); + } } else { cd9660_rrip_initialize_inode(node); @@ -435,14 +443,6 @@ cd9660_rrip_initialize_node(cd9660node * SUSP_ENTRY_RRIP_RE, "RE", SUSP_LOC_ENTRY); cd9660_rrip_RE(current,node); TAILQ_INSERT_TAIL(&node->head, current, rr_ll); - - /* Handle PL */ - current = cd9660node_susp_create_node(SUSP_TYPE_RRIP, - SUSP_ENTRY_RRIP_PL, "PL", SUSP_LOC_DOTDOT); - cd9660_rrip_PL(current,node->dot_dot_record); - TAILQ_INSERT_TAIL(&node->dot_dot_record->head, current, - rr_ll); - TAILQ_INSERT_TAIL(&node->head, current, rr_ll); } } return 1; @@ -496,7 +496,7 @@ cd9660_rrip_CL(struct ISO_SUSP_ATTRIBUTE int cd9660_rrip_RE(struct ISO_SUSP_ATTRIBUTES *p, cd9660node *node __unused) { - p->attr.rr_entry.RE.h.length[0] = 0; + p->attr.rr_entry.RE.h.length[0] = 4; p->attr.rr_entry.RE.h.version[0] = 1; return 1; } From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:18:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1E7106566B; Sat, 13 Aug 2011 13:18:40 +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 4C6F88FC08; Sat, 13 Aug 2011 13:18: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 p7DDIeW1018005; Sat, 13 Aug 2011 13:18:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDIetV017999; Sat, 13 Aug 2011 13:18:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131318.p7DDIetV017999@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:18:40 +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: r224837 - in stable/8/release: . amd64 i386 pc98 picobsd/floppy.tree/sbin sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:18:40 -0000 Author: marius Date: Sat Aug 13 13:18:39 2011 New Revision: 224837 URL: http://svn.freebsd.org/changeset/base/224837 Log: MFC: r221466, r221494 (partial), r224652 Change several archs to use makefs (from base) instead of mkisofs (from ports) which makes release CD generation both faster and self-hosting. Added: stable/8/release/pc98/mkisoimages.sh - copied, changed from r221466, head/release/pc98/mkisoimages.sh stable/8/release/sun4v/mkisoimages.sh - copied, changed from r221466, head/release/sun4v/mkisoimages.sh Modified: stable/8/release/Makefile stable/8/release/amd64/mkisoimages.sh stable/8/release/i386/mkisoimages.sh Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) Modified: stable/8/release/Makefile ============================================================================== --- stable/8/release/Makefile Sat Aug 13 13:15:38 2011 (r224836) +++ stable/8/release/Makefile Sat Aug 13 13:18:39 2011 (r224837) @@ -335,12 +335,8 @@ EXTRAS+= cdrom.1 cdrom.2 cdrom.3 .if defined(MAKE_ISOS) EXTRAS+= iso.1 .endif -.if ${TARGET} == "pc98" -BOOTABLE="-G" -.else BOOTABLE="-b" .endif -.endif .if !defined(NODOC) DOCREL= doc.1 doc.2 @@ -1123,35 +1119,35 @@ CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1 .endif iso.1: -.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh) +.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) @echo "Creating ISO images..." .if defined(CD_BOOT) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_bootonly \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} .endif - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ ${CD_DISC1_PKGS} - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \ FreeBSD_Packages \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ ${CD_DISC2_PKGS} .if defined(MAKE_DVD) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ ${CD_DVD1_PKGS} .endif .if !defined(NODOC) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \ FreeBSD_Documentation \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \ ${CD_DOCS_PKGS} .endif .if defined(SEPARATE_LIVEFS) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_LiveFS \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} .endif @@ -1160,7 +1156,7 @@ iso.1: @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) touch ${.TARGET} .else - @echo "Do not know how to create an ISO for ${TARGET_ARCH}." + @echo "Do not know how to create an ISO for ${TARGET}." .endif # Modified: stable/8/release/amd64/mkisoimages.sh ============================================================================== --- stable/8/release/amd64/mkisoimages.sh Sat Aug 13 13:15:38 2011 (r224836) +++ stable/8/release/amd64/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) @@ -23,10 +23,9 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" if [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. - bootable="-b boot/cdboot -no-emul-boot" + bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" shift else bootable="" @@ -37,21 +36,7 @@ if [ $# -lt 3 ]; then exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* Modified: stable/8/release/i386/mkisoimages.sh ============================================================================== --- stable/8/release/i386/mkisoimages.sh Sat Aug 13 13:15:38 2011 (r224836) +++ stable/8/release/i386/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) @@ -23,38 +23,20 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" - if [ "x$1" = "x-b" ]; then - bootable="-b boot/cdboot -no-emul-boot" - shift -elif [ "x$1" = "x-G" ]; then - bootable="-G /R/cdrom/bootonly/boot/cdboot" + # This is highly x86-centric and will be used directly below. + bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" shift else bootable="" fi if [ $# -lt 3 ]; then - echo Usage: $0 '[-bG] image-label image-name base-bits-dir [extra-bits-dir]' + echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* Copied and modified: stable/8/release/pc98/mkisoimages.sh (from r221466, head/release/pc98/mkisoimages.sh) ============================================================================== --- head/release/pc98/mkisoimages.sh Wed May 4 23:41:11 2011 (r221466, copy source) +++ stable/8/release/pc98/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) @@ -23,7 +23,6 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" if [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o generic-bootimage=$4/boot/cdboot" @@ -40,6 +39,4 @@ fi LABEL=$1; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* -rm $1/etc/fstab Copied and modified: stable/8/release/sun4v/mkisoimages.sh (from r221466, head/release/sun4v/mkisoimages.sh) ============================================================================== --- head/release/sun4v/mkisoimages.sh Wed May 4 23:41:11 2011 (r221466, copy source) +++ stable/8/release/sun4v/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) @@ -66,7 +66,5 @@ fi LABEL=$1; shift NAME=$1; shift -echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* -rm $1/etc/fstab rm -f ${IMG} From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:18:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02FA5106564A; Sat, 13 Aug 2011 13:18:55 +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 E49BE8FC0A; Sat, 13 Aug 2011 13:18:54 +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 p7DDIsIT018051; Sat, 13 Aug 2011 13:18:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDIsnm018045; Sat, 13 Aug 2011 13:18:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201108131318.p7DDIsnm018045@svn.freebsd.org> From: Marius Strobl Date: Sat, 13 Aug 2011 13:18:54 +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: r224838 - in stable/7/release: . amd64 i386 pc98 sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:18:55 -0000 Author: marius Date: Sat Aug 13 13:18:54 2011 New Revision: 224838 URL: http://svn.freebsd.org/changeset/base/224838 Log: MFC: r221466, r221494 (partial), r224652 Change several archs to use makefs (from base) instead of mkisofs (from ports) which makes release CD generation both faster and self-hosting. Added: stable/7/release/pc98/mkisoimages.sh - copied, changed from r221466, head/release/pc98/mkisoimages.sh stable/7/release/sun4v/mkisoimages.sh - copied, changed from r221466, head/release/sun4v/mkisoimages.sh Modified: stable/7/release/Makefile stable/7/release/amd64/mkisoimages.sh stable/7/release/i386/mkisoimages.sh Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/7/release/picobsd/tinyware/login/ (props changed) Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Sat Aug 13 13:18:39 2011 (r224837) +++ stable/7/release/Makefile Sat Aug 13 13:18:54 2011 (r224838) @@ -335,12 +335,8 @@ EXTRAS+= cdrom.1 cdrom.2 cdrom.3 .if defined(MAKE_ISOS) EXTRAS+= iso.1 .endif -.if ${TARGET} == "pc98" -BOOTABLE="-G" -.else BOOTABLE="-b" .endif -.endif .if !defined(NODOC) DOCREL= doc.1 doc.2 @@ -1144,38 +1140,38 @@ CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1 .endif iso.1: -.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh) +.if exists(${.CURDIR}/${TARGET}/mkisoimages.sh) @echo "Creating ISO images..." .if defined(CD_BOOT) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_bootonly \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} .endif - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ ${CD_DISC1_PKGS} - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \ FreeBSD_Packages \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ ${CD_DISC2_PKGS} - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \ FreeBSD_Packages_2 \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ ${CD_DISC3_PKGS} .if defined(MAKE_DVD) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ ${CD_DVD1_PKGS} .endif .if !defined(NODOC) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh \ FreeBSD_Documentation \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} .endif .if defined(SEPARATE_LIVEFS) - @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ + @sh ${.CURDIR}/${TARGET}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_LiveFS \ ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} .endif @@ -1184,7 +1180,7 @@ iso.1: @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) touch ${.TARGET} .else - @echo "Do not know how to create an ISO for ${TARGET_ARCH}." + @echo "Do not know how to create an ISO for ${TARGET}." .endif # Modified: stable/7/release/amd64/mkisoimages.sh ============================================================================== --- stable/7/release/amd64/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) +++ stable/7/release/amd64/mkisoimages.sh Sat Aug 13 13:18:54 2011 (r224838) @@ -23,10 +23,9 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" if [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. - bootable="-b boot/cdboot -no-emul-boot" + bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" shift else bootable="" @@ -37,21 +36,7 @@ if [ $# -lt 3 ]; then exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* Modified: stable/7/release/i386/mkisoimages.sh ============================================================================== --- stable/7/release/i386/mkisoimages.sh Sat Aug 13 13:18:39 2011 (r224837) +++ stable/7/release/i386/mkisoimages.sh Sat Aug 13 13:18:54 2011 (r224838) @@ -23,38 +23,20 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" - if [ "x$1" = "x-b" ]; then - bootable="-b boot/cdboot -no-emul-boot" - shift -elif [ "x$1" = "x-G" ]; then - bootable="-G /R/cdrom/bootonly/boot/cdboot" + # This is highly x86-centric and will be used directly below. + bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" shift else bootable="" fi if [ $# -lt 3 ]; then - echo Usage: $0 '[-bG] image-label image-name base-bits-dir [extra-bits-dir]' + echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]' exit 1 fi -type mkisofs 2>&1 | grep " is " >/dev/null -if [ $? -ne 0 ]; then - echo The cdrtools port is not installed. Trying to get it now. - if [ -f /usr/ports/sysutils/cdrtools/Makefile ]; then - cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean - else - if ! pkg_add -r cdrtools; then - echo "Could not get it via pkg_add - please go install this" - echo "from the ports collection and run this script again." - exit 2 - fi - fi -fi - LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* +makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* Copied and modified: stable/7/release/pc98/mkisoimages.sh (from r221466, head/release/pc98/mkisoimages.sh) ============================================================================== --- head/release/pc98/mkisoimages.sh Wed May 4 23:41:11 2011 (r221466, copy source) +++ stable/7/release/pc98/mkisoimages.sh Sat Aug 13 13:18:54 2011 (r224838) @@ -23,7 +23,6 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. -publisher="The FreeBSD Project. http://www.freebsd.org/" if [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o generic-bootimage=$4/boot/cdboot" @@ -40,6 +39,4 @@ fi LABEL=$1; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* -rm $1/etc/fstab Copied and modified: stable/7/release/sun4v/mkisoimages.sh (from r221466, head/release/sun4v/mkisoimages.sh) ============================================================================== --- head/release/sun4v/mkisoimages.sh Wed May 4 23:41:11 2011 (r221466, copy source) +++ stable/7/release/sun4v/mkisoimages.sh Sat Aug 13 13:18:54 2011 (r224838) @@ -31,8 +31,8 @@ if [ "x$1" = "x-b" ]; then dd if=/dev/zero of=${IMG} bs=512 count=1024 MD=`mdconfig -a -t vnode -f ${IMG}` sunlabel -w -B -b $4/boot/boot1 ${MD} auto - newfs -O1 -o space -m 0 /dev/${MD} - mount /dev/${MD} ${MNT} + newfs -O1 -o space -m 0 /dev/${MD}c + mount /dev/${MD}c ${MNT} mkdir ${MNT}/boot cp $4/boot/loader ${MNT}/boot umount ${MNT} @@ -66,7 +66,5 @@ fi LABEL=$1; shift NAME=$1; shift -echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $* -rm $1/etc/fstab rm -f ${IMG} From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:26:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69E68106564A; Sat, 13 Aug 2011 13:26:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE3A8FC0A; Sat, 13 Aug 2011 13:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DDQfAC018326; Sat, 13 Aug 2011 13:26:41 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDQfmC018324; Sat, 13 Aug 2011 13:26:41 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131326.p7DDQfmC018324@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 13:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224839 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:26:41 -0000 Author: rwatson Date: Sat Aug 13 13:26:40 2011 New Revision: 224839 URL: http://svn.freebsd.org/changeset/base/224839 Log: Now that capability support has been committed, update and expand the comment at the type of sys_capability.c to describe its new contents. Approved by: re (xxx) Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat Aug 13 13:18:54 2011 (r224838) +++ head/sys/kern/sys_capability.c Sat Aug 13 13:26:40 2011 (r224839) @@ -31,9 +31,24 @@ /* * FreeBSD kernel capability facility. * - * Currently, this file implements only capability mode; capabilities - * (rights-refined file descriptors) will follow. + * Two kernel features are implemented here: capability mode, a sandboxed mode + * of execution for processes, and capabilities, a refinement on file + * descriptors that allows fine-grained control over operations on the file + * descriptor. Collectively, these allow processes to run in the style of a + * historic "capability system" in which they can use only resources + * explicitly delegated to them. This model is enforced by restricting access + * to global namespaces in capability mode. * + * Capabilities wrap other file descriptor types, binding them to a constant + * rights mask set when the capability is created. New capabilities may be + * derived from existing capabilities, but only if they have the same or a + * strict subset of the rights on the original capability. + * + * System calls permitted in capability mode are defined in capabilities.conf; + * calls must be carefully audited for safety to ensure that they don't allow + * escape from a sandbox. Some calls permit only a subset of operations in + * capability mode -- for example, shm_open(2) is limited to creating + * anonymous, rather than named, POSIX shared memory objects. */ #include "opt_capsicum.h" @@ -512,4 +527,3 @@ cap_funwrap_mmap(struct file *fp_cap, ca } #endif /* CAPABILITIES */ - From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:34:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EAE0106564A; Sat, 13 Aug 2011 13:34:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E9638FC18; Sat, 13 Aug 2011 13:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DDY2hq018582; Sat, 13 Aug 2011 13:34:02 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDY2uV018580; Sat, 13 Aug 2011 13:34:02 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131334.p7DDY2uV018580@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 13:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224840 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:34:02 -0000 Author: rwatson Date: Sat Aug 13 13:34:01 2011 New Revision: 224840 URL: http://svn.freebsd.org/changeset/base/224840 Log: Update use of the FEATURE() macro in sys_capability.c to reflect the move to two different kernel options for capability mode vs. capabilities. Approved by: re (bz) Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat Aug 13 13:26:40 2011 (r224839) +++ head/sys/kern/sys_capability.c Sat Aug 13 13:34:01 2011 (r224840) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #ifdef CAPABILITY_MODE -FEATURE(security_capabilities, "Capsicum Capability Mode"); +FEATURE(security_capability_mode, "Capsicum Capability Mode"); /* * System call to enter capability mode for the process. @@ -134,6 +134,8 @@ cap_getmode(struct thread *td, struct ca #ifdef CAPABILITIES +FEATURE(security_capabilities, "Capsicum Capabilities"); + /* * struct capability describes a capability, and is hung off of its struct * file f_data field. cap_file and cap_rightss are static once hooked up, as From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 13:49:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4C0106566B; Sat, 13 Aug 2011 13:49:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A41D8FC08; Sat, 13 Aug 2011 13:49:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DDnC8q019074; Sat, 13 Aug 2011 13:49:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DDnC4c019072; Sat, 13 Aug 2011 13:49:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201108131349.p7DDnC4c019072@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 13 Aug 2011 13:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224841 - head/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 13:49:12 -0000 Author: bz Date: Sat Aug 13 13:49:11 2011 New Revision: 224841 URL: http://svn.freebsd.org/changeset/base/224841 Log: Fix jls backward compat mode broken in r222465, correctly displaying addresses in verbose mode (jls -v) again. Submitted by: jamie MFC after: 3 days Approved by: re (kib) Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Sat Aug 13 13:34:01 2011 (r224840) +++ head/usr.sbin/jls/jls.c Sat Aug 13 13:49:11 2011 (r224841) @@ -371,7 +371,7 @@ print_jail(int pflags, int jflags) *(int *)params[5].jp_value); n = 6; #ifdef INET - if (ip4_ok && !strcmp(params[n].jp_name, "ip.addr")) { + if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) { count = params[n].jp_valuelen / sizeof(struct in_addr); for (ai = 0; ai < count; ai++) if (inet_ntop(AF_INET, From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 16:03:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA053106566B; Sat, 13 Aug 2011 16:03:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7B88FC12; Sat, 13 Aug 2011 16:03: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 p7DG3ePf023095; Sat, 13 Aug 2011 16:03:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DG3e80023093; Sat, 13 Aug 2011 16:03:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131603.p7DG3e80023093@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 16:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224842 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 16:03:40 -0000 Author: rwatson Date: Sat Aug 13 16:03:40 2011 New Revision: 224842 URL: http://svn.freebsd.org/changeset/base/224842 Log: When falloc() was broken into separate falloc_noinstall() and finstall(), a bug was introduced in kern_openat() such that the error from the vnode open operation was overwritten before it was passed as an argument to dupfdopen(). This broke operations on /dev/{stdin,stdout,stderr}. Fix by preserving the original error number across finstall() so that it is still available. Approved by: re (kib) Reported by: cognet Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Aug 13 13:49:11 2011 (r224841) +++ head/sys/kern/vfs_syscalls.c Sat Aug 13 16:03:40 2011 (r224842) @@ -1086,7 +1086,7 @@ kern_openat(struct thread *td, int fd, c struct vnode *vp; int cmode; struct file *nfp; - int type, indx = -1, error; + int type, indx = -1, error, error_open; struct flock lf; struct nameidata nd; int vfslocked; @@ -1145,10 +1145,11 @@ kern_openat(struct thread *td, int fd, c (error == ENODEV || error == ENXIO) && (td->td_dupfd >= 0)) { /* XXX from fdopen */ + error_open = error; if ((error = finstall(td, fp, &indx, flags)) != 0) goto bad_unlocked; if ((error = dupfdopen(td, fdp, indx, td->td_dupfd, - flags, error)) == 0) + flags, error_open)) == 0) goto success; } /* From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:08:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 014191065672; Sat, 13 Aug 2011 17:08:58 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4D498FC13; Sat, 13 Aug 2011 17:08: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 p7DH8vRg025103; Sat, 13 Aug 2011 17:08:57 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DH8vCe025100; Sat, 13 Aug 2011 17:08:57 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131708.p7DH8vCe025100@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224843 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:08:58 -0000 Author: zack Date: Sat Aug 13 17:08:57 2011 New Revision: 224843 URL: http://svn.freebsd.org/changeset/base/224843 Log: MFC: r224077 Small acl patch to return the aclerror that comes back from nfsrv_dissectacl(). This fixes a problem where ATTRNOTSUPP was being returned instead of BADOWNER. Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 16:03:40 2011 (r224842) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:08:57 2011 (r224843) @@ -660,9 +660,9 @@ nfsrv_dissectacl(struct nfsrv_descript * aclsize = NFSX_UNSIGNED; acecnt = fxdr_unsigned(int, *tl); if (acecnt > ACL_MAX_ENTRIES) - aceerr = 1; + aceerr = NFSERR_ATTRNOTSUPP; if (nfsrv_useacl == 0) - aceerr = 1; + aceerr = NFSERR_ATTRNOTSUPP; for (i = 0; i < acecnt; i++) { if (aclp && !aceerr) error = nfsrv_dissectace(nd, &aclp->acl_entry[i], Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 16:03:40 2011 (r224842) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:08:57 2011 (r224843) @@ -2301,7 +2301,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, s if (error) goto nfsmout; if (aceerr && !nd->nd_repstat) - nd->nd_repstat = NFSERR_ATTRNOTSUPP; + nd->nd_repstat = aceerr; attrsum += aclsize; break; case NFSATTRBIT_ARCHIVE: From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:16:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360301065676; Sat, 13 Aug 2011 17:16:07 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C23A8FC08; Sat, 13 Aug 2011 17:16: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 p7DHG6Z8025446; Sat, 13 Aug 2011 17:16:06 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHG6V8025442; Sat, 13 Aug 2011 17:16:06 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131716.p7DHG6V8025442@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:16: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: r224844 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:16:07 -0000 Author: zack Date: Sat Aug 13 17:16:06 2011 New Revision: 224844 URL: http://svn.freebsd.org/changeset/base/224844 Log: MFC: 224078 Move nfsvno_pathconf to be accessible to sys/fs/nfs; no functionality change. Modified: stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Sat Aug 13 17:08:57 2011 (r224843) +++ stable/8/sys/fs/nfs/nfs_commonport.c Sat Aug 13 17:16:06 2011 (r224844) @@ -291,6 +291,49 @@ nfsvno_getfs(struct nfsfsinfo *sip, int NFSV3FSINFO_CANSETTIME); } +/* + * Do the pathconf vnode op. + */ +int +nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, + struct ucred *cred, struct thread *p) +{ + int error; + + error = VOP_PATHCONF(vp, flag, retf); + if (error == EOPNOTSUPP || error == EINVAL) { + /* + * Some file systems return EINVAL for name arguments not + * supported and some return EOPNOTSUPP for this case. + * So the NFSv3 Pathconf RPC doesn't fail for these cases, + * just fake them. + */ + switch (flag) { + case _PC_LINK_MAX: + *retf = LINK_MAX; + break; + case _PC_NAME_MAX: + *retf = NAME_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *retf = 1; + break; + case _PC_NO_TRUNC: + *retf = 1; + break; + default: + /* + * Only happens if a _PC_xxx is added to the server, + * but this isn't updated. + */ + *retf = 0; + printf("nfsrvd pathconf flag=%d not supp\n", flag); + }; + error = 0; + } + return (error); +} + /* Fake nfsrv_atroot. Just return 0 */ int nfsrv_atroot(struct vnode *vp, long *retp) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Sat Aug 13 17:08:57 2011 (r224843) +++ stable/8/sys/fs/nfs/nfs_var.h Sat Aug 13 17:16:06 2011 (r224844) @@ -325,6 +325,8 @@ struct ucred *newnfs_getcred(void); void newnfs_setroot(struct ucred *); int nfs_catnap(int, int, const char *); struct nfsreferral *nfsv4root_getreferral(vnode_t, vnode_t, u_int32_t); +int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, + NFSPROC_T *); int nfsrv_atroot(vnode_t, long *); void newnfs_timer(void *); int nfs_supportsnfsv4acls(vnode_t); @@ -569,8 +571,6 @@ int nfsvno_checkexp(mount_t, NFSSOCKADDR struct ucred **); int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, int, vnode_t *, struct nfsexstuff *, struct ucred **); -int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, - NFSPROC_T *); vnode_t nfsvno_getvp(fhandle_t *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:08:57 2011 (r224843) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:16:06 2011 (r224844) @@ -2580,49 +2580,6 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ } /* - * Do the pathconf vnode op. - */ -int -nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf, - struct ucred *cred, struct thread *p) -{ - int error; - - error = VOP_PATHCONF(vp, flag, retf); - if (error == EOPNOTSUPP || error == EINVAL) { - /* - * Some file systems return EINVAL for name arguments not - * supported and some return EOPNOTSUPP for this case. - * So the NFSv3 Pathconf RPC doesn't fail for these cases, - * just fake them. - */ - switch (flag) { - case _PC_LINK_MAX: - *retf = LINK_MAX; - break; - case _PC_NAME_MAX: - *retf = NAME_MAX; - break; - case _PC_CHOWN_RESTRICTED: - *retf = 1; - break; - case _PC_NO_TRUNC: - *retf = 1; - break; - default: - /* - * Only happens if a _PC_xxx is added to the server, - * but this isn't updated. - */ - *retf = 0; - printf("nfsrvd pathconf flag=%d not supp\n", flag); - }; - error = 0; - } - return (error); -} - -/* * nfsd_fhtovp() - convert a fh to a vnode ptr * - look up fsid in mount list (if not found ret error) * - get vp and export rights by calling nfsvno_fhtovp() From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:17:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1021065672; Sat, 13 Aug 2011 17:17:05 +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 4F5DA8FC12; Sat, 13 Aug 2011 17:17: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 p7DHH5DF025533; Sat, 13 Aug 2011 17:17:05 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHH5qE025530; Sat, 13 Aug 2011 17:17:05 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201108131717.p7DHH5qE025530@svn.freebsd.org> From: Attilio Rao Date: Sat, 13 Aug 2011 17:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224845 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:17:05 -0000 Author: attilio Date: Sat Aug 13 17:17:04 2011 New Revision: 224845 URL: http://svn.freebsd.org/changeset/base/224845 Log: Fix a typo in cb_dumpdata() about wrongly calling wdog_kern_pat(). Submitted by: Andrew Boyer Approved by: re (kib) Modified: head/sys/mips/mips/dump_machdep.c Modified: head/sys/mips/mips/dump_machdep.c ============================================================================== --- head/sys/mips/mips/dump_machdep.c Sat Aug 13 17:16:06 2011 (r224844) +++ head/sys/mips/mips/dump_machdep.c Sat Aug 13 17:17:04 2011 (r224845) @@ -188,7 +188,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr } #ifdef SW_WATCHDOG - wdog_kern_path(WD_LASTVAL); + wdog_kern_pat(WD_LASTVAL); #endif error = dump_write(di, (void *)(intptr_t)(pa),0, dumplo, sz); /* XXX fix PA */ if (error) From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:17:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E486F106566C; Sat, 13 Aug 2011 17:17:06 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA5D88FC1D; Sat, 13 Aug 2011 17:17: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 p7DHH6Ld025571; Sat, 13 Aug 2011 17:17:06 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHH6Pm025566; Sat, 13 Aug 2011 17:17:06 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131717.p7DHH6Pm025566@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:17: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: r224846 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:17:07 -0000 Author: zack Date: Sat Aug 13 17:17:06 2011 New Revision: 224846 URL: http://svn.freebsd.org/changeset/base/224846 Log: MFC: 224080 Remove unnecessary thread pointer from VOPLOCK macros and current users. Modified: stable/8/sys/fs/nfs/nfsport.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfsport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsport.h Sat Aug 13 17:17:04 2011 (r224845) +++ stable/8/sys/fs/nfs/nfsport.h Sat Aug 13 17:17:06 2011 (r224846) @@ -832,10 +832,13 @@ void nfsd_mntinit(void); /* * Define these for vnode lock/unlock ops. + * + * These are good abstractions to macro out, so that they can be added to + * later, for debugging or stats, etc. */ -#define NFSVOPLOCK(v, f, p) vn_lock((v), (f)) -#define NFSVOPUNLOCK(v, f, p) VOP_UNLOCK((v), (f)) -#define NFSVOPISLOCKED(v, p) VOP_ISLOCKED((v)) +#define NFSVOPLOCK(v, f) vn_lock((v), (f)) +#define NFSVOPUNLOCK(v, f) VOP_UNLOCK((v), (f)) +#define NFSVOPISLOCKED(v) VOP_ISLOCKED((v)) /* * Define ncl_hash(). Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:17:04 2011 (r224845) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:17:06 2011 (r224846) @@ -280,7 +280,7 @@ nfsvno_namei(struct nfsrv_descript *nd, return (ENOTDIR); } if (islocked) - NFSVOPUNLOCK(dp, 0, p); + NFSVOPUNLOCK(dp, 0); VREF(dp); *retdirp = dp; if (NFSVNO_EXRDONLY(exp)) @@ -349,7 +349,7 @@ nfsvno_namei(struct nfsrv_descript *nd, if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0) nfsvno_relpathbuf(ndp); if (ndp->ni_vp && !lockleaf) - NFSVOPUNLOCK(ndp->ni_vp, 0, p); + NFSVOPUNLOCK(ndp->ni_vp, 0); break; } @@ -357,7 +357,7 @@ nfsvno_namei(struct nfsrv_descript *nd, * Validate symlink */ if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1) - NFSVOPUNLOCK(ndp->ni_dvp, 0, p); + NFSVOPUNLOCK(ndp->ni_dvp, 0); if (!(nd->nd_flag & ND_PUBLOOKUP)) { error = EINVAL; goto badlink2; @@ -2865,14 +2865,14 @@ nfsvno_advlock(struct vnode *vp, int fty fl.l_pid = (pid_t)0; fl.l_sysid = (int)nfsv4_sysid; - NFSVOPUNLOCK(vp, 0, td); + NFSVOPUNLOCK(vp, 0); if (ftype == F_UNLCK) error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl, (F_POSIX | F_REMOTE)); else error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl, (F_POSIX | F_REMOTE)); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); return (error); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:17:04 2011 (r224845) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:17:06 2011 (r224846) @@ -1449,7 +1449,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); - NFSVOPUNLOCK(tdp, 0, p); + NFSVOPUNLOCK(tdp, 0); } } NFSNAMEICNDSET(&tond.ni_cnd, nd->nd_cred, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART); @@ -1554,7 +1554,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); return (0); } - NFSVOPUNLOCK(vp, 0, p); + NFSVOPUNLOCK(vp, 0); if (vnode_vtype(vp) == VDIR) { if (nd->nd_flag & ND_NFSV4) nd->nd_repstat = NFSERR_ISDIR; @@ -1584,7 +1584,7 @@ nfsrvd_link(struct nfsrv_descript *nd, i nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, 0, p); if (dp) - NFSVOPUNLOCK(dp, 0, p); + NFSVOPUNLOCK(dp, 0); } } NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE, @@ -1868,7 +1868,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *n nd->nd_repstat = nfsvno_getattr(vp, nvap, nd->nd_cred, p, 1); if (vpp && !nd->nd_repstat) { - NFSVOPUNLOCK(vp, 0, p); + NFSVOPUNLOCK(vp, 0); *vpp = vp; } else { vput(vp); @@ -2765,7 +2765,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ * (ie: Leave the NFSVOPUNLOCK() about here.) */ if (vp) - NFSVOPUNLOCK(vp, 0, p); + NFSVOPUNLOCK(vp, 0); if (stp) FREE((caddr_t)stp, M_NFSDSTATE); if (!nd->nd_repstat && dirp) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:17:04 2011 (r224845) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:17:06 2011 (r224846) @@ -430,7 +430,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, } else { if (nfs_retfh[nd->nd_procnum] == 1) { if (vp) - NFSVOPUNLOCK(vp, 0, p); + NFSVOPUNLOCK(vp, 0); error = (*(nfsrv3_procs1[nd->nd_procnum]))(nd, isdgram, vp, NULL, (fhandle_t *)fh.nfsrvfh_data, p, &nes); } else if (nfs_retfh[nd->nd_procnum] == 2) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:17:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E93106566C; Sat, 13 Aug 2011 17:17:59 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8015B8FC08; Sat, 13 Aug 2011 17:17: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 p7DHHxqG025650; Sat, 13 Aug 2011 17:17:59 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHHxU9025641; Sat, 13 Aug 2011 17:17:59 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131717.p7DHHxU9025641@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:17: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: r224847 - in stable/8/sys/fs: nfs nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:17:59 -0000 Author: zack Date: Sat Aug 13 17:17:59 2011 New Revision: 224847 URL: http://svn.freebsd.org/changeset/base/224847 Log: MFC: 224081 Simple find/replace of vn_lock -> NFSVOPLOCK. This is done so that NFSVOPLOCK can be modified later to add enhanced logging and assertions. Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clsubs.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:17:59 2011 (r224847) @@ -1995,7 +1995,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); } else if (naclp != NULL) { - if (vn_lock(vp, LK_SHARED) == 0) { + if (NFSVOPLOCK(vp, LK_SHARED) == 0) { error = VOP_ACCESSX(vp, VREAD_ACL, cred, p); if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sat Aug 13 17:17:59 2011 (r224847) @@ -105,7 +105,7 @@ nfscl_nget(struct mount *mntp, struct vn if (error == 0 && nvp != NULL) { /* * I believe there is a slight chance that vgonel() could - * get called on this vnode between when vn_lock() drops + * get called on this vnode between when NFSVOPLOCK() drops * the VI_LOCK() and vget() acquires it again, so that it * hasn't yet had v_usecount incremented. If this were to * happen, the VI_DOOMED flag would be set, so check for Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Sat Aug 13 17:17:59 2011 (r224847) @@ -145,7 +145,7 @@ ncl_upgrade_vnlock(struct vnode *vp) KASSERT(old_lock == LK_SHARED, ("ncl_upgrade_vnlock: wrong old_lock %d", old_lock)); /* Upgrade to exclusive lock, this might block */ - vn_lock(vp, LK_UPGRADE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); } return (old_lock); } @@ -156,7 +156,7 @@ ncl_downgrade_vnlock(struct vnode *vp, i if (old_lock != LK_EXCLUSIVE) { KASSERT(old_lock == LK_SHARED, ("wrong old_lock %d", old_lock)); /* Downgrade from exclusive lock. */ - vn_lock(vp, LK_DOWNGRADE | LK_RETRY); + NFSVOPLOCK(vp, LK_DOWNGRADE | LK_RETRY); } } Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:17:59 2011 (r224847) @@ -1177,7 +1177,7 @@ nfs_lookup(struct vop_lookup_args *ap) vfs_ref(mp); VOP_UNLOCK(dvp, 0); error = vfs_busy(mp, 0); - vn_lock(dvp, ltype | LK_RETRY); + NFSVOPLOCK(dvp, ltype | LK_RETRY); vfs_rel(mp); if (error == 0 && (dvp->v_iflag & VI_DOOMED)) { vfs_unbusy(mp); @@ -1193,7 +1193,7 @@ nfs_lookup(struct vop_lookup_args *ap) newvp = NFSTOV(np); vfs_unbusy(mp); if (newvp != dvp) - vn_lock(dvp, ltype | LK_RETRY); + NFSVOPLOCK(dvp, ltype | LK_RETRY); if (dvp->v_iflag & VI_DOOMED) { if (error == 0) { if (newvp == dvp) @@ -1707,7 +1707,7 @@ nfs_rename(struct vop_rename_args *ap) error = 0; goto out; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) + if ((error = NFSVOPLOCK(fvp, LK_EXCLUSIVE)) != 0) goto out; /* @@ -2879,7 +2879,7 @@ nfs_advlock(struct vop_advlock_args *ap) cred = p->p_ucred; else cred = td->td_ucred; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); return (EBADF); @@ -2909,7 +2909,7 @@ nfs_advlock(struct vop_advlock_args *ap) "ncladvl"); if (error) return (EINTR); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); return (EBADF); @@ -2952,7 +2952,7 @@ nfs_advlock(struct vop_advlock_args *ap) VOP_UNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = vn_lock(vp, LK_SHARED); + error = NFSVOPLOCK(vp, LK_SHARED); if (error) return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { @@ -2983,7 +2983,7 @@ nfs_advlockasync(struct vop_advlockasync if (NFS_ISV4(vp)) return (EOPNOTSUPP); - error = vn_lock(vp, LK_SHARED); + error = NFSVOPLOCK(vp, LK_SHARED); if (error) return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:17:59 2011 (r224847) @@ -116,7 +116,7 @@ nfsvno_getattr(struct vnode *vp, struct */ if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { lockedit = 1; - vn_lock(vp, LK_SHARED | LK_RETRY); + NFSVOPLOCK(vp, LK_SHARED | LK_RETRY); } } error = VOP_GETATTR(vp, &nvap->na_vattr, cred); @@ -158,7 +158,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ int error = 0, getret = 0; if (vpislocked == 0) { - if (vn_lock(vp, LK_SHARED) != 0) + if (NFSVOPLOCK(vp, LK_SHARED) != 0) return (EPERM); } if (accmode & VWRITE) { @@ -1095,7 +1095,7 @@ nfsvno_rename(struct nameidata *fromndp, goto out; } if (ndflag & ND_NFSV4) { - if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(fvp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(fvp, 0, p); VOP_UNLOCK(fvp, 0); } else @@ -1156,7 +1156,7 @@ nfsvno_link(struct nameidata *ndp, struc error = EXDEV; } if (!error) { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) == 0) error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else @@ -1983,7 +1983,7 @@ again: dp->d_name[1] == '.') cn.cn_flags |= ISDOTDOT; - if (vn_lock(vp, LK_SHARED) + if (NFSVOPLOCK(vp, LK_SHARED) != 0) { nd->nd_repstat = EPERM; break; @@ -2575,7 +2575,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ * but this will have to do until VFS_FHTOVP() has a lock * type argument like VFS_VGET(). */ - vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY); + NFSVOPLOCK(*vpp, LK_DOWNGRADE | LK_RETRY); return (error); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:17:59 2011 (r224847) @@ -238,7 +238,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd VOP_UNLOCK(vp, 0); if (at_root != 0) { if ((nd->nd_repstat = - vn_lock(tvp, LK_SHARED)) == 0) { + NFSVOPLOCK(tvp, LK_SHARED)) == 0) { nd->nd_repstat = VOP_GETATTR( tvp, &va, nd->nd_cred); vput(tvp); @@ -2703,7 +2703,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ }; stp->ls_flags |= NFSLCK_RECLAIM; vp = dp; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) == 0) nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, stp, vp, nd, p, nd->nd_repstat); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:17:59 2011 (r224847) @@ -861,7 +861,7 @@ nfsrvd_compound(struct nfsrv_descript *n } if (nfsv4_opflag[op].modifyfs) vn_start_write(savevp, &temp_mp, V_WAIT); - if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(savevp, LK_EXCLUSIVE) == 0) { VREF(vp); VREF(savevp); error = (*(nfsrv4_ops2[op]))(nd, isdgram, @@ -878,7 +878,7 @@ nfsrvd_compound(struct nfsrv_descript *n if (nfsv4_opflag[op].modifyfs) vn_start_write(vp, &temp_mp, V_WAIT); - if (vn_lock(vp, nfsv4_opflag[op].lktype) + if (NFSVOPLOCK(vp, nfsv4_opflag[op].lktype) == 0) VREF(vp); else Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:17:06 2011 (r224846) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:17:59 2011 (r224847) @@ -4096,7 +4096,7 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); vn_start_write(vp, &mp, V_WAIT); - if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); VOP_UNLOCK(vp, 0); @@ -4231,7 +4231,7 @@ nfsrv_checkstable(struct nfsclient *clp) * Return 0 to indicate the conflict can't be revoked and 1 to indicate * the revocation worked and the conflicting client is "bye, bye", so it * can be tried again. - * Return 2 to indicate that the vnode is VI_DOOMED after vn_lock(). + * Return 2 to indicate that the vnode is VI_DOOMED after NFSVOPLOCK(). * Unlocks State before a non-zero value is returned. */ static int @@ -4258,7 +4258,7 @@ nfsrv_clientconflict(struct nfsclient *c } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - vn_lock(vp, lktype | LK_RETRY); + NFSVOPLOCK(vp, lktype | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) != 0) return (2); else @@ -4426,7 +4426,7 @@ nfsrv_delegconflict(struct nfsstate *stp } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - vn_lock(vp, lktype | LK_RETRY); + NFSVOPLOCK(vp, lktype | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) != 0) { *haslockp = 0; NFSLOCKV4ROOTMUTEX(); @@ -4626,7 +4626,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); VOP_UNLOCK(vp, 0); } else From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:18:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED10A106566B; Sat, 13 Aug 2011 17:18:45 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5D08FC1D; Sat, 13 Aug 2011 17:18:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DHIjGA025738; Sat, 13 Aug 2011 17:18:45 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHIj55025729; Sat, 13 Aug 2011 17:18:45 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131718.p7DHIj55025729@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224848 - in stable/8/sys/fs: nfs nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:18:46 -0000 Author: zack Date: Sat Aug 13 17:18:45 2011 New Revision: 224848 URL: http://svn.freebsd.org/changeset/base/224848 Log: MFC: 224082 Simple find/replace of VOP_UNLOCK -> NFSVOPUNLOCK. This is done so that NFSVOPUNLOCK can be modified later to add enhanced logging and assertions. Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:18:45 2011 (r224848) @@ -2000,7 +2000,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, naclp, cred, p); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); } else error = NFSERR_PERM; if (error != 0) { Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sat Aug 13 17:18:45 2011 (r224848) @@ -295,7 +295,7 @@ nfscl_ngetreopen(struct mount *mntp, u_i error = vfs_hash_get(mntp, hash, (LK_EXCLUSIVE | LK_NOWAIT), td, &nvp, newnfs_vncmpf, nfhp); if (error == 0 && nvp != NULL) { - VOP_UNLOCK(nvp, 0); + NFSVOPUNLOCK(nvp, 0); } else if (error == EBUSY) { /* * The LK_EXCLOTHER lock type tells nfs_lock1() to not try Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat Aug 13 17:18:45 2011 (r224848) @@ -1340,7 +1340,7 @@ mountnfs(struct nfs_args *argp, struct m /* * Lose the lock but keep the ref. */ - VOP_UNLOCK(*vpp, 0); + NFSVOPUNLOCK(*vpp, 0); return (0); } error = EIO; @@ -1487,7 +1487,7 @@ loop: error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); vrele(vp); MNT_ILOCK(mp); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:18:45 2011 (r224848) @@ -1175,7 +1175,7 @@ nfs_lookup(struct vop_lookup_args *ap) error = vfs_busy(mp, MBF_NOWAIT); if (error != 0) { vfs_ref(mp); - VOP_UNLOCK(dvp, 0); + NFSVOPUNLOCK(dvp, 0); error = vfs_busy(mp, 0); NFSVOPLOCK(dvp, ltype | LK_RETRY); vfs_rel(mp); @@ -1186,7 +1186,7 @@ nfs_lookup(struct vop_lookup_args *ap) if (error != 0) return (error); } - VOP_UNLOCK(dvp, 0); + NFSVOPUNLOCK(dvp, 0); error = nfscl_nget(mp, dvp, nfhp, cnp, td, &np, NULL, cnp->cn_lkflags); if (error == 0) @@ -1724,7 +1724,7 @@ nfs_rename(struct vop_rename_args *ap) * this condition can result in potential (silent) data loss. */ error = VOP_FSYNC(fvp, MNT_WAIT, fcnp->cn_thread); - VOP_UNLOCK(fvp, 0); + NFSVOPUNLOCK(fvp, 0); if (!error && tvp) error = VOP_FSYNC(tvp, MNT_WAIT, tcnp->cn_thread); if (error) @@ -2881,7 +2881,7 @@ nfs_advlock(struct vop_advlock_args *ap) cred = td->td_ucred; NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (EBADF); } @@ -2904,27 +2904,27 @@ nfs_advlock(struct vop_advlock_args *ap) ap->a_fl, 0, cred, td, ap->a_id, ap->a_flags); if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) && ap->a_op == F_SETLK) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); error = nfs_catnap(PZERO | PCATCH, ret, "ncladvl"); if (error) return (EINTR); NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (EBADF); } } } while (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) && ap->a_op == F_SETLK); if (ret == NFSERR_DENIED) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (EAGAIN); } else if (ret == EINVAL || ret == EBADF || ret == EINTR) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (ret); } else if (ret != 0) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (EACCES); } @@ -2949,7 +2949,7 @@ nfs_advlock(struct vop_advlock_args *ap) } } } - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { error = NFSVOPLOCK(vp, LK_SHARED); @@ -2957,13 +2957,13 @@ nfs_advlock(struct vop_advlock_args *ap) return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); error = lf_advlock(ap, &(vp->v_lockf), size); } else { if (nfs_advlock_p != NULL) error = nfs_advlock_p(ap); else { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); error = ENOLCK; } } @@ -2988,10 +2988,10 @@ nfs_advlockasync(struct vop_advlockasync return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); error = lf_advlockasync(ap, &(vp->v_lockf), size); } else { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); error = EOPNOTSUPP; } return (error); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:18:45 2011 (r224848) @@ -121,7 +121,7 @@ nfsvno_getattr(struct vnode *vp, struct } error = VOP_GETATTR(vp, &nvap->na_vattr, cred); if (lockedit != 0) - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (error); } @@ -189,7 +189,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ } if (error != 0) { if (vpislocked == 0) - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (error); } @@ -229,7 +229,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ } } if (vpislocked == 0) - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); return (error); } @@ -1097,7 +1097,7 @@ nfsvno_rename(struct nameidata *fromndp, if (ndflag & ND_NFSV4) { if (NFSVOPLOCK(fvp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(fvp, 0, p); - VOP_UNLOCK(fvp, 0); + NFSVOPUNLOCK(fvp, 0); } else error = EPERM; if (tvp && !error) @@ -1165,7 +1165,7 @@ nfsvno_link(struct nameidata *ndp, struc vrele(ndp->ni_dvp); else vput(ndp->ni_dvp); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); } else { if (ndp->ni_dvp == ndp->ni_vp) vrele(ndp->ni_dvp); @@ -1884,7 +1884,7 @@ again: */ mp = vp->v_mount; vfs_ref(mp); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); nd->nd_repstat = vfs_busy(mp, 0); vfs_rel(mp); if (nd->nd_repstat != 0) { @@ -1998,7 +1998,7 @@ again: r = VOP_LOOKUP(vp, &nvp, &cn); if (vp != nvp) - VOP_UNLOCK(vp, + NFSVOPUNLOCK(vp, 0); } } @@ -2077,7 +2077,7 @@ again: if (nvp != NULL) { supports_nfsv4acls = nfs_supportsnfsv4acls(nvp); - VOP_UNLOCK(nvp, 0); + NFSVOPUNLOCK(nvp, 0); } else supports_nfsv4acls = 0; if (refp != NULL) { Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Aug 13 17:18:45 2011 (r224848) @@ -235,7 +235,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd } else at_root = 0; vfs_ref(mp); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); if (at_root != 0) { if ((nd->nd_repstat = NFSVOPLOCK(tvp, LK_SHARED)) == 0) { @@ -1276,7 +1276,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (vpp != NULL && nd->nd_repstat == 0) { - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); *vpp = vp; } else vput(vp); @@ -1735,7 +1735,7 @@ nfsrvd_symlinksub(struct nfsrv_descript nvap, nd->nd_cred, p, 1); } if (vpp != NULL && nd->nd_repstat == 0) { - VOP_UNLOCK(ndp->ni_vp, 0); + NFSVOPUNLOCK(ndp->ni_vp, 0); *vpp = ndp->ni_vp; } else vput(ndp->ni_vp); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Aug 13 17:18:45 2011 (r224848) @@ -705,7 +705,7 @@ nfsrvd_compound(struct nfsrv_descript *n vrele(vp); vp = nvp; cur_fsid = vp->v_mount->mnt_stat.f_fsid; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); vpnes = nes; } break; @@ -720,7 +720,7 @@ nfsrvd_compound(struct nfsrv_descript *n vrele(vp); vp = nvp; cur_fsid = vp->v_mount->mnt_stat.f_fsid; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); vpnes = nes; } break; @@ -733,7 +733,7 @@ nfsrvd_compound(struct nfsrv_descript *n vrele(vp); vp = nvp; cur_fsid = vp->v_mount->mnt_stat.f_fsid; - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); vpnes = nes; } } else @@ -840,7 +840,7 @@ nfsrvd_compound(struct nfsrv_descript *n } } /* Lookup ops return a locked vnode */ - VOP_UNLOCK(nvp, 0); + NFSVOPUNLOCK(nvp, 0); } if (!nd->nd_repstat) { vrele(vp); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:17:59 2011 (r224847) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:18:45 2011 (r224848) @@ -4099,7 +4099,7 @@ nfsrv_updatestable(NFSPROC_T *p) if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); } else error = EPERM; vn_finished_write(mp); @@ -4249,7 +4249,7 @@ nfsrv_clientconflict(struct nfsclient *c if (*haslockp == 0) { NFSUNLOCKSTATE(); lktype = VOP_ISLOCKED(vp); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4417,7 +4417,7 @@ nfsrv_delegconflict(struct nfsstate *stp if (*haslockp == 0) { NFSUNLOCKSTATE(); lktype = VOP_ISLOCKED(vp); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); do { @@ -4628,7 +4628,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO do { if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); - VOP_UNLOCK(vp, 0); + NFSVOPUNLOCK(vp, 0); } else error = EPERM; if (error == NFSERR_DELAY) { From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:19:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5F9E106566B; Sat, 13 Aug 2011 17:19:24 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC72D8FC15; Sat, 13 Aug 2011 17:19:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DHJOjh025815; Sat, 13 Aug 2011 17:19:24 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHJOF7025809; Sat, 13 Aug 2011 17:19:24 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131719.p7DHJOF7025809@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224849 - in stable/8/sys/fs: nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:19:25 -0000 Author: zack Date: Sat Aug 13 17:19:24 2011 New Revision: 224849 URL: http://svn.freebsd.org/changeset/base/224849 Log: MFC: r224083 Simple find/replace of VOP_ISLOCKED -> NFSVOPISLOCKED. This is done so that NFSVOPISLOCKED can be modified later to add enhanced logging and assertions. Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clsubs.c Sat Aug 13 17:18:45 2011 (r224848) +++ stable/8/sys/fs/nfsclient/nfs_clsubs.c Sat Aug 13 17:19:24 2011 (r224849) @@ -140,7 +140,7 @@ ncl_upgrade_vnlock(struct vnode *vp) int old_lock; ASSERT_VOP_LOCKED(vp, "ncl_upgrade_vnlock"); - old_lock = VOP_ISLOCKED(vp); + old_lock = NFSVOPISLOCKED(vp); if (old_lock != LK_EXCLUSIVE) { KASSERT(old_lock == LK_SHARED, ("ncl_upgrade_vnlock: wrong old_lock %d", old_lock)); Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat Aug 13 17:18:45 2011 (r224848) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sat Aug 13 17:19:24 2011 (r224849) @@ -1473,7 +1473,7 @@ loop: VI_LOCK(vp); MNT_IUNLOCK(mp); /* XXX Racy bv_cnt check. */ - if (VOP_ISLOCKED(vp) || vp->v_bufobj.bo_dirty.bv_cnt == 0 || + if (NFSVOPISLOCKED(vp) || vp->v_bufobj.bo_dirty.bv_cnt == 0 || waitfor == MNT_LAZY) { VI_UNLOCK(vp); MNT_ILOCK(mp); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:18:45 2011 (r224848) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sat Aug 13 17:19:24 2011 (r224849) @@ -1171,7 +1171,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if (flags & ISDOTDOT) { - ltype = VOP_ISLOCKED(dvp); + ltype = NFSVOPISLOCKED(dvp); error = vfs_busy(mp, MBF_NOWAIT); if (error != 0) { vfs_ref(mp); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:18:45 2011 (r224848) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Aug 13 17:19:24 2011 (r224849) @@ -114,7 +114,7 @@ nfsvno_getattr(struct vnode *vp, struct * locked by this thread or not locked by this thread. * As such, shared lock it, if not exclusively locked. */ - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + if (NFSVOPISLOCKED(vp) != LK_EXCLUSIVE) { lockedit = 1; NFSVOPLOCK(vp, LK_SHARED | LK_RETRY); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:18:45 2011 (r224848) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Aug 13 17:19:24 2011 (r224849) @@ -4248,7 +4248,7 @@ nfsrv_clientconflict(struct nfsclient *c return (0); if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = VOP_ISLOCKED(vp); + lktype = NFSVOPISLOCKED(vp); NFSVOPUNLOCK(vp, 0); NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); @@ -4416,7 +4416,7 @@ nfsrv_delegconflict(struct nfsstate *stp */ if (*haslockp == 0) { NFSUNLOCKSTATE(); - lktype = VOP_ISLOCKED(vp); + lktype = NFSVOPISLOCKED(vp); NFSVOPUNLOCK(vp, 0); NFSLOCKV4ROOTMUTEX(); nfsv4_relref(&nfsv4rootfs_lock); @@ -4610,7 +4610,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO nfsrv_issuedelegs == 0) return; - KASSERT((VOP_ISLOCKED(vp) != LK_EXCLUSIVE), ("vp %p is locked", vp)); + KASSERT((NFSVOPISLOCKED(vp) != LK_EXCLUSIVE), ("vp %p is locked", vp)); /* * First, get a reference on the nfsv4rootfs_lock so that an * exclusive lock cannot be acquired by another thread. From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:20:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519A91065670; Sat, 13 Aug 2011 17:20:01 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39FEA8FC13; Sat, 13 Aug 2011 17:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DHK1qr025889; Sat, 13 Aug 2011 17:20:01 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHK1xW025888; Sat, 13 Aug 2011 17:20:01 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131720.p7DHK1xW025888@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224850 - stable/8/sys/kgssapi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:20:01 -0000 Author: zack Date: Sat Aug 13 17:20:00 2011 New Revision: 224850 URL: http://svn.freebsd.org/changeset/base/224850 Log: MFC: 224084 Add a small comment about unloading the kgsappi module. Modified: stable/8/sys/kgssapi/gss_impl.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/kgssapi/gss_impl.c ============================================================================== --- stable/8/sys/kgssapi/gss_impl.c Sat Aug 13 17:19:24 2011 (r224849) +++ stable/8/sys/kgssapi/gss_impl.c Sat Aug 13 17:20:00 2011 (r224850) @@ -282,7 +282,11 @@ kgssapi_modevent(module_t mod, int type, rpc_gss_svc_max_data_length; break; case MOD_UNLOAD: - /* Unloading of the kgssapi module isn't supported. */ + /* + * Unloading of the kgssapi module is not currently supported. + * If somebody wants this, we would need to keep track of + * currently executing threads and make sure the count is 0. + */ /* FALLTHROUGH */ default: error = EOPNOTSUPP; From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:21:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFB75106566C; Sat, 13 Aug 2011 17:21:50 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE06B8FC1A; Sat, 13 Aug 2011 17:21:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DHLoc4026002; Sat, 13 Aug 2011 17:21:50 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHLoo3025993; Sat, 13 Aug 2011 17:21:50 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131721.p7DHLoo3025993@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224851 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:21:50 -0000 Author: zack Date: Sat Aug 13 17:21:50 2011 New Revision: 224851 URL: http://svn.freebsd.org/changeset/base/224851 Log: MFC r224086: Add DEXITCODE plumbing to NFS. Isilon has the concept of an in-memory exit-code ring that saves the last exit code of a function and allows for stack tracing. This is very helpful when debugging tough issues. This patch is essentially a no-op for BSD at this point, until we upstream the dexitcode logic itself. The patch adds DEXITCODE calls to every NFS function that returns an errno error code. A number of code paths were also reorganized to have single exit paths, to reduce code duplication. Submitted by: David Kwan Modified: stable/8/sys/fs/nfs/nfs_commonacl.c stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfs/nfsdport.h stable/8/sys/fs/nfsserver/nfs_nfsdcache.c stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c stable/8/sys/fs/nfsserver/nfs_nfsdstate.c stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonacl.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfs/nfs_commonacl.c Sat Aug 13 17:21:50 2011 (r224851) @@ -59,7 +59,8 @@ nfsrv_dissectace(struct nfsrv_descript * mask = fxdr_unsigned(u_int32_t, *tl++); len = fxdr_unsigned(int, *tl); if (len < 0) { - return (NFSERR_BADXDR); + error = NFSERR_BADXDR; + goto nfsmout; } else if (len == 0) { /* Netapp filers return a 0 length who for nil users */ acep->ae_tag = ACL_UNDEFINED_TAG; @@ -68,7 +69,8 @@ nfsrv_dissectace(struct nfsrv_descript * acep->ae_entry_type = ACL_ENTRY_TYPE_DENY; if (acesizep) *acesizep = 4 * NFSX_UNSIGNED; - return (0); + error = 0; + goto nfsmout; } if (len > NFSV4_SMALLSTR) name = malloc(len + 1, M_NFSSTRING, M_WAITOK); @@ -78,7 +80,7 @@ nfsrv_dissectace(struct nfsrv_descript * if (error) { if (len > NFSV4_SMALLSTR) free(name, M_NFSSTRING); - return (error); + goto nfsmout; } if (len == 6) { if (!NFSBCMP(name, "OWNER@", 6)) { @@ -171,8 +173,9 @@ nfsrv_dissectace(struct nfsrv_descript * *aceerrp = aceerr; if (acesizep) *acesizep = NFSM_RNDUP(len) + (4 * NFSX_UNSIGNED); - return (0); + error = 0; nfsmout: + NFSEXITCODE(error); return (error); } @@ -184,6 +187,7 @@ nfsrv_acemasktoperm(u_int32_t acetype, u enum vtype type, acl_perm_t *permp) { acl_perm_t perm = 0x0; + int error = 0; if (mask & NFSV4ACE_READDATA) { mask &= ~NFSV4ACE_READDATA; @@ -257,10 +261,15 @@ nfsrv_acemasktoperm(u_int32_t acetype, u mask &= ~NFSV4ACE_SYNCHRONIZE; perm |= ACL_SYNCHRONIZE; } - if (mask != 0) - return (NFSERR_ATTRNOTSUPP); + if (mask != 0) { + error = NFSERR_ATTRNOTSUPP; + goto out; + } *permp = perm; - return (0); + +out: + NFSEXITCODE(error); + return (error); } /* local functions */ @@ -445,19 +454,26 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, { int error; - if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) - return (NFSERR_ATTRNOTSUPP); + if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { + error = NFSERR_ATTRNOTSUPP; + goto out; + } /* * With NFSv4 ACLs, chmod(2) may need to add additional entries. * Make sure it has enough room for that - splitting every entry * into two and appending "canonical six" entries at the end. * Cribbed out of kern/vfs_acl.c - Rick M. */ - if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) - return (NFSERR_ATTRNOTSUPP); + if (aclp->acl_cnt > (ACL_MAX_ENTRIES - 6) / 2) { + error = NFSERR_ATTRNOTSUPP; + goto out; + } error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); if (!error) error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); + +out: + NFSEXITCODE(error); return (error); } Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sat Aug 13 17:21:50 2011 (r224851) @@ -143,7 +143,7 @@ newnfs_connect(struct nfsmount *nmp, str CLIENT *client; struct netconfig *nconf; struct socket *so; - int one = 1, retries, error; + int one = 1, retries, error = 0; struct thread *td = curthread; /* @@ -199,7 +199,7 @@ newnfs_connect(struct nfsmount *nmp, str nrp->nr_soproto, td->td_ucred, td); if (error) { td->td_ucred = origcred; - return (error); + goto out; } do { if (error != 0 && pktscale > 2) @@ -230,7 +230,7 @@ newnfs_connect(struct nfsmount *nmp, str soclose(so); if (error) { td->td_ucred = origcred; - return (error); + goto out; } client = clnt_reconnect_create(nconf, saddr, nrp->nr_prog, @@ -284,7 +284,10 @@ newnfs_connect(struct nfsmount *nmp, str /* Restore current thread's credentials. */ td->td_ucred = origcred; - return (0); + +out: + NFSEXITCODE(error); + return (error); } /* Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfs/nfs_commonport.c Sat Aug 13 17:21:50 2011 (r224851) @@ -331,6 +331,7 @@ nfsvno_pathconf(struct vnode *vp, int fl }; error = 0; } + NFSEXITCODE(error); return (error); } @@ -429,6 +430,7 @@ nfssvc_nfscommon(struct thread *td, stru int error; error = nfssvc_call(td, uap, td->td_ucred); + NFSEXITCODE(error); return (error); } @@ -441,9 +443,9 @@ nfssvc_call(struct thread *p, struct nfs if (uap->flag & NFSSVC_IDNAME) { error = copyin(uap->argp, (caddr_t)&nid, sizeof (nid)); if (error) - return (error); + goto out; error = nfssvc_idname(&nid); - return (error); + goto out; } else if (uap->flag & NFSSVC_GETSTATS) { error = copyout(&newnfsstats, CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats)); @@ -505,7 +507,7 @@ nfssvc_call(struct thread *p, struct nfs sizeof(newnfsstats.cbrpccnt)); } } - return (error); + goto out; } else if (uap->flag & NFSSVC_NFSUSERDPORT) { u_short sockport; @@ -517,6 +519,9 @@ nfssvc_call(struct thread *p, struct nfs nfsrv_nfsuserddelport(); error = 0; } + +out: + NFSEXITCODE(error); return (error); } @@ -571,7 +576,7 @@ nfscommon_modevent(module_t mod, int typ switch (type) { case MOD_LOAD: if (loaded) - return (0); + goto out; newnfs_portinit(); mtx_init(&nfs_nameid_mutex, "nfs_nameid_mutex", NULL, MTX_DEF); mtx_init(&nfs_sockl_mutex, "nfs_sockl_mutex", NULL, MTX_DEF); @@ -608,6 +613,9 @@ nfscommon_modevent(module_t mod, int typ error = EOPNOTSUPP; break; } + +out: + NFSEXITCODE(error); return error; } static moduledata_t nfscommon_mod = { Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:21:50 2011 (r224851) @@ -179,8 +179,10 @@ nfsm_mbufuio(struct nfsrv_descript *nd, len = NFSMTOD(mp, caddr_t) + mbuf_len(mp) - mbufcp; rem = NFSM_RNDUP(siz) - siz; while (siz > 0) { - if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return (EBADRPC); + if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) { + error = EBADRPC; + goto out; + } left = uiop->uio_iov->iov_len; uiocp = uiop->uio_iov->iov_base; if (left > siz) @@ -189,8 +191,10 @@ nfsm_mbufuio(struct nfsrv_descript *nd, while (left > 0) { while (len == 0) { mp = mbuf_next(mp); - if (mp == NULL) - return (EBADRPC); + if (mp == NULL) { + error = EBADRPC; + goto out; + } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); } @@ -231,6 +235,9 @@ nfsm_mbufuio(struct nfsrv_descript *nd, else nd->nd_dpos += rem; } + +out: + NFSEXITCODE2(error, nd); return (error); } #endif /* !APPLE */ @@ -308,9 +315,10 @@ nfsm_dissct(struct nfsrv_descript *nd, i APPLESTATIC int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { + int error = 0; if (offs == 0) - return (0); + goto out; /* * A negative offs should be considered a serious problem. */ @@ -330,13 +338,18 @@ nfsm_advance(struct nfsrv_descript *nd, while (offs > left) { offs -= left; nd->nd_md = mbuf_next(nd->nd_md); - if (nd->nd_md == NULL) - return (EBADRPC); + if (nd->nd_md == NULL) { + error = EBADRPC; + goto out; + } left = mbuf_len(nd->nd_md); nd->nd_dpos = NFSMTOD(nd->nd_md, caddr_t); } nd->nd_dpos += offs; - return (0); + +out: + NFSEXITCODE(error); + return (error); } /* @@ -620,8 +633,10 @@ nfsm_getfh(struct nfsrv_descript *nd, st if (nd->nd_flag & (ND_NFSV3 | ND_NFSV4)) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); if ((len = fxdr_unsigned(int, *tl)) <= 0 || - len > NFSX_FHMAX) - return (EBADRPC); + len > NFSX_FHMAX) { + error = EBADRPC; + goto nfsmout; + } } else len = NFSX_V2FH; MALLOC(nfhp, struct nfsfh *, sizeof (struct nfsfh) + len, @@ -629,11 +644,12 @@ nfsm_getfh(struct nfsrv_descript *nd, st error = nfsrv_mtostr(nd, nfhp->nfh_fh, len); if (error) { FREE((caddr_t)nfhp, M_NFSFH); - return (error); + goto nfsmout; } nfhp->nfh_len = len; *nfhpp = nfhp; nfsmout: + NFSEXITCODE2(error, nd); return (error); } @@ -670,7 +686,7 @@ nfsrv_dissectacl(struct nfsrv_descript * else error = nfsrv_skipace(nd, &acesize); if (error) - return (error); + goto nfsmout; aclsize += acesize; } if (aclp && !aceerr) @@ -680,6 +696,7 @@ nfsrv_dissectacl(struct nfsrv_descript * if (aclsizep) *aclsizep = aclsize; nfsmout: + NFSEXITCODE2(error, nd); return (error); } @@ -697,6 +714,7 @@ nfsrv_skipace(struct nfsrv_descript *nd, error = nfsm_advance(nd, NFSM_RNDUP(len), -1); nfsmout: *acesizep = NFSM_RNDUP(len) + (4 * NFSX_UNSIGNED); + NFSEXITCODE2(error, nd); return (error); } @@ -715,8 +733,10 @@ nfsrv_getattrbits(struct nfsrv_descript NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); cnt = fxdr_unsigned(int, *tl); - if (cnt < 0) - return (NFSERR_BADXDR); + if (cnt < 0) { + error = NFSERR_BADXDR; + goto nfsmout; + } if (cnt > NFSATTRBIT_MAXWORDS) { outcnt = NFSATTRBIT_MAXWORDS; if (retnotsupp) @@ -735,6 +755,7 @@ nfsrv_getattrbits(struct nfsrv_descript if (cntp) *cntp = NFSX_UNSIGNED + (cnt * NFSX_UNSIGNED); nfsmout: + NFSEXITCODE2(error, nd); return (error); } @@ -756,7 +777,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd u_int32_t *leasep, u_int32_t *rderrp, NFSPROC_T *p, struct ucred *cred) { u_int32_t *tl; - int i = 0, j, k, l, m, bitpos, attrsum = 0; + int i = 0, j, k, l = 0, m, bitpos, attrsum = 0; int error, tfhsize, aceerr, attrsize, cnt, retnotsup; u_char *cp, *cp2, namestr[NFSV4_SMALLSTR + 1]; nfsattrbit_t attrbits, retattrbits, checkattrbits; @@ -782,7 +803,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd error = nfsrv_getattrbits(nd, &attrbits, NULL, NULL); } if (error) - return (error); + goto nfsmout; if (compare) { *retcmpp = retnotsup; @@ -853,7 +874,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd error = nfsrv_getattrbits(nd, &nap->na_suppattr, &cnt, &retnotsup); if (error) - return (error); + goto nfsmout; if (compare && !(*retcmpp)) { NFSSETSUPP_ATTRBIT(&checkattrbits); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) @@ -1014,7 +1035,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd &cnt, p); if (error) { acl_free(naclp); - return (error); + goto nfsmout; } if (aceerr || nfsrv_compareacl(aclp, naclp)) *retcmpp = NFSERR_NOTSAME; @@ -1033,7 +1054,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd error = nfsrv_dissectacl(nd, NULL, &aceerr, &cnt, p); if (error) - return (error); + goto nfsmout; } attrsum += cnt; break; @@ -1118,7 +1139,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_FILEHANDLE: error = nfsm_getfh(nd, &tnfhp); if (error) - return (error); + goto nfsmout; tfhsize = tnfhp->nfh_len; if (compare) { if (!(*retcmpp) && @@ -1184,7 +1205,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_FSLOCATIONS: error = nfsrv_getrefstr(nd, &cp, &cp2, &l, &m); if (error) - return (error); + goto nfsmout; attrsum += l; if (compare && !(*retcmpp)) { refp = nfsv4root_getreferral(vp, NULL, 0); @@ -1360,8 +1381,10 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_OWNER: NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); j = fxdr_unsigned(int, *tl); - if (j < 0) - return (NFSERR_BADXDR); + if (j < 0) { + error = NFSERR_BADXDR; + goto nfsmout; + } attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(j)); if (j > NFSV4_SMALLSTR) cp = malloc(j + 1, M_NFSSTRING, M_WAITOK); @@ -1371,7 +1394,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd if (error) { if (j > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); - return (error); + goto nfsmout; } if (compare) { if (!(*retcmpp)) { @@ -1391,8 +1414,10 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_OWNERGROUP: NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); j = fxdr_unsigned(int, *tl); - if (j < 0) - return (NFSERR_BADXDR); + if (j < 0) { + error = NFSERR_BADXDR; + goto nfsmout; + } attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(j)); if (j > NFSV4_SMALLSTR) cp = malloc(j + 1, M_NFSSTRING, M_WAITOK); @@ -1402,7 +1427,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd if (error) { if (j > NFSV4_SMALLSTR) free(cp, M_NFSSTRING); - return (error); + goto nfsmout; } if (compare) { if (!(*retcmpp)) { @@ -1708,6 +1733,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd error = nfsm_advance(nd, attrsize - attrsum, -1); } nfsmout: + NFSEXITCODE2(error, nd); return (error); } @@ -1904,8 +1930,10 @@ nfsrv_mtostr(struct nfsrv_descript *nd, siz -= xfer; if (siz > 0) { mp = mbuf_next(mp); - if (mp == NULL) - return (EBADRPC); + if (mp == NULL) { + error = EBADRPC; + goto out; + } cp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); } else { @@ -1922,6 +1950,9 @@ nfsrv_mtostr(struct nfsrv_descript *nd, else nd->nd_dpos += rem; } + +out: + NFSEXITCODE2(error, nd); return (error); } @@ -2568,9 +2599,12 @@ nfsv4_strtouid(u_char *str, int len, uid u_char *cp; struct nfsusrgrp *usrp; int cnt, ret; + int error = 0; - if (len == 0) - return (NFSERR_BADOWNER); + if (len == 0) { + error = NFSERR_BADOWNER; + goto out; + } /* * Look for an '@'. */ @@ -2601,7 +2635,8 @@ tryagain: if (len == 6 && !NFSBCMP(str, "nobody", 6)) { *uidp = nfsrv_defaultuid; NFSUNLOCKNAMEID(); - return (0); + error = 0; + goto out; } LIST_FOREACH(usrp, NFSUSERNAMEHASH(str, len), lug_namehash) { @@ -2613,7 +2648,8 @@ tryagain: TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); NFSUNLOCKNAMEID(); - return (0); + error = 0; + goto out; } } NFSUNLOCKNAMEID(); @@ -2622,7 +2658,11 @@ tryagain: str, p); if (ret == 0 && cnt < 2) goto tryagain; - return (NFSERR_BADOWNER); + error = NFSERR_BADOWNER; + +out: + NFSEXITCODE(error); + return (error); } /* @@ -2748,9 +2788,12 @@ nfsv4_strtogid(u_char *str, int len, gid u_char *cp; struct nfsusrgrp *usrp; int cnt, ret; + int error = 0; - if (len == 0) - return (NFSERR_BADOWNER); + if (len == 0) { + error = NFSERR_BADOWNER; + goto out; + } /* * Look for an '@'. */ @@ -2779,7 +2822,8 @@ tryagain: if (len == 7 && !NFSBCMP(str, "nogroup", 7)) { *gidp = nfsrv_defaultgid; NFSUNLOCKNAMEID(); - return (0); + error = 0; + goto out; } LIST_FOREACH(usrp, NFSGROUPNAMEHASH(str, len), lug_namehash) { @@ -2791,7 +2835,8 @@ tryagain: TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru); TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru); NFSUNLOCKNAMEID(); - return (0); + error = 0; + goto out; } } NFSUNLOCKNAMEID(); @@ -2800,7 +2845,11 @@ tryagain: str, p); if (ret == 0 && cnt < 2) goto tryagain; - return (NFSERR_BADOWNER); + error = NFSERR_BADOWNER; + +out: + NFSEXITCODE(error); + return (error); } /* @@ -2845,7 +2894,8 @@ nfsrv_nfsuserdport(u_short port, NFSPROC NFSLOCKNAMEID(); if (nfsrv_nfsuserd) { NFSUNLOCKNAMEID(); - return (EPERM); + error = EPERM; + goto out; } nfsrv_nfsuserd = 1; NFSUNLOCKNAMEID(); @@ -2871,6 +2921,8 @@ nfsrv_nfsuserdport(u_short port, NFSPROC NFSSOCKADDRFREE(rp->nr_nam); nfsrv_nfsuserd = 0; } +out: + NFSEXITCODE(error); return (error); } @@ -2910,7 +2962,8 @@ nfsrv_getuser(int procnum, uid_t uid, gi NFSLOCKNAMEID(); if (nfsrv_nfsuserd == 0) { NFSUNLOCKNAMEID(); - return (EPERM); + error = EPERM; + goto out; } NFSUNLOCKNAMEID(); nd = &nfsd; @@ -2936,6 +2989,8 @@ nfsrv_getuser(int procnum, uid_t uid, gi mbuf_freem(nd->nd_mrep); error = nd->nd_repstat; } +out: + NFSEXITCODE(error); return (error); } @@ -2992,7 +3047,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) NFSUNLOCKNAMEID(); if (error) free(cp, M_NFSSTRING); - return (error); + goto out; } /* @@ -3005,7 +3060,7 @@ nfssvc_idname(struct nfsd_idargs *nidp) nidp->nid_namelen); if (error) { free((caddr_t)newusrp, M_NFSUSERGROUP); - return (error); + goto out; } newusrp->lug_namelen = nidp->nid_namelen; @@ -3080,6 +3135,8 @@ nfssvc_idname(struct nfsd_idargs *nidp) } else FREE((caddr_t)newusrp, M_NFSUSERGROUP); NFSUNLOCKNAMEID(); +out: + NFSEXITCODE(error); return (error); } @@ -3109,6 +3166,7 @@ nfsrv_checkutf8(u_int8_t *cp, int len) int cnt = 0, gotd = 0, shift = 0; u_int8_t byte; static int utf8_shift[5] = { 7, 11, 16, 21, 26 }; + int error = 0; /* * Here are what the variables are used for: @@ -3125,14 +3183,18 @@ nfsrv_checkutf8(u_int8_t *cp, int len) if (cnt > 0) { /* This handles the 10xxxxxx bytes */ if ((*cp & 0xc0) != 0x80 || - (gotd && (*cp & 0x20))) - return (NFSERR_INVAL); + (gotd && (*cp & 0x20))) { + error = NFSERR_INVAL; + goto out; + } gotd = 0; val <<= 6; val |= (*cp & 0x3f); cnt--; - if (cnt == 0 && (val >> shift) == 0x0) - return (NFSERR_INVAL); + if (cnt == 0 && (val >> shift) == 0x0) { + error = NFSERR_INVAL; + goto out; + } } else if (*cp & 0x80) { /* first byte of multi byte char */ byte = *cp; @@ -3140,8 +3202,10 @@ nfsrv_checkutf8(u_int8_t *cp, int len) cnt++; byte <<= 1; } - if (cnt == 0 || cnt == 6) - return (NFSERR_INVAL); + if (cnt == 0 || cnt == 6) { + error = NFSERR_INVAL; + goto out; + } val = (*cp & (0x3f >> cnt)); shift = utf8_shift[cnt - 1]; if (cnt == 2 && val == 0xd) @@ -3152,8 +3216,11 @@ nfsrv_checkutf8(u_int8_t *cp, int len) len--; } if (cnt > 0) - return (NFSERR_INVAL); - return (0); + error = NFSERR_INVAL; + +out: + NFSEXITCODE(error); + return (error); } /* @@ -3174,7 +3241,7 @@ nfsrv_getrefstr(struct nfsrv_descript *n { u_int32_t *tl; u_char *cp = NULL, *cp2 = NULL, *cp3, *str; - int i, j, len, stringlen, cnt, slen, siz, xdrsum, error, nsrv; + int i, j, len, stringlen, cnt, slen, siz, xdrsum, error = 0, nsrv; struct list { SLIST_ENTRY(list) next; int len; @@ -3192,15 +3259,20 @@ nfsrv_getrefstr(struct nfsrv_descript *n */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); - if (len < 0 || len > 10240) - return (NFSERR_BADXDR); + if (len < 0 || len > 10240) { + error = NFSERR_BADXDR; + goto nfsmout; + } if (len == 0) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); - if (*tl != 0) - return (NFSERR_BADXDR); + if (*tl != 0) { + error = NFSERR_BADXDR; + goto nfsmout; + } *nilp = 1; *sump = 2 * NFSX_UNSIGNED; - return (0); + error = 0; + goto nfsmout; } cp = malloc(len + 1, M_NFSSTRING, M_WAITOK); error = nfsrv_mtostr(nd, cp, len); @@ -3210,10 +3282,8 @@ nfsrv_getrefstr(struct nfsrv_descript *n if (cnt <= 0) error = NFSERR_BADXDR; } - if (error) { - free(cp, M_NFSSTRING); - return (error); - } + if (error) + goto nfsmout; /* * Now, loop through the location list and make up the srvlist. @@ -3227,9 +3297,8 @@ nfsrv_getrefstr(struct nfsrv_descript *n NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nsrv = fxdr_unsigned(int, *tl); if (nsrv <= 0) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (NFSERR_BADXDR); + error = NFSERR_BADXDR; + goto nfsmout; } /* @@ -3238,9 +3307,8 @@ nfsrv_getrefstr(struct nfsrv_descript *n NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); if (len <= 0 || len > 1024) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (NFSERR_BADXDR); + error = NFSERR_BADXDR; + goto nfsmout; } nfsrv_refstrbigenough(siz + len + 3, &cp2, &cp3, &slen); if (cp3 != cp2) { @@ -3248,11 +3316,8 @@ nfsrv_getrefstr(struct nfsrv_descript *n siz++; } error = nfsrv_mtostr(nd, cp3, len); - if (error) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (error); - } + if (error) + goto nfsmout; cp3 += len; *cp3++ = ':'; siz += (len + 1); @@ -3264,18 +3329,14 @@ nfsrv_getrefstr(struct nfsrv_descript *n NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); if (len <= 0 || len > 1024) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (NFSERR_BADXDR); + error = NFSERR_BADXDR; + goto nfsmout; } lsp = (struct list *)malloc(sizeof (struct list) + len, M_TEMP, M_WAITOK); error = nfsrv_mtostr(nd, lsp->host, len); - if (error) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (error); - } + if (error) + goto nfsmout; xdrsum += NFSX_UNSIGNED + NFSM_RNDUP(len); lsp->len = len; SLIST_INSERT_HEAD(&head, lsp, next); @@ -3287,17 +3348,13 @@ nfsrv_getrefstr(struct nfsrv_descript *n NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); len = fxdr_unsigned(int, *tl); if (len <= 0 || len > 1024) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (NFSERR_BADXDR); + error = NFSERR_BADXDR; + goto nfsmout; } nfsrv_refstrbigenough(siz + len + 1, &cp2, &cp3, &slen); error = nfsrv_mtostr(nd, cp3, len); - if (error) { - free(cp, M_NFSSTRING); - free(cp2, M_NFSSTRING); - return (error); - } + if (error) + goto nfsmout; xdrsum += NFSX_UNSIGNED + NFSM_RNDUP(len); str = cp3; stringlen = len; @@ -3320,12 +3377,14 @@ nfsrv_getrefstr(struct nfsrv_descript *n *fsrootp = cp; *srvp = cp2; *sump = xdrsum; + NFSEXITCODE2(0, nd); return (0); nfsmout: if (cp != NULL) free(cp, M_NFSSTRING); if (cp2 != NULL) free(cp2, M_NFSSTRING); + NFSEXITCODE2(error, nd); return (error); } Modified: stable/8/sys/fs/nfs/nfsdport.h ============================================================================== --- stable/8/sys/fs/nfs/nfsdport.h Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfs/nfsdport.h Sat Aug 13 17:21:50 2011 (r224851) @@ -57,6 +57,22 @@ struct nfsexstuff { int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ }; +/* + * These are NO-OPS for BSD until Isilon upstreams EXITCODE support. + * EXITCODE is an in-memory ring buffer that holds the routines failing status. + * This is a valuable tool to use when debugging and analyzing issues. + * In addition to recording a routine's failing status, it offers + * logging of routines for call stack tracing. + * EXITCODE should be used only in routines that return a true errno value, as + * that value will be formatted to a displayable errno string. Routines that + * return regular int status that are not true errno should not set EXITCODE. + * If you want to log routine tracing, you can add EXITCODE(0) to any routine. + * NFS extended the EXITCODE with EXITCODE2 to record either the routine's + * exit errno status or the nd_repstat. + */ +#define NFSEXITCODE(error) +#define NFSEXITCODE2(error, nd) + #define NFSVNO_EXINIT(e) ((e)->nes_exflag = 0) #define NFSVNO_EXPORTED(e) ((e)->nes_exflag & MNT_EXPORTED) #define NFSVNO_EXRDONLY(e) ((e)->nes_exflag & MNT_EXRDONLY) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Sat Aug 13 17:21:50 2011 (r224851) @@ -308,6 +308,7 @@ nfsrvd_getcache(struct nfsrv_descript *n ret = nfsrc_gettcp(nd, newrp); } nfsrc_trimcache(nd->nd_sockref, so); + NFSEXITCODE2(0, nd); return (ret); } @@ -373,7 +374,7 @@ loop: } nfsrc_unlock(rp); free((caddr_t)newrp, M_NFSRVCACHE); - return (ret); + goto out; } } newnfsstats.srvcache_misses++; @@ -394,7 +395,11 @@ loop: TAILQ_INSERT_TAIL(&nfsrvudplru, newrp, rc_lru); NFSUNLOCKCACHE(); nd->nd_rp = newrp; - return (RC_DOIT); + ret = RC_DOIT; + +out: + NFSEXITCODE2(0, nd); + return (ret); } /* @@ -436,8 +441,7 @@ nfsrvd_updatecache(struct nfsrv_descript M_COPYALL, M_WAIT); rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT; nfsrc_unlock(rp); - nfsrc_trimcache(nd->nd_sockref, so); - return (retrp); + goto out; } /* @@ -492,7 +496,10 @@ nfsrvd_updatecache(struct nfsrv_descript nfsrc_freecache(rp); NFSUNLOCKCACHE(); } + +out: nfsrc_trimcache(nd->nd_sockref, so); + NFSEXITCODE2(0, nd); return (retrp); } @@ -656,7 +663,7 @@ tryagain: } nfsrc_unlock(rp); free((caddr_t)newrp, M_NFSRVCACHE); - return (ret); + goto out; } newnfsstats.srvcache_misses++; newnfsstats.srvcache_size++; @@ -670,7 +677,11 @@ tryagain: LIST_INSERT_HEAD(hp, newrp, rc_hash); NFSUNLOCKCACHE(); nd->nd_rp = newrp; - return (RC_DOIT); + ret = RC_DOIT; + +out: + NFSEXITCODE2(0, nd); + return (ret); } /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Aug 13 17:20:00 2011 (r224850) +++ stable/8/sys/fs/nfsserver/nfs_nfsdkrpc.c Sat Aug 13 17:21:50 2011 (r224851) @@ -115,7 +115,7 @@ nfssvc_program(struct svc_req *rqst, SVC if (rqst->rq_proc > NFSV2PROC_STATFS) { svcerr_noproc(rqst); svc_freereq(rqst); - return; + goto out; } nd.nd_procnum = newnfs_nfsv3_procid[rqst->rq_proc]; nd.nd_flag = ND_NFSV2; @@ -123,7 +123,7 @@ nfssvc_program(struct svc_req *rqst, SVC if (rqst->rq_proc >= NFS_V3NPROCS) { svcerr_noproc(rqst); svc_freereq(rqst); - return; + goto out; } nd.nd_procnum = rqst->rq_proc; nd.nd_flag = ND_NFSV3; @@ -132,7 +132,7 @@ nfssvc_program(struct svc_req *rqst, SVC rqst->rq_proc != NFSV4PROC_COMPOUND) { svcerr_noproc(rqst); svc_freereq(rqst); - return; + goto out; } nd.nd_procnum = rqst->rq_proc; nd.nd_flag = ND_NFSV4; @@ -192,7 +192,7 @@ nfssvc_program(struct svc_req *rqst, SVC svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); - return; + goto out; } } @@ -201,7 +201,7 @@ nfssvc_program(struct svc_req *rqst, SVC svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); - return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:22:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 718541065676; Sat, 13 Aug 2011 17:22:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61E818FC16; Sat, 13 Aug 2011 17:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DHMGpB026072; Sat, 13 Aug 2011 17:22:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHMG0s026070; Sat, 13 Aug 2011 17:22:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201108131722.p7DHMG0s026070@svn.freebsd.org> From: Robert Watson Date: Sat, 13 Aug 2011 17:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224852 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:22:16 -0000 Author: rwatson Date: Sat Aug 13 17:22:16 2011 New Revision: 224852 URL: http://svn.freebsd.org/changeset/base/224852 Log: Trim some warnings and notes from capabilities.conf -- these are left over from Capsicum development, and no longer apply. Approved by: re (kib) Sponsored by: Google Inc Modified: head/sys/kern/capabilities.conf Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Sat Aug 13 17:21:50 2011 (r224851) +++ head/sys/kern/capabilities.conf Sat Aug 13 17:22:16 2011 (r224852) @@ -196,7 +196,7 @@ fpathconf ## ## Allow various file descriptor-based I/O operations, subject to capability -## rights. mmap(2) requires further attention. +## rights. ## freebsd6_ftruncate freebsd6_lseek @@ -334,8 +334,6 @@ issetugid ## Allow kevent(2), as we will authorize based on capability rights on the ## target descriptor. ## -## XXXRW: Do we do this? -## kevent ## @@ -404,9 +402,6 @@ mlockall ## Allow memory mapping a file descriptor, and updating protections, subject ## to capability rights. ## -## XXXRW: We currently don't properly mask VM protections using capability -## rights. -## mmap mprotect From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 17:29:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BAC3106566C; Sat, 13 Aug 2011 17:29:38 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF6E88FC17; Sat, 13 Aug 2011 17:29: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 p7DHTbbt026335; Sat, 13 Aug 2011 17:29:37 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DHTbVl026333; Sat, 13 Aug 2011 17:29:37 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201108131729.p7DHTbVl026333@svn.freebsd.org> From: Zack Kirsch Date: Sat, 13 Aug 2011 17:29: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: r224853 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 17:29:38 -0000 Author: zack Date: Sat Aug 13 17:29:37 2011 New Revision: 224853 URL: http://svn.freebsd.org/changeset/base/224853 Log: MFC r224079 and r224121: r224121 was meant to revert r224079, except I accidentally checked in an additional ACL patch in r224121. Committing both of these ends up with just the ACL fix. Here is the real commit note for the ACL patch: Running pynfs verify/nverify tests produces a panic in nfsrv_compareacl(). This patch fixes the panic. Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:22:16 2011 (r224852) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Aug 13 17:29:37 2011 (r224853) @@ -1037,7 +1037,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd acl_free(naclp); goto nfsmout; } - if (aceerr || nfsrv_compareacl(aclp, naclp)) + if (aceerr || aclp == NULL || + nfsrv_compareacl(aclp, naclp)) *retcmpp = NFSERR_NOTSAME; acl_free(naclp); } else { From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 21:33:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CDC4106564A; Sat, 13 Aug 2011 21:33:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61E708FC0C; Sat, 13 Aug 2011 21:33:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DLXoT4033863; Sat, 13 Aug 2011 21:33:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DLXo3m033860; Sat, 13 Aug 2011 21:33:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201108132133.p7DLXo3m033860@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 13 Aug 2011 21:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224854 - in stable/8: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 21:33:50 -0000 Author: jilles Date: Sat Aug 13 21:33:50 2011 New Revision: 224854 URL: http://svn.freebsd.org/changeset/base/224854 Log: MFC r222716: sh: Fix $? in heredocs on simple commands. The patch is slightly different because redirected compound commands are handled differently in stable/8 (no separate function, redirection errors are fatal). PR: bin/41410 Added: stable/8/tools/regression/bin/sh/expansion/heredoc2.0 - copied unchanged from r222716, head/tools/regression/bin/sh/expansion/heredoc2.0 Modified: stable/8/bin/sh/eval.c Directory Properties: stable/8/bin/sh/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) Modified: stable/8/bin/sh/eval.c ============================================================================== --- stable/8/bin/sh/eval.c Sat Aug 13 17:29:37 2011 (r224853) +++ stable/8/bin/sh/eval.c Sat Aug 13 21:33:50 2011 (r224854) @@ -221,6 +221,7 @@ evaltree(union node *n, int flags) evaltree(n->nbinary.ch2, flags); break; case NREDIR: + oexitstatus = exitstatus; expredir(n->nredir.redirect); redirect(n->nredir.redirect, REDIR_PUSH); evaltree(n->nredir.n, flags); @@ -400,6 +401,7 @@ evalsubshell(union node *n, int flags) struct job *jp; int backgnd = (n->type == NBACKGND); + oexitstatus = exitstatus; expredir(n->nredir.redirect); if ((!backgnd && flags & EV_EXIT && !have_traps()) || forkshell(jp = makejob(n, 1), n, backgnd) == 0) { @@ -428,7 +430,6 @@ expredir(union node *n) for (redir = n ; redir ; redir = redir->nfile.next) { struct arglist fn; fn.lastp = &fn.list; - oexitstatus = exitstatus; switch (redir->type) { case NFROM: case NTO: Copied: stable/8/tools/regression/bin/sh/expansion/heredoc2.0 (from r222716, head/tools/regression/bin/sh/expansion/heredoc2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/heredoc2.0 Sat Aug 13 21:33:50 2011 (r224854, copy of r222716, head/tools/regression/bin/sh/expansion/heredoc2.0) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +f() { return $1; } + +[ `f 42; cat < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93482106566B; Sat, 13 Aug 2011 21:35:22 +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 829DE8FC15; Sat, 13 Aug 2011 21:35:22 +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 p7DLZM6F033951; Sat, 13 Aug 2011 21:35:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DLZMR3033948; Sat, 13 Aug 2011 21:35:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108132135.p7DLZMR3033948@svn.freebsd.org> From: Martin Matuska Date: Sat, 13 Aug 2011 21:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224855 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 21:35:22 -0000 Author: mm Date: Sat Aug 13 21:35:22 2011 New Revision: 224855 URL: http://svn.freebsd.org/changeset/base/224855 Log: zfs_ioctl.c: improve code readability in zfs_ioc_dataset_list_next() zvol.c: fix calling of dmu_objset_prefetch() in zvol_create_minors() by passing full instead of relative dataset name and prefetching all visible datasets to be processed later instead of just the pool name Reviewed by: pjd Approved by: re (kib) MFC after: 1 week > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M opensolaris/uts/common/fs/zfs/zfs_ioctl.c M opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 13 21:33:50 2011 (r224854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Aug 13 21:35:22 2011 (r224855) @@ -1963,9 +1963,10 @@ top: uint64_t cookie = 0; int len = sizeof (zc->zc_name) - (p - zc->zc_name); - while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) - if (dataset_name_hidden(zc->zc_name) == B_FALSE) + while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) { + if (!dataset_name_hidden(zc->zc_name)) (void) dmu_objset_prefetch(zc->zc_name, NULL); + } } do { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Aug 13 21:33:50 2011 (r224854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Aug 13 21:35:22 2011 (r224855) @@ -2197,11 +2197,11 @@ zvol_create_minors(const char *name) p = osname + strlen(osname); len = MAXPATHLEN - (p - osname); - if (strchr(name, '/') == NULL) { - /* Prefetch only for pool name. */ - cookie = 0; - while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) - (void) dmu_objset_prefetch(p, NULL); + /* Prefetch the datasets. */ + cookie = 0; + while (dmu_dir_list_next(os, len, p, NULL, &cookie) == 0) { + if (!dataset_name_hidden(osname)) + (void) dmu_objset_prefetch(osname, NULL); } cookie = 0; From owner-svn-src-all@FreeBSD.ORG Sat Aug 13 23:34:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2857F106564A; Sat, 13 Aug 2011 23:34:18 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 167FD8FC08; Sat, 13 Aug 2011 23:34:18 +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 p7DNYITg037495; Sat, 13 Aug 2011 23:34:18 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7DNYHQL037489; Sat, 13 Aug 2011 23:34:17 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201108132334.p7DNYHQL037489@svn.freebsd.org> From: Matt Jacob Date: Sat, 13 Aug 2011 23:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224856 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2011 23:34:18 -0000 Author: mjacob Date: Sat Aug 13 23:34:17 2011 New Revision: 224856 URL: http://svn.freebsd.org/changeset/base/224856 Log: Most of these changes to isp are to allow for isp.ko unloading. We also revive loop down freezes. We also externaliz within isp isp_prt_endcmd so something outside the core module can print something about a command completing. Also some work in progress to assist in handling timed out commands better. Partially Sponsored by: Panasas Approved by: re (kib) MFC after: 1 month Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Aug 13 21:35:22 2011 (r224855) +++ head/sys/dev/isp/isp.c Sat Aug 13 23:34:17 2011 (r224856) @@ -102,7 +102,6 @@ static const uint8_t alpa_map[] = { /* * Local function prototypes. */ -static void isp_prt_endcmd(ispsoftc_t *, XS_T *); static int isp_parse_async(ispsoftc_t *, uint16_t); static int isp_parse_async_fc(ispsoftc_t *, uint16_t); static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t *); @@ -5391,7 +5390,7 @@ out: * Support routines. */ -static void +void isp_prt_endcmd(ispsoftc_t *isp, XS_T *xs) { char cdbstr[16 * 5 + 1]; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sat Aug 13 21:35:22 2011 (r224855) +++ head/sys/dev/isp/isp_freebsd.c Sat Aug 13 23:34:17 2011 (r224856) @@ -108,15 +108,13 @@ isp_attach_chan(ispsoftc_t *isp, struct return (EIO); } ISP_UNLOCK(isp); - - if (xpt_create_path(&path, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + if (xpt_create_path_unlocked(&path, NULL, cam_sim_path(sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(sim)); ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); return (ENXIO); } - xpt_setup_ccb(&csa.ccb_h, path, 5); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE; @@ -190,12 +188,16 @@ isp_attach(ispsoftc_t *isp) isp->isp_osinfo.ehook.ich_func = isp_intr_enable; isp->isp_osinfo.ehook.ich_arg = isp; + /* + * Haha. Set this first, because if we're loaded as a module isp_intr_enable + * will be called right awawy, which will clear isp_osinfo.ehook_active, + * which would be unwise to then set again later. + */ + isp->isp_osinfo.ehook_active = 1; if (config_intrhook_establish(&isp->isp_osinfo.ehook) != 0) { isp_prt(isp, ISP_LOGERR, "could not establish interrupt enable hook"); return (-EIO); } - isp->isp_osinfo.ehook_active = 1; - /* * Create the device queue for our SIM(s). @@ -252,20 +254,33 @@ unwind: return (-1); } -void +int isp_detach(ispsoftc_t *isp) { + struct cam_sim *sim; + struct cam_path *path; + struct ccb_setasync csa; int chan; ISP_LOCK(isp); + for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { + if (IS_FC(isp)) { + sim = ISP_FC_PC(isp, chan)->sim; + path = ISP_FC_PC(isp, chan)->path; + } else { + sim = ISP_SPI_PC(isp, chan)->sim; + path = ISP_SPI_PC(isp, chan)->path; + } + if (sim->refcount > 2) { + ISP_UNLOCK(isp); + return (EBUSY); + } + } if (isp->isp_osinfo.timer_active) { callout_stop(&isp->isp_osinfo.tmo); isp->isp_osinfo.timer_active = 0; } - ISP_UNLOCK(isp); for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { - struct cam_sim *sim; - struct cam_path *path; if (IS_FC(isp)) { sim = ISP_FC_PC(isp, chan)->sim; path = ISP_FC_PC(isp, chan)->path; @@ -273,12 +288,17 @@ isp_detach(ispsoftc_t *isp) sim = ISP_SPI_PC(isp, chan)->sim; path = ISP_SPI_PC(isp, chan)->path; } + xpt_setup_ccb(&csa.ccb_h, path, 5); + csa.ccb_h.func_code = XPT_SASYNC_CB; + csa.event_enable = 0; + csa.callback = isp_cam_async; + csa.callback_arg = sim; + xpt_action((union ccb *)&csa); xpt_free_path(path); - ISP_LOCK(isp); xpt_bus_deregister(cam_sim_path(sim)); - ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } + ISP_UNLOCK(isp); if (isp->isp_osinfo.cdev) { destroy_dev(isp->isp_osinfo.cdev); isp->isp_osinfo.cdev = NULL; @@ -291,6 +311,7 @@ isp_detach(ispsoftc_t *isp) cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; } + return (0); } static void @@ -309,6 +330,20 @@ isp_freeze_loopdown(ispsoftc_t *isp, int } } +static void +isp_unfreeze_loopdown(ispsoftc_t *isp, int chan) +{ + if (IS_FC(isp)) { + struct isp_fc *fc = ISP_FC_PC(isp, chan); + int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; + fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; + if (wasfrozen && fc->simqfrozen == 0) { + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "%s: Chan %d releasing simq", __func__, chan); + xpt_release_simq(fc->sim, 1); + } + } +} + static int ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td) @@ -702,6 +737,7 @@ isp_intr_enable(void *arg) } } } + isp->isp_osinfo.ehook_active = 0; ISP_UNLOCK(isp); /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(&isp->isp_osinfo.ehook); @@ -1308,7 +1344,7 @@ done: xpt_print(ccb->ccb_h.path, "now disabled for target mode\n"); } if (tptr) { - rls_lun_statep(isp, tptr); + destroy_lun_state(isp, tptr); } isp->isp_osinfo.rptr = NULL; isp->isp_osinfo.tmbusy = 0; @@ -3787,19 +3823,20 @@ static void isp_cam_async(void *cbarg, uint32_t code, struct cam_path *path, void *arg) { struct cam_sim *sim; + int bus, tgt; ispsoftc_t *isp; sim = (struct cam_sim *)cbarg; isp = (ispsoftc_t *) cam_sim_softc(sim); + bus = cam_sim_bus(sim); + tgt = xpt_path_target_id(path); + switch (code) { case AC_LOST_DEVICE: if (IS_SCSI(isp)) { uint16_t oflags, nflags; - int bus = cam_sim_bus(sim); sdparam *sdp = SDPARAM(isp, bus); - int tgt; - tgt = xpt_path_target_id(path); if (tgt >= 0) { nflags = sdp->isp_devparam[tgt].nvrm_flags; #ifndef ISP_TARGET_MODE @@ -3843,11 +3880,32 @@ isp_watchdog(void *arg) { struct ccb_scsiio *xs = arg; ispsoftc_t *isp; - uint32_t handle; + uint32_t ohandle = ISP_HANDLE_FREE, handle; isp = XS_ISP(xs); handle = isp_find_handle(isp, xs); + + if (handle != ISP_HANDLE_FREE && !XS_CMD_WPEND_P(xs)) { + isp_xs_prt(isp, xs, ISP_LOGWARN, "first watchdog (handle 0x%x) timed out- deferring for grace period", handle); + callout_reset(&PISP_PCMD(xs)->wdog, 2 * hz, isp_watchdog, xs); + XS_CMD_S_WPEND(xs); + return; + } + XS_C_TACTIVE(xs); + + /* + * Hand crank the interrupt code just to be sure the command isn't stuck somewhere. + */ + if (handle != ISP_HANDLE_FREE) { + uint32_t isr; + uint16_t sema, mbox; + if (ISP_READ_ISR(isp, &isr, &sema, &mbox) != 0) { + isp_intr(isp, isr, sema, mbox); + } + ohandle = handle; + handle = isp_find_handle(isp, xs); + } if (handle != ISP_HANDLE_FREE) { /* * Try and make sure the command is really dead before @@ -3884,7 +3942,14 @@ isp_watchdog(void *arg) isp_destroy_handle(isp, handle); isp_prt(isp, ISP_LOGERR, "%s: timeout for handle 0x%x", __func__, handle); XS_SETERR(xs, CAM_CMD_TIMEOUT); + isp_prt_endcmd(isp, xs); isp_done(xs); + } else { + if (ohandle != ISP_HANDLE_FREE) { + isp_prt(isp, ISP_LOGWARN, "%s: timeout for handle 0x%x, recovered during interrupt", __func__, ohandle); + } else { + isp_prt(isp, ISP_LOGWARN, "%s: timeout for handle already free", __func__); + } } } @@ -4013,7 +4078,7 @@ isp_ldt_task(void *arg, int pending) ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; fcportdb_t *lp; - int dbidx, tgt; + int dbidx, tgt, i; ISP_LOCK(isp); isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d Loop Down Timer expired @ %lu", chan, (unsigned long) time_uptime); @@ -4035,6 +4100,23 @@ isp_ldt_task(void *arg, int pending) /* * XXX: CLEAN UP AND COMPLETE ANY PENDING COMMANDS FIRST! */ + + + for (i = 0; i < isp->isp_maxcmds; i++) { + struct ccb_scsiio *xs; + + if (!ISP_VALID_HANDLE(isp, isp->isp_xflist[i].handle)) { + continue; + } + if ((xs = isp->isp_xflist[i].cmd) == NULL) { + continue; + } + if (dbidx != (FCPARAM(isp, chan)->isp_dev_map[XS_TGT(xs)] - 1)) { + continue; + } + isp_prt(isp, ISP_LOGWARN, "command handle 0x%08x for %d.%d.%d orphaned by loop down timeout", + isp->isp_xflist[i].handle, chan, XS_TGT(xs), XS_LUN(xs)); + } /* * Mark that we've announced that this device is gone.... @@ -4056,6 +4138,9 @@ isp_ldt_task(void *arg, int pending) isp_make_gone(isp, chan, tgt); } + if (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR) { + isp_unfreeze_loopdown(isp, chan); + } /* * The loop down timer has expired. Wake up the kthread * to notice that fact (or make it false). @@ -4063,6 +4148,7 @@ isp_ldt_task(void *arg, int pending) fc->loop_dead = 1; fc->loop_down_time = fc->loop_down_limit+1; wakeup(fc); + ISP_UNLOCK(isp); } static void @@ -4076,7 +4162,7 @@ isp_kthread(void *arg) mtx_lock(&isp->isp_osinfo.lock); for (;;) { - int wasfrozen, lb, lim; + int lb, lim; isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "%s: Chan %d checking FC state", __func__, chan); lb = isp_fc_runstate(isp, chan, 250000); @@ -4147,12 +4233,7 @@ isp_kthread(void *arg) */ if (FCPARAM(isp, chan)->loop_seen_once || fc->loop_dead) { - wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN; - fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN; - if (wasfrozen && fc->simqfrozen == 0) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "%s: Chan %d releasing simq", __func__, chan); - xpt_release_simq(fc->sim, 1); - } + isp_unfreeze_loopdown(isp, chan); } isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "%s: Chan %d sleep time %d", __func__, chan, slp); @@ -4251,6 +4332,7 @@ isp_action(struct cam_sim *sim, union cc ts = 60*1000; } ts = isp_mstohz(ts); + XS_S_TACTIVE(ccb); callout_reset(&PISP_PCMD(ccb)->wdog, ts, isp_watchdog, ccb); break; case CMD_RQLATER: @@ -4777,7 +4859,9 @@ isp_action(struct cam_sim *sim, union cc /* * Set base transfer capabilities for Fibre Channel, for this HBA. */ - if (IS_24XX(isp)) { + if (IS_25XX(isp)) { + cpi->base_transfer_speed = 8000000; + } else if (IS_24XX(isp)) { cpi->base_transfer_speed = 4000000; } else if (IS_23XX(isp)) { cpi->base_transfer_speed = 2000000; @@ -4823,6 +4907,7 @@ void isp_done(XS_T *sccb) { ispsoftc_t *isp = XS_ISP(sccb); + uint32_t status; if (XS_NOERR(sccb)) XS_SETERR(sccb, CAM_REQ_CMP); @@ -4837,8 +4922,10 @@ isp_done(XS_T *sccb) } sccb->ccb_h.status &= ~CAM_SIM_QUEUED; - if ((sccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - isp_prt(isp, ISP_LOGDEBUG0, "target %d lun %d CAM status 0x%x SCSI status 0x%x", XS_TGT(sccb), XS_LUN(sccb), sccb->ccb_h.status, sccb->scsi_status); + status = sccb->ccb_h.status & CAM_STATUS_MASK; + if (status != CAM_REQ_CMP) { + if (status != CAM_SEL_TIMEOUT) + isp_prt(isp, ISP_LOGDEBUG0, "target %d lun %d CAM status 0x%x SCSI status 0x%x", XS_TGT(sccb), XS_LUN(sccb), sccb->ccb_h.status, sccb->scsi_status); if ((sccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { sccb->ccb_h.status |= CAM_DEV_QFRZN; xpt_freeze_devq(sccb->ccb_h.path, 1); @@ -4850,7 +4937,8 @@ isp_done(XS_T *sccb) } XS_CMD_S_DONE(sccb); - callout_stop(&PISP_PCMD(sccb)->wdog); + if (XS_TACTIVE_P(sccb)) + callout_stop(&PISP_PCMD(sccb)->wdog); XS_CMD_S_CLEAR(sccb); isp_free_pcmd(isp, (union ccb *) sccb); xpt_done((union ccb *) sccb); Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sat Aug 13 21:35:22 2011 (r224855) +++ head/sys/dev/isp/isp_freebsd.h Sat Aug 13 23:34:17 2011 (r224856) @@ -582,7 +582,7 @@ default: \ * prototypes for isp_pci && isp_freebsd to share */ extern int isp_attach(ispsoftc_t *); -extern void isp_detach(ispsoftc_t *); +extern int isp_detach(ispsoftc_t *); extern void isp_uninit(ispsoftc_t *); extern uint64_t isp_default_wwn(ispsoftc_t *, int, int, int); @@ -600,12 +600,23 @@ extern int isp_autoconfig; * Platform private flags */ #define ISP_SPRIV_ERRSET 0x1 +#define ISP_SPRIV_TACTIVE 0x2 #define ISP_SPRIV_DONE 0x8 +#define ISP_SPRIV_WPEND 0x10 + +#define XS_S_TACTIVE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_TACTIVE +#define XS_C_TACTIVE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_TACTIVE +#define XS_TACTIVE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_TACTIVE) #define XS_CMD_S_DONE(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_DONE #define XS_CMD_C_DONE(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_DONE #define XS_CMD_DONE_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_DONE) +#define XS_CMD_S_WPEND(sccb) (sccb)->ccb_h.spriv_field0 |= ISP_SPRIV_WPEND +#define XS_CMD_C_WPEND(sccb) (sccb)->ccb_h.spriv_field0 &= ~ISP_SPRIV_WPEND +#define XS_CMD_WPEND_P(sccb) ((sccb)->ccb_h.spriv_field0 & ISP_SPRIV_WPEND) + + #define XS_CMD_S_CLEAR(sccb) (sccb)->ccb_h.spriv_field0 = 0 /* Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sat Aug 13 21:35:22 2011 (r224855) +++ head/sys/dev/isp/isp_pci.c Sat Aug 13 23:34:17 2011 (r224856) @@ -347,7 +347,11 @@ static int isp_pci_detach (device_t); struct isp_pcisoftc { ispsoftc_t pci_isp; device_t pci_dev; - struct resource * pci_reg; + struct resource * regs; + void * irq; + int iqd; + int rtp; + int rgd; void * ih; int16_t pci_poff[_NREG_BLKS]; bus_dma_tag_t dmat; @@ -645,8 +649,7 @@ isp_get_specific_options(device_t dev, i static int isp_pci_attach(device_t dev) { - struct resource *regs, *irq; - int rtp, rgd, iqd, i, m1, m2, locksetup = 0; + int i, m1, m2, locksetup = 0; int isp_nvports = 0; uint32_t data, cmd, linesz, did; struct isp_pcisoftc *pcs; @@ -687,32 +690,31 @@ isp_pci_attach(device_t dev) isp_get_pci_options(dev, &m1, &m2); linesz = PCI_DFLT_LNSZ; - irq = regs = NULL; - rgd = rtp = iqd = 0; + pcs->irq = pcs->regs = NULL; + pcs->rgd = pcs->rtp = pcs->iqd = 0; cmd = pci_read_config(dev, PCIR_COMMAND, 2); if (cmd & m1) { - rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - regs = bus_alloc_resource_any(dev, rtp, &rgd, RF_ACTIVE); - } - if (regs == NULL && (cmd & m2)) { - rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - regs = bus_alloc_resource_any(dev, rtp, &rgd, RF_ACTIVE); + pcs->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; + pcs->rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); + } + if (pcs->regs == NULL && (cmd & m2)) { + pcs->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; + pcs->rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); } - if (regs == NULL) { + if (pcs->regs == NULL) { device_printf(dev, "unable to map any ports\n"); goto bad; } if (bootverbose) { - device_printf(dev, "using %s space register mapping\n", (rgd == IO_MAP_REG)? "I/O" : "Memory"); + device_printf(dev, "using %s space register mapping\n", (pcs->rgd == IO_MAP_REG)? "I/O" : "Memory"); } - isp->isp_bus_tag = rman_get_bustag(regs); - isp->isp_bus_handle = rman_get_bushandle(regs); + isp->isp_bus_tag = rman_get_bustag(pcs->regs); + isp->isp_bus_handle = rman_get_bushandle(pcs->regs); pcs->pci_dev = dev; - pcs->pci_reg = regs; pcs->pci_poff[BIU_BLOCK >> _BLK_REG_SHFT] = BIU_REGS_OFF; pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS_OFF; pcs->pci_poff[SXP_BLOCK >> _BLK_REG_SHFT] = PCI_SXP_REGS_OFF; @@ -931,13 +933,13 @@ isp_pci_attach(device_t dev) pcs->msicount = 1; } if (pci_alloc_msi(dev, &pcs->msicount) == 0) { - iqd = 1; + pcs->iqd = 1; } else { - iqd = 0; + pcs->iqd = 0; } } - irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, RF_ACTIVE | RF_SHAREABLE); - if (irq == NULL) { + pcs->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &pcs->iqd, RF_ACTIVE | RF_SHAREABLE); + if (pcs->irq == NULL) { device_printf(dev, "could not allocate interrupt\n"); goto bad; } @@ -946,7 +948,7 @@ isp_pci_attach(device_t dev) mtx_init(&isp->isp_osinfo.lock, "isp", NULL, MTX_DEF); locksetup++; - if (isp_setup_intr(dev, irq, ISP_IFLAGS, NULL, isp_platform_intr, isp, &pcs->ih)) { + if (isp_setup_intr(dev, pcs->irq, ISP_IFLAGS, NULL, isp_platform_intr, isp, &pcs->ih)) { device_printf(dev, "could not setup interrupt\n"); goto bad; } @@ -982,19 +984,19 @@ isp_pci_attach(device_t dev) bad: if (pcs->ih) { - (void) bus_teardown_intr(dev, irq, pcs->ih); + (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); } if (locksetup) { mtx_destroy(&isp->isp_osinfo.lock); } - if (irq) { - (void) bus_release_resource(dev, SYS_RES_IRQ, iqd, irq); + if (pcs->irq) { + (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); } if (pcs->msicount) { pci_release_msi(dev); } - if (regs) { - (void) bus_release_resource(dev, rtp, rgd, regs); + if (pcs->regs) { + (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); } if (pcs->pci_isp.isp_param) { free(pcs->pci_isp.isp_param, M_DEVBUF); @@ -1012,14 +1014,36 @@ isp_pci_detach(device_t dev) { struct isp_pcisoftc *pcs; ispsoftc_t *isp; + int status; pcs = device_get_softc(dev); if (pcs == NULL) { return (ENXIO); } isp = (ispsoftc_t *) pcs; - ISP_DISABLE_INTS(isp); + status = isp_detach(isp); + if (status) + return (status); + ISP_LOCK(isp); + isp_uninit(isp); + if (pcs->ih) { + (void) bus_teardown_intr(dev, pcs->irq, pcs->ih); + } + ISP_UNLOCK(isp); mtx_destroy(&isp->isp_osinfo.lock); + (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->iqd, pcs->irq); + if (pcs->msicount) { + pci_release_msi(dev); + } + (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); + if (pcs->pci_isp.isp_param) { + free(pcs->pci_isp.isp_param, M_DEVBUF); + pcs->pci_isp.isp_param = NULL; + } + if (pcs->pci_isp.isp_osinfo.pc.ptr) { + free(pcs->pci_isp.isp_osinfo.pc.ptr, M_DEVBUF); + pcs->pci_isp.isp_osinfo.pc.ptr = NULL; + } return (0); } Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Sat Aug 13 21:35:22 2011 (r224855) +++ head/sys/dev/isp/ispvar.h Sat Aug 13 23:34:17 2011 (r224856) @@ -953,6 +953,11 @@ void isp_async(ispsoftc_t *, ispasync_t, #define ISPASYNC_CHANGE_OTHER 2 /* + * Platform Independent Error Prinout + */ +void isp_prt_endcmd(ispsoftc_t *, XS_T *); + +/* * Platform Dependent Error and Debug Printout * * Two required functions for each platform must be provided: