From owner-svn-src-vendor@FreeBSD.ORG Sun Sep 7 12:07:27 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06F0AC9B; Sun, 7 Sep 2014 12:07:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E62A41890; Sun, 7 Sep 2014 12:07:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s87C7Qpt046261; Sun, 7 Sep 2014 12:07:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s87C7Q9n046260; Sun, 7 Sep 2014 12:07:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409071207.s87C7Q9n046260@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 7 Sep 2014 12:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271223 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2014 12:07:27 -0000 Author: delphij Date: Sun Sep 7 12:07:26 2014 New Revision: 271223 URL: http://svnweb.freebsd.org/changeset/base/271223 Log: 5117 space map reallocation can cause corruption Reviewed by: Matthew Ahrens Reviewed by: Sebastien Roy Reviewed by: Richard Elling Approved by: Richard Lowe Author: George Wilson illumos/illumos-gate@e503a685964805f048b35c2a4e70e0638344f2b7 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Sun Sep 7 11:57:08 2014 (r271222) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Sun Sep 7 12:07:26 2014 (r271223) @@ -684,6 +684,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) return; } + if (dn->dn_next_nlevels[txgoff]) { + dnode_increase_indirection(dn, tx); + dn->dn_next_nlevels[txgoff] = 0; + } + if (dn->dn_next_nblkptr[txgoff]) { /* this should only happen on a realloc */ ASSERT(dn->dn_allocated_txg == tx->tx_txg); @@ -708,11 +713,6 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) mutex_exit(&dn->dn_mtx); } - if (dn->dn_next_nlevels[txgoff]) { - dnode_increase_indirection(dn, tx); - dn->dn_next_nlevels[txgoff] = 0; - } - dbuf_sync_list(list, tx); if (!DMU_OBJECT_IS_SPECIAL(dn->dn_object)) { From owner-svn-src-vendor@FreeBSD.ORG Sun Sep 7 12:13:50 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EAB4FD7; Sun, 7 Sep 2014 12:13:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FF95194C; Sun, 7 Sep 2014 12:13:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s87CDork050950; Sun, 7 Sep 2014 12:13:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s87CDoct050949; Sun, 7 Sep 2014 12:13:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409071213.s87CDoct050949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 7 Sep 2014 12:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271224 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2014 12:13:50 -0000 Author: delphij Date: Sun Sep 7 12:13:49 2014 New Revision: 271224 URL: http://svnweb.freebsd.org/changeset/base/271224 Log: 5116 zpool history -i goes into infinite loop Reviewed by: Christopher Siden Reviewed by: Dan Kimmel Reviewed by: George Wilson Reviewed by: Richard Elling Reviewed by: Boris Protopopov Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@3339867a862f63acdad71abd574d5d79e18d8579 Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Sun Sep 7 12:07:26 2014 (r271223) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Sun Sep 7 12:13:49 2014 (r271224) @@ -3698,22 +3698,24 @@ zpool_history_unpack(char *buf, uint64_t return (0); } -#define HIS_BUF_LEN (128*1024) - /* * Retrieve the command history of a pool. */ int zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) { - char buf[HIS_BUF_LEN]; + char *buf; + int buflen = 128 * 1024; uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; + buf = malloc(buflen); + if (buf == NULL) + return (ENOMEM); do { - uint64_t bytes_read = sizeof (buf); + uint64_t bytes_read = buflen; uint64_t leftover; if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) @@ -3727,10 +3729,23 @@ zpool_get_history(zpool_handle_t *zhp, n &leftover, &records, &numrecords)) != 0) break; off -= leftover; + if (leftover == bytes_read) { + /* + * no progress made, because buffer is not big enough + * to hold this record; resize and retry. + */ + buflen *= 2; + free(buf); + buf = malloc(buflen); + if (buf == NULL) + return (ENOMEM); + } /* CONSTCOND */ } while (1); + free(buf); + if (!err) { verify(nvlist_alloc(nvhisp, NV_UNIQUE_NAME, 0) == 0); verify(nvlist_add_nvlist_array(*nvhisp, ZPOOL_HIST_RECORD, From owner-svn-src-vendor@FreeBSD.ORG Sun Sep 7 12:18:13 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 619811A2; Sun, 7 Sep 2014 12:18:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1711961; Sun, 7 Sep 2014 12:18:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s87CIDUo051561; Sun, 7 Sep 2014 12:18:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s87CIDBU051560; Sun, 7 Sep 2014 12:18:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409071218.s87CIDBU051560@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 7 Sep 2014 12:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271225 - vendor/illumos/dist/cmd/zpool X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2014 12:18:13 -0000 Author: delphij Date: Sun Sep 7 12:18:12 2014 New Revision: 271225 URL: http://svnweb.freebsd.org/changeset/base/271225 Log: 5118 When verifying or creating a storage pool, error messages only show one device Reviewed by: Adam Leventhal Reviewed by: Dan Kimmel Reviewed by: Matt Ahrens Reviewed by: Boris Protopopov Approved by: Dan McDonald Author: Basil Crow illumos/illumos-gate@75fbdf9b9f63da7e23a9814982b78a782559c086 Modified: vendor/illumos/dist/cmd/zpool/zpool_vdev.c Modified: vendor/illumos/dist/cmd/zpool/zpool_vdev.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_vdev.c Sun Sep 7 12:13:49 2014 (r271224) +++ vendor/illumos/dist/cmd/zpool/zpool_vdev.c Sun Sep 7 12:18:12 2014 (r271225) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ /* @@ -1027,8 +1028,8 @@ is_spare(nvlist_t *config, const char *p * Go through and find any devices that are in use. We rely on libdiskmgt for * the majority of this task. */ -static int -check_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force, +static boolean_t +is_device_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force, boolean_t replacing, boolean_t isspare) { nvlist_t **child; @@ -1037,6 +1038,7 @@ check_in_use(nvlist_t *config, nvlist_t int ret; char buf[MAXPATHLEN]; uint64_t wholedisk; + boolean_t anyinuse = B_FALSE; verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0); @@ -1059,38 +1061,37 @@ check_in_use(nvlist_t *config, nvlist_t (void) strlcpy(buf, path, sizeof (buf)); if (is_spare(config, buf)) - return (0); + return (B_FALSE); } if (strcmp(type, VDEV_TYPE_DISK) == 0) ret = check_device(path, force, isspare); - - if (strcmp(type, VDEV_TYPE_FILE) == 0) + else if (strcmp(type, VDEV_TYPE_FILE) == 0) ret = check_file(path, force, isspare); - return (ret); + return (ret != 0); } for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_FALSE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_FALSE)) + anyinuse = B_TRUE; if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES, &child, &children) == 0) for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_TRUE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_TRUE)) + anyinuse = B_TRUE; if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE, &child, &children) == 0) for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_FALSE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_FALSE)) + anyinuse = B_TRUE; - return (0); + return (anyinuse); } static const char * @@ -1442,7 +1443,7 @@ make_root_vdev(zpool_handle_t *zhp, int * uses (such as a dedicated dump device) that even '-f' cannot * override. */ - if (check_in_use(poolconfig, newroot, force, replacing, B_FALSE) != 0) { + if (is_device_in_use(poolconfig, newroot, force, replacing, B_FALSE)) { nvlist_free(newroot); return (NULL); } From owner-svn-src-vendor@FreeBSD.ORG Mon Sep 8 18:09:20 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 672191D1; Mon, 8 Sep 2014 18:09:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3852C132C; Mon, 8 Sep 2014 18:09:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s88I9KNU005929; Mon, 8 Sep 2014 18:09:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s88I9KMB005928; Mon, 8 Sep 2014 18:09:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201409081809.s88I9KMB005928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 8 Sep 2014 18:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271279 - vendor/NetBSD/libc-vis/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 18:09:20 -0000 Author: brooks Date: Mon Sep 8 18:09:19 2014 New Revision: 271279 URL: http://svnweb.freebsd.org/changeset/base/271279 Log: Vendor import of NetBSD's (un)vis(3) at 2014-09-08 Modified: vendor/NetBSD/libc-vis/dist/vis.c Modified: vendor/NetBSD/libc-vis/dist/vis.c ============================================================================== --- vendor/NetBSD/libc-vis/dist/vis.c Mon Sep 8 17:01:30 2014 (r271278) +++ vendor/NetBSD/libc-vis/dist/vis.c Mon Sep 8 18:09:19 2014 (r271279) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */ +/* $NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $"); +__RCSID("$NetBSD: vis.c,v 1.62 2014/09/08 17:35:01 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -357,7 +357,7 @@ istrsenvisx(char *mbdst, size_t *dlen, c ssize_t mbslength, maxolen; _DIAGASSERT(mbdst != NULL); - _DIAGASSERT(mbsrc != NULL); + _DIAGASSERT(mbsrc != NULL || mblength == 0); _DIAGASSERT(mbextra != NULL); /* @@ -375,8 +375,6 @@ istrsenvisx(char *mbdst, size_t *dlen, c /* Allocate space for the wide char strings */ psrc = pdst = extra = NULL; - if (!mblength) - mblength = strlen(mbsrc); if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) return -1; if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) @@ -528,6 +526,15 @@ out: free(psrc); return error; } + +static int +istrsenvisxl(char *mbdst, size_t *dlen, const char *mbsrc, + int flags, const char *mbextra, int *cerr_ptr) +{ + return istrsenvisx(mbdst, dlen, mbsrc, + mbsrc != NULL ? strlen(mbsrc) : 0, flags, mbextra, cerr_ptr); +} + #endif #if !HAVE_SVIS @@ -571,13 +578,13 @@ snvis(char *mbdst, size_t dlen, int c, i int strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, mbextra, NULL); + return istrsenvisxl(mbdst, NULL, mbsrc, flags, mbextra, NULL); } int strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra) { - return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, mbextra, NULL); + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, mbextra, NULL); } int @@ -646,13 +653,13 @@ nvis(char *mbdst, size_t dlen, int c, in int strvis(char *mbdst, const char *mbsrc, int flags) { - return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, "", NULL); + return istrsenvisxl(mbdst, NULL, mbsrc, flags, "", NULL); } int strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags) { - return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, "", NULL); + return istrsenvisxl(mbdst, &dlen, mbsrc, flags, "", NULL); } /* From owner-svn-src-vendor@FreeBSD.ORG Mon Sep 8 18:10:11 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C34931B; Mon, 8 Sep 2014 18:10:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB28133A; Mon, 8 Sep 2014 18:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s88IABjs006158; Mon, 8 Sep 2014 18:10:11 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s88IABHF006157; Mon, 8 Sep 2014 18:10:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201409081810.s88IABHF006157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 8 Sep 2014 18:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271280 - vendor/NetBSD/libc-vis/20140908 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 18:10:11 -0000 Author: brooks Date: Mon Sep 8 18:10:10 2014 New Revision: 271280 URL: http://svnweb.freebsd.org/changeset/base/271280 Log: Tag 2014-09-08 import of NetBSD's (un)vis(3) Added: vendor/NetBSD/libc-vis/20140908/ - copied from r271279, vendor/NetBSD/libc-vis/dist/ From owner-svn-src-vendor@FreeBSD.ORG Mon Sep 8 18:11:21 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32FC254D; Mon, 8 Sep 2014 18:11:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFD813DF; Mon, 8 Sep 2014 18:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s88IBK8d008030; Mon, 8 Sep 2014 18:11:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s88IBKGr008029; Mon, 8 Sep 2014 18:11:20 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201409081811.s88IBKGr008029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 8 Sep 2014 18:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271281 - vendor/NetBSD/libc-vis X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 18:11:21 -0000 Author: brooks Date: Mon Sep 8 18:11:20 2014 New Revision: 271281 URL: http://svnweb.freebsd.org/changeset/base/271281 Log: Take advantage of the ^ feature in modern SVN versions. Modified: vendor/NetBSD/libc-vis/FreeBSD-Upgrade Modified: vendor/NetBSD/libc-vis/FreeBSD-Upgrade ============================================================================== --- vendor/NetBSD/libc-vis/FreeBSD-Upgrade Mon Sep 8 18:10:10 2014 (r271280) +++ vendor/NetBSD/libc-vis/FreeBSD-Upgrade Mon Sep 8 18:11:20 2014 (r271281) @@ -19,8 +19,8 @@ Instructions for updating unvis(3) and v svn commit -m "Vendor import of NetBSD's (un)vis(3) at `date +%F`" dist svn cp -m "Tag `date +%F` import of NetBSD's (un)vis(3)" \ - $REPO/base/vendor/NetBSD/libc-vis/dist \ - $REPO/base/vendor/NetBSD/libc-vis/`date +%Y%m%d` + ^/vendor/NetBSD/libc-vis/dist \ + ^/vendor/NetBSD/libc-vis/`date +%Y%m%d` 4) Update the files in src/contrib/libc-pwcache: From owner-svn-src-vendor@FreeBSD.ORG Tue Sep 9 02:50:11 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18D891F3; Tue, 9 Sep 2014 02:50:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F407F1BC0; Tue, 9 Sep 2014 02:50:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s892oA8Y066896; Tue, 9 Sep 2014 02:50:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s892oAbA066101; Tue, 9 Sep 2014 02:50:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409090250.s892oAbA066101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 9 Sep 2014 02:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271294 - in vendor/pjdfstest: . dist dist/tests dist/tests/chflags dist/tests/chmod dist/tests/chown dist/tests/ftruncate dist/tests/granular dist/tests/link dist/tests/mkdir dist/test... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 02:50:11 -0000 Author: ngie Date: Tue Sep 9 02:50:09 2014 New Revision: 271294 URL: http://svnweb.freebsd.org/changeset/base/271294 Log: Add vendor import for pjdfstest This vendor import code was obtained from https://github.com/pjd/pjdfstest/commit/abf03c3a47745d4521b0e4aa141317553ca48f91 Approved by: rpaulo (mentor) Phabric: D743 Sponsored by: EMC / Isilon Storage Division Added: vendor/pjdfstest/ vendor/pjdfstest/dist/ vendor/pjdfstest/dist/LICENSE vendor/pjdfstest/dist/Makefile (contents, props changed) vendor/pjdfstest/dist/README vendor/pjdfstest/dist/pjdfstest.c (contents, props changed) vendor/pjdfstest/dist/tests/ vendor/pjdfstest/dist/tests/chflags/ vendor/pjdfstest/dist/tests/chflags/00.t vendor/pjdfstest/dist/tests/chflags/01.t vendor/pjdfstest/dist/tests/chflags/02.t vendor/pjdfstest/dist/tests/chflags/03.t vendor/pjdfstest/dist/tests/chflags/04.t vendor/pjdfstest/dist/tests/chflags/05.t vendor/pjdfstest/dist/tests/chflags/06.t vendor/pjdfstest/dist/tests/chflags/07.t vendor/pjdfstest/dist/tests/chflags/08.t vendor/pjdfstest/dist/tests/chflags/09.t vendor/pjdfstest/dist/tests/chflags/10.t vendor/pjdfstest/dist/tests/chflags/11.t vendor/pjdfstest/dist/tests/chflags/12.t vendor/pjdfstest/dist/tests/chflags/13.t vendor/pjdfstest/dist/tests/chmod/ vendor/pjdfstest/dist/tests/chmod/00.t vendor/pjdfstest/dist/tests/chmod/01.t vendor/pjdfstest/dist/tests/chmod/02.t vendor/pjdfstest/dist/tests/chmod/03.t vendor/pjdfstest/dist/tests/chmod/04.t vendor/pjdfstest/dist/tests/chmod/05.t vendor/pjdfstest/dist/tests/chmod/06.t vendor/pjdfstest/dist/tests/chmod/07.t vendor/pjdfstest/dist/tests/chmod/08.t vendor/pjdfstest/dist/tests/chmod/09.t vendor/pjdfstest/dist/tests/chmod/10.t vendor/pjdfstest/dist/tests/chmod/11.t vendor/pjdfstest/dist/tests/chmod/12.t vendor/pjdfstest/dist/tests/chmod/foo (contents, props changed) vendor/pjdfstest/dist/tests/chown/ vendor/pjdfstest/dist/tests/chown/00.t vendor/pjdfstest/dist/tests/chown/01.t vendor/pjdfstest/dist/tests/chown/02.t vendor/pjdfstest/dist/tests/chown/03.t vendor/pjdfstest/dist/tests/chown/04.t vendor/pjdfstest/dist/tests/chown/05.t vendor/pjdfstest/dist/tests/chown/06.t vendor/pjdfstest/dist/tests/chown/07.t vendor/pjdfstest/dist/tests/chown/08.t vendor/pjdfstest/dist/tests/chown/09.t vendor/pjdfstest/dist/tests/chown/10.t vendor/pjdfstest/dist/tests/conf vendor/pjdfstest/dist/tests/ftruncate/ vendor/pjdfstest/dist/tests/ftruncate/00.t vendor/pjdfstest/dist/tests/ftruncate/01.t vendor/pjdfstest/dist/tests/ftruncate/02.t vendor/pjdfstest/dist/tests/ftruncate/03.t vendor/pjdfstest/dist/tests/ftruncate/04.t vendor/pjdfstest/dist/tests/ftruncate/05.t vendor/pjdfstest/dist/tests/ftruncate/06.t vendor/pjdfstest/dist/tests/ftruncate/07.t vendor/pjdfstest/dist/tests/ftruncate/08.t vendor/pjdfstest/dist/tests/ftruncate/09.t vendor/pjdfstest/dist/tests/ftruncate/10.t vendor/pjdfstest/dist/tests/ftruncate/11.t vendor/pjdfstest/dist/tests/ftruncate/12.t vendor/pjdfstest/dist/tests/ftruncate/13.t vendor/pjdfstest/dist/tests/ftruncate/14.t vendor/pjdfstest/dist/tests/granular/ vendor/pjdfstest/dist/tests/granular/00.t vendor/pjdfstest/dist/tests/granular/01.t vendor/pjdfstest/dist/tests/granular/02.t vendor/pjdfstest/dist/tests/granular/03.t vendor/pjdfstest/dist/tests/granular/04.t vendor/pjdfstest/dist/tests/granular/05.t vendor/pjdfstest/dist/tests/link/ vendor/pjdfstest/dist/tests/link/00.t vendor/pjdfstest/dist/tests/link/01.t vendor/pjdfstest/dist/tests/link/02.t vendor/pjdfstest/dist/tests/link/03.t vendor/pjdfstest/dist/tests/link/04.t vendor/pjdfstest/dist/tests/link/05.t vendor/pjdfstest/dist/tests/link/06.t vendor/pjdfstest/dist/tests/link/07.t vendor/pjdfstest/dist/tests/link/08.t vendor/pjdfstest/dist/tests/link/09.t vendor/pjdfstest/dist/tests/link/10.t vendor/pjdfstest/dist/tests/link/11.t vendor/pjdfstest/dist/tests/link/12.t vendor/pjdfstest/dist/tests/link/13.t vendor/pjdfstest/dist/tests/link/14.t vendor/pjdfstest/dist/tests/link/15.t vendor/pjdfstest/dist/tests/link/16.t vendor/pjdfstest/dist/tests/link/17.t vendor/pjdfstest/dist/tests/misc.sh (contents, props changed) vendor/pjdfstest/dist/tests/mkdir/ vendor/pjdfstest/dist/tests/mkdir/00.t vendor/pjdfstest/dist/tests/mkdir/01.t vendor/pjdfstest/dist/tests/mkdir/02.t vendor/pjdfstest/dist/tests/mkdir/03.t vendor/pjdfstest/dist/tests/mkdir/04.t vendor/pjdfstest/dist/tests/mkdir/05.t vendor/pjdfstest/dist/tests/mkdir/06.t vendor/pjdfstest/dist/tests/mkdir/07.t vendor/pjdfstest/dist/tests/mkdir/08.t vendor/pjdfstest/dist/tests/mkdir/09.t vendor/pjdfstest/dist/tests/mkdir/10.t vendor/pjdfstest/dist/tests/mkdir/11.t vendor/pjdfstest/dist/tests/mkdir/12.t vendor/pjdfstest/dist/tests/mkfifo/ vendor/pjdfstest/dist/tests/mkfifo/00.t vendor/pjdfstest/dist/tests/mkfifo/01.t vendor/pjdfstest/dist/tests/mkfifo/02.t vendor/pjdfstest/dist/tests/mkfifo/03.t vendor/pjdfstest/dist/tests/mkfifo/04.t vendor/pjdfstest/dist/tests/mkfifo/05.t vendor/pjdfstest/dist/tests/mkfifo/06.t vendor/pjdfstest/dist/tests/mkfifo/07.t vendor/pjdfstest/dist/tests/mkfifo/08.t vendor/pjdfstest/dist/tests/mkfifo/09.t vendor/pjdfstest/dist/tests/mkfifo/10.t vendor/pjdfstest/dist/tests/mkfifo/11.t vendor/pjdfstest/dist/tests/mkfifo/12.t vendor/pjdfstest/dist/tests/mknod/ vendor/pjdfstest/dist/tests/mknod/00.t vendor/pjdfstest/dist/tests/mknod/01.t vendor/pjdfstest/dist/tests/mknod/02.t vendor/pjdfstest/dist/tests/mknod/03.t vendor/pjdfstest/dist/tests/mknod/04.t vendor/pjdfstest/dist/tests/mknod/05.t vendor/pjdfstest/dist/tests/mknod/06.t vendor/pjdfstest/dist/tests/mknod/07.t vendor/pjdfstest/dist/tests/mknod/08.t vendor/pjdfstest/dist/tests/mknod/09.t vendor/pjdfstest/dist/tests/mknod/10.t vendor/pjdfstest/dist/tests/mknod/11.t vendor/pjdfstest/dist/tests/open/ vendor/pjdfstest/dist/tests/open/00.t vendor/pjdfstest/dist/tests/open/01.t vendor/pjdfstest/dist/tests/open/02.t vendor/pjdfstest/dist/tests/open/03.t vendor/pjdfstest/dist/tests/open/04.t vendor/pjdfstest/dist/tests/open/05.t vendor/pjdfstest/dist/tests/open/06.t vendor/pjdfstest/dist/tests/open/07.t vendor/pjdfstest/dist/tests/open/08.t vendor/pjdfstest/dist/tests/open/09.t vendor/pjdfstest/dist/tests/open/10.t vendor/pjdfstest/dist/tests/open/11.t vendor/pjdfstest/dist/tests/open/12.t vendor/pjdfstest/dist/tests/open/13.t vendor/pjdfstest/dist/tests/open/14.t vendor/pjdfstest/dist/tests/open/15.t vendor/pjdfstest/dist/tests/open/16.t vendor/pjdfstest/dist/tests/open/17.t vendor/pjdfstest/dist/tests/open/18.t vendor/pjdfstest/dist/tests/open/19.t vendor/pjdfstest/dist/tests/open/20.t vendor/pjdfstest/dist/tests/open/21.t vendor/pjdfstest/dist/tests/open/22.t vendor/pjdfstest/dist/tests/open/23.t vendor/pjdfstest/dist/tests/open/24.t vendor/pjdfstest/dist/tests/rename/ vendor/pjdfstest/dist/tests/rename/00.t vendor/pjdfstest/dist/tests/rename/01.t vendor/pjdfstest/dist/tests/rename/02.t vendor/pjdfstest/dist/tests/rename/03.t vendor/pjdfstest/dist/tests/rename/04.t vendor/pjdfstest/dist/tests/rename/05.t vendor/pjdfstest/dist/tests/rename/06.t vendor/pjdfstest/dist/tests/rename/07.t vendor/pjdfstest/dist/tests/rename/08.t vendor/pjdfstest/dist/tests/rename/09.t vendor/pjdfstest/dist/tests/rename/10.t vendor/pjdfstest/dist/tests/rename/11.t vendor/pjdfstest/dist/tests/rename/12.t vendor/pjdfstest/dist/tests/rename/13.t vendor/pjdfstest/dist/tests/rename/14.t vendor/pjdfstest/dist/tests/rename/15.t vendor/pjdfstest/dist/tests/rename/16.t vendor/pjdfstest/dist/tests/rename/17.t vendor/pjdfstest/dist/tests/rename/18.t vendor/pjdfstest/dist/tests/rename/19.t vendor/pjdfstest/dist/tests/rename/20.t vendor/pjdfstest/dist/tests/rename/21.t vendor/pjdfstest/dist/tests/rmdir/ vendor/pjdfstest/dist/tests/rmdir/00.t vendor/pjdfstest/dist/tests/rmdir/01.t vendor/pjdfstest/dist/tests/rmdir/02.t vendor/pjdfstest/dist/tests/rmdir/03.t vendor/pjdfstest/dist/tests/rmdir/04.t vendor/pjdfstest/dist/tests/rmdir/05.t vendor/pjdfstest/dist/tests/rmdir/06.t vendor/pjdfstest/dist/tests/rmdir/07.t vendor/pjdfstest/dist/tests/rmdir/08.t vendor/pjdfstest/dist/tests/rmdir/09.t vendor/pjdfstest/dist/tests/rmdir/10.t vendor/pjdfstest/dist/tests/rmdir/11.t vendor/pjdfstest/dist/tests/rmdir/12.t vendor/pjdfstest/dist/tests/rmdir/13.t vendor/pjdfstest/dist/tests/rmdir/14.t vendor/pjdfstest/dist/tests/rmdir/15.t vendor/pjdfstest/dist/tests/symlink/ vendor/pjdfstest/dist/tests/symlink/00.t vendor/pjdfstest/dist/tests/symlink/01.t vendor/pjdfstest/dist/tests/symlink/02.t vendor/pjdfstest/dist/tests/symlink/03.t vendor/pjdfstest/dist/tests/symlink/04.t vendor/pjdfstest/dist/tests/symlink/05.t vendor/pjdfstest/dist/tests/symlink/06.t vendor/pjdfstest/dist/tests/symlink/07.t vendor/pjdfstest/dist/tests/symlink/08.t vendor/pjdfstest/dist/tests/symlink/09.t vendor/pjdfstest/dist/tests/symlink/10.t vendor/pjdfstest/dist/tests/symlink/11.t vendor/pjdfstest/dist/tests/symlink/12.t vendor/pjdfstest/dist/tests/truncate/ vendor/pjdfstest/dist/tests/truncate/00.t vendor/pjdfstest/dist/tests/truncate/01.t vendor/pjdfstest/dist/tests/truncate/02.t vendor/pjdfstest/dist/tests/truncate/03.t vendor/pjdfstest/dist/tests/truncate/04.t vendor/pjdfstest/dist/tests/truncate/05.t vendor/pjdfstest/dist/tests/truncate/06.t vendor/pjdfstest/dist/tests/truncate/07.t vendor/pjdfstest/dist/tests/truncate/08.t vendor/pjdfstest/dist/tests/truncate/09.t vendor/pjdfstest/dist/tests/truncate/10.t vendor/pjdfstest/dist/tests/truncate/11.t vendor/pjdfstest/dist/tests/truncate/12.t vendor/pjdfstest/dist/tests/truncate/13.t vendor/pjdfstest/dist/tests/truncate/14.t vendor/pjdfstest/dist/tests/unlink/ vendor/pjdfstest/dist/tests/unlink/00.t vendor/pjdfstest/dist/tests/unlink/01.t vendor/pjdfstest/dist/tests/unlink/02.t vendor/pjdfstest/dist/tests/unlink/03.t vendor/pjdfstest/dist/tests/unlink/04.t vendor/pjdfstest/dist/tests/unlink/05.t vendor/pjdfstest/dist/tests/unlink/06.t vendor/pjdfstest/dist/tests/unlink/07.t vendor/pjdfstest/dist/tests/unlink/08.t vendor/pjdfstest/dist/tests/unlink/09.t vendor/pjdfstest/dist/tests/unlink/10.t vendor/pjdfstest/dist/tests/unlink/11.t vendor/pjdfstest/dist/tests/unlink/12.t vendor/pjdfstest/dist/tests/unlink/13.t Added: vendor/pjdfstest/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/pjdfstest/dist/LICENSE Tue Sep 9 02:50:09 2014 (r271294) @@ -0,0 +1,27 @@ +$FreeBSD: head/tools/regression/pjdfstest/LICENSE 211354 2010-08-15 21:29:03Z pjd $ + +License for all regression tests available with pjdfstest: + +Copyright (c) 2006-2012 Pawel Jakub Dawidek +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 AUTHORS 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 AUTHORS 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. Added: vendor/pjdfstest/dist/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/pjdfstest/dist/Makefile Tue Sep 9 02:50:09 2014 (r271294) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +PROG= pjdfstest + +${PROG}: ${PROG}.c + @OSTYPE=`uname`; \ + CFLAGS=-D__OS_$${OSTYPE}__; \ + if [ $$OSTYPE = "FreeBSD" ]; then \ + CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT -DHAS_CONNECTAT -DHAS_LPATHCONF"; \ + elif [ $$OSTYPE = "SunOS" ]; then \ + CFLAGS="$$CFLAGS -DHAS_TRUNCATE64 -DHAS_STAT64"; \ + CFLAGS="$$CFLAGS -lsocket"; \ + elif [ $$OSTYPE = "Darwin" ]; then \ + CFLAGS="$$CFLAGS -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_LCHFLAGS"; \ + elif [ $$OSTYPE == "Linux" ]; then \ + CFLAGS="$$CFLAGS -D_GNU_SOURCE"; \ + else \ + echo "Unsupported operating system: ${OSTYPE}."; \ + exit 1; \ + fi; \ + cmd="gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ + echo $$cmd; \ + $$cmd + +clean: + rm -f ${PROG} Added: vendor/pjdfstest/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/pjdfstest/dist/README Tue Sep 9 02:50:09 2014 (r271294) @@ -0,0 +1,22 @@ +$FreeBSD: head/tools/regression/pjdfstest/README 211354 2010-08-15 21:29:03Z pjd $ + +Few notes on how to use pjdfstest in short steps: + + # cd pjdfstest + # vi tests/conf + Change 'fs' to file system type you want to test (UFS or ZFS). + # vi Makefile + You need to manually tweak few things by editing CFLAGS lines + at the top of the file. + # make + It will compile pjdfstest utility which is used by regression tests. + # cd /path/to/file/system/you/want/to/test/ + # prove -r /path/to/pjdfstest/tests + +That's all. Enjoy. + +Currently supported operating systems: FreeBSD, Solaris. +Currently supported file system types: UFS, ZFS. + +-- +Pawel Jakub Dawidek Added: vendor/pjdfstest/dist/pjdfstest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/pjdfstest/dist/pjdfstest.c Tue Sep 9 02:50:09 2014 (r271294) @@ -0,0 +1,1493 @@ +/*- + * Copyright (c) 2006-2010 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 +#include +#include +#include +#include +#ifndef makedev +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef HAS_TRUNCATE64 +#define truncate64 truncate +#define ftruncate64 ftruncate +#endif +#ifndef HAS_STAT64 +#define stat64 stat +#define fstat64 fstat +#define lstat64 lstat +#endif +#ifdef HAS_FREEBSD_ACL +#include +#endif + +#ifndef ALLPERMS +#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) +#endif + +enum action { + ACTION_OPEN, + ACTION_OPENAT, + ACTION_CREATE, + ACTION_UNLINK, + ACTION_UNLINKAT, + ACTION_MKDIR, + ACTION_MKDIRAT, + ACTION_RMDIR, + ACTION_LINK, + ACTION_LINKAT, + ACTION_SYMLINK, + ACTION_SYMLINKAT, + ACTION_RENAME, + ACTION_RENAMEAT, + ACTION_MKFIFO, + ACTION_MKFIFOAT, + ACTION_MKNOD, + ACTION_MKNODAT, + ACTION_BIND, +#ifdef HAS_BINDAT + ACTION_BINDAT, +#endif + ACTION_CONNECT, +#ifdef HAS_CONNECTAT + ACTION_CONNECTAT, +#endif + ACTION_CHMOD, + ACTION_FCHMOD, +#ifdef HAS_LCHMOD + ACTION_LCHMOD, +#endif + ACTION_FCHMODAT, + ACTION_CHOWN, + ACTION_FCHOWN, + ACTION_LCHOWN, + ACTION_FCHOWNAT, +#ifdef HAS_CHFLAGS + ACTION_CHFLAGS, +#endif +#ifdef HAS_FCHFLAGS + ACTION_FCHFLAGS, +#endif +#ifdef HAS_CHFLAGSAT + ACTION_CHFLAGSAT, +#endif +#ifdef HAS_LCHFLAGS + ACTION_LCHFLAGS, +#endif + ACTION_TRUNCATE, + ACTION_FTRUNCATE, + ACTION_STAT, + ACTION_FSTAT, + ACTION_LSTAT, + ACTION_FSTATAT, + ACTION_PATHCONF, + ACTION_FPATHCONF, +#ifdef HAS_LPATHCONF + ACTION_LPATHCONF, +#endif +#ifdef HAS_FREEBSD_ACL + ACTION_PREPENDACL, + ACTION_READACL, +#endif + ACTION_WRITE, +}; + +#define TYPE_NONE 0x0000 +#define TYPE_STRING 0x0001 +#define TYPE_NUMBER 0x0002 +#define TYPE_DESCRIPTOR 0x0003 +#define TYPE_MASK 0x000f + +#define TYPE_OPTIONAL 0x0100 + +#define MAX_ARGS 8 + +struct syscall_desc { + const char *sd_name; + enum action sd_action; + int sd_args[MAX_ARGS]; +}; + +static struct syscall_desc syscalls[] = { + { "open", ACTION_OPEN, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } }, + { "openat", ACTION_OPENAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER | TYPE_OPTIONAL, TYPE_NONE } }, + { "create", ACTION_CREATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "unlink", ACTION_UNLINK, { TYPE_STRING, TYPE_NONE } }, + { "unlinkat", ACTION_UNLINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "mkdir", ACTION_MKDIR, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "mkdirat", ACTION_MKDIRAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "rmdir", ACTION_RMDIR, { TYPE_STRING, TYPE_NONE } }, + { "link", ACTION_LINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "linkat", ACTION_LINKAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "symlink", ACTION_SYMLINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "symlinkat", ACTION_SYMLINKAT, { TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, + { "rename", ACTION_RENAME, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "renameat", ACTION_RENAMEAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, + { "mkfifo", ACTION_MKFIFO, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "mkfifoat", ACTION_MKFIFOAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "mknod", ACTION_MKNOD, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} }, + { "mknodat", ACTION_MKNODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} }, + { "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } }, +#ifdef HAS_BINDAT + { "bindat", ACTION_BINDAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, +#endif + { "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } }, +#ifdef HAS_CONNECTAT + { "connectat", ACTION_CONNECTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, +#endif + { "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "fchmod", ACTION_FCHMOD, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } }, +#ifdef HAS_LCHMOD + { "lchmod", ACTION_LCHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, +#endif + { "fchmodat", ACTION_FCHMODAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } }, + { "chown", ACTION_CHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } }, + { "fchown", ACTION_FCHOWN, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } }, + { "lchown", ACTION_LCHOWN, { TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE } }, + { "fchownat", ACTION_FCHOWNAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_STRING, TYPE_NONE } }, +#ifdef HAS_CHFLAGS + { "chflags", ACTION_CHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, +#endif +#ifdef HAS_FCHFLAGS + { "fchflags", ACTION_FCHFLAGS, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, +#endif +#ifdef HAS_CHFLAGSAT + { "chflagsat", ACTION_CHFLAGSAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } }, +#endif +#ifdef HAS_LCHFLAGS + { "lchflags", ACTION_LCHFLAGS, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, +#endif + { "truncate", ACTION_TRUNCATE, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "ftruncate", ACTION_FTRUNCATE, { TYPE_DESCRIPTOR, TYPE_NUMBER, TYPE_NONE } }, + { "stat", ACTION_STAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "fstat", ACTION_FSTAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, + { "lstat", ACTION_LSTAT, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "fstatat", ACTION_FSTATAT, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "pathconf", ACTION_PATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "fpathconf", ACTION_FPATHCONF, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, +#ifdef HAS_LPATHCONF + { "lpathconf", ACTION_LPATHCONF, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, +#endif +#ifdef HAS_FREEBSD_ACL + { "prependacl", ACTION_PREPENDACL, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, + { "readacl", ACTION_READACL, { TYPE_STRING, TYPE_NONE } }, +#endif + { "write", ACTION_WRITE, { TYPE_DESCRIPTOR, TYPE_STRING, TYPE_NONE } }, + { NULL, -1, { TYPE_NONE } } +}; + +struct flag { + long long f_flag; + const char *f_str; +}; + +static struct flag open_flags[] = { +#ifdef O_RDONLY + { O_RDONLY, "O_RDONLY" }, +#endif +#ifdef O_WRONLY + { O_WRONLY, "O_WRONLY" }, +#endif +#ifdef O_RDWR + { O_RDWR, "O_RDWR" }, +#endif +#ifdef O_NONBLOCK + { O_NONBLOCK, "O_NONBLOCK" }, +#endif +#ifdef O_APPEND + { O_APPEND, "O_APPEND" }, +#endif +#ifdef O_CREAT + { O_CREAT, "O_CREAT" }, +#endif +#ifdef O_TRUNC + { O_TRUNC, "O_TRUNC" }, +#endif +#ifdef O_EXCL + { O_EXCL, "O_EXCL" }, +#endif +#ifdef O_SHLOCK + { O_SHLOCK, "O_SHLOCK" }, +#endif +#ifdef O_EXLOCK + { O_EXLOCK, "O_EXLOCK" }, +#endif +#ifdef O_DIRECT + { O_DIRECT, "O_DIRECT" }, +#endif +#ifdef O_FSYNC + { O_FSYNC, "O_FSYNC" }, +#endif +#ifdef O_SYNC + { O_SYNC, "O_SYNC" }, +#endif +#ifdef O_NOFOLLOW + { O_NOFOLLOW, "O_NOFOLLOW" }, +#endif +#ifdef O_NOCTTY + { O_NOCTTY, "O_NOCTTY" }, +#endif +#ifdef O_DIRECTORY + { O_DIRECTORY, "O_DIRECTORY" }, +#endif + { 0, NULL } +}; + +#ifdef HAS_CHFLAGS +static struct flag chflags_flags[] = { +#ifdef UF_NODUMP + { UF_NODUMP, "UF_NODUMP" }, +#endif +#ifdef UF_IMMUTABLE + { UF_IMMUTABLE, "UF_IMMUTABLE" }, +#endif +#ifdef UF_APPEND + { UF_APPEND, "UF_APPEND" }, +#endif +#ifdef UF_NOUNLINK + { UF_NOUNLINK, "UF_NOUNLINK" }, +#endif +#ifdef UF_OPAQUE + { UF_OPAQUE, "UF_OPAQUE" }, +#endif +#ifdef SF_ARCHIVED + { SF_ARCHIVED, "SF_ARCHIVED" }, +#endif +#ifdef SF_IMMUTABLE + { SF_IMMUTABLE, "SF_IMMUTABLE" }, +#endif +#ifdef SF_APPEND + { SF_APPEND, "SF_APPEND" }, +#endif +#ifdef SF_NOUNLINK + { SF_NOUNLINK, "SF_NOUNLINK" }, +#endif +#ifdef SF_SNAPSHOT + { SF_SNAPSHOT, "SF_SNAPSHOT" }, +#endif + { 0, NULL } +}; +#endif + +static struct flag unlinkat_flags[] = { + { AT_REMOVEDIR, "AT_REMOVEDIR" }, + { 0, NULL } +}; + +static struct flag linkat_flags[] = { + { AT_SYMLINK_FOLLOW, "AT_SYMLINK_FOLLOW" }, + { 0, NULL } +}; + +static struct flag chflagsat_flags[] = { + { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" }, + { 0, NULL } +}; + +static struct flag fchmodat_flags[] = { + { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" }, + { 0, NULL } +}; + +static struct flag fchownat_flags[] = { + { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" }, + { 0, NULL } +}; + +static struct flag fstatat_flags[] = { + { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" }, + { 0, NULL } +}; + +struct name { + int n_name; + const char *n_str; +}; + +static struct name pathconf_names[] = { +#ifdef _PC_LINK_MAX + { _PC_LINK_MAX, "_PC_LINK_MAX" }, +#endif +#ifdef _PC_NAME_MAX + { _PC_NAME_MAX, "_PC_NAME_MAX" }, +#endif +#ifdef _PC_PATH_MAX + { _PC_PATH_MAX, "_PC_PATH_MAX" }, +#endif +#ifdef _PC_SYMLINK_MAX + { _PC_SYMLINK_MAX, "_PC_SYMLINK_MAX" }, +#endif + { 0, NULL } +}; + +static const char *err2str(int error); + +static int *descriptors; +static int ndescriptors; + +static void +usage(void) +{ + + fprintf(stderr, "usage: pjdfstest [-U umask] [-u uid] [-g gid1[,gid2[...]]] syscall args ...\n"); + exit(1); +} + +static long long +str2flags(struct flag *tflags, char *sflags) +{ + long long flags = 0; + unsigned int i; + char *f; + + /* 'none' or '0' means no flags */ + if (strcmp(sflags, "none") == 0 || strcmp(sflags, "0") == 0) + return (0); + for (f = strtok(sflags, ",|"); f != NULL; f = strtok(NULL, ",|")) { + for (i = 0; tflags[i].f_str != NULL; i++) { + if (strcmp(tflags[i].f_str, f) == 0) + break; + } + if (tflags[i].f_str == NULL) { + fprintf(stderr, "unknown flag '%s'\n", f); + exit(1); + } + flags |= tflags[i].f_flag; + } + return (flags); +} + +#ifdef HAS_CHFLAGS +static char * +flags2str(struct flag *tflags, long long flags) +{ + static char sflags[1024]; + unsigned int i; + + sflags[0] = '\0'; + for (i = 0; tflags[i].f_str != NULL; i++) { + if (flags & tflags[i].f_flag) { + if (sflags[0] != '\0') + strlcat(sflags, ",", sizeof(sflags)); + strlcat(sflags, tflags[i].f_str, sizeof(sflags)); + } + } + if (sflags[0] == '\0') + strlcpy(sflags, "none", sizeof(sflags)); + return (sflags); +} +#endif + +static int +str2name(struct name *names, char *name) +{ + unsigned int i; + + for (i = 0; names[i].n_str != NULL; i++) { + if (strcmp(names[i].n_str, name) == 0) + return (names[i].n_name); + } + return (-1); +} + +static struct syscall_desc * +find_syscall(const char *name) +{ + int i; + + for (i = 0; syscalls[i].sd_name != NULL; i++) { + if (strcmp(syscalls[i].sd_name, name) == 0) + return (&syscalls[i]); + } + return (NULL); +} + +static void +show_stat(struct stat64 *sp, const char *what) +{ + + if (strcmp(what, "mode") == 0) + printf("0%o", (unsigned int)(sp->st_mode & ALLPERMS)); + else if (strcmp(what, "inode") == 0) + printf("%lld", (long long)sp->st_ino); + else if (strcmp(what, "nlink") == 0) + printf("%lld", (long long)sp->st_nlink); + else if (strcmp(what, "uid") == 0) + printf("%d", (int)sp->st_uid); + else if (strcmp(what, "gid") == 0) + printf("%d", (int)sp->st_gid); + else if (strcmp(what, "size") == 0) + printf("%lld", (long long)sp->st_size); + else if (strcmp(what, "blocks") == 0) + printf("%lld", (long long)sp->st_blocks); + else if (strcmp(what, "atime") == 0) + printf("%lld", (long long)sp->st_atime); + else if (strcmp(what, "mtime") == 0) + printf("%lld", (long long)sp->st_mtime); + else if (strcmp(what, "ctime") == 0) + printf("%lld", (long long)sp->st_ctime); +#ifdef HAS_CHFLAGS + else if (strcmp(what, "flags") == 0) + printf("%s", flags2str(chflags_flags, (long long)sp->st_flags)); +#endif + else if (strcmp(what, "major") == 0) + printf("%u", (unsigned int)major(sp->st_rdev)); + else if (strcmp(what, "minor") == 0) + printf("%u", (unsigned int)minor(sp->st_rdev)); + else if (strcmp(what, "type") == 0) { + switch (sp->st_mode & S_IFMT) { + case S_IFIFO: + printf("fifo"); + break; + case S_IFCHR: + printf("char"); + break; + case S_IFDIR: + printf("dir"); + break; + case S_IFBLK: + printf("block"); + break; + case S_IFREG: + printf("regular"); + break; + case S_IFLNK: + printf("symlink"); + break; + case S_IFSOCK: + printf("socket"); + break; + default: + printf("unknown"); + break; + } + } else { + printf("unknown"); + } +} + +static void +show_stats(struct stat64 *sp, char *what) +{ + const char *s = ""; + char *w; + + for (w = strtok(what, ","); w != NULL; w = strtok(NULL, ",")) { + printf("%s", s); + show_stat(sp, w); + s = ","; + } + printf("\n"); +} + +static void +descriptor_add(int fd) +{ + + ndescriptors++; + if (descriptors == NULL) { + descriptors = malloc(sizeof(descriptors[0]) * ndescriptors); + } else { + descriptors = realloc(descriptors, + sizeof(descriptors[0]) * ndescriptors); + } + assert(descriptors != NULL); + descriptors[ndescriptors - 1] = fd; +} + +static int +descriptor_get(int pos) +{ + + if (pos < 0 || pos >= ndescriptors) { + fprintf(stderr, "invalid descriptor %d\n", pos); + exit(1); + } + + return (descriptors[pos]); +} + +static unsigned int +call_syscall(struct syscall_desc *scall, char *argv[]) +{ + struct stat64 sb; + long long flags; + unsigned int i; + char *endp; + int name, rval; + union { + char *str; + long long num; + } args[MAX_ARGS]; +#ifdef HAS_FREEBSD_ACL + int entry_id = ACL_FIRST_ENTRY; + acl_t acl, newacl; + acl_entry_t entry, newentry; +#endif + + /* + * Verify correctness of the arguments. + */ + for (i = 0; i < sizeof(args)/sizeof(args[0]); i++) { + if (scall->sd_args[i] == TYPE_NONE) { + if (argv[i] == NULL || strcmp(argv[i], ":") == 0) + break; + fprintf(stderr, "too many arguments [%s]\n", argv[i]); + exit(1); + } else { + if (argv[i] == NULL || strcmp(argv[i], ":") == 0) { + if (scall->sd_args[i] & TYPE_OPTIONAL) + break; + fprintf(stderr, "too few arguments\n"); + exit(1); + } + if ((scall->sd_args[i] & TYPE_MASK) == TYPE_STRING) { + if (strcmp(argv[i], "NULL") == 0) + args[i].str = NULL; + else if (strcmp(argv[i], "DEADCODE") == 0) + args[i].str = (void *)0xdeadc0de; + else + args[i].str = argv[i]; + } else if ((scall->sd_args[i] & TYPE_MASK) == + TYPE_NUMBER) { + args[i].num = strtoll(argv[i], &endp, 0); + if (*endp != '\0' && + !isspace((unsigned char)*endp)) { + fprintf(stderr, + "invalid argument %u, number expected [%s]\n", + i, endp); + exit(1); + } + } else if ((scall->sd_args[i] & TYPE_MASK) == + TYPE_DESCRIPTOR) { + if (strcmp(argv[i], "AT_FDCWD") == 0) { + args[i].num = AT_FDCWD; + } else if (strcmp(argv[i], "BADFD") == 0) { + /* In case AT_FDCWD is -1 on some systems... */ + if (AT_FDCWD == -1) + args[i].num = -2; + else + args[i].num = -1; + } else { + int pos; + + pos = strtoll(argv[i], &endp, 0); + if (*endp != '\0' && + !isspace((unsigned char)*endp)) { + fprintf(stderr, + "invalid argument %u, number expected [%s]\n", + i, endp); + exit(1); + } + args[i].num = descriptor_get(pos); + } + } + } + } + /* + * Call the given syscall. + */ +#define NUM(n) (args[(n)].num) +#define STR(n) (args[(n)].str) + switch (scall->sd_action) { + case ACTION_OPEN: + flags = str2flags(open_flags, STR(1)); + if (flags & O_CREAT) { + if (i == 2) { + fprintf(stderr, "too few arguments\n"); + exit(1); + } + rval = open(STR(0), (int)flags, (mode_t)NUM(2)); + } else { + if (i == 3) { + fprintf(stderr, "too many arguments\n"); + exit(1); + } + rval = open(STR(0), (int)flags); + } + if (rval >= 0) + descriptor_add(rval); + break; + case ACTION_OPENAT: + flags = str2flags(open_flags, STR(2)); + if (flags & O_CREAT) { + if (i == 3) { + fprintf(stderr, "too few arguments\n"); + exit(1); + } + rval = openat(NUM(0), STR(1), (int)flags, + (mode_t)NUM(3)); + } else { + if (i == 4) { + fprintf(stderr, "too many arguments\n"); + exit(1); + } + rval = openat(NUM(0), STR(1), (int)flags); + } + if (rval >= 0) + descriptor_add(rval); + break; + case ACTION_CREATE: + rval = open(STR(0), O_CREAT | O_EXCL, (mode_t)NUM(1)); + if (rval >= 0) + close(rval); + break; + case ACTION_UNLINK: + rval = unlink(STR(0)); + break; + case ACTION_UNLINKAT: + rval = unlinkat(NUM(0), STR(1), + (int)str2flags(unlinkat_flags, STR(2))); + break; + case ACTION_MKDIR: + rval = mkdir(STR(0), (mode_t)NUM(1)); + break; + case ACTION_MKDIRAT: + rval = mkdirat(NUM(0), STR(1), (mode_t)NUM(2)); + break; + case ACTION_RMDIR: + rval = rmdir(STR(0)); + break; + case ACTION_LINK: + rval = link(STR(0), STR(1)); + break; + case ACTION_LINKAT: + rval = linkat(NUM(0), STR(1), NUM(2), STR(3), + (int)str2flags(linkat_flags, STR(4))); + break; + case ACTION_SYMLINK: + rval = symlink(STR(0), STR(1)); + break; + case ACTION_SYMLINKAT: + rval = symlinkat(STR(0), NUM(1), STR(2)); + break; + case ACTION_RENAME: + rval = rename(STR(0), STR(1)); + break; + case ACTION_RENAMEAT: + rval = renameat(NUM(0), STR(1), NUM(2), STR(3)); + break; + case ACTION_MKFIFO: + rval = mkfifo(STR(0), (mode_t)NUM(1)); + break; + case ACTION_MKFIFOAT: + rval = mkfifoat(NUM(0), STR(1), (mode_t)NUM(2)); + break; + case ACTION_MKNOD: + case ACTION_MKNODAT: + { + mode_t ntype; + dev_t dev; + int fa; + + switch (scall->sd_action) { + case ACTION_MKNOD: + fa = 0; + break; + case ACTION_MKNODAT: + fa = 1; + break; + default: + abort(); + } + + dev = makedev(NUM(fa + 3), NUM(fa + 4)); + if (strcmp(STR(fa + 1), "c") == 0) /* character device */ + ntype = S_IFCHR; + else if (strcmp(STR(fa + 1), "b") == 0) /* block device */ + ntype = S_IFBLK; + else if (strcmp(STR(fa + 1), "f") == 0) /* fifo special */ + ntype = S_IFIFO; + else if (strcmp(STR(fa + 1), "d") == 0) /* directory */ + ntype = S_IFDIR; + else if (strcmp(STR(fa + 1), "o") == 0) /* regular file */ + ntype = S_IFREG; + else { + fprintf(stderr, "wrong argument 1\n"); + exit(1); + } + switch (scall->sd_action) { + case ACTION_MKNOD: + rval = mknod(STR(0), ntype | NUM(2), dev); + break; + case ACTION_MKNODAT: + rval = mknodat(NUM(0), STR(1), ntype | NUM(3), dev); + break; + default: + abort(); + } + break; + } + case ACTION_BIND: + { + struct sockaddr_un sunx; + + sunx.sun_family = AF_UNIX; + strncpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = bind(rval, (struct sockaddr *)&sunx, sizeof(sunx)); + break; + } +#ifdef HAS_BINDAT + case ACTION_BINDAT: + { + struct sockaddr_un sunx; + + sunx.sun_family = AF_UNIX; + strncpy(sunx.sun_path, STR(1), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = bindat(NUM(0), rval, (struct sockaddr *)&sunx, + sizeof(sunx)); + break; + } +#endif + case ACTION_CONNECT: + { + struct sockaddr_un sunx; + + sunx.sun_family = AF_UNIX; + strncpy(sunx.sun_path, STR(0), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = connect(rval, (struct sockaddr *)&sunx, sizeof(sunx)); + break; + } +#ifdef HAS_CONNECTAT + case ACTION_CONNECTAT: + { + struct sockaddr_un sunx; + + sunx.sun_family = AF_UNIX; + strncpy(sunx.sun_path, STR(1), sizeof(sunx.sun_path) - 1); + sunx.sun_path[sizeof(sunx.sun_path) - 1] = '\0'; + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = connectat(NUM(0), rval, (struct sockaddr *)&sunx, + sizeof(sunx)); + break; + } +#endif + case ACTION_CHMOD: + rval = chmod(STR(0), (mode_t)NUM(1)); + break; + case ACTION_FCHMOD: + rval = fchmod(NUM(0), (mode_t)NUM(1)); + break; +#ifdef HAS_LCHMOD + case ACTION_LCHMOD: + rval = lchmod(STR(0), (mode_t)NUM(1)); + break; +#endif + case ACTION_FCHMODAT: + rval = fchmodat(NUM(0), STR(1), (mode_t)NUM(2), + str2flags(fchmodat_flags, STR(3))); + break; + case ACTION_CHOWN: + rval = chown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); + break; + case ACTION_FCHOWN: + rval = fchown(NUM(0), (uid_t)NUM(1), (gid_t)NUM(2)); + break; + case ACTION_LCHOWN: + rval = lchown(STR(0), (uid_t)NUM(1), (gid_t)NUM(2)); + break; + case ACTION_FCHOWNAT: + rval = fchownat(NUM(0), STR(1), (uid_t)NUM(2), (gid_t)NUM(3), + (int)str2flags(fchownat_flags, STR(4))); + break; +#ifdef HAS_CHFLAGS + case ACTION_CHFLAGS: + rval = chflags(STR(0), + (unsigned long)str2flags(chflags_flags, STR(1))); + break; +#endif +#ifdef HAS_FCHFLAGS + case ACTION_FCHFLAGS: + rval = fchflags(NUM(0), + (unsigned long)str2flags(chflags_flags, STR(1))); + break; +#endif +#ifdef HAS_CHFLAGSAT + case ACTION_CHFLAGSAT: + rval = chflagsat(NUM(0), STR(1), + (unsigned long)str2flags(chflags_flags, STR(2)), + (int)str2flags(chflagsat_flags, STR(3))); + break; +#endif +#ifdef HAS_LCHFLAGS + case ACTION_LCHFLAGS: + rval = lchflags(STR(0), + (unsigned long)str2flags(chflags_flags, STR(1))); + break; +#endif + case ACTION_TRUNCATE: + rval = truncate64(STR(0), NUM(1)); + break; + case ACTION_FTRUNCATE: + rval = ftruncate64(NUM(0), NUM(1)); + break; + case ACTION_STAT: + rval = stat64(STR(0), &sb); + if (rval == 0) { + show_stats(&sb, STR(1)); + return (i); + } + break; + case ACTION_FSTAT: + rval = fstat64(NUM(0), &sb); + if (rval == 0) { + show_stats(&sb, STR(1)); + return (i); + } + break; + case ACTION_LSTAT: + rval = lstat64(STR(0), &sb); + if (rval == 0) { + show_stats(&sb, STR(1)); + return (i); + } + break; + case ACTION_FSTATAT: + rval = fstatat(NUM(0), STR(1), &sb, + (int)str2flags(fstatat_flags, STR(2))); + if (rval == 0) { + show_stats(&sb, STR(3)); + return (i); + } + break; + case ACTION_PATHCONF: + case ACTION_FPATHCONF: +#ifdef HAS_LPATHCONF + case ACTION_LPATHCONF: +#endif + { + long lrval; + + name = str2name(pathconf_names, STR(1)); + if (name == -1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Tue Sep 9 02:53:56 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60031459; Tue, 9 Sep 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 329411C8A; Tue, 9 Sep 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s892rutn069697; Tue, 9 Sep 2014 02:53:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s892rucW069696; Tue, 9 Sep 2014 02:53:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409090253.s892rucW069696@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 9 Sep 2014 02:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271295 - vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 02:53:56 -0000 Author: ngie Date: Tue Sep 9 02:53:55 2014 New Revision: 271295 URL: http://svnweb.freebsd.org/changeset/base/271295 Log: Add tag ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91 Approved by: rpaulo (mentor) Phabric: D743 Sponsored by: EMC / Isilon Storage Division Added: vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91/ - copied from r271294, vendor/pjdfstest/dist/ From owner-svn-src-vendor@FreeBSD.ORG Thu Sep 11 21:38:14 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DC16B43; Thu, 11 Sep 2014 21:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D3B977; Thu, 11 Sep 2014 21:38:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8BLcDpv071058; Thu, 11 Sep 2014 21:38:13 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8BLcAGr071038; Thu, 11 Sep 2014 21:38:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201409112138.s8BLcAGr071038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 11 Sep 2014 21:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271440 - in vendor-sys/acpica/dist: . generate/unix generate/unix/acpiexamples generate/unix/acpiexec generate/unix/acpihelp generate/unix/acpinames generate/unix/iasl source/common so... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 21:38:14 -0000 Author: jkim Date: Thu Sep 11 21:38:09 2014 New Revision: 271440 URL: http://svnweb.freebsd.org/changeset/base/271440 Log: Import ACPICA 20140828. Added: vendor-sys/acpica/dist/source/common/ahuuids.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslascii.c (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslparser.y (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslrules.y (contents, props changed) vendor-sys/acpica/dist/source/compiler/aslsupport.y (contents, props changed) vendor-sys/acpica/dist/source/compiler/asltokens.y (contents, props changed) vendor-sys/acpica/dist/source/compiler/asltypes.y (contents, props changed) vendor-sys/acpica/dist/source/components/utilities/uthex.c (contents, props changed) vendor-sys/acpica/dist/source/components/utilities/utuuid.c (contents, props changed) Deleted: vendor-sys/acpica/dist/source/compiler/aslcompiler.y Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile vendor-sys/acpica/dist/generate/unix/acpinames/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/adfile.c vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslhex.c vendor-sys/acpica/dist/source/compiler/asllength.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/asllookup.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslnamesp.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/aslprepkg.c vendor-sys/acpica/dist/source/compiler/aslresource.c vendor-sys/acpica/dist/source/compiler/aslrestype1.c vendor-sys/acpica/dist/source/compiler/aslrestype1i.c vendor-sys/acpica/dist/source/compiler/aslrestype2.c vendor-sys/acpica/dist/source/compiler/aslrestype2d.c vendor-sys/acpica/dist/source/compiler/aslrestype2e.c vendor-sys/acpica/dist/source/compiler/aslrestype2q.c vendor-sys/acpica/dist/source/compiler/aslrestype2s.c vendor-sys/acpica/dist/source/compiler/aslrestype2w.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/asluuid.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtsubtable.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/prutils.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbhistry.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbstats.c vendor-sys/acpica/dist/source/components/debugger/dbutils.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c vendor-sys/acpica/dist/source/components/disassembler/dmnames.c vendor-sys/acpica/dist/source/components/disassembler/dmobject.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmresrc.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl2.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcs.c vendor-sys/acpica/dist/source/components/disassembler/dmutils.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dswstate.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/events/evhandler.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evrgnini.c vendor-sys/acpica/dist/source/components/events/evxface.c vendor-sys/acpica/dist/source/components/events/evxfevnt.c vendor-sys/acpica/dist/source/components/events/evxfgpe.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/executer/exoparg2.c vendor-sys/acpica/dist/source/components/executer/exregion.c vendor-sys/acpica/dist/source/components/namespace/nsalloc.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsobject.c vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c vendor-sys/acpica/dist/source/components/namespace/nswalk.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/namespace/nsxfobj.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/parser/psopcode.c vendor-sys/acpica/dist/source/components/parser/psopinfo.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/parser/psscope.c vendor-sys/acpica/dist/source/components/parser/pstree.c vendor-sys/acpica/dist/source/components/parser/psutils.c vendor-sys/acpica/dist/source/components/parser/pswalk.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/resources/rsxface.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utexcep.c vendor-sys/acpica/dist/source/components/utilities/utfileio.c vendor-sys/acpica/dist/source/components/utilities/utinit.c vendor-sys/acpica/dist/source/components/utilities/utmath.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utmutex.c vendor-sys/acpica/dist/source/components/utilities/utownerid.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/components/utilities/utstate.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/utxface.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acdispat.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnames.h vendor-sys/acpica/dist/source/include/acparser.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/achaiku.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/include/platform/aclinuxex.h vendor-sys/acpica/dist/source/include/platform/acmsvc.h vendor-sys/acpica/dist/source/os_specific/service_layers/osefixf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oslibcfs.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpibin/abmain.c vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/source/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/changes.txt Thu Sep 11 21:38:09 2014 (r271440) @@ -1,4 +1,159 @@ ---------------------------------------- +28 August 2014. Summary of changes for version 20140828: + +1) ACPICA kernel-resident subsystem: + +Fixed a problem related to the internal use of the Timer() operator where +a 64-bit divide could cause an attempted link to a double-precision math +library. This divide is not actually necessary, so the code was +restructured to eliminate it. Lv Zheng. + +ACPI 5.1: Added support for the runtime validation of the _DSD package +(similar to the iASL support). + +ACPI 5.1/Headers: Added support for the GICC affinity subtable to the +SRAT table. Hanjun Guo . + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total + Debug Version: 192.1K Code, 79.8K Data, 271.9K Total + Previous Release: + Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total1 + Debug Version: 192.0K Code, 79.7K Data, 271.7K Total + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Fixed a problem on unix systems where the original terminal +state was not always properly restored upon exit. Seen when using the -v +option. ACPICA BZ 1104. + +iASL: Fixed a problem with the validation of the ranges/length within the +Memory24 resource descriptor. There was a boundary condition when the +range was equal to the (length -1) caused by the fact that these values +are defined in 256-byte blocks, not bytes. ACPICA BZ 1098 + +Disassembler: Fixed a problem with the GpioInt descriptor interrupt polarity +flags. The flags are actually 2 bits, not 1, and the "ActiveBoth" keyword is +now supported properly. + +ACPI 5.1: Added the GICC affinity subtable to the SRAT table. Supported +in the disassembler, data table compiler, and table template generator. + +iASL: Added a requirement for Device() objects that one of either a _HID +or _ADR must exist within the scope of a Device, as per the ACPI +specification. Remove a similar requirement that was incorrectly in place +for the _DSD object. + +iASL: Added error detection for illegal named references within control +methods that would cause runtime failures. Now trapped as errors are: 1) +References to objects within a non-parent control method. 2) Forward +references (within a method) -- for control methods, AML interpreters use +a one-pass parse of control methods. ACPICA BZ 1008. + +iASL: Added error checking for dependencies related to the _PSx power +methods. ACPICA BZ 1029. +1) For _PS0, one of these must exist within the same scope: _PS1, _PS2, +_PS3. +2) For _PS1, _PS2, and PS3: A _PS0 object must exist within the same +scope. + +iASL and table compiler: Cleanup miscellaneous memory leaks by fully +deploying the existing object and string caches and adding new caches for +the table compiler. + +iASL: Split the huge parser source file into multiple subfiles to improve +manageability. Generation now requires the M4 macro preprocessor, which +is part of the Bison distribution on both unix and windows platforms. + +AcpiSrc: Fixed and removed all extraneous warnings generated during +entire ACPICA source code scan and/or conversion. + + +---------------------------------------- + +24 July 2014. Summary of changes for version 20140724: + +The ACPI 5.1 specification has been released and is available at: +http://uefi.org/specs/access + + +0) ACPI 5.1 support in ACPICA: + +ACPI 5.1 is fully supported in ACPICA as of this release. + +New predefined names. Support includes iASL and runtime ACPICA +validation. + _CCA (Cache Coherency Attribute). + _DSD (Device-Specific Data). David Box. + +Modifications to existing ACPI tables. Support includes headers, iASL +Data Table compiler, disassembler, and the template generator. + FADT - New fields and flags. Graeme Gregory. + GTDT - One new subtable and new fields. Tomasz Nowicki. + MADT - Two new subtables. Tomasz Nowicki. + PCCT - One new subtable. + +Miscellaneous. + New notification type for System Resource Affinity change events. + + +1) ACPICA kernel-resident subsystem: + +Fixed a regression introduced in 20140627 where a fault can happen during +the deletion of Alias AML namespace objects. The problem affected both +the core ACPICA and the ACPICA tools including iASL and AcpiExec. + +Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a +simple mechanism to enable wake GPEs that have no associated handler or +control method. Rafael Wysocki. + +Updated the AcpiEnableGpe interface to disallow the enable if there is no +handler or control method associated with the particular GPE. This will +help avoid meaningless GPEs and even GPE floods. Rafael Wysocki. + +Updated GPE handling and dispatch by disabling the GPE before clearing +the status bit for edge-triggered GPEs. Lv Zheng. + +Added Timer() support to the AML Debug object. The current timer value is +now displayed with each invocation of (Store to) the debug object to +enable simple generation of execution times for AML code (method +execution for example.) ACPICA BZ 1093. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total + Debug Version: 192.0K Code, 79.7K Data, 271.7K Total + Previous Release: + Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total + Debug Version: 191.7K Code, 79.6K Data, 271.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Fixed an issue with the recently added local printf implementation, +concerning width/precision specifiers that could cause incorrect output. +Lv Zheng. ACPICA BZ 1094. + +Disassembler: Added support to detect buffers that contain UUIDs and +disassemble them to an invocation of the ToUUID operator. Also emit +commented descriptions of known ACPI-related UUIDs. + +AcpiHelp: Added support to display known ACPI-related UUIDs. New option, +-u. Adds three new files. + +iASL: Update table compiler and disassembler for DMAR table changes that +were introduced in September 2013. With assistance by David Woodhouse. + +---------------------------------------- 27 June 2014. Summary of changes for version 20140627: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Sep 11 21:38:09 2014 (r271440) @@ -207,6 +207,8 @@ endif # -Wshadow\ # +# M4 macro processor is used to build the final parser file +# # Bison/Flex configuration # # -y: act like yacc @@ -226,6 +228,9 @@ endif YACC= bison YFLAGS += -y +MACROPROC= m4 +MFLAGS= -P -I$(ASL_COMPILER) + LEX= flex LFLAGS += -i -s Modified: vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/acpiexamples/Makefile Thu Sep 11 21:38:09 2014 (r271440) @@ -138,6 +138,7 @@ OBJECTS = \ $(OBJDIR)/uteval.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ + $(OBJDIR)/uthex.o\ $(OBJDIR)/utids.o\ $(OBJDIR)/utinit.o\ $(OBJDIR)/utlock.o\ Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Thu Sep 11 21:38:09 2014 (r271440) @@ -45,6 +45,7 @@ OBJECTS = \ $(OBJDIR)/aemain.o\ $(OBJDIR)/aetables.o\ $(OBJDIR)/ahids.o\ + $(OBJDIR)/ahuuids.o\ $(OBJDIR)/cmfsize.o\ $(OBJDIR)/dbcmds.o\ $(OBJDIR)/dbconvert.o\ @@ -204,6 +205,7 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utfileio.o\ $(OBJDIR)/utglobal.o\ + $(OBJDIR)/uthex.o\ $(OBJDIR)/utids.o\ $(OBJDIR)/utinit.o\ $(OBJDIR)/utlock.o\ @@ -219,6 +221,7 @@ OBJECTS = \ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstring.o\ $(OBJDIR)/uttrack.o\ + $(OBJDIR)/utuuid.o\ $(OBJDIR)/utxface.o\ $(OBJDIR)/utxferror.o\ $(OBJDIR)/utxfinit.o\ Modified: vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Thu Sep 11 21:38:09 2014 (r271440) @@ -35,15 +35,18 @@ OBJECTS = \ $(OBJDIR)/ahids.o\ $(OBJDIR)/ahpredef.o\ $(OBJDIR)/ahmain.o\ + $(OBJDIR)/ahuuids.o\ $(OBJDIR)/getopt.o\ $(OBJDIR)/oslibcfs.o\ $(OBJDIR)/osunixxf.o\ $(OBJDIR)/utdebug.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utglobal.o\ + $(OBJDIR)/uthex.o\ $(OBJDIR)/utmath.o\ $(OBJDIR)/utpredef.o\ - $(OBJDIR)/utprint.o + $(OBJDIR)/utprint.o\ + $(OBJDIR)/utuuid.o # # Flags specific to acpihelp Modified: vendor-sys/acpica/dist/generate/unix/acpinames/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Thu Sep 11 21:38:09 2014 (r271440) @@ -103,6 +103,7 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utfileio.o\ $(OBJDIR)/utglobal.o\ + $(OBJDIR)/uthex.o\ $(OBJDIR)/utids.o\ $(OBJDIR)/utinit.o\ $(OBJDIR)/utlock.o\ Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Thu Sep 11 21:38:09 2014 (r271440) @@ -48,7 +48,9 @@ OBJECTS = \ $(OBJDIR)/adwalk.o\ $(OBJDIR)/ahids.o\ $(OBJDIR)/ahpredef.o\ + $(OBJDIR)/ahuuids.o\ $(OBJDIR)/aslanalyze.o\ + $(OBJDIR)/aslascii.o\ $(OBJDIR)/aslbtypes.o\ $(OBJDIR)/aslcodegen.o\ $(OBJDIR)/aslcompile.o\ @@ -193,6 +195,7 @@ OBJECTS = \ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utfileio.o\ $(OBJDIR)/utglobal.o\ + $(OBJDIR)/uthex.o\ $(OBJDIR)/utinit.o\ $(OBJDIR)/utlock.o\ $(OBJDIR)/utmath.o\ @@ -205,10 +208,12 @@ OBJECTS = \ $(OBJDIR)/utresrc.o\ $(OBJDIR)/utstate.o\ $(OBJDIR)/utstring.o\ + $(OBJDIR)/utuuid.o\ $(OBJDIR)/utxface.o\ $(OBJDIR)/utxferror.o INTERMEDIATES = \ + $(OBJDIR)/aslcompiler.y\ $(OBJDIR)/aslcompilerlex.c\ $(OBJDIR)/aslcompilerparse.c\ $(OBJDIR)/dtparserlex.c\ @@ -221,6 +226,18 @@ MISC = \ $(OBJDIR)/dtparser.y.h\ $(OBJDIR)/prparser.y.h +ASL_PARSER = \ + $(ASL_COMPILER)/aslparser.y\ + $(ASL_COMPILER)/asltokens.y\ + $(ASL_COMPILER)/asltypes.y\ + $(ASL_COMPILER)/aslrules.y + +ASL_LEXER = \ + $(ASL_COMPILER)/aslcompiler.l\ + $(ASL_COMPILER)/aslsupport.l\ + $(OBJDIR)/aslcompiler.y.h + + # # Flags specific to iASL compiler # @@ -234,17 +251,22 @@ CFLAGS += \ # include ../Makefile.rules +# +# Macro processing for iASL .y files +# +$(OBJDIR)/aslcompiler.y : $(ASL_PARSER) + $(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $(OBJDIR)/aslcompiler.y # # Parser and Lexer - intermediate C files # -$(OBJDIR)/aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l $(ASL_COMPILER)/aslsupport.l $(OBJDIR)/aslcompiler.y.h +$(OBJDIR)/aslcompilerlex.c : $(ASL_LEXER) $(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l -$(OBJDIR)/aslcompiler.y.h : $(ASL_COMPILER)/aslcompiler.y +$(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y $(YACC) $(YFLAGS) -pAslCompiler -o/dev/null --defines=$@ $< -$(OBJDIR)/aslcompilerparse.c : $(ASL_COMPILER)/aslcompiler.y +$(OBJDIR)/aslcompilerparse.c : $(OBJDIR)/aslcompiler.y $(YACC) $(YFLAGS) -pAslCompiler -o$@ --defines=/dev/null $< $(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h Modified: vendor-sys/acpica/dist/source/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adfile.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/adfile.c Thu Sep 11 21:38:09 2014 (r271440) @@ -41,7 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ - +#include "aslcompiler.h" #include "acpi.h" #include "accommon.h" #include "acapps.h" @@ -206,7 +206,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst * case where we append the suffix, an added dot and the null terminator. */ - NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) + NewFilename = UtStringCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); if (!NewFilename) { @@ -255,7 +255,7 @@ FlStrdup ( char *NewString; - NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1); + NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); if (!NewString) { return (NULL); @@ -337,7 +337,6 @@ FlSplitInputPathname ( if (!Filename) { - ACPI_FREE (DirectoryPath); return (AE_NO_MEMORY); } @@ -349,6 +348,5 @@ FlSplitInputPathname ( return (AE_OK); } - ACPI_FREE (Filename); return (AE_OK); } Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/adisasm.c Thu Sep 11 21:38:09 2014 (r271440) @@ -41,12 +41,9 @@ * POSSIBILITY OF SUCH DAMAGES. */ - -#include "acpi.h" -#include "accommon.h" +#include "aslcompiler.h" #include "acparser.h" #include "amlcode.h" -#include "acdebug.h" #include "acdisasm.h" #include "acdispat.h" #include "acnamesp.h" @@ -60,23 +57,6 @@ #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("adisasm") -/* - * Older versions of Bison won't emit this external in the generated header. - * Newer versions do emit the external, so we don't need to do it. - */ -#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H -extern int AslCompilerdebug; -#endif - -ACPI_STATUS -NsDisplayNamespace ( - void); - -void -NsSetupNamespaceListing ( - void *Handle); - - /* Local prototypes */ static void @@ -654,7 +634,7 @@ AdCreateTableHeader ( } else { - NewFilename = ACPI_ALLOCATE_ZEROED (9); + NewFilename = UtStringCacheCalloc (9); if (NewFilename) { strncat (NewFilename, Table->Signature, 4); @@ -674,8 +654,6 @@ AdCreateTableHeader ( "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n", NewFilename, Table->Signature, Table->Revision, Table->OemId, Table->OemTableId, Table->OemRevision); - - ACPI_FREE (NewFilename); } Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/adwalk.c Thu Sep 11 21:38:09 2014 (r271440) @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acparser.h" Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/ahids.c Thu Sep 11 21:38:09 2014 (r271440) @@ -174,7 +174,11 @@ const AH_DEVICE_ID AslDeviceIds[] = {"PNP0C60", "Display Sensor Device"}, {"PNP0C70", "Dock Sensor Device"}, {"PNP0C80", "Memory Device"}, - {"PNP0D40", "Standard Compliant SD Host Controller"}, + {"PNP0D10", "XHCI USB Controller with debug"}, + {"PNP0D15", "XHCI USB Controller without debug"}, + {"PNP0D20", "EHCI USB Controller without debug"}, + {"PNP0D25", "EHCI USB Controller with debug"}, + {"PNP0D40", "SDA Standard Compliant SD Host Controller"}, {"PNP0D80", "Windows-compatible System Power Management Controller"}, {"PNP0F03", "Microsoft PS/2-style Mouse"}, {"SMO91D0", "Sensor Hub"}, Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Thu Sep 11 21:38:09 2014 (r271440) @@ -97,6 +97,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"), AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"), AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"), + AH_PREDEF ("_CCA", "Cache Coherency Attribute", "Returns a device's support level for cache coherency"), AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"), AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"), AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"), @@ -121,6 +122,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"), AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"), AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"), + AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"), AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"), AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"), AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"), Added: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Thu Sep 11 21:38:09 2014 (r271440) @@ -0,0 +1,132 @@ +/****************************************************************************** + * + * Module Name: ahuuids - Table of known ACPI-related UUIDs + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2014, Intel Corp. + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include "acpi.h" +#include "accommon.h" + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("ahuuids") + +/* + * Table of "known" (ACPI-related) UUIDs + */ +const AH_UUID AcpiUuids[] = +{ + {"PCI Host Bridge Device", + "33db4d5b-1ff7-401c-9657-7441c03dd766"}, + + {"Platform-wide Capabilities", + "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"}, + + {"Dynamic Enumeration", + "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"}, + + {"GPIO Controller", + "4f248f40-d5e2-499f-834c-27758ea1cd3f"}, + + {"Battery Thermal Limit", + "4c2067e3-887d-475c-9720-4af1d3ed602e"}, + + {"Thermal Extensions", + "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"}, + + {"USB Controller", + "ce2ee385-00e6-48cb-9f05-2edb927c4899"}, + + {"HID I2C Device", + "3cdff6f7-4267-4555-ad05-b30a3d8938de"}, + + {"Power Button Device", + "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"}, + + {"Device Labeling Interface", + "e5c937d0-3553-4d7a-9117-ea4d19c3434d"}, + + {"SATA Controller", + "e4db149b-fcfe-425b-a6d8-92357d78fc7f"}, + + {"Physical Presence Interface", + "3dddfaa6-361b-4eb4-a424-8d10089d1653"}, + + {"Device Properties for _DSD", + "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"}, + + {NULL, NULL} +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiAhMatchUuid + * + * PARAMETERS: Data - Data buffer containing a UUID + * + * RETURN: ASCII description string for the UUID if it is found. + * + * DESCRIPTION: Returns a description string for "known" UUIDs, which are + * are UUIDs that are related to ACPI in some way. + * + ******************************************************************************/ + +const char * +AcpiAhMatchUuid ( + UINT8 *Data) +{ + const AH_UUID *Info; + UINT8 UuidBuffer[UUID_BUFFER_LENGTH]; + + + /* Walk the table of known ACPI-related UUIDs */ + + for (Info = AcpiUuids; Info->Description; Info++) + { + AcpiUtConvertStringToUuid (Info->String, UuidBuffer); + + if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) + { + return (Info->Description); + } + } + + return (NULL); +} Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/dmextern.c Thu Sep 11 21:38:09 2014 (r271440) @@ -406,18 +406,37 @@ AcpiDmGetExternalsFromFile ( while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile)) { Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */ - if (!Token) continue; - if (strcmp (Token, "External")) continue; + if (!Token) + { + continue; + } + if (strcmp (Token, "External")) + { + continue; + } MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */ - if (!MethodName) continue; + if (!MethodName) + { + continue; + } Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */ - if (!Token) continue; - if (strcmp (Token, "MethodObj")) continue; + if (!Token) + { + continue; + } + + if (strcmp (Token, "MethodObj")) + { + continue; + } Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */ - if (!Token) continue; + if (!Token) + { + continue; + } /* Convert arg count string to an integer */ Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Thu Sep 11 21:38:09 2014 (r271440) @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acparser.h" Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/dmtable.c Thu Sep 11 21:38:09 2014 (r271440) @@ -87,9 +87,21 @@ static const char *AcpiDmDmarS "Reserved Memory Region", "Root Port ATS Capability", "Remapping Hardware Static Affinity", + "ACPI Namespace Device Declaration", "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmDmarScope[] = +{ + "Reserved value", + "PCI Endpoint Device", + "PCI Bridge Device", + "IOAPIC Device", + "Message-capable HPET Device", + "Namespace Device", + "Unknown Scope Type" /* Reserved */ +}; + static const char *AcpiDmEinjActions[] = { "Begin Operation", @@ -160,6 +172,13 @@ static const char *AcpiDmErstI "Unknown Instruction" }; +static const char *AcpiDmGtdtSubnames[] = +{ + "Generic Timer Block", + "Generic Watchdog Timer", + "Unknown SubTable Type" /* Reserved */ +}; + static const char *AcpiDmHestSubnames[] = { "IA-32 Machine Check Exception", @@ -189,25 +208,28 @@ static const char *AcpiDmHestN static const char *AcpiDmMadtSubnames[] = { - "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */ - "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */ - "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */ - "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */ - "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */ - "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */ - "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */ - "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */ - "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ - "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */ - "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */ - "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */ - "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */ - "Unknown SubTable Type" /* Reserved */ + "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */ + "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */ + "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */ + "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */ + "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */ + "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */ + "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */ + "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */ + "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */ + "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */ + "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */ + "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */ + "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */ + "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */ + "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */ + "Unknown SubTable Type" /* Reserved */ }; static const char *AcpiDmPcctSubnames[] = { "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */ + "HW-Reduced Communications Subspace", "Unknown SubTable Type" /* Reserved */ }; @@ -231,6 +253,7 @@ static const char *AcpiDmSratS "Processor Local APIC/SAPIC Affinity", "Memory Affinity", "Processor Local x2APIC Affinity", + "GICC Affinity", "Unknown SubTable Type" /* Reserved */ }; @@ -306,7 +329,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"}, {ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"}, - {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"}, + {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, @@ -705,6 +728,7 @@ AcpiDmDumpTable ( case ACPI_DMT_SPACEID: case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: + case ACPI_DMT_GTDT: case ACPI_DMT_MADT: case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: @@ -716,6 +740,7 @@ AcpiDmDumpTable ( case ACPI_DMT_EINJINST: case ACPI_DMT_ERSTACT: case ACPI_DMT_ERSTINST: + case ACPI_DMT_DMAR_SCOPE: ByteLength = 1; break; @@ -1047,6 +1072,19 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; + case ACPI_DMT_DMAR_SCOPE: + + /* DMAR device scope types */ + + Temp8 = *Target; + if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED) + { + Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]); + break; + case ACPI_DMT_EINJACT: /* EINJ Action types */ @@ -1099,6 +1137,19 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]); break; + case ACPI_DMT_GTDT: + + /* GTDT subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_GTDT_TYPE_RESERVED) + { + Temp8 = ACPI_GTDT_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]); + break; + case ACPI_DMT_HEST: /* HEST subtable types */ Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Thu Sep 11 21:15:20 2014 (r271439) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Thu Sep 11 21:38:09 2014 (r271440) @@ -891,18 +891,24 @@ AcpiDmDumpDmar ( ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); break; - case ACPI_DMAR_TYPE_ATSR: + case ACPI_DMAR_TYPE_ROOT_ATS: InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; - case ACPI_DMAR_HARDWARE_AFFINITY: + case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: InfoTable = AcpiDmTableInfoDmar3; ScopeOffset = sizeof (ACPI_DMAR_RHSA); break; + case ACPI_DMAR_TYPE_NAMESPACE: + + InfoTable = AcpiDmTableInfoDmar4; + ScopeOffset = sizeof (ACPI_DMAR_ANDD); + break; + default: AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type); @@ -916,7 +922,16 @@ AcpiDmDumpDmar ( return; } - /* Dump the device scope entries (if any) */ + /* + * Dump the optional device scope entries + */ + if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || + (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE)) + { + /* These types do not support device scopes */ + + goto NextSubtable; + } ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); while (ScopeOffset < SubTable->Length) @@ -956,6 +971,7 @@ AcpiDmDumpDmar ( ScopeTable, ScopeTable->Length); } +NextSubtable: /* Point to next subtable */ Offset += SubTable->Length; @@ -1155,6 +1171,123 @@ NextSubTable: /******************************************************************************* * + * FUNCTION: AcpiDmDumpGtdt + * + * PARAMETERS: Table - A GTDT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a GTDT. This table type consists + * of an open-ended number of subtables. + * + ******************************************************************************/ + +void +AcpiDmDumpGtdt ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + ACPI_GTDT_HEADER *SubTable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_GTDT); + ACPI_DMTABLE_INFO *InfoTable; + UINT32 SubTableLength; + UINT32 GtCount; + ACPI_GTDT_TIMER_ENTRY *GtxTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Subtables */ + + SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common subtable header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoGtdtHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + GtCount = 0; + switch (SubTable->Type) + { + case ACPI_GTDT_TYPE_TIMER_BLOCK: + + SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); + GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, + SubTable))->TimerCount; + + InfoTable = AcpiDmTableInfoGtdt0; + break; + + case ACPI_GTDT_TYPE_WATCHDOG: + + SubTableLength = sizeof (ACPI_GTDT_WATCHDOG); + + InfoTable = AcpiDmTableInfoGtdt1; + break; + + default: + + /* Cannot continue on unknown type - no length */ + + AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type); + return; + } + + Status = AcpiDmDumpTable (Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to end of current subtable (each subtable above is of fixed length) */ + + Offset += SubTableLength; + + /* If there are any Gt Timer Blocks from above, dump them now */ + + if (GtCount) + { + GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength); + SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); + + while (GtCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, GtxTable, + sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_GTDT_TIMER_ENTRY); + GtxTable++; + GtCount--; + } + } + + /* Point to next subtable */ + + SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpHest * * PARAMETERS: Table - A HEST table @@ -1662,6 +1795,16 @@ AcpiDmDumpMadt ( InfoTable = AcpiDmTableInfoMadt12; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Thu Sep 11 21:40:33 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20750CA4; Thu, 11 Sep 2014 21:40:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E777D992; Thu, 11 Sep 2014 21:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8BLeWRb072467; Thu, 11 Sep 2014 21:40:32 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8BLeWme072466; Thu, 11 Sep 2014 21:40:32 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201409112140.s8BLeWme072466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 11 Sep 2014 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271441 - vendor-sys/acpica/20140828 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 21:40:33 -0000 Author: jkim Date: Thu Sep 11 21:40:32 2014 New Revision: 271441 URL: http://svnweb.freebsd.org/changeset/base/271441 Log: Tag ACPICA 20140828. Added: vendor-sys/acpica/20140828/ - copied from r271440, vendor-sys/acpica/dist/ From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 14:23:51 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7AF8C91; Sat, 13 Sep 2014 14:23:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D205EDEB; Sat, 13 Sep 2014 14:23:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DENpVI046818; Sat, 13 Sep 2014 14:23:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DENpPW046817; Sat, 13 Sep 2014 14:23:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131423.s8DENpPW046817@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 14:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271510 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 14:23:52 -0000 Author: delphij Date: Sat Sep 13 14:23:51 2014 New Revision: 271510 URL: http://svnweb.freebsd.org/changeset/base/271510 Log: 5151 blkdev should support reporting of physical block size Reviewed by: Josef 'Jeff' Sipek Reviewed by: Garrett D'Amore Approved by: Dan McDonald Author: Hans Rosenfeld illumos/illumos-gate@32ce6b819524e8719d4ce58db40a00e9f17843e2 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Sat Sep 13 13:46:16 2014 (r271509) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dnode.h Sat Sep 13 14:23:51 2014 (r271510) @@ -56,7 +56,7 @@ extern "C" { * Fixed constants. */ #define DNODE_SHIFT 9 /* 512 bytes */ -#define DN_MIN_INDBLKSHIFT 10 /* 1k */ +#define DN_MIN_INDBLKSHIFT 12 /* 4k */ #define DN_MAX_INDBLKSHIFT 14 /* 16k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 14:30:47 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5CCF21; Sat, 13 Sep 2014 14:30:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C498E19; Sat, 13 Sep 2014 14:30:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DEUlXj049737; Sat, 13 Sep 2014 14:30:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DEUlxV049736; Sat, 13 Sep 2014 14:30:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131430.s8DEUlxV049736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 14:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271511 - vendor/illumos/dist/lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 14:30:47 -0000 Author: delphij Date: Sat Sep 13 14:30:46 2014 New Revision: 271511 URL: http://svnweb.freebsd.org/changeset/base/271511 Log: 5135 zpool_find_import_cached() can use fnvlist_* Reviewed by: Christopher Siden Reviewed by: Max Grossman Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@b18d6b0e20b5bf6e2007c550bb33dcbab6b5dddc Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_import.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Sat Sep 13 14:23:51 2014 (r271510) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_import.c Sat Sep 13 14:30:46 2014 (r271511) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -1377,21 +1377,15 @@ zpool_find_import_cached(libzfs_handle_t elem = NULL; while ((elem = nvlist_next_nvpair(raw, elem)) != NULL) { - verify(nvpair_value_nvlist(elem, &src) == 0); + src = fnvpair_value_nvlist(elem); - verify(nvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME, - &name) == 0); + name = fnvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME); if (poolname != NULL && strcmp(poolname, name) != 0) continue; - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != 0) { - verify(nvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID, - &this_guid) == 0); - if (guid != this_guid) - continue; - } + this_guid = fnvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID); + if (guid != 0 && guid != this_guid) + continue; if (pool_active(hdl, name, this_guid, &active) != 0) { nvlist_free(raw); From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:05:11 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 779625E3; Sat, 13 Sep 2014 15:05:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6201C183; Sat, 13 Sep 2014 15:05:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DF5Bpx066126; Sat, 13 Sep 2014 15:05:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DF5BpZ066125; Sat, 13 Sep 2014 15:05:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131505.s8DF5BpZ066125@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 15:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271512 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:05:11 -0000 Author: delphij Date: Sat Sep 13 15:05:10 2014 New Revision: 271512 URL: http://svnweb.freebsd.org/changeset/base/271512 Log: 5136 fix write throttle comment in dsl_pool.c Reviewed by: Adam Leventhal Reviewed by: Christopher Siden Reviewed by: Max Grossman Reviewed by: Josef 'Jeff' Sipek Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@d85a1e969ce08b3bc4a7cb3626a6e33a28b5caeb Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Sat Sep 13 14:30:46 2014 (r271511) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Sat Sep 13 15:05:10 2014 (r271512) @@ -111,8 +111,8 @@ int zfs_delay_min_dirty_percent = 60; /* * This controls how quickly the delay approaches infinity. - * Larger values cause it to delay less for a given amount of dirty data. - * Therefore larger values will cause there to be more dirty data for a + * Larger values cause it to delay more for a given amount of dirty data. + * Therefore larger values will cause there to be less dirty data for a * given throughput. * * For the smoothest delay, this value should be about 1 billion divided @@ -125,12 +125,6 @@ int zfs_delay_min_dirty_percent = 60; uint64_t zfs_delay_scale = 1000 * 1000 * 1000 / 2000; -/* - * XXX someday maybe turn these into #defines, and you have to tune it on a - * per-pool basis using zfs.conf. - */ - - hrtime_t zfs_throttle_delay = MSEC2NSEC(10); hrtime_t zfs_throttle_resolution = MSEC2NSEC(10); From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:24:36 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59A51644; Sat, 13 Sep 2014 15:24:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447FE3CD; Sat, 13 Sep 2014 15:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DFOaj2080058; Sat, 13 Sep 2014 15:24:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DFOaHI080057; Sat, 13 Sep 2014 15:24:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131524.s8DFOaHI080057@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 15:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271515 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:24:36 -0000 Author: delphij Date: Sat Sep 13 15:24:35 2014 New Revision: 271515 URL: http://svnweb.freebsd.org/changeset/base/271515 Log: 5138 add tunable for maximum number of blocks freed in one txg Reviewed by: Adam Leventhal Reviewed by: Mattew Ahrens Reviewed by: Josef 'Jeff' Sipek Reviewed by: Richard Elling Reviewed by: George Wilson Approved by: Dan McDonald Author: Max Grossman illumos/illumos-gate@af3465da8fa420c4ec701e3e57704d537a6f755b Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Sep 13 15:22:08 2014 (r271514) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Sep 13 15:24:35 2014 (r271515) @@ -69,6 +69,8 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */ enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE; int dsl_scan_delay_completion = B_FALSE; /* set to delay scan completion */ +/* max number of blocks to free in a single TXG */ +uint64_t zfs_free_max_blocks = UINT64_MAX; #define DSL_SCAN_IS_SCRUB_RESILVER(scn) \ ((scn)->scn_phys.scn_func == POOL_SCAN_SCRUB || \ @@ -1319,6 +1321,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s if (zfs_recover) return (B_FALSE); + if (scn->scn_visited_this_txg >= zfs_free_max_blocks) + return (B_TRUE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:27:46 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A098078E; Sat, 13 Sep 2014 15:27:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD0E3ED; Sat, 13 Sep 2014 15:27:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DFRkcB080503; Sat, 13 Sep 2014 15:27:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DFRk3J080502; Sat, 13 Sep 2014 15:27:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131527.s8DFRk3J080502@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 15:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271516 - vendor/illumos/dist/lib/libzpool/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:27:46 -0000 Author: delphij Date: Sat Sep 13 15:27:46 2014 New Revision: 271516 URL: http://svnweb.freebsd.org/changeset/base/271516 Log: 5134 if ZFS_DEBUG or debug= is set, libzpool should enable debug prints Reviewed by: Adam Leventhal Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Saso Kiselkov Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@7fa49ea5e7d23077615525b1738f90f273258b05 Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c Modified: vendor/illumos/dist/lib/libzpool/common/kernel.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/kernel.c Sat Sep 13 15:24:35 2014 (r271515) +++ vendor/illumos/dist/lib/libzpool/common/kernel.c Sat Sep 13 15:27:46 2014 (r271516) @@ -629,6 +629,9 @@ dprintf_setup(int *argc, char **argv) */ if (dprintf_find_string("on")) dprintf_print_all = 1; + + if (dprintf_string != NULL) + zfs_flags |= ZFS_DEBUG_DPRINTF; } /* From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:31:37 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C80319D0; Sat, 13 Sep 2014 15:31:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B250A668; Sat, 13 Sep 2014 15:31:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DFVbwU084498; Sat, 13 Sep 2014 15:31:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DFVbDi084497; Sat, 13 Sep 2014 15:31:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131531.s8DFVbDi084497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 15:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271517 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:31:37 -0000 Author: delphij Date: Sat Sep 13 15:31:37 2014 New Revision: 271517 URL: http://svnweb.freebsd.org/changeset/base/271517 Log: 5140 message about "%recv could not be opened" is printed when booting after crash Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Max Grossman Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@22438533bcc131ecebd4c16c699c35e91d321b76 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Sat Sep 13 15:27:46 2014 (r271516) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Sat Sep 13 15:31:37 2014 (r271517) @@ -635,7 +635,14 @@ zil_claim(const char *osname, void *txar error = dmu_objset_own(osname, DMU_OST_ANY, B_FALSE, FTAG, &os); if (error != 0) { - cmn_err(CE_WARN, "can't open objset for %s", osname); + /* + * EBUSY indicates that the objset is inconsistent, in which + * case it can not have a ZIL. + */ + if (error != EBUSY) { + cmn_err(CE_WARN, "can't open objset for %s, error %u", + osname, error); + } return (0); } From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:34:13 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CF9CB40; Sat, 13 Sep 2014 15:34:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB4C68A; Sat, 13 Sep 2014 15:34:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DFYDev084885; Sat, 13 Sep 2014 15:34:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DFYCkQ084883; Sat, 13 Sep 2014 15:34:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409131534.s8DFYCkQ084883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 13 Sep 2014 15:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r271518 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:34:13 -0000 Author: delphij Date: Sat Sep 13 15:34:12 2014 New Revision: 271518 URL: http://svnweb.freebsd.org/changeset/base/271518 Log: 5139 SEEK_HOLE failed to report a hole at end of file Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Max Grossman Reviewed by: Peng Dai Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@0fbc0cd0e52a11f6c4397a1714f94412cbf98b60 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Sep 13 15:31:37 2014 (r271517) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Sep 13 15:34:12 2014 (r271518) @@ -1943,6 +1943,15 @@ dnode_next_offset(dnode_t *dn, int flags flags, offset, lvl, blkfill, txg); } + /* + * There's always a "virtual hole" at the end of the object, even + * if all BP's which physically exist are non-holes. + */ + if ((flags & DNODE_FIND_HOLE) && error == ESRCH && txg == 0 && + minlvl == 1 && blkfill == 1 && !(flags & DNODE_FIND_BACKWARDS)) { + error = 0; + } + if (error == 0 && (flags & DNODE_FIND_BACKWARDS ? initial_offset < *offset : initial_offset > *offset)) error = SET_ERROR(ESRCH); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Sat Sep 13 15:31:37 2014 (r271517) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c Sat Sep 13 15:34:12 2014 (r271518) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ @@ -271,16 +271,19 @@ zfs_holey(vnode_t *vp, int cmd, offset_t error = dmu_offset_next(zp->z_zfsvfs->z_os, zp->z_id, hole, &noff); - /* end of file? */ - if ((error == ESRCH) || (noff > file_sz)) { - /* - * Handle the virtual hole at the end of file. - */ - if (hole) { - *off = file_sz; - return (0); - } + if (error == ESRCH) return (SET_ERROR(ENXIO)); + + /* + * We could find a hole that begins after the logical end-of-file, + * because dmu_offset_next() only works on whole blocks. If the + * EOF falls mid-block, then indicate that the "virtual hole" + * at the end of the file begins at the logical EOF, rather than + * at the end of the last block. + */ + if (noff > file_sz) { + ASSERT(hole); + noff = file_sz; } if (noff < *off) From owner-svn-src-vendor@FreeBSD.ORG Sat Sep 13 15:59:19 2014 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E42B1A5; Sat, 13 Sep 2014 15:59:19 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 82E268A5; Sat, 13 Sep 2014 15:59:19 +0000 (UTC) Received: from delphij-macbook.local (unknown [10.64.64.50]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 316556DD4; Sat, 13 Sep 2014 08:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1410623959; x=1410638359; bh=2XYQ26leZ6TCPAYGkjL0F99pTkheSprVmlCpNaLtQcE=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=WSxAQ1q28Bt1AAxuuhfizWHRHfuMy9FhiRpWVSmV6eDAU1/xV8YXzFzOezTjxCRRz XINKuyDHzBXLEfUUGA/9i4sXNS3WicjbDRgZzFguo3+F/hxVPRdF3+Nb8KvurtfRG7 6h/PPgZ+Y3hVhn6KPX0waO86c/XscltRUrwssync= Message-ID: <541469D4.70503@delphij.net> Date: Sat, 13 Sep 2014 23:59:16 +0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r271510 - vendor-sys/illumos/dist/uts/common/fs/zfs/sys References: <201409131423.s8DENpPW046817@svn.freebsd.org> In-Reply-To: <201409131423.s8DENpPW046817@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 15:59:19 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 9/13/14 10:23 PM, Xin LI wrote: > Author: delphij Date: Sat Sep 13 14:23:51 2014 New Revision: > 271510 URL: http://svnweb.freebsd.org/changeset/base/271510 > > Log: 5151 blkdev should support reporting of physical block size > Reviewed by: Josef 'Jeff' Sipek Reviewed > by: Garrett D'Amore Approved by: Dan McDonald > Author: Hans Rosenfeld > > > illumos/illumos-gate@32ce6b819524e8719d4ce58db40a00e9f17843e2 Whoops, this was wrong, should read: === 5141 zfs minimum indirect block size is 4K Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@e94f268a6264bf027b3bc556fb4cceb84f7323c5 === Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUFGnUAAoJEJW2GBstM+nsVXsP/AuL/M+zJJUWnUpqbQekV4H2 Yq5m5lTJQvWcZw4XhG659JIvAWkc9O+pOvUpP0HiYe5ErSV4wHyIcB4hZepDh25y EbkzHKnDo5hUIlmbfGSQ+m7oYnFeDew8MjOPtoicqbc/JXVgcvQMuHNzE8ejQ9AO JYDNnhakT1mafqXOTqcePF57lGDZVDMJplSMJlsTUTc9QJBAGP+lc54oAUW4JGEc O01C6tuEpT/E9BKD5aI8a1UaTQxRk2uzhq42MF2u5N/iO9HApkR9+ZZcucHGykY5 lJz99NegfUYfBsktVSvg5XaAohwLbvWC2LPR3p3Uh52Gtd613l7TLw9IwTZmZysv /Jfa4LZRs7k1ppUvyOhZtllkcIy1GEnJpQx50URrYxtIhF/ttNf9QrkbfKc/E3+3 Ch/ulj/8RhwQhGj0X+nXDpIFOCTPWpUPWCmgREaA/lt+WRwCsYZmN1ipY7aX7BSx oHh89A197VnYZ9MTpxxzdA1LUcTM57F0TiFlkhywe5GsGGEAYPDuf3rAy8RAVFmD MmNVgUx6N4ADwxkccHNHsH8qXhQusm9fArnSNyWh++qw+2tOQqUcEPjuWmuFOtNs ueOLMAGm0fMiqAvM36dj08LCXKCBk317S6r6EQo+kmGZTzg6xFhgjnqzoErtQhB/ jznoIT1i1FuGiKOTl/x+ =oCxp -----END PGP SIGNATURE-----