From owner-svn-src-stable-10@freebsd.org Sun Dec 18 14:31:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21486C871AA; Sun, 18 Dec 2016 14:31:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D7B1E192B; Sun, 18 Dec 2016 14:31:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBIEVCKI007841; Sun, 18 Dec 2016 14:31:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBIEVC98007840; Sun, 18 Dec 2016 14:31:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612181431.uBIEVC98007840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 18 Dec 2016 14:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310228 - in stable: 10/sys/dev/xen/blkfront 11/sys/dev/xen/blkfront 9/sys/dev/xen/blkfront X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2016 14:31:13 -0000 Author: dim Date: Sun Dec 18 14:31:11 2016 New Revision: 310228 URL: https://svnweb.freebsd.org/changeset/base/310228 Log: MFC r310013 (by cperciva): Check that blkfront devices have a non-zero number of sectors and a non-zero sector size. Such a device would be a virtual disk of zero bytes; clearly not useful, and not something we should try to attach. As a fortuitous side effect, checking that these values are non-zero here results in them not *becoming* zero later on the function. This odd behaviour began with r309124 (clang 3.9.0) but is challenging to debug; making any changes to this function whatsoever seems to affect the llvm optimizer behaviour enough to make the unexpected zeroing of the sector_size variable cease. PR: 215209 Security: The potential for variables to unexpectedly become zero has worrying consequences for security in general, but not so much in this particular context. MFC r310086: In xbd_connect(), use correct scanf conversion specifiers for the feature_barrier and feature_flush variables. Otherwise, adjacent variables on the stack, such as sector_size, may be overwritten, with disastrous results. Note that I did not see a good reason to revert the addition of zero checks introduced in r310013. Better safe than sorry. PR: 215209 Tested by: royger Modified: stable/10/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/xen/blkfront/blkfront.c stable/9/sys/dev/xen/blkfront/blkfront.c Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/10/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/10/sys/dev/xen/blkfront/blkfront.c Sun Dec 18 14:10:24 2016 (r310227) +++ stable/10/sys/dev/xen/blkfront/blkfront.c Sun Dec 18 14:31:11 2016 (r310228) @@ -1239,19 +1239,27 @@ xbd_connect(struct xbd_softc *sc) xenbus_get_otherend_path(dev)); return; } + if ((sectors == 0) || (sector_size == 0)) { + xenbus_dev_fatal(dev, 0, + "invalid parameters from %s:" + " sectors = %lu, sector_size = %lu", + xenbus_get_otherend_path(dev), + sectors, sector_size); + return; + } err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), "physical-sector-size", "%lu", &phys_sector_size, NULL); if (err || phys_sector_size <= sector_size) phys_sector_size = 0; err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), - "feature-barrier", "%lu", &feature_barrier, + "feature-barrier", "%d", &feature_barrier, NULL); if (err == 0 && feature_barrier != 0) sc->xbd_flags |= XBDF_BARRIER; err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), - "feature-flush-cache", "%lu", &feature_flush, + "feature-flush-cache", "%d", &feature_flush, NULL); if (err == 0 && feature_flush != 0) sc->xbd_flags |= XBDF_FLUSH; From owner-svn-src-stable-10@freebsd.org Mon Dec 19 00:28:05 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97601C7272A; Mon, 19 Dec 2016 00:28:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 669021EC2; Mon, 19 Dec 2016 00:28:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJ0S49T056208; Mon, 19 Dec 2016 00:28:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJ0S47T056206; Mon, 19 Dec 2016 00:28:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612190028.uBJ0S47T056206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Dec 2016 00:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310238 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 00:28:05 -0000 Author: kib Date: Mon Dec 19 00:28:04 2016 New Revision: 310238 URL: https://svnweb.freebsd.org/changeset/base/310238 Log: MFC r310155: Fix typo. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Mon Dec 19 00:26:25 2016 (r310237) +++ stable/10/libexec/rtld-elf/rtld.c Mon Dec 19 00:28:04 2016 (r310238) @@ -2469,7 +2469,7 @@ objlist_call_init(Objlist *list, RtldLoc continue; /* * Race: other thread might try to use this object before current - * one completes the initilization. Not much can be done here + * one completes the initialization. Not much can be done here * without better locking. */ elm->obj->init_done = true; From owner-svn-src-stable-10@freebsd.org Mon Dec 19 09:38:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF7DC8655B; Mon, 19 Dec 2016 09:38:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ED44010C3; Mon, 19 Dec 2016 09:38:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJ9cZg2082559; Mon, 19 Dec 2016 09:38:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJ9cZBx082557; Mon, 19 Dec 2016 09:38:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612190938.uBJ9cZBx082557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Dec 2016 09:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310244 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 09:38:36 -0000 Author: hselasky Date: Mon Dec 19 09:38:34 2016 New Revision: 310244 URL: https://svnweb.freebsd.org/changeset/base/310244 Log: MFC r309406: Remove useless NULL checks. NULL is not returned when allocating memory passing the M_WAITOK flag. Submitted by: trasz @ Differential Revision: https://reviews.freebsd.org/D5772 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Mon Dec 19 09:32:29 2016 (r310243) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Mon Dec 19 09:38:34 2016 (r310244) @@ -854,8 +854,6 @@ mlx5e_create_main_flow_table(struct mlx5 u8 *dmac; g = malloc(9 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 2; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; @@ -939,8 +937,6 @@ mlx5e_create_vlan_flow_table(struct mlx5 struct mlx5_flow_table_group *g; g = malloc(2 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 12; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 19 09:32:29 2016 (r310243) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 19 09:38:34 2016 (r310244) @@ -651,10 +651,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, wq_sz = mlx5_wq_ll_get_size(&rq->wq); rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (rq->mbuf == NULL) { - err = -ENOMEM; - goto err_rq_wq_destroy; - } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; @@ -903,8 +899,6 @@ mlx5e_alloc_sq_db(struct mlx5e_sq *sq) int x; sq->mbuf = malloc(wq_sz * sizeof(sq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (sq->mbuf == NULL) - return (-ENOMEM); /* Create DMA descriptor MAPs */ for (x = 0; x != wq_sz; x++) { @@ -1492,9 +1486,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); - if (c == NULL) - return (-ENOMEM); - c->priv = priv; c->ix = ix; c->cpu = 0; @@ -1705,8 +1696,6 @@ mlx5e_open_channels(struct mlx5e_priv *p priv->channel = malloc(priv->params.num_channels * sizeof(struct mlx5e_channel *), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv->channel == NULL) - return (-ENOMEM); mlx5e_build_channel_param(priv, &cparam); for (i = 0; i < priv->params.num_channels; i++) { @@ -2885,10 +2874,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *m return (NULL); } priv = malloc(sizeof(*priv), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv == NULL) { - mlx5_core_err(mdev, "malloc() failed\n"); - return (NULL); - } mlx5e_priv_mtx_init(priv); ifp = priv->ifp = if_alloc(IFT_ETHER); From owner-svn-src-stable-10@freebsd.org Mon Dec 19 09:45:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00CD9C86ACF; Mon, 19 Dec 2016 09:45:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C3F8D309; Mon, 19 Dec 2016 09:45:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJ9jNWt086588; Mon, 19 Dec 2016 09:45:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJ9jNZ5086587; Mon, 19 Dec 2016 09:45:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612190945.uBJ9jNZ5086587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Dec 2016 09:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310249 - stable/10/sys/netgraph X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 09:45:25 -0000 Author: hselasky Date: Mon Dec 19 09:45:23 2016 New Revision: 310249 URL: https://svnweb.freebsd.org/changeset/base/310249 Log: MFC r309404: Fix return value from ng_uncallout(). callout_stop() recently started returning -1 when the callout is already stopped, which is not handled by the netgraph code. Properly filter the return value. Netgraph callers only want to know if the callout was cancelled and not draining or already stopped. Discussed with: julian, glebius Modified: stable/10/sys/netgraph/ng_base.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/ng_base.c ============================================================================== --- stable/10/sys/netgraph/ng_base.c Mon Dec 19 09:44:14 2016 (r310248) +++ stable/10/sys/netgraph/ng_base.c Mon Dec 19 09:45:23 2016 (r310249) @@ -3823,7 +3823,11 @@ ng_uncallout(struct callout *c, node_p n } c->c_arg = NULL; - return (rval); + /* + * Callers only want to know if the callout was cancelled and + * not draining or stopped. + */ + return (rval > 0); } /* From owner-svn-src-stable-10@freebsd.org Mon Dec 19 09:52:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6C0C872D6; Mon, 19 Dec 2016 09:52:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 18082129C; Mon, 19 Dec 2016 09:52:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJ9qWpu091156; Mon, 19 Dec 2016 09:52:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJ9qW2A091155; Mon, 19 Dec 2016 09:52:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612190952.uBJ9qW2A091155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Dec 2016 09:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310254 - stable/10/sys/dev/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 09:52:33 -0000 Author: hselasky Date: Mon Dec 19 09:52:32 2016 New Revision: 310254 URL: https://svnweb.freebsd.org/changeset/base/310254 Log: MFC r309400: Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb Modified: stable/10/sys/dev/acpica/acpi_ec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_ec.c Mon Dec 19 09:51:17 2016 (r310253) +++ stable/10/sys/dev/acpica/acpi_ec.c Mon Dec 19 09:52:32 2016 (r310254) @@ -618,16 +618,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, } static void -EcGpeQueryHandler(void *Context) +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) { - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); @@ -652,7 +650,6 @@ EcGpeQueryHandler(void *Context) EC_EVENT_INPUT_BUFFER_EMPTY))) break; } - sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); device_printf(sc->ec_dev, "GPE query failed: %s\n", @@ -683,6 +680,29 @@ EcGpeQueryHandler(void *Context) } } +static void +EcGpeQueryHandler(void *Context) +{ + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; + int pending; + + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + + do { + /* Read the current pending count */ + pending = atomic_load_acq_int(&sc->ec_sci_pend); + + /* Call GPE handler function */ + EcGpeQueryHandlerSub(sc); + + /* + * Try to reset the pending count to zero. If this fails we + * know another GPE event has occurred while handling the + * current GPE event and need to loop. + */ + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); +} + /* * The GPE handler is called when IBE/OBF or SCI events occur. We are * called from an unknown lock context. @@ -711,13 +731,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT * It will run the query and _Qxx method later, under the lock. */ EcStatus = EC_GET_CSR(sc); - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { + if ((EcStatus & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) - sc->ec_sci_pend = TRUE; - else + if (ACPI_FAILURE(Status)) { printf("EcGpeHandler: queuing GPE query handler failed\n"); + atomic_store_rel_int(&sc->ec_sci_pend, 0); + } } return (ACPI_REENABLE_GPE); } @@ -764,7 +785,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec running gpe handler directly"); EcGpeQueryHandler(sc); } From owner-svn-src-stable-10@freebsd.org Mon Dec 19 13:14:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C532AC87776; Mon, 19 Dec 2016 13:14:40 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6187D6CB; Mon, 19 Dec 2016 13:14:40 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJDEdMq074996; Mon, 19 Dec 2016 13:14:39 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJDEdM2074992; Mon, 19 Dec 2016 13:14:39 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201612191314.uBJDEdM2074992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Mon, 19 Dec 2016 13:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310264 - stable/10/sys/dev/mrsas X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 13:14:40 -0000 Author: kadesai Date: Mon Dec 19 13:14:39 2016 New Revision: 310264 URL: https://svnweb.freebsd.org/changeset/base/310264 Log: MFC r309284-r309294 r309294 This patch upgrades driver version to 06.712.04.00-fbsd r309293 This patch will add code to refire IOCTL commands after OCR. r309292 This patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the SYNCHRONIZE_CACHE command at driver instead of passing it to firmware for all Gen3 controllers. r309291 Wait for AEN task to be completed(if in queue) before resetting the controller and return without processing event in AEN thread, if controller reset is in progress. r309290 This patch will add task management support in driver. Below is high level description: If a SCSI IO times out, then before initiating OCR, now the driver will try to send a target reset to the particular target for which the IO is timed out. If that also fails, then the driver will initiate OCR. r309289 Process outstanding reply descriptors from all the reply descriptor post queues before initiating OCR. r309288 Clean up reference to AEN command if abort AEN is succesful as the command is aborted. Did the same by setting sc->aen_cmd = NULL when aborting AEN is successful. r309287 Update controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED recieved. r309286 Add sanity check in IO and IOCTL path not to process command further if controller is in HW_CRITICAL_ERROR. r309285 Use a variable to indicate Gen3 controllers and remove all PCI ids based checks used for gen3 controllers. r309284 High level description of new solution - Free MFI and MPT command from same context. Free both the command either from process (from where mfi-mpt pass-through was called) or from ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which will do MFI/MPT list. Modified: stable/10/sys/dev/mrsas/mrsas.c stable/10/sys/dev/mrsas/mrsas.h stable/10/sys/dev/mrsas/mrsas_cam.c stable/10/sys/dev/mrsas/mrsas_fp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.c Mon Dec 19 12:27:01 2016 (r310263) +++ stable/10/sys/dev/mrsas/mrsas.c Mon Dec 19 13:14:39 2016 (r310264) @@ -110,6 +110,7 @@ int mrsas_issue_polled(struct mrsas_soft int mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason); int mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason); int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +int mrsas_reset_targets(struct mrsas_softc *sc); int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); @@ -153,7 +154,6 @@ extern void mrsas_cam_detach(struct mrsa extern void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); extern void mrsas_free_frame(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); extern int mrsas_alloc_mfi_cmds(struct mrsas_softc *sc); -extern void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); extern struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); extern int mrsas_passthru(struct mrsas_softc *sc, void *arg, u_long ioctlCmd); extern uint8_t MR_ValidateMapInfo(struct mrsas_softc *sc); @@ -307,28 +307,11 @@ mrsas_enable_intr(struct mrsas_softc *sc static int mrsas_clear_intr(struct mrsas_softc *sc) { - u_int32_t status, fw_status, fw_state; + u_int32_t status; /* Read received interrupt */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - /* - * If FW state change interrupt is received, write to it again to - * clear - */ - if (status & MRSAS_FW_STATE_CHNG_INTERRUPT) { - fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, - outbound_scratch_pad)); - fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT) { - device_printf(sc->mrsas_dev, "FW is in FAULT state!\n"); - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); - } - mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), status); - mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - return (1); - } /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) return (0); @@ -449,6 +432,11 @@ mrsas_setup_sysctl(struct mrsas_softc *s OID_AUTO, "reset_in_progress", CTLFLAG_RD, &sc->reset_in_progress, 0, "ocr in progress status"); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "block_sync_cache", CTLFLAG_RW, + &sc->block_sync_cache, 0, + "Block SYNC CACHE at driver. "); + } /* @@ -468,6 +456,7 @@ mrsas_get_tunables(struct mrsas_softc *s sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; + sc->block_sync_cache = 0; /* * Grab the global variables. @@ -674,16 +663,15 @@ mrsas_register_aen(struct mrsas_softc *s sc->aen_cmd); if (ret_val) { - printf("mrsas: Failed to abort " - "previous AEN command\n"); + printf("mrsas: Failed to abort previous AEN command\n"); return ret_val; - } + } else + sc->aen_cmd = NULL; } } cmd = mrsas_get_mfi_cmd(sc); - if (!cmd) - return -ENOMEM; + return ENOMEM; dcmd = &cmd->frame->dcmd; @@ -835,6 +823,15 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { + sc->mrsas_gen3_ctrl = 1; + } + mrsas_get_tunables(sc); /* @@ -875,6 +872,7 @@ mrsas_attach(device_t dev) TAILQ_INIT(&sc->mrsas_mfi_cmd_list_head); mrsas_atomic_set(&sc->fw_outstanding, 0); + mrsas_atomic_set(&sc->target_reset_outstanding, 0); sc->io_cmds_highwater = 0; @@ -953,8 +951,7 @@ mrsas_ich_startup(void *arg) /* * Intialize a counting Semaphore to take care no. of concurrent IOCTLs */ - sema_init(&sc->ioctl_count_sema, - MRSAS_MAX_MFI_CMDS - 5, + sema_init(&sc->ioctl_count_sema, MRSAS_MAX_IOCTL_CMDS, IOCTL_SEMA_DESCRIPTION); /* Create a /dev entry for mrsas controller. */ @@ -1070,7 +1067,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->raidmap_lock); /* Wait for all the semaphores to be released */ - while (sema_value(&sc->ioctl_count_sema) != (MRSAS_MAX_MFI_CMDS - 5)) + while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) pause("mr_shutdown", hz); /* Destroy the counting semaphore created for Ioctl */ @@ -1353,9 +1350,11 @@ mrsas_ioctl(struct cdev *dev, u_long cmd if (!sc) return ENOENT; - if (sc->remove_in_progress) { + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { mrsas_dprint(sc, MRSAS_INFO, - "Driver remove or shutdown called.\n"); + "Either driver remove or shutdown called or " + "HW is in unrecoverable critical error state.\n"); return ENOENT; } mtx_lock_spin(&sc->ioctl_lock); @@ -1547,7 +1546,10 @@ mrsas_complete_cmd(struct mrsas_softc *s PLD_LOAD_BALANCE_INFO lbinfo; u_int32_t device_id; int threshold_reply_count = 0; - +#if TM_DEBUG + MR_TASK_MANAGE_REQUEST *mr_tm_req; + MPI2_SCSI_TASK_MANAGE_REQUEST *mpi_tm_req; +#endif /* If we have a hardware error, not need to continue */ if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) @@ -1574,6 +1576,16 @@ mrsas_complete_cmd(struct mrsas_softc *s extStatus = scsi_io_req->RaidContext.exStatus; switch (scsi_io_req->Function) { + case MPI2_FUNCTION_SCSI_TASK_MGMT: +#if TM_DEBUG + mr_tm_req = (MR_TASK_MANAGE_REQUEST *) cmd_mpt->io_request; + mpi_tm_req = (MPI2_SCSI_TASK_MANAGE_REQUEST *) + &mr_tm_req->TmRequest; + device_printf(sc->mrsas_dev, "TM completion type 0x%X, " + "TaskMID: 0x%X", mpi_tm_req->TaskType, mpi_tm_req->TaskMID); +#endif + wakeup_one((void *)&sc->ocr_chan); + break; case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; @@ -1591,9 +1603,16 @@ mrsas_complete_cmd(struct mrsas_softc *s break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; - mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); - cmd_mpt->flags = 0; - mrsas_release_mpt_cmd(cmd_mpt); + /* + * Make sure NOT TO release the mfi command from the called + * function's context if it is fired with issue_polled call. + * And also make sure that the issue_polled call should only be + * used if INTERRUPT IS DISABLED. + */ + if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + mrsas_release_mfi_cmd(cmd_mfi); + else + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); break; } @@ -1628,12 +1647,7 @@ mrsas_complete_cmd(struct mrsas_softc *s */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1654,12 +1668,7 @@ mrsas_complete_cmd(struct mrsas_softc *s /* Clear response interrupt */ if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2434,12 +2443,21 @@ mrsas_ioc_init(struct mrsas_softc *sc) u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; + u_int32_t scratch_pad_2; /* Allocate memory for the IOC INIT command */ if (mrsas_alloc_ioc_cmd(sc)) { device_printf(sc->mrsas_dev, "Cannot allocate IOC command.\n"); return (1); } + + if (!sc->block_sync_cache) { + scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->fw_sync_cache_support = (scratch_pad_2 & + MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; + } + IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; @@ -2457,12 +2475,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -2584,7 +2597,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; - callout_init(&cmd->cm_callout, 0); + callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; cmd->io_request = (MRSAS_RAID_SCSI_IO_REQUEST *) (io_req_base + offset); @@ -2779,6 +2792,7 @@ mrsas_ocr_thread(void *arg) { struct mrsas_softc *sc; u_int32_t fw_status, fw_state; + u_int8_t tm_target_reset_failed = 0; sc = (struct mrsas_softc *)arg; @@ -2801,20 +2815,66 @@ mrsas_ocr_thread(void *arg) fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset) { - device_printf(sc->mrsas_dev, "%s started due to %s!\n", - sc->disableOnlineCtrlReset ? "Kill Adapter" : "OCR", - sc->do_timedout_reset ? "IO Timeout" : - "FW fault detected"); - mtx_lock_spin(&sc->ioctl_lock); - sc->reset_in_progress = 1; - sc->reset_count++; - mtx_unlock_spin(&sc->ioctl_lock); + if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || + mrsas_atomic_read(&sc->target_reset_outstanding)) { + + /* First, freeze further IOs to come to the SIM */ mrsas_xpt_freeze(sc); - mrsas_reset_ctrl(sc, sc->do_timedout_reset); - mrsas_xpt_release(sc); - sc->reset_in_progress = 0; - sc->do_timedout_reset = 0; + + /* If this is an IO timeout then go for target reset */ + if (mrsas_atomic_read(&sc->target_reset_outstanding)) { + device_printf(sc->mrsas_dev, "Initiating Target RESET " + "because of SCSI IO timeout!\n"); + + /* Let the remaining IOs to complete */ + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, + "mrsas_reset_targets", 5 * hz); + + /* Try to reset the target device */ + if (mrsas_reset_targets(sc) == FAIL) + tm_target_reset_failed = 1; + } + + /* If this is a DCMD timeout or FW fault, + * then go for controller reset + */ + if (fw_state == MFI_STATE_FAULT || tm_target_reset_failed || + (sc->do_timedout_reset == MFI_DCMD_TIMEOUT_OCR)) { + if (tm_target_reset_failed) + device_printf(sc->mrsas_dev, "Initiaiting OCR because of " + "TM FAILURE!\n"); + else + device_printf(sc->mrsas_dev, "Initiaiting OCR " + "because of %s!\n", sc->do_timedout_reset ? + "DCMD IO Timeout" : "FW fault"); + + mtx_lock_spin(&sc->ioctl_lock); + sc->reset_in_progress = 1; + mtx_unlock_spin(&sc->ioctl_lock); + sc->reset_count++; + + /* + * Wait for the AEN task to be completed if it is running. + */ + mtx_unlock(&sc->sim_lock); + taskqueue_drain(sc->ev_tq, &sc->ev_task); + mtx_lock(&sc->sim_lock); + + taskqueue_block(sc->ev_tq); + /* Try to reset the controller */ + mrsas_reset_ctrl(sc, sc->do_timedout_reset); + + sc->do_timedout_reset = 0; + sc->reset_in_progress = 0; + tm_target_reset_failed = 0; + mrsas_atomic_set(&sc->target_reset_outstanding, 0); + memset(sc->target_reset_pool, 0, + sizeof(sc->target_reset_pool)); + taskqueue_unblock(sc->ev_tq); + } + + /* Now allow IOs to come to the SIM */ + mrsas_xpt_release(sc); } } mtx_unlock(&sc->sim_lock); @@ -2866,6 +2926,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; union mrsas_evt_class_locale class_locale; + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) { device_printf(sc->mrsas_dev, @@ -2993,13 +3054,25 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, mpt_cmd = sc->mpt_cmd_list[j]; if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; - mrsas_release_mfi_cmd(mfi_cmd); - mrsas_release_mpt_cmd(mpt_cmd); + /* If not an IOCTL then release the command else re-fire */ + if (!mfi_cmd->sync_cmd) { + mrsas_release_mfi_cmd(mfi_cmd); + } else { + req_desc = mrsas_get_request_desc(sc, + mfi_cmd->cmd_id.context.smid - 1); + mrsas_dprint(sc, MRSAS_OCR, + "Re-fire command DCMD opcode 0x%x index %d\n ", + mfi_cmd->frame->dcmd.opcode, j); + if (!req_desc) + device_printf(sc->mrsas_dev, + "Cannot build MPT cmd.\n"); + else + mrsas_fire_cmd(sc, req_desc->addr.u.low, + req_desc->addr.u.high); + } } } - sc->aen_cmd = NULL; - /* Reset load balance info */ memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); @@ -3014,17 +3087,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, megasas_setup_jbod_map(sc); - memset(sc->pd_list, 0, - MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - if (mrsas_get_pd_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get PD list failed from OCR.\n" - "Will get the latest PD LIST after OCR on event.\n"); - } - memset(sc->ld_ids, 0xff, MRSAS_MAX_LD_IDS); - if (mrsas_get_ld_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get LD lsit failed from OCR.\n" - "Will get the latest LD LIST after OCR on event.\n"); - } mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -3034,6 +3096,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, class_locale.members.locale = MR_EVT_LOCALE_ALL; class_locale.members.class = MR_EVT_CLASS_DEBUG; + mtx_unlock(&sc->sim_lock); if (mrsas_register_aen(sc, sc->last_seq_num, class_locale.word)) { device_printf(sc->mrsas_dev, @@ -3043,6 +3106,8 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, "or the controller does not support AEN.\n" "Please contact to the SUPPORT TEAM if the problem persists\n"); } + mtx_lock(&sc->sim_lock); + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; @@ -3139,6 +3204,11 @@ mrsas_wait_for_outstanding(struct mrsas_ if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, "Found FW in FAULT state, will reset adapter.\n"); + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); retval = 1; goto out; } @@ -3156,8 +3226,10 @@ mrsas_wait_for_outstanding(struct mrsas_ mrsas_dprint(sc, MRSAS_OCR, "[%2d]waiting for %d " "commands to complete\n", i, outstanding); count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); } DELAY(1000 * 1000); } @@ -3176,17 +3248,33 @@ out: * mrsas_release_mfi_cmd: Return a cmd to free command pool * input: Command packet for return to free cmd pool * - * This function returns the MFI command to the command list. + * This function returns the MFI & MPT command to the command list. */ void -mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd) +mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd_mfi) { - struct mrsas_softc *sc = cmd->sc; + struct mrsas_softc *sc = cmd_mfi->sc; + struct mrsas_mpt_cmd *cmd_mpt; + mtx_lock(&sc->mfi_cmd_pool_lock); - cmd->ccb_ptr = NULL; - cmd->cmd_id.frame_count = 0; - TAILQ_INSERT_TAIL(&(sc->mrsas_mfi_cmd_list_head), cmd, next); + /* + * Release the mpt command (if at all it is allocated + * associated with the mfi command + */ + if (cmd_mfi->cmd_id.context.smid) { + mtx_lock(&sc->mpt_cmd_pool_lock); + /* Get the mpt cmd from mfi cmd frame's smid value */ + cmd_mpt = sc->mpt_cmd_list[cmd_mfi->cmd_id.context.smid-1]; + cmd_mpt->flags = 0; + cmd_mpt->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; + TAILQ_INSERT_HEAD(&(sc->mrsas_mpt_cmd_list_head), cmd_mpt, next); + mtx_unlock(&sc->mpt_cmd_pool_lock); + } + /* Release the mfi command */ + cmd_mfi->ccb_ptr = NULL; + cmd_mfi->cmd_id.frame_count = 0; + TAILQ_INSERT_HEAD(&(sc->mrsas_mfi_cmd_list_head), cmd_mfi, next); mtx_unlock(&sc->mfi_cmd_pool_lock); return; @@ -3235,7 +3323,11 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; else @@ -3246,13 +3338,16 @@ mrsas_get_ctrl_info(struct mrsas_softc * sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->disableOnlineCtrlReset = + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; dcmd_timeout: mrsas_free_ctlr_info_cmd(sc); if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); @@ -3495,12 +3590,7 @@ mrsas_build_mptmfi_passthru(struct mrsas io_req = mpt_cmd->io_request; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -3868,8 +3958,6 @@ megasas_sync_pd_seq_num(struct mrsas_sof dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3946,8 +4034,6 @@ mrsas_get_ld_map_info(struct mrsas_softc retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3974,9 +4060,8 @@ mrsas_sync_map_info(struct mrsas_softc * cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { - device_printf(sc->mrsas_dev, - "Cannot alloc for sync map info cmd\n"); - return 1; + device_printf(sc->mrsas_dev, "Cannot alloc for sync map info cmd\n"); + return ENOMEM; } map = sc->ld_drv_map[sc->map_id & 1]; num_lds = map->raidMap.ldCount; @@ -4076,7 +4161,11 @@ mrsas_get_pd_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4107,7 +4196,8 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); @@ -4169,7 +4259,11 @@ mrsas_get_ld_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); dcmd->pad_0 = 0; - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4195,7 +4289,7 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); @@ -4359,6 +4453,11 @@ mrsas_aen_handler(struct mrsas_softc *sc printf("invalid instance!\n"); return; } + if (sc->remove_in_progress || sc->reset_in_progress) { + device_printf(sc->mrsas_dev, "Returning from %s, line no %d\n", + __func__, __LINE__); + return; + } if (sc->evt_detail_mem) { switch (sc->evt_detail_mem->code) { case MR_EVT_PD_INSERTED: @@ -4367,7 +4466,6 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_PD_REMOVED: fail_aen = mrsas_get_pd_list(sc); @@ -4375,13 +4473,11 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_LD_OFFLINE: case MR_EVT_CFG_CLEARED: case MR_EVT_LD_DELETED: mrsas_bus_scan_sim(sc, sc->sim_0); - doscan = 0; break; case MR_EVT_LD_CREATED: fail_aen = mrsas_get_ld_list(sc); @@ -4389,15 +4485,18 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_0); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED: case MR_EVT_FOREIGN_CFG_IMPORTED: case MR_EVT_LD_STATE_CHANGE: doscan = 1; break; + case MR_EVT_CTRL_PROP_CHANGED: + fail_aen = mrsas_get_ctrl_info(sc); + if (fail_aen) + goto skip_register_aen; + break; default: - doscan = 0; break; } } else { @@ -4473,8 +4572,7 @@ mrsas_complete_aen(struct mrsas_softc *s sc->aen_cmd = NULL; mrsas_release_mfi_cmd(cmd); - if (!sc->remove_in_progress) - taskqueue_enqueue(sc->ev_tq, &sc->ev_task); + taskqueue_enqueue(sc->ev_tq, &sc->ev_task); return; } Modified: stable/10/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/10/sys/dev/mrsas/mrsas.h Mon Dec 19 12:27:01 2016 (r310263) +++ stable/10/sys/dev/mrsas/mrsas.h Mon Dec 19 13:14:39 2016 (r310264) @@ -106,7 +106,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.709.07.00-fbsd" +#define MRSAS_VERSION "06.712.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 @@ -205,7 +205,9 @@ typedef struct _RAID_CONTEXT { #define MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD (0x0100) #define MPI2_SCSIIO_EEDPFLAGS_INSERT_OP (0x0004) #define MPI2_FUNCTION_SCSI_IO_REQUEST (0x00) /* SCSI IO */ -#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) +#define MPI2_FUNCTION_SCSI_TASK_MGMT (0x01) +#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x03) +#define MPI2_REQ_DESCRIPT_FLAGS_FP_IO (0x06) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_SGE_FLAGS_64_BIT_ADDRESSING (0x02) #define MPI2_SCSIIO_CONTROL_WRITE (0x01000000) @@ -314,6 +316,91 @@ typedef union { } MPI2_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI2_SCSI_IO_CDB_UNION, Mpi2ScsiIoCdb_t, MPI2_POINTER pMpi2ScsiIoCdb_t; +/**************************************************************************** + * * SCSI Task Management messages + * ****************************************************************************/ + +/*SCSI Task Management Request Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST { + u_int16_t DevHandle; /*0x00 */ + u_int8_t ChainOffset; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t Reserved1; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved2; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved3; /*0x0A */ + u_int8_t LUN[8]; /*0x0C */ + u_int32_t Reserved4[7]; /*0x14 */ + u_int16_t TaskMID; /*0x30 */ + u_int16_t Reserved5; /*0x32 */ +} MPI2_SCSI_TASK_MANAGE_REQUEST; + +/*SCSI Task Management Reply Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY { + u_int16_t DevHandle; /*0x00 */ + u_int8_t MsgLength; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t ResponseCode; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved1; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved2; /*0x0A */ + u_int16_t Reserved3; /*0x0C */ + u_int16_t IOCStatus; /*0x0E */ + u_int32_t IOCLogInfo; /*0x10 */ + u_int32_t TerminationCount; /*0x14 */ + u_int32_t ResponseInfo; /*0x18 */ +} MPI2_SCSI_TASK_MANAGE_REPLY; + +typedef struct _MR_TM_REQUEST { + char request[128]; +} MR_TM_REQUEST; + +typedef struct _MR_TM_REPLY { + char reply[128]; +} MR_TM_REPLY; + +/* SCSI Task Management Request Message */ +typedef struct _MR_TASK_MANAGE_REQUEST { + /*To be type casted to struct MPI2_SCSI_TASK_MANAGE_REQUEST */ + MR_TM_REQUEST TmRequest; + union { + struct { + u_int32_t isTMForLD:1; + u_int32_t isTMForPD:1; + u_int32_t reserved1:30; + u_int32_t reserved2; + } tmReqFlags; + MR_TM_REPLY TMReply; + } uTmReqReply; +} MR_TASK_MANAGE_REQUEST; + +/* TaskType values */ +#define MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) +#define MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) +#define MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) +#define MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) +#define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT (0x0A) + +/* ResponseCode values */ +#define MPI2_SCSITASKMGMT_RSP_TM_COMPLETE (0x00) +#define MPI2_SCSITASKMGMT_RSP_INVALID_FRAME (0x02) +#define MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04) +#define MPI2_SCSITASKMGMT_RSP_TM_FAILED (0x05) +#define MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08) +#define MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09) +#define MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG (0x0A) +#define MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80) + /* * RAID SCSI IO Request Message Total SGE count will be one less than * _MPI2_SCSI_IO_REQUEST @@ -584,7 +671,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define MAX_RAIDMAP_PHYSICAL_DEVICES (MAX_PHYSICAL_DEVICES) #define MR_DCMD_LD_MAP_GET_INFO 0x0300e101 #define MR_DCMD_SYSTEM_PD_MAP_GET_INFO 0x0200e102 - +#define MR_DCMD_PD_MFI_TASK_MGMT 0x0200e100 #define MRSAS_MAX_PD_CHANNELS 1 #define MRSAS_MAX_LD_CHANNELS 1 @@ -599,7 +686,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define VD_EXT_DEBUG 0 - +#define TM_DEBUG 1 /******************************************************************* * RAID map related structures @@ -659,7 +746,8 @@ typedef struct _MR_LD_RAID { u_int32_t fpWriteAcrossStripe:1; u_int32_t fpReadAcrossStripe:1; u_int32_t fpNonRWCapable:1; - u_int32_t reserved4:7; + u_int32_t tmCapable:1; + u_int32_t reserved4:6; } capability; u_int32_t reserved6; u_int64_t size; @@ -876,7 +964,11 @@ struct IO_REQUEST_INFO { struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; - u_int8_t reserved[4]; + struct { + u_int8_t tmCapable:1; + u_int8_t reserved:7; + } capability; + u_int8_t reserved[3]; } __packed; struct MR_PD_CFG_SEQ_NUM_SYNC { @@ -1242,7 +1334,6 @@ enum MR_EVT_ARGS { MR_EVT_ARGS_GENERIC, }; - /* * Thunderbolt (and later) Defines */ @@ -1256,7 +1347,8 @@ enum MR_EVT_ARGS { #define HOST_DIAG_WRITE_ENABLE 0x80 #define HOST_DIAG_RESET_ADAPTER 0x4 #define MRSAS_TBOLT_MAX_RESET_TRIES 3 -#define MRSAS_MAX_MFI_CMDS 32 +#define MRSAS_MAX_MFI_CMDS 16 +#define MRSAS_MAX_IOCTL_CMDS 3 /* * Invader Defines @@ -1395,6 +1487,7 @@ struct mrsas_mpt_cmd { union ccb *ccb_ptr; struct callout cm_callout; struct mrsas_softc *sc; + boolean_t tmCapable; TAILQ_ENTRY(mrsas_mpt_cmd) next; }; @@ -1448,6 +1541,7 @@ enum MR_PD_QUERY_TYPE { #define MR_EVT_LD_DELETED 0x008b #define MR_EVT_FOREIGN_CFG_IMPORTED 0x00db #define MR_EVT_LD_OFFLINE 0x00fc +#define MR_EVT_CTRL_PROP_CHANGED 0x012f #define MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED 0x0152 enum MR_PD_STATE { @@ -1990,6 +2084,11 @@ struct mrsas_ctrl_info { #define MR_MAX_MSIX_REG_ARRAY 16 /* + * SYNC CACHE offset define + */ +#define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 + +/* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a * lower number to the mid layer because it can issue a few internal commands @@ -2470,8 +2569,7 @@ struct mrsas_irq_context { enum MEGASAS_OCR_REASON { FW_FAULT_OCR = 0, - SCSIIO_TIMEOUT_OCR = 1, - MFI_DCMD_TIMEOUT_OCR = 2, + MFI_DCMD_TIMEOUT_OCR = 1, }; /* Controller management info added to support Linux Emulator */ @@ -2746,6 +2844,11 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + u_int32_t block_sync_cache; + u_int8_t fw_sync_cache_support; + mrsas_atomic_t target_reset_outstanding; +#define MRSAS_MAX_TM_TARGETS (MRSAS_MAX_PD + MRSAS_MAX_LD_IDS) + struct mrsas_mpt_cmd *target_reset_pool[MRSAS_MAX_TM_TARGETS]; bus_dma_tag_t jbodmap_tag[2]; bus_dmamap_t jbodmap_dmamap[2]; @@ -2794,6 +2897,7 @@ struct mrsas_softc { LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t mrsas_gen3_ctrl; u_int8_t secure_jbod_support; u_int8_t use_seqnum_jbod_fp; u_int8_t max256vdSupport; Modified: stable/10/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/10/sys/dev/mrsas/mrsas_cam.c Mon Dec 19 12:27:01 2016 (r310263) +++ stable/10/sys/dev/mrsas/mrsas_cam.c Mon Dec 19 13:14:39 2016 (r310264) @@ -95,6 +95,11 @@ static void mrsas_freeze_simq(struct mrs static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); +static int mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t id, u_int32_t bus_id); +static void mrsas_tm_response_code(struct mrsas_softc *sc, + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply); +static int mrsas_issue_tm(struct mrsas_softc *sc, + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc); static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); @@ -105,6 +110,10 @@ struct mrsas_mpt_cmd *mrsas_get_mpt_cmd( MRSAS_REQUEST_DESCRIPTOR_UNION * mrsas_get_request_desc(struct mrsas_softc *sc, u_int16_t index); +extern void +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, + u_int8_t extStatus); +extern int mrsas_reset_targets(struct mrsas_softc *sc); extern u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); extern u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map, @@ -125,6 +134,9 @@ extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); extern int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +extern MR_LD_RAID *MR_LdRaidGet(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); +extern void mrsas_disable_intr(struct mrsas_softc *sc); +extern void mrsas_enable_intr(struct mrsas_softc *sc); /* @@ -260,6 +272,17 @@ mrsas_action(struct cam_sim *sim, union struct ccb_hdr *ccb_h = &(ccb->ccb_h); u_int32_t device_id; + /* + * Check if the system going down + * or the adapter is in unrecoverable critical error + */ + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + xpt_done(ccb); + return; + } + switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { @@ -375,6 +398,10 @@ mrsas_scsiio_timeout(void *data) { struct mrsas_mpt_cmd *cmd; struct mrsas_softc *sc; + u_int32_t target_id; + + if (!data) + return; cmd = (struct mrsas_mpt_cmd *)data; sc = cmd->sc; @@ -383,6 +410,7 @@ mrsas_scsiio_timeout(void *data) printf("command timeout with NULL ccb\n"); return; } + /* * Below callout is dummy entry so that it will be cancelled from * mrsas_cmd_done(). Now Controller will go to OCR/Kill Adapter based @@ -390,15 +418,25 @@ mrsas_scsiio_timeout(void *data) * context. */ #if (__FreeBSD_version >= 1000510) - callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0, mrsas_scsiio_timeout, cmd, 0); #else - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + callout_reset(&cmd->cm_callout, (180000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif - sc->do_timedout_reset = SCSIIO_TIMEOUT_OCR; - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); + + if (cmd->ccb_ptr->cpi.bus_id == 0) + target_id = cmd->ccb_ptr->ccb_h.target_id; + else + target_id = (cmd->ccb_ptr->ccb_h.target_id + (MRSAS_MAX_PD - 1)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Dec 19 17:02:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73E3C884CB; Mon, 19 Dec 2016 17:02:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8D3106C; Mon, 19 Dec 2016 17:02:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D6B4E10A761; Mon, 19 Dec 2016 12:02:24 -0500 (EST) From: John Baldwin To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r308371 - in stable/10: share/man/man4 sys/conf sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts Date: Mon, 19 Dec 2016 08:55:26 -0800 Message-ID: <2547422.gn4y6NaJ31@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <912ba7fd-353c-006e-ef65-faa12b83de9f@FreeBSD.org> References: <201611061356.uA6DuYcO079294@repo.freebsd.org> <1625245.4edrXav981@ralph.baldwin.cx> <912ba7fd-353c-006e-ef65-faa12b83de9f@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 19 Dec 2016 12:02:24 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 17:02:33 -0000 On Wednesday, December 14, 2016 05:41:47 PM Andriy Gapon wrote: > On 05/12/2016 23:49, John Baldwin wrote: > > On Sunday, November 06, 2016 01:56:34 PM Andriy Gapon wrote: > >> Author: avg > >> Date: Sun Nov 6 13:56:34 2016 > >> New Revision: 308371 > >> URL: https://svnweb.freebsd.org/changeset/base/308371 > >> > >> Log: > >> MFC r307768: jedec_ts: a driver for thermal sensors on memory modules > >> > >> Added: > >> stable/10/share/man/man4/jedec_ts.4 > >> - copied unchanged from r307768, head/share/man/man4/jedec_ts.4 > >> stable/10/sys/dev/jedec_ts/ > >> - copied from r307768, head/sys/dev/jedec_ts/ > >> stable/10/sys/modules/i2c/jedec_ts/ > >> - copied from r307768, head/sys/modules/i2c/jedec_ts/ > >> Modified: > >> stable/10/sys/conf/NOTES > >> stable/10/sys/conf/files > >> stable/10/sys/modules/i2c/Makefile > >> Directory Properties: > >> stable/10/ (props changed) > > > > FYI, this doesn't work and has broken tinderbox builds on stable/10. > > smbus_get_addr() doesn't exist on 10. It was originally a hand-rolled > > ivar wrapper that was removed in r93023 in 2002. The function prototype > > was not removed, so the compile works, but linking fails. The stale > > prototype is still present in smbconf.h in HEAD (and should be removed). > > The "real" smbus_get_addr() was added back to smbconf.h along with an > > implementation of smbus_read_ivar() in r281985. Parts of that commit > > probably need to be MFC'd to 10. > > > > John, > > thank you for catching this and sorry for the trouble. > Could you please check if r310062 really fixes the problem? Yes. Well, it fixes linking of kernels at least. Now make tinderbox on 10 fails for the following kernels: _.ia64.GENERIC: Maxmem is not available on ia64. It is spelled paddr_max instead. The firewire code is trying to use Maxmem. _.ia64.LINT: Same. _.arm.LINT: Many link errors and warnings, though lack of 'kbd_*' symbols seems to be the only actual errors. I suspect you recently MFC'd changes to fwohci.c that are using Maxmem. However, I'm not sure it is worth fixing fwohci on ia64. -- John Baldwin From owner-svn-src-stable-10@freebsd.org Mon Dec 19 18:26:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BD7C88F7E; Mon, 19 Dec 2016 18:26:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7761415FF; Mon, 19 Dec 2016 18:26:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJIQQRb007292; Mon, 19 Dec 2016 18:26:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJIQQXV007291; Mon, 19 Dec 2016 18:26:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612191826.uBJIQQXV007291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Dec 2016 18:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310280 - stable/10/lib/libusb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 18:26:27 -0000 Author: trasz Date: Mon Dec 19 18:26:26 2016 New Revision: 310280 URL: https://svnweb.freebsd.org/changeset/base/310280 Log: MFC r307774: Fix libusb20_dev_get_desc(3) to use the "vendor product" order, not "product vendor". This is consistent with how it's generally done. The ordering is visible eg in usbconfig(8) output. Modified: stable/10/lib/libusb/libusb20_ugen20.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libusb/libusb20_ugen20.c ============================================================================== --- stable/10/lib/libusb/libusb20_ugen20.c Mon Dec 19 17:31:34 2016 (r310279) +++ stable/10/lib/libusb/libusb20_ugen20.c Mon Dec 19 18:26:26 2016 (r310280) @@ -214,8 +214,8 @@ ugen20_enumerate(struct libusb20_device snprintf(pdev->usb_desc, sizeof(pdev->usb_desc), USB_GENERIC_NAME "%u.%u: <%s %s> at usbus%u", pdev->bus_number, - pdev->device_address, devinfo.udi_product, - devinfo.udi_vendor, pdev->bus_number); + pdev->device_address, devinfo.udi_vendor, + devinfo.udi_product, pdev->bus_number); error = 0; done: From owner-svn-src-stable-10@freebsd.org Mon Dec 19 18:27:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 476C0C88008; Mon, 19 Dec 2016 18:27:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 16A14179A; Mon, 19 Dec 2016 18:27:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJIRMBt007392; Mon, 19 Dec 2016 18:27:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJIRMNg007391; Mon, 19 Dec 2016 18:27:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612191827.uBJIRMNg007391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 19 Dec 2016 18:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310281 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 18:27:23 -0000 Author: trasz Date: Mon Dec 19 18:27:22 2016 New Revision: 310281 URL: https://svnweb.freebsd.org/changeset/base/310281 Log: MFC r307902: Make the USB attach strings in dmesg include product name. MFC after: 1 month Modified: stable/10/sys/dev/usb/usb_device.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usb_device.c ============================================================================== --- stable/10/sys/dev/usb/usb_device.c Mon Dec 19 18:26:26 2016 (r310280) +++ stable/10/sys/dev/usb/usb_device.c Mon Dec 19 18:27:22 2016 (r310281) @@ -1941,8 +1941,8 @@ config_done: udev->ugen_symlink = usb_alloc_symlink(udev->ugen_name); /* Announce device */ - printf("%s: <%s> at %s\n", udev->ugen_name, - usb_get_manufacturer(udev), + printf("%s: <%s %s> at %s\n", udev->ugen_name, + usb_get_manufacturer(udev), usb_get_product(udev), device_get_nameunit(udev->bus->bdev)); #endif @@ -2148,8 +2148,9 @@ usb_free_device(struct usb_device *udev, #if USB_HAVE_UGEN if (!rebooting) { - printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, - usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + printf("%s: <%s %s> at %s (disconnected)\n", udev->ugen_name, + usb_get_manufacturer(udev), usb_get_product(udev), + device_get_nameunit(bus->bdev)); } /* Destroy UGEN symlink, if any */ From owner-svn-src-stable-10@freebsd.org Mon Dec 19 19:39:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D5D2C874A7; Mon, 19 Dec 2016 19:39:03 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4AA5D1693; Mon, 19 Dec 2016 19:39:03 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJJd2D2036183; Mon, 19 Dec 2016 19:39:02 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJJd2Tt036182; Mon, 19 Dec 2016 19:39:02 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201612191939.uBJJd2Tt036182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Mon, 19 Dec 2016 19:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310288 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 19:39:03 -0000 Author: lifanov (ports committer) Date: Mon Dec 19 19:39:02 2016 New Revision: 310288 URL: https://svnweb.freebsd.org/changeset/base/310288 Log: MFC r310160 retain cc.4.gz man page for Chelsio T6 NICs This man page was removed in r225583 when cc.4 was renamed to mod_cc.4 With reintroduction of cc.4 "make installworld; make delete-old" was no longer convergent. Reviewed by: matthew Approved by: jhb (implicit), matthew (mentor) Differential Revision: https://reviews.freebsd.org/D8829 Modified: stable/10/ObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Mon Dec 19 19:37:55 2016 (r310287) +++ stable/10/ObsoleteFiles.inc Mon Dec 19 19:39:02 2016 (r310288) @@ -937,7 +937,6 @@ OLD_FILES+=usr/lib32/libftpio_p.a OLD_FILES+=usr/include/ftpio.h OLD_FILES+=usr/share/man/man3/ftpio.3.gz # 20110915: rename congestion control manpages -OLD_FILES+=usr/share/man/man4/cc.4.gz OLD_FILES+=usr/share/man/man9/cc.9.gz # 20110831: atomic page flags operations OLD_FILES+=usr/share/man/man9/vm_page_flag.9.gz From owner-svn-src-stable-10@freebsd.org Mon Dec 19 22:28:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63E90C887F6; Mon, 19 Dec 2016 22:28:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3E7561F29; Mon, 19 Dec 2016 22:28:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJMSSZm005661; Mon, 19 Dec 2016 22:28:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJMSSWR005660; Mon, 19 Dec 2016 22:28:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201612192228.uBJMSSWR005660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 19 Dec 2016 22:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310303 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 22:28:29 -0000 Author: rmacklem Date: Mon Dec 19 22:28:28 2016 New Revision: 310303 URL: https://svnweb.freebsd.org/changeset/base/310303 Log: MFC: r309566 Fix the NFSv4.1 server for Open reclaim after a reboot. The NFSv4.1 server failed to update the nfs-stablerestart file for a client when the client was issued its first Open. As such, recovery of Opens after a server reboot failed with NFSERR_NOGRACE. This patch fixes this. It also changes the code so that it malloc()'s the 1024 byte array instead of allocating it on the kernel stack for both NFSv4.0 and NFSv4.1. Note that this bug only affected NFSv4.1 and only when clients attempted to reclaim Opens after a server reboot. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Mon Dec 19 22:18:36 2016 (r310302) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Mon Dec 19 22:28:28 2016 (r310303) @@ -2498,6 +2498,8 @@ nfsrv_openctrl(struct nfsrv_descript *nd struct nfsclient *clp; int error = 0, haslock = 0, ret, delegate = 1, writedeleg = 1; int readonly = 0, cbret = 1, getfhret = 0; + int gotstate = 0, len = 0; + u_char *clidp = NULL; if ((new_stp->ls_flags & NFSLCK_SHAREBITS) == NFSLCK_READACCESS) readonly = 1; @@ -2516,6 +2518,7 @@ nfsrv_openctrl(struct nfsrv_descript *nd goto out; } + clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK); tryagain: MALLOC(new_lfp, struct nfslockfile *, sizeof (struct nfslockfile), M_NFSDLOCKFILE, M_WAITOK); @@ -3178,6 +3181,16 @@ tryagain: nfsrv_openpluslock++; nfsrv_delegatecnt++; } + /* + * Since NFSv4.1 never does an OpenConfirm, the first + * open state will be acquired here. + */ + if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { + clp->lc_flags |= LCL_STAMPEDSTABLE; + len = clp->lc_idlen; + NFSBCOPY(clp->lc_id, clidp, len); + gotstate = 1; + } } else { *rflagsp |= NFSV4OPEN_RESULTCONFIRM; new_stp->ls_flags = NFSLCK_NEEDSCONFIRM; @@ -3214,7 +3227,17 @@ tryagain: if (new_deleg) FREE((caddr_t)new_deleg, M_NFSDSTATE); + /* + * If the NFSv4.1 client just acquired its first open, write a timestamp + * to the stable storage file. + */ + if (gotstate != 0) { + nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p); + nfsrv_backupstable(); + } + out: + free(clidp, M_TEMP); NFSEXITCODE2(error, nd); return (error); } @@ -3231,7 +3254,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss struct nfslockfile *lfp; u_int32_t bits; int error = 0, gotstate = 0, len = 0; - u_char client[NFSV4_OPAQUELIMIT]; + u_char *clidp = NULL; /* * Check for restart conditions (client and server). @@ -3241,6 +3264,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss if (error) goto out; + clidp = malloc(NFSV4_OPAQUELIMIT, M_TEMP, M_WAITOK); NFSLOCKSTATE(); /* * Get the open structure via clientid and stateid. @@ -3319,7 +3343,7 @@ nfsrv_openupdate(vnode_t vp, struct nfss if (!(clp->lc_flags & LCL_STAMPEDSTABLE)) { clp->lc_flags |= LCL_STAMPEDSTABLE; len = clp->lc_idlen; - NFSBCOPY(clp->lc_id, client, len); + NFSBCOPY(clp->lc_id, clidp, len); gotstate = 1; } NFSUNLOCKSTATE(); @@ -3366,11 +3390,12 @@ nfsrv_openupdate(vnode_t vp, struct nfss * to the stable storage file. */ if (gotstate != 0) { - nfsrv_writestable(client, len, NFSNST_NEWSTATE, p); + nfsrv_writestable(clidp, len, NFSNST_NEWSTATE, p); nfsrv_backupstable(); } out: + free(clidp, M_TEMP); NFSEXITCODE2(error, nd); return (error); } From owner-svn-src-stable-10@freebsd.org Tue Dec 20 07:50:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD588C89BD4; Tue, 20 Dec 2016 07:50:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A57CB15CC; Tue, 20 Dec 2016 07:50:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBK7on9k040782; Tue, 20 Dec 2016 07:50:49 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBK7onvx040780; Tue, 20 Dec 2016 07:50:49 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201612200750.uBK7onvx040780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 20 Dec 2016 07:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310320 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 07:50:51 -0000 Author: ed Date: Tue Dec 20 07:50:49 2016 New Revision: 310320 URL: https://svnweb.freebsd.org/changeset/base/310320 Log: MFC r309650: Properly sign extend the result of jrand48() and mrand48(). These functions are supposed to return a value between [-2^31, 2^31). This doesn't seem to work on 64-bit systems, where we return a value between [0, 3^32). Patch up the function to use proper casts to int32_t. While there, fix some other style bugs. Modified: stable/10/lib/libc/gen/jrand48.c stable/10/lib/libc/gen/mrand48.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/jrand48.c ============================================================================== --- stable/10/lib/libc/gen/jrand48.c Tue Dec 20 07:42:15 2016 (r310319) +++ stable/10/lib/libc/gen/jrand48.c Tue Dec 20 07:50:49 2016 (r310320) @@ -14,11 +14,14 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" long jrand48(unsigned short xseed[3]) { + _dorand48(xseed); - return ((long) xseed[2] << 16) + (long) xseed[1]; + return ((int32_t)(((uint32_t)xseed[2] << 16) | (uint32_t)xseed[1])); } Modified: stable/10/lib/libc/gen/mrand48.c ============================================================================== --- stable/10/lib/libc/gen/mrand48.c Tue Dec 20 07:42:15 2016 (r310319) +++ stable/10/lib/libc/gen/mrand48.c Tue Dec 20 07:50:49 2016 (r310320) @@ -14,6 +14,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "rand48.h" extern unsigned short _rand48_seed[3]; @@ -21,6 +23,8 @@ extern unsigned short _rand48_seed[3]; long mrand48(void) { + _dorand48(_rand48_seed); - return ((long) _rand48_seed[2] << 16) + (long) _rand48_seed[1]; + return ((int32_t)(((uint32_t)_rand48_seed[2] << 16) | + (uint32_t)_rand48_seed[1])); } From owner-svn-src-stable-10@freebsd.org Tue Dec 20 08:42:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 797A9C86F93; Tue, 20 Dec 2016 08:42:48 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1D44F101A; Tue, 20 Dec 2016 08:42:48 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBK8glO0063468; Tue, 20 Dec 2016 08:42:47 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBK8gl9l063467; Tue, 20 Dec 2016 08:42:47 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201612200842.uBK8gl9l063467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 20 Dec 2016 08:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310322 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Dec 2016 08:42:48 -0000 Author: cperciva Date: Tue Dec 20 08:42:47 2016 New Revision: 310322 URL: https://svnweb.freebsd.org/changeset/base/310322 Log: MFC r308708: Reduce verbosity of warnings about truncating NFS fileids to 32-bit inode numbers. Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Dec 20 08:01:17 2016 (r310321) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Dec 20 08:42:47 2016 (r310322) @@ -827,6 +827,11 @@ nfsv4_loadattr(struct nfsrv_descript *nd struct dqblk dqb; uid_t savuid; #endif + static struct timeval last64fileid; + static size_t count64fileid; + static struct timeval last64mountfileid; + static size_t count64mountfileid; + static struct timeval warninterval = { 60, 0 }; if (compare) { retnotsup = 0; @@ -1196,8 +1201,14 @@ nfsv4_loadattr(struct nfsrv_descript *nd *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { - if (*tl++) - printf("NFSv4 fileid > 32bits\n"); + if (*tl++) { + count64fileid++; + if (ratecheck(&last64fileid, &warninterval)) { + printf("NFSv4 fileid > 32bits (%zu occurrences)\n", + count64fileid); + count64fileid = 0; + } + } nap->na_fileid = thyp; } attrsum += NFSX_HYPER; @@ -1734,8 +1745,14 @@ nfsv4_loadattr(struct nfsrv_descript *nd } } } else if (nap != NULL) { - if (*tl++) - printf("NFSv4 mounted on fileid > 32bits\n"); + if (*tl++) { + count64mountfileid++; + if (ratecheck(&last64mountfileid, &warninterval)) { + printf("NFSv4 mounted on fileid > 32bits (%zu occurrences)\n", + count64mountfileid); + count64mountfileid = 0; + } + } nap->na_mntonfileno = thyp; } attrsum += NFSX_HYPER; From owner-svn-src-stable-10@freebsd.org Wed Dec 21 11:32:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3CAC893D4; Wed, 21 Dec 2016 11:32:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D3A0415FD; Wed, 21 Dec 2016 11:32:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLBW96l019012; Wed, 21 Dec 2016 11:32:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLBW9Ud019011; Wed, 21 Dec 2016 11:32:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612211132.uBLBW9Ud019011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Dec 2016 11:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310363 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 11:32:10 -0000 Author: kib Date: Wed Dec 21 11:32:08 2016 New Revision: 310363 URL: https://svnweb.freebsd.org/changeset/base/310363 Log: MFC r310098: Provide introductory description of the default pager. Modified: stable/10/sys/vm/default_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/default_pager.c ============================================================================== --- stable/10/sys/vm/default_pager.c Wed Dec 21 09:59:55 2016 (r310362) +++ stable/10/sys/vm/default_pager.c Wed Dec 21 11:32:08 2016 (r310363) @@ -63,6 +63,16 @@ static boolean_t default_pager_haspage(v int *); /* * pagerops for OBJT_DEFAULT - "default pager". + * + * This pager handles anonymous (no handle) swap-backed memory, just + * like the swap pager. It allows several optimizations based on the + * fact that no pages of a default object can be swapped out. The + * most important optimization is in vm_fault(), where the pager is + * never asked for a non-resident page. Instead, a freshly allocated + * zeroed page is used. + * + * On the first request to page out a page from a default object, the + * object is converted to swap pager type. */ struct pagerops defaultpagerops = { .pgo_alloc = default_pager_alloc, From owner-svn-src-stable-10@freebsd.org Wed Dec 21 11:34:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F44C8956E; Wed, 21 Dec 2016 11:34:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 836851A7F; Wed, 21 Dec 2016 11:34:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLBYGKP020973; Wed, 21 Dec 2016 11:34:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLBYGXS020972; Wed, 21 Dec 2016 11:34:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612211134.uBLBYGXS020972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Dec 2016 11:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310364 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 11:34:17 -0000 Author: kib Date: Wed Dec 21 11:34:16 2016 New Revision: 310364 URL: https://svnweb.freebsd.org/changeset/base/310364 Log: MFC r310205: Fix typo. Modified: stable/10/sys/amd64/amd64/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Wed Dec 21 11:32:08 2016 (r310363) +++ stable/10/sys/amd64/amd64/trap.c Wed Dec 21 11:34:16 2016 (r310364) @@ -971,7 +971,7 @@ amd64_syscall(struct thread *td, int tra } KASSERT(PCB_USER_FPU(td->td_pcb), - ("System call %s returing with kernel FPU ctx leaked", + ("System call %s returning with kernel FPU ctx leaked", syscallname(td->td_proc, sa.code))); KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", From owner-svn-src-stable-10@freebsd.org Wed Dec 21 15:39:17 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA42C8A38E; Wed, 21 Dec 2016 15:39:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4EB95150C; Wed, 21 Dec 2016 15:39:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLFdGfH020492; Wed, 21 Dec 2016 15:39:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLFdGoW020491; Wed, 21 Dec 2016 15:39:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612211539.uBLFdGoW020491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 21 Dec 2016 15:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310369 - stable/10/contrib/binutils/bfd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 15:39:17 -0000 Author: pfg Date: Wed Dec 21 15:39:16 2016 New Revision: 310369 URL: https://svnweb.freebsd.org/changeset/base/310369 Log: MFC r310132: libbfd: make sure variables are initialized before using them. Initialize l_sec_contents to make sure that free(l_sec_contents) is called on valid pointers. Obtained from: OpenBSD (partial CVS rev 1.18) Modified: stable/10/contrib/binutils/bfd/elflink.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/10/contrib/binutils/bfd/elflink.c Wed Dec 21 15:38:28 2016 (r310368) +++ stable/10/contrib/binutils/bfd/elflink.c Wed Dec 21 15:39:16 2016 (r310369) @@ -11487,7 +11487,7 @@ _bfd_elf_section_already_linked (bfd *ab abfd, sec); else if (sec->size != 0) { - bfd_byte *sec_contents, *l_sec_contents; + bfd_byte *sec_contents, *l_sec_contents = NULL; if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents)) (*_bfd_error_handler) From owner-svn-src-stable-10@freebsd.org Wed Dec 21 23:16:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1466C8B6F7; Wed, 21 Dec 2016 23:16:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8973D130A; Wed, 21 Dec 2016 23:16:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLNGwGm009137; Wed, 21 Dec 2016 23:16:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLNGwuQ009134; Wed, 21 Dec 2016 23:16:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201612212316.uBLNGwuQ009134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 21 Dec 2016 23:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310378 - stable/10/sbin/mount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 23:16:59 -0000 Author: brooks Date: Wed Dec 21 23:16:58 2016 New Revision: 310378 URL: https://svnweb.freebsd.org/changeset/base/310378 Log: MFC r310092: Add a free_iovec() function to reset iovec's. The primary purpose is to call nmount() in a loop with new iovec's so free_iovec takes arguments by reference and resets their values. Reviewed by: cem MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 Modified: stable/10/sbin/mount/getmntopts.c stable/10/sbin/mount/mntopts.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/mount/getmntopts.c ============================================================================== --- stable/10/sbin/mount/getmntopts.c Wed Dec 21 22:53:10 2016 (r310377) +++ stable/10/sbin/mount/getmntopts.c Wed Dec 21 23:16:58 2016 (r310378) @@ -181,3 +181,17 @@ build_iovec_argf(struct iovec **iov, int va_end(ap); build_iovec(iov, iovlen, name, strdup(val), (size_t)-1); } + +/* + * Free the iovec and reset to NULL with zero length. Useful for calling + * nmount in a loop. + */ +void +free_iovec(struct iovec **iov, int *iovlen) +{ + int i; + + for (i = 0; i < *iovlen; i++) + free((*iov)[i].iov_base); + free(*iov); +} Modified: stable/10/sbin/mount/mntopts.h ============================================================================== --- stable/10/sbin/mount/mntopts.h Wed Dec 21 22:53:10 2016 (r310377) +++ stable/10/sbin/mount/mntopts.h Wed Dec 21 23:16:58 2016 (r310378) @@ -99,3 +99,4 @@ int checkpath(const char *, char resolve extern int getmnt_silent; void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len); void build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const char *fmt, ...); +void free_iovec(struct iovec **iovec, int *iovlen); From owner-svn-src-stable-10@freebsd.org Wed Dec 21 23:59:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3086C8B24D; Wed, 21 Dec 2016 23:59:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8DB6316E4; Wed, 21 Dec 2016 23:59:59 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBLNxw6h025385; Wed, 21 Dec 2016 23:59:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBLNxwdc025383; Wed, 21 Dec 2016 23:59:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201612212359.uBLNxwdc025383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 21 Dec 2016 23:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310380 - stable/10/bin/df X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 23:59:59 -0000 Author: brooks Date: Wed Dec 21 23:59:58 2016 New Revision: 310380 URL: https://svnweb.freebsd.org/changeset/base/310380 Log: MFC r310088, r310090, r310095 r310088: Put the undocumented df feature of mounting filesystems from device nodes under an ifdef. Leave enabled. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 r310090: Mount filesystems without executable permissions since they should never be used. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 r310095: Use nmount(2) rather than the obsolete mount(2). Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 Modified: stable/10/bin/df/Makefile stable/10/bin/df/df.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/df/Makefile ============================================================================== --- stable/10/bin/df/Makefile Wed Dec 21 23:54:12 2016 (r310379) +++ stable/10/bin/df/Makefile Wed Dec 21 23:59:58 2016 (r310380) @@ -9,6 +9,9 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} +CFLAGS+= -DMOUNT_CHAR_DEVS +SRCS+= getmntopts.c + DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/10/bin/df/df.c ============================================================================== --- stable/10/bin/df/df.c Wed Dec 21 23:54:12 2016 (r310379) +++ stable/10/bin/df/df.c Wed Dec 21 23:59:58 2016 (r310380) @@ -50,10 +50,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef MOUNT_CHAR_DEVS #include +#endif #include #include #include +#ifdef MOUNT_CHAR_DEVS +#include +#endif #include #include #include @@ -97,7 +102,9 @@ imax(int a, int b) static int aflag = 0, cflag, hflag, iflag, kflag, lflag = 0, nflag, Tflag; static int thousands; +#ifdef MOUNT_CHAR_DEVS static struct ufs_args mdev; +#endif int main(int argc, char *argv[]) @@ -106,11 +113,21 @@ main(int argc, char *argv[]) struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; +#ifdef MOUNT_CHAR_DEVS + struct iovec *iov = NULL; +#endif const char *fstype; - char *mntpath, *mntpt; +#ifdef MOUNT_CHAR_DEVS + char *mntpath; + char errmsg[255] = {0}; +#endif + char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; +#ifdef MOUNT_CHAR_DEVS + int iovlen = 0; +#endif fstype = "ufs"; (void)setlocale(LC_ALL, ""); @@ -215,6 +232,7 @@ main(int argc, char *argv[]) rv = 1; continue; } +#ifdef MOUNT_CHAR_DEVS } else if (S_ISCHR(stbuf.st_mode)) { if ((mntpt = getmntpt(*argv)) == NULL) { mdev.fspec = *argv; @@ -231,9 +249,23 @@ main(int argc, char *argv[]) free(mntpath); continue; } - if (mount(fstype, mntpt, MNT_RDONLY, - &mdev) != 0) { - warn("%s", *argv); + if (iov != NULL) + free_iovec(&iov, &iovlen); + build_iovec_argf(&iov, &iovlen, "fstype", "%s", + fstype); + build_iovec_argf(&iov, &iovlen, "fspath", "%s", + mntpath); + build_iovec_argf(&iov, &iovlen, "from", "%s", + *argv); + build_iovec(&iov, &iovlen, "errmsg", errmsg, + sizeof(errmsg)); + if (nmount(iov, iovlen, + MNT_RDONLY|MNT_NOEXEC) < 0) { + if (errmsg[0]) + warn("%s: %s", *argv, + errmsg); + else + warn("%s", *argv); rv = 1; (void)rmdir(mntpt); free(mntpath); @@ -252,6 +284,7 @@ main(int argc, char *argv[]) free(mntpath); continue; } +#endif } else mntpt = *argv; From owner-svn-src-stable-10@freebsd.org Fri Dec 23 09:35:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D424C8CE40; Fri, 23 Dec 2016 09:35:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 42A951C60; Fri, 23 Dec 2016 09:35:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBN9ZdH8053813; Fri, 23 Dec 2016 09:35:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBN9ZdIV053812; Fri, 23 Dec 2016 09:35:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612230935.uBN9ZdIV053812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Dec 2016 09:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310471 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 09:35:40 -0000 Author: kib Date: Fri Dec 23 09:35:39 2016 New Revision: 310471 URL: https://svnweb.freebsd.org/changeset/base/310471 Log: MFC r310159: Switch from stdatomic.h to atomic.h for kernel. Modified: stable/10/sys/kern/kern_event.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_event.c ============================================================================== --- stable/10/sys/kern/kern_event.c Fri Dec 23 09:30:34 2016 (r310470) +++ stable/10/sys/kern/kern_event.c Fri Dec 23 09:35:39 2016 (r310471) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -66,6 +65,7 @@ __FBSDID("$FreeBSD$"); #ifdef KTRACE #include #endif +#include #include @@ -184,7 +184,7 @@ static struct filterops user_filtops = { }; static uma_zone_t knote_zone; -static atomic_uint kq_ncallouts = ATOMIC_VAR_INIT(0); +static unsigned int kq_ncallouts = 0; static unsigned int kq_calloutmax = 4 * 1024; SYSCTL_UINT(_kern, OID_AUTO, kq_calloutmax, CTLFLAG_RW, &kq_calloutmax, 0, "Maximum number of callouts allocated for kqueue"); @@ -652,13 +652,11 @@ filt_timerattach(struct knote *kn) if (to < 0) return (EINVAL); - ncallouts = atomic_load_explicit(&kq_ncallouts, memory_order_relaxed); do { + ncallouts = kq_ncallouts; if (ncallouts >= kq_calloutmax) return (ENOMEM); - } while (!atomic_compare_exchange_weak_explicit(&kq_ncallouts, - &ncallouts, ncallouts + 1, memory_order_relaxed, - memory_order_relaxed)); + } while (!atomic_cmpset_int(&kq_ncallouts, ncallouts, ncallouts + 1)); kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ @@ -683,7 +681,7 @@ filt_timerdetach(struct knote *kn) callout_drain(calloutp); free(calloutp, M_KQUEUE); free(kn->kn_ptr.p_nexttime, M_KQUEUE); - old = atomic_fetch_sub_explicit(&kq_ncallouts, 1, memory_order_relaxed); + old = atomic_fetchadd_int(&kq_ncallouts, -1); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ } From owner-svn-src-stable-10@freebsd.org Fri Dec 23 09:39:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB515C8CF03; Fri, 23 Dec 2016 09:39:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BAA7C1DF7; Fri, 23 Dec 2016 09:39:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBN9dopr054001; Fri, 23 Dec 2016 09:39:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBN9doa7054000; Fri, 23 Dec 2016 09:39:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612230939.uBN9doa7054000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 23 Dec 2016 09:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310472 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 09:39:52 -0000 Author: kib Date: Fri Dec 23 09:39:50 2016 New Revision: 310472 URL: https://svnweb.freebsd.org/changeset/base/310472 Log: MFC r310182: In swp_pager_meta_free_all(), fix type of the index variable. Style. Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Fri Dec 23 09:35:39 2016 (r310471) +++ stable/10/sys/vm/swap_pager.c Fri Dec 23 09:39:50 2016 (r310472) @@ -1997,30 +1997,30 @@ swp_pager_meta_free(vm_object_t object, static void swp_pager_meta_free_all(vm_object_t object) { - daddr_t index = 0; + struct swblock **pswap, *swap; + vm_pindex_t index; + daddr_t v; + int i; VM_OBJECT_ASSERT_WLOCKED(object); if (object->type != OBJT_SWAP) return; - while (object->un_pager.swp.swp_bcount) { - struct swblock **pswap; - struct swblock *swap; - + index = 0; + while (object->un_pager.swp.swp_bcount != 0) { mtx_lock(&swhash_mtx); pswap = swp_pager_hash(object, index); if ((swap = *pswap) != NULL) { - int i; - for (i = 0; i < SWAP_META_PAGES; ++i) { - daddr_t v = swap->swb_pages[i]; + v = swap->swb_pages[i]; if (v != SWAPBLK_NONE) { --swap->swb_count; swp_pager_freeswapspace(v, 1); } } if (swap->swb_count != 0) - panic("swap_pager_meta_free_all: swb_count != 0"); + panic( + "swap_pager_meta_free_all: swb_count != 0"); *pswap = swap->swb_hnext; uma_zfree(swap_zone, swap); --object->un_pager.swp.swp_bcount; From owner-svn-src-stable-10@freebsd.org Fri Dec 23 15:05:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E069DC8E853; Fri, 23 Dec 2016 15:05:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A1419362; Fri, 23 Dec 2016 15:05:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBNF5fi8090307; Fri, 23 Dec 2016 15:05:41 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBNF5fer090305; Fri, 23 Dec 2016 15:05:41 GMT (envelope-from des@FreeBSD.org) Message-Id: <201612231505.uBNF5fer090305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 23 Dec 2016 15:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310480 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 15:05:43 -0000 Author: des Date: Fri Dec 23 15:05:41 2016 New Revision: 310480 URL: https://svnweb.freebsd.org/changeset/base/310480 Log: MFH (r309269): use malloc()ed buffers instead of stack buffers Modified: stable/10/lib/libutil/gr_util.c stable/10/lib/libutil/pw_util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/gr_util.c ============================================================================== --- stable/10/lib/libutil/gr_util.c Fri Dec 23 15:02:40 2016 (r310479) +++ stable/10/lib/libutil/gr_util.c Fri Dec 23 15:05:41 2016 (r310480) @@ -164,11 +164,12 @@ gr_tmp(int mfd) int gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct group *fgr; const struct group *sgr; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_gr == NULL && gr == NULL) return(-1); @@ -186,6 +187,10 @@ gr_copy(int ffd, int tfd, const struct g if (sgr == NULL) sgr = gr; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -199,10 +204,16 @@ gr_copy(int ffd, int tfd, const struct g if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("group line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("group line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end -p); @@ -210,7 +221,7 @@ gr_copy(int ffd, int tfd, const struct g } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end -buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -219,7 +230,7 @@ gr_copy(int ffd, int tfd, const struct g break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len -1] != '\n') ++len, *end++ = '\n'; @@ -281,7 +292,7 @@ gr_copy(int ffd, int tfd, const struct g if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -303,12 +314,12 @@ gr_copy(int ffd, int tfd, const struct g write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } Modified: stable/10/lib/libutil/pw_util.c ============================================================================== --- stable/10/lib/libutil/pw_util.c Fri Dec 23 15:02:40 2016 (r310479) +++ stable/10/lib/libutil/pw_util.c Fri Dec 23 15:05:41 2016 (r310480) @@ -428,11 +428,12 @@ pw_make_v7(const struct passwd *pw) int pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct passwd *fpw; const struct passwd *spw; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_pw == NULL && pw == NULL) return (-1); @@ -450,6 +451,10 @@ pw_copy(int ffd, int tfd, const struct p if (spw == NULL) spw = pw; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -463,10 +468,16 @@ pw_copy(int ffd, int tfd, const struct p if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("passwd line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("passwd line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end - p); @@ -474,7 +485,7 @@ pw_copy(int ffd, int tfd, const struct p } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end - buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -483,7 +494,7 @@ pw_copy(int ffd, int tfd, const struct p break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len - 1] != '\n') ++len, *end++ = '\n'; @@ -546,7 +557,7 @@ pw_copy(int ffd, int tfd, const struct p if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -568,12 +579,12 @@ pw_copy(int ffd, int tfd, const struct p write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } From owner-svn-src-stable-10@freebsd.org Fri Dec 23 18:29:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 384E5C8EE7C; Fri, 23 Dec 2016 18:29:12 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ED129C98; Fri, 23 Dec 2016 18:29:11 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBNITBia071853; Fri, 23 Dec 2016 18:29:11 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBNITA0V071850; Fri, 23 Dec 2016 18:29:10 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201612231829.uBNITA0V071850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 23 Dec 2016 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310484 - in stable/10: share/man/man4 sys/conf sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 18:29:12 -0000 Author: ken Date: Fri Dec 23 18:29:10 2016 New Revision: 310484 URL: https://svnweb.freebsd.org/changeset/base/310484 Log: MFC, r310338: ------------------------------------------------------------------------ r310338 | ken | 2016-12-20 14:17:07 -0700 (Tue, 20 Dec 2016) | 37 lines Turn on FC-Tape by default in the isp(4) driver. FC-Tape provides additional link level error recovery, and is highly recommended for tape devices. It will only be turned on for a given target if the target supports it. Without this setting, we default to whatever FC-Tape setting is in NVRAM on the card. This can be overridden by setting the following loader tunable, for example for isp0: hint.isp.0.nofctape=1 sys/conf/options: Add a new kernel config option, ISP_FCTAPE_OFF, that defaults the FC-Tape configuration to off. sys/dev/isp/isp_pci.c: If ISP_FCTAPE_OFF is defined, turn off FC-Tape. Otherwise, turn it on if the card supports it. share/man/man4/isp.4: Add a description of FC-Tape to the isp(4) man page. Add descriptions of the fctape and nofctape options, as well as the ISP_FCTAPE_OFF kernel configuration option. Add the ispfw module and kernel drivers to the suggested configurations at the top of the man page so that users are less likely to leave it out. The driver works well with the included firmware, but may not work at all with whatever firmware the user has flashed on their card. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Sponsored by: Spectra Logic Modified: stable/10/share/man/man4/isp.4 stable/10/sys/conf/options stable/10/sys/dev/isp/isp_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/isp.4 ============================================================================== --- stable/10/share/man/man4/isp.4 Fri Dec 23 18:25:43 2016 (r310483) +++ stable/10/share/man/man4/isp.4 Fri Dec 23 18:29:10 2016 (r310484) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2015 +.Dd December 20, 2016 .Dt ISP 4 .Os .Sh NAME @@ -39,13 +39,15 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device scbus" .Cd "device isp" +.Cd "device ispfw" .Ed .Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent isp_load="YES" +ispfw_load="YES" .Ed .Sh DESCRIPTION This driver provides access to @@ -62,6 +64,30 @@ Fibre Channel supports initiator and tar utilizing Class 3 and Class 2 (2200 and later) connections. Support is available for Public and Private loops, Point-to-Point and Fabric connections. +.Pp +FC-Tape is supported on 4Gb (2400) and newer controllers. +FC-Tape is highly recommended for connections to tape drives that support +it. +It encompasses four elements from the the T-10 FCP-4 specification: +.Bl -bullet -offset indent +.It +Precise Delivery of Commands +.It +Confirmed Completion of FCP I/O Operations +.It +Retransmission of Unsuccessfully Transmitted IUs +.It +Task Retry Identification +.El +.Pp +Together these features allow for link level error recovery with tape +devices. +Without it, an initiator cannot, for instance, tell whether a tape write +command that has timed out resulted in all, part or none of the data going to +the tape drive. +FC-Tape is automatically enabled when connecting controller that supports +it to a target that supports it. +It may be disabled using configuration and hint options described below. .Sh FIRMWARE Firmware loading is supported if the .Xr ispfw 4 @@ -120,6 +146,13 @@ Target mode support for Fibre Channel ad .Cd options ISP_TARGET_MODE .Pp option. +.Pp +To disable FC-Tape, use the following configuration option: +.Pp +.Cd options ISP_FCTAPE_OFF +.Pp +Note that even if the ISP_FCTAPE_OFF option is used, it may be overridden +by the fctape hint described below. .Sh BOOT OPTIONS The following options are switchable by setting values in .Pa /boot/device.hints . @@ -169,6 +202,11 @@ A hint value for a driver debug level (s for the values. .It Va hint.isp.0.vports A hint to create specified number of additional virtual ports. +.It Va hint.isp.0.nofctape +Set this to 1 to disable FC-Tape operation on the given isp instance. +.It Va hint.isp.0.fctape +Set this to 1 to enable FC-Tape operation on the given isp instance for +targets that support it. .El .Sh SYSCTL OPTIONS .Bl -tag -width indent Modified: stable/10/sys/conf/options ============================================================================== --- stable/10/sys/conf/options Fri Dec 23 18:25:43 2016 (r310483) +++ stable/10/sys/conf/options Fri Dec 23 18:29:10 2016 (r310484) @@ -374,6 +374,7 @@ ISP_TARGET_MODE opt_isp.h ISP_FW_CRASH_DUMP opt_isp.h ISP_DEFAULT_ROLES opt_isp.h ISP_INTERNAL_TARGET opt_isp.h +ISP_FCTAPE_OFF opt_isp.h # Options used only in dev/iscsi ISCSI_INITIATOR_DEBUG opt_iscsi_initiator.h Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Fri Dec 23 18:25:43 2016 (r310483) +++ stable/10/sys/dev/isp/isp_pci.c Fri Dec 23 18:29:10 2016 (r310484) @@ -598,11 +598,18 @@ isp_get_specific_options(device_t dev, i } } +#ifdef ISP_FCTAPE_OFF + isp->isp_confopts |= ISP_CFG_NOFCTAPE; +#else + isp->isp_confopts |= ISP_CFG_FCTAPE; +#endif + tval = 0; snprintf(name, sizeof(name), "%snofctape", prefix); (void) resource_int_value(device_get_name(dev), device_get_unit(dev), name, &tval); if (tval) { + isp->isp_confopts &= ~ISP_CFG_FCTAPE; isp->isp_confopts |= ISP_CFG_NOFCTAPE; } From owner-svn-src-stable-10@freebsd.org Fri Dec 23 19:28:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF9D9C8D04E; Fri, 23 Dec 2016 19:28:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 64BC7A90; Fri, 23 Dec 2016 19:28:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBNJSFIX095992; Fri, 23 Dec 2016 19:28:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBNJSFMK095990; Fri, 23 Dec 2016 19:28:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612231928.uBNJSFMK095990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 23 Dec 2016 19:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310485 - in stable: 10/sys/amd64/amd64 10/sys/i386/i386 11/sys/amd64/amd64 11/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 19:28:16 -0000 Author: jhb Date: Fri Dec 23 19:28:15 2016 New Revision: 310485 URL: https://svnweb.freebsd.org/changeset/base/310485 Log: MFC 308820,308821: Fixes for fatal page faults on x86. 308820: Report page faults due to reserved bits in PTEs as a separate fault type. Rather than reporting a page fault due to a bad PTE as a protection violation with the "rsv" flag, treat these faults as a separate type of fault altogether. 308821: MFamd64: Various fatal page fault fixes. - If a page fault is triggered due to reserved bits in a PTE, treat it as a fatal fault and panic. - If PG_NX is in use, report whether a fatal page fault is due to an instruction fetch or a data access. - If a fatal page fault is due to reserved bits in a PTE, report that as the page fault type rather than a protection violation. Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Fri Dec 23 18:29:10 2016 (r310484) +++ stable/10/sys/amd64/amd64/trap.c Fri Dec 23 19:28:15 2016 (r310485) @@ -812,11 +812,11 @@ trap_fatal(frame, eva) #endif if (type == T_PAGEFLT) { printf("fault virtual address = 0x%lx\n", eva); - printf("fault code = %s %s %s%s, %s\n", + printf("fault code = %s %s %s, %s\n", code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", code & PGEX_I ? "instruction" : "data", - code & PGEX_RSV ? " rsv" : "", + code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); } printf("instruction pointer = 0x%lx:0x%lx\n", Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Fri Dec 23 18:29:10 2016 (r310484) +++ stable/10/sys/i386/i386/trap.c Fri Dec 23 19:28:15 2016 (r310485) @@ -879,6 +879,14 @@ trap_pfault(frame, usermode, eva) } /* + * If the trap was caused by errant bits in the PTE then panic. + */ + if (frame->tf_err & PGEX_RSV) { + trap_fatal(frame, eva); + return (-1); + } + + /* * PGEX_I is defined only if the execute disable bit capability is * supported and enabled. */ @@ -968,9 +976,15 @@ trap_fatal(frame, eva) #endif if (type == T_PAGEFLT) { printf("fault virtual address = 0x%x\n", eva); - printf("fault code = %s %s, %s\n", + printf("fault code = %s %s%s, %s\n", code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", +#if defined(PAE) || defined(PAE_TABLES) + pg_nx != 0 ? + (code & PGEX_I ? " instruction" : " data") : +#endif + "", + code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); } printf("instruction pointer = 0x%x:0x%x\n", From owner-svn-src-stable-10@freebsd.org Fri Dec 23 19:42:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1117DC8D615; Fri, 23 Dec 2016 19:42:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BA296164D; Fri, 23 Dec 2016 19:42:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBNJgH8N003675; Fri, 23 Dec 2016 19:42:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBNJgHrB003674; Fri, 23 Dec 2016 19:42:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612231942.uBNJgHrB003674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 23 Dec 2016 19:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310487 - in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 19:42:19 -0000 Author: jhb Date: Fri Dec 23 19:42:17 2016 New Revision: 310487 URL: https://svnweb.freebsd.org/changeset/base/310487 Log: MFC 309588: Don't attach to Host-PCI bridges with a bad bus number. If the bus number assigned to a Host-PCI bridge doesn't match the first bus number in the associated producer range from _CRS, print a warning and fail to attach rather than panicking due to an assertion failure. At least one single-socket Dell machine leaves a "ghost" Host-PCI bridge device in the ACPI namespace that seems to correspond to the I/O hub in the second socket of a two-socket machine. However, the BIOS doesn't configure the settings for this "ghost" bridge correctly, nor does it have any PCI devices behind it. Modified: stable/10/sys/dev/acpica/acpi_pcib_acpi.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi_pcib_acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_pcib_acpi.c Fri Dec 23 19:30:14 2016 (r310486) +++ stable/10/sys/dev/acpica/acpi_pcib_acpi.c Fri Dec 23 19:42:17 2016 (r310487) @@ -480,10 +480,17 @@ acpi_pcib_acpi_attach(device_t dev) pci_domain_release_bus(sc->ap_segment, dev, rid, bus_res); } } else { -#ifdef INVARIANTS - if (first_decoded_bus(sc, &start) == 0) - KASSERT(start == sc->ap_bus, ("bus number mismatch")); -#endif + /* + * Require the bus number from _BBN to match the start of any + * decoded range. + */ + if (first_decoded_bus(sc, &start) == 0 && sc->ap_bus != start) { + device_printf(dev, + "bus number %d does not match start of decoded range %ju\n", + sc->ap_bus, (uintmax_t)start); + pcib_host_res_free(dev, &sc->ap_host_res); + return (ENXIO); + } } #else /* From owner-svn-src-stable-10@freebsd.org Fri Dec 23 22:42:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBB2AC8E550; Fri, 23 Dec 2016 22:42:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7FD8B15AC; Fri, 23 Dec 2016 22:42:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBNMgFDe077271; Fri, 23 Dec 2016 22:42:15 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBNMgFel077265; Fri, 23 Dec 2016 22:42:15 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201612232242.uBNMgFel077265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 23 Dec 2016 22:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310490 - in stable: 10/contrib/amd 10/contrib/amd/amd 10/contrib/amd/amq 10/contrib/amd/conf/checkmount 10/contrib/amd/conf/mtab 10/contrib/amd/conf/nfs_prot 10/contrib/amd/conf/transp... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 22:42:17 -0000 Author: cy Date: Fri Dec 23 22:42:14 2016 New Revision: 310490 URL: https://svnweb.freebsd.org/changeset/base/310490 Log: MFC r308493, r308619: Update amd from am-utils 6.1.5 to 6.2. Used extensively on my network over the past ten weeks. Reviewed by: pfg, brooks Suggested by: pfg Obtained from: ftp://ftp.am-utils.org/pub/am-utils/ Relnotes: yes Differential Revision: D8405 Added: stable/10/contrib/amd/amd/info_sun.c - copied unchanged from r308493, head/contrib/amd/amd/info_sun.c stable/10/contrib/amd/amd/ops_ext.c - copied unchanged from r308493, head/contrib/amd/amd/ops_ext.c stable/10/contrib/amd/amd/ops_lustre.c - copied unchanged from r308493, head/contrib/amd/amd/ops_lustre.c stable/10/contrib/amd/amd/ops_nfs4.c - copied unchanged from r308493, head/contrib/amd/amd/ops_nfs4.c stable/10/contrib/amd/amd/ops_udf.c - copied unchanged from r308493, head/contrib/amd/amd/ops_udf.c stable/10/contrib/amd/amd/sun2amd.8 - copied unchanged from r308493, head/contrib/amd/amd/sun2amd.8 stable/10/contrib/amd/amd/sun2amd.c - copied unchanged from r308493, head/contrib/amd/amd/sun2amd.c stable/10/contrib/amd/amd/sun_map.c - copied unchanged from r308493, head/contrib/amd/amd/sun_map.c stable/10/contrib/amd/amd/sun_map.h - copied unchanged from r308493, head/contrib/amd/amd/sun_map.h stable/10/contrib/amd/amd/sun_map_parse.y - copied unchanged from r308493, head/contrib/amd/amd/sun_map_parse.y stable/10/contrib/amd/amd/sun_map_tok.l - copied unchanged from r308493, head/contrib/amd/amd/sun_map_tok.l stable/10/contrib/amd/amd/test1.sh - copied unchanged from r308493, head/contrib/amd/amd/test1.sh stable/10/contrib/amd/fsinfo/null_gram.c - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.c stable/10/contrib/amd/fsinfo/null_gram.h - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.h stable/10/contrib/amd/fsinfo/null_gram.y - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.y stable/10/contrib/amd/fsinfo/null_lex.c - copied unchanged from r308493, head/contrib/amd/fsinfo/null_lex.c stable/10/contrib/amd/fsinfo/null_lex.l - copied unchanged from r308493, head/contrib/amd/fsinfo/null_lex.l stable/10/contrib/amd/include/nfs_common.h - copied unchanged from r308493, head/contrib/amd/include/nfs_common.h Modified: stable/10/contrib/amd/AUTHORS stable/10/contrib/amd/BUGS stable/10/contrib/amd/COPYING stable/10/contrib/amd/ChangeLog stable/10/contrib/amd/FAQ stable/10/contrib/amd/INSTALL stable/10/contrib/amd/MIRRORS.html stable/10/contrib/amd/MIRRORS.txt stable/10/contrib/amd/NEWS stable/10/contrib/amd/README stable/10/contrib/amd/README.attrcache stable/10/contrib/amd/README.ldap stable/10/contrib/amd/README.y2k stable/10/contrib/amd/amd/am_ops.c stable/10/contrib/amd/amd/amd.8 stable/10/contrib/amd/amd/amd.c stable/10/contrib/amd/amd/amd.h stable/10/contrib/amd/amd/amfs_auto.c stable/10/contrib/amd/amd/amfs_direct.c stable/10/contrib/amd/amd/amfs_error.c stable/10/contrib/amd/amd/amfs_generic.c stable/10/contrib/amd/amd/amfs_host.c stable/10/contrib/amd/amd/amfs_link.c stable/10/contrib/amd/amd/amfs_linkx.c stable/10/contrib/amd/amd/amfs_nfsl.c stable/10/contrib/amd/amd/amfs_nfsx.c stable/10/contrib/amd/amd/amfs_program.c stable/10/contrib/amd/amd/amfs_root.c stable/10/contrib/amd/amd/amfs_toplvl.c stable/10/contrib/amd/amd/amfs_union.c stable/10/contrib/amd/amd/amq_subr.c stable/10/contrib/amd/amd/amq_svc.c stable/10/contrib/amd/amd/autil.c stable/10/contrib/amd/amd/clock.c stable/10/contrib/amd/amd/conf.c stable/10/contrib/amd/amd/conf_parse.y stable/10/contrib/amd/amd/conf_tok.l stable/10/contrib/amd/amd/get_args.c stable/10/contrib/amd/amd/info_exec.c stable/10/contrib/amd/amd/info_file.c stable/10/contrib/amd/amd/info_hesiod.c stable/10/contrib/amd/amd/info_ldap.c stable/10/contrib/amd/amd/info_ndbm.c stable/10/contrib/amd/amd/info_nis.c stable/10/contrib/amd/amd/info_nisplus.c stable/10/contrib/amd/amd/info_passwd.c stable/10/contrib/amd/amd/info_union.c stable/10/contrib/amd/amd/map.c stable/10/contrib/amd/amd/mapc.c stable/10/contrib/amd/amd/mntfs.c stable/10/contrib/amd/amd/nfs_prot_svc.c stable/10/contrib/amd/amd/nfs_start.c stable/10/contrib/amd/amd/nfs_subr.c stable/10/contrib/amd/amd/ops_TEMPLATE.c stable/10/contrib/amd/amd/ops_cachefs.c stable/10/contrib/amd/amd/ops_cdfs.c stable/10/contrib/amd/amd/ops_efs.c stable/10/contrib/amd/amd/ops_lofs.c stable/10/contrib/amd/amd/ops_mfs.c stable/10/contrib/amd/amd/ops_nfs.c stable/10/contrib/amd/amd/ops_nfs3.c stable/10/contrib/amd/amd/ops_nullfs.c stable/10/contrib/amd/amd/ops_pcfs.c stable/10/contrib/amd/amd/ops_tfs.c stable/10/contrib/amd/amd/ops_tmpfs.c stable/10/contrib/amd/amd/ops_ufs.c stable/10/contrib/amd/amd/ops_umapfs.c stable/10/contrib/amd/amd/ops_unionfs.c stable/10/contrib/amd/amd/ops_xfs.c stable/10/contrib/amd/amd/opts.c stable/10/contrib/amd/amd/readdir.c stable/10/contrib/amd/amd/restart.c stable/10/contrib/amd/amd/rpc_fwd.c stable/10/contrib/amd/amd/sched.c stable/10/contrib/amd/amd/srvr_amfs_auto.c stable/10/contrib/amd/amd/srvr_nfs.c stable/10/contrib/amd/amq/amq.8 stable/10/contrib/amd/amq/amq.c stable/10/contrib/amd/amq/amq.h stable/10/contrib/amd/amq/amq_clnt.c stable/10/contrib/amd/amq/amq_xdr.c stable/10/contrib/amd/amq/pawd.1 stable/10/contrib/amd/amq/pawd.c stable/10/contrib/amd/bootstrap stable/10/contrib/amd/conf/checkmount/checkmount_bsd44.c stable/10/contrib/amd/conf/mtab/mtab_bsd.c stable/10/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h stable/10/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h stable/10/contrib/amd/conf/transp/transp_sockets.c stable/10/contrib/amd/conf/umount/umount_bsd44.c stable/10/contrib/amd/doc/am-utils.texi stable/10/contrib/amd/doc/stamp-vti stable/10/contrib/amd/doc/texinfo.tex stable/10/contrib/amd/doc/version.texi stable/10/contrib/amd/fixmount/fixmount.8 stable/10/contrib/amd/fixmount/fixmount.c stable/10/contrib/amd/fsinfo/fsi_analyze.c stable/10/contrib/amd/fsinfo/fsi_data.h stable/10/contrib/amd/fsinfo/fsi_dict.c stable/10/contrib/amd/fsinfo/fsi_gram.y stable/10/contrib/amd/fsinfo/fsi_lex.l stable/10/contrib/amd/fsinfo/fsi_util.c stable/10/contrib/amd/fsinfo/fsinfo.8 stable/10/contrib/amd/fsinfo/fsinfo.c stable/10/contrib/amd/fsinfo/fsinfo.h stable/10/contrib/amd/fsinfo/wr_atab.c stable/10/contrib/amd/fsinfo/wr_bparam.c stable/10/contrib/amd/fsinfo/wr_dumpset.c stable/10/contrib/amd/fsinfo/wr_exportfs.c stable/10/contrib/amd/fsinfo/wr_fstab.c stable/10/contrib/amd/hlfsd/hlfsd.8 stable/10/contrib/amd/hlfsd/hlfsd.c stable/10/contrib/amd/hlfsd/hlfsd.h stable/10/contrib/amd/hlfsd/homedir.c stable/10/contrib/amd/hlfsd/nfs_prot_svc.c stable/10/contrib/amd/hlfsd/stubs.c stable/10/contrib/amd/include/am_compat.h stable/10/contrib/amd/include/am_defs.h stable/10/contrib/amd/include/am_utils.h stable/10/contrib/amd/include/am_xdr_func.h stable/10/contrib/amd/include/amq_defs.h stable/10/contrib/amd/include/mount_headers1.h stable/10/contrib/amd/include/mount_headers2.h stable/10/contrib/amd/ldap-id.ms stable/10/contrib/amd/ldap-id.txt stable/10/contrib/amd/libamu/amu.h stable/10/contrib/amd/libamu/hasmntopt.c stable/10/contrib/amd/libamu/misc_rpc.c stable/10/contrib/amd/libamu/mount_fs.c stable/10/contrib/amd/libamu/mtab.c stable/10/contrib/amd/libamu/nfs_prot_xdr.c stable/10/contrib/amd/libamu/strerror.c stable/10/contrib/amd/libamu/strutil.c stable/10/contrib/amd/libamu/wire.c stable/10/contrib/amd/libamu/xdr_func.c stable/10/contrib/amd/libamu/xutil.c stable/10/contrib/amd/mk-amd-map/mk-amd-map.8 stable/10/contrib/amd/mk-amd-map/mk-amd-map.c stable/10/contrib/amd/scripts/amd.conf-sample stable/10/contrib/amd/scripts/amd.conf.5 stable/10/contrib/amd/scripts/automount2amd.8 stable/10/contrib/amd/scripts/fixrmtab.in stable/10/contrib/amd/vers.m4 stable/10/contrib/amd/wire-test/wire-test.8 stable/10/contrib/amd/wire-test/wire-test.c stable/10/usr.sbin/amd/amd/Makefile stable/10/usr.sbin/amd/fsinfo/Makefile stable/10/usr.sbin/amd/include/config.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/11/contrib/amd/amd/info_sun.c - copied unchanged from r308493, head/contrib/amd/amd/info_sun.c stable/11/contrib/amd/amd/ops_ext.c - copied unchanged from r308493, head/contrib/amd/amd/ops_ext.c stable/11/contrib/amd/amd/ops_lustre.c - copied unchanged from r308493, head/contrib/amd/amd/ops_lustre.c stable/11/contrib/amd/amd/ops_nfs4.c - copied unchanged from r308493, head/contrib/amd/amd/ops_nfs4.c stable/11/contrib/amd/amd/ops_udf.c - copied unchanged from r308493, head/contrib/amd/amd/ops_udf.c stable/11/contrib/amd/amd/sun2amd.8 - copied unchanged from r308493, head/contrib/amd/amd/sun2amd.8 stable/11/contrib/amd/amd/sun2amd.c - copied unchanged from r308493, head/contrib/amd/amd/sun2amd.c stable/11/contrib/amd/amd/sun_map.c - copied unchanged from r308493, head/contrib/amd/amd/sun_map.c stable/11/contrib/amd/amd/sun_map.h - copied unchanged from r308493, head/contrib/amd/amd/sun_map.h stable/11/contrib/amd/amd/sun_map_parse.y - copied unchanged from r308493, head/contrib/amd/amd/sun_map_parse.y stable/11/contrib/amd/amd/sun_map_tok.l - copied unchanged from r308493, head/contrib/amd/amd/sun_map_tok.l stable/11/contrib/amd/amd/test1.sh - copied unchanged from r308493, head/contrib/amd/amd/test1.sh stable/11/contrib/amd/fsinfo/null_gram.c - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.c stable/11/contrib/amd/fsinfo/null_gram.h - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.h stable/11/contrib/amd/fsinfo/null_gram.y - copied unchanged from r308493, head/contrib/amd/fsinfo/null_gram.y stable/11/contrib/amd/fsinfo/null_lex.c - copied unchanged from r308493, head/contrib/amd/fsinfo/null_lex.c stable/11/contrib/amd/fsinfo/null_lex.l - copied unchanged from r308493, head/contrib/amd/fsinfo/null_lex.l stable/11/contrib/amd/include/nfs_common.h - copied unchanged from r308493, head/contrib/amd/include/nfs_common.h Modified: stable/11/contrib/amd/AUTHORS stable/11/contrib/amd/BUGS stable/11/contrib/amd/COPYING stable/11/contrib/amd/ChangeLog stable/11/contrib/amd/FAQ stable/11/contrib/amd/INSTALL stable/11/contrib/amd/MIRRORS.html stable/11/contrib/amd/MIRRORS.txt stable/11/contrib/amd/NEWS stable/11/contrib/amd/README stable/11/contrib/amd/README.attrcache stable/11/contrib/amd/README.ldap stable/11/contrib/amd/README.y2k stable/11/contrib/amd/amd/am_ops.c stable/11/contrib/amd/amd/amd.8 stable/11/contrib/amd/amd/amd.c stable/11/contrib/amd/amd/amd.h stable/11/contrib/amd/amd/amfs_auto.c stable/11/contrib/amd/amd/amfs_direct.c stable/11/contrib/amd/amd/amfs_error.c stable/11/contrib/amd/amd/amfs_generic.c stable/11/contrib/amd/amd/amfs_host.c stable/11/contrib/amd/amd/amfs_link.c stable/11/contrib/amd/amd/amfs_linkx.c stable/11/contrib/amd/amd/amfs_nfsl.c stable/11/contrib/amd/amd/amfs_nfsx.c stable/11/contrib/amd/amd/amfs_program.c stable/11/contrib/amd/amd/amfs_root.c stable/11/contrib/amd/amd/amfs_toplvl.c stable/11/contrib/amd/amd/amfs_union.c stable/11/contrib/amd/amd/amq_subr.c stable/11/contrib/amd/amd/amq_svc.c stable/11/contrib/amd/amd/autil.c stable/11/contrib/amd/amd/clock.c stable/11/contrib/amd/amd/conf.c stable/11/contrib/amd/amd/conf_parse.y stable/11/contrib/amd/amd/conf_tok.l stable/11/contrib/amd/amd/get_args.c stable/11/contrib/amd/amd/info_exec.c stable/11/contrib/amd/amd/info_file.c stable/11/contrib/amd/amd/info_hesiod.c stable/11/contrib/amd/amd/info_ldap.c stable/11/contrib/amd/amd/info_ndbm.c stable/11/contrib/amd/amd/info_nis.c stable/11/contrib/amd/amd/info_nisplus.c stable/11/contrib/amd/amd/info_passwd.c stable/11/contrib/amd/amd/info_union.c stable/11/contrib/amd/amd/map.c stable/11/contrib/amd/amd/mapc.c stable/11/contrib/amd/amd/mntfs.c stable/11/contrib/amd/amd/nfs_prot_svc.c stable/11/contrib/amd/amd/nfs_start.c stable/11/contrib/amd/amd/nfs_subr.c stable/11/contrib/amd/amd/ops_TEMPLATE.c stable/11/contrib/amd/amd/ops_cachefs.c stable/11/contrib/amd/amd/ops_cdfs.c stable/11/contrib/amd/amd/ops_efs.c stable/11/contrib/amd/amd/ops_lofs.c stable/11/contrib/amd/amd/ops_mfs.c stable/11/contrib/amd/amd/ops_nfs.c stable/11/contrib/amd/amd/ops_nfs3.c stable/11/contrib/amd/amd/ops_nullfs.c stable/11/contrib/amd/amd/ops_pcfs.c stable/11/contrib/amd/amd/ops_tfs.c stable/11/contrib/amd/amd/ops_tmpfs.c stable/11/contrib/amd/amd/ops_ufs.c stable/11/contrib/amd/amd/ops_umapfs.c stable/11/contrib/amd/amd/ops_unionfs.c stable/11/contrib/amd/amd/ops_xfs.c stable/11/contrib/amd/amd/opts.c stable/11/contrib/amd/amd/readdir.c stable/11/contrib/amd/amd/restart.c stable/11/contrib/amd/amd/rpc_fwd.c stable/11/contrib/amd/amd/sched.c stable/11/contrib/amd/amd/srvr_amfs_auto.c stable/11/contrib/amd/amd/srvr_nfs.c stable/11/contrib/amd/amq/amq.8 stable/11/contrib/amd/amq/amq.c stable/11/contrib/amd/amq/amq.h stable/11/contrib/amd/amq/amq_clnt.c stable/11/contrib/amd/amq/amq_xdr.c stable/11/contrib/amd/amq/pawd.1 stable/11/contrib/amd/amq/pawd.c stable/11/contrib/amd/bootstrap stable/11/contrib/amd/conf/checkmount/checkmount_bsd44.c stable/11/contrib/amd/conf/mtab/mtab_bsd.c stable/11/contrib/amd/conf/nfs_prot/nfs_prot_freebsd2.h stable/11/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h stable/11/contrib/amd/conf/transp/transp_sockets.c stable/11/contrib/amd/conf/umount/umount_bsd44.c stable/11/contrib/amd/doc/am-utils.texi stable/11/contrib/amd/doc/stamp-vti stable/11/contrib/amd/doc/texinfo.tex stable/11/contrib/amd/doc/version.texi stable/11/contrib/amd/fixmount/fixmount.8 stable/11/contrib/amd/fixmount/fixmount.c stable/11/contrib/amd/fsinfo/fsi_analyze.c stable/11/contrib/amd/fsinfo/fsi_data.h stable/11/contrib/amd/fsinfo/fsi_dict.c stable/11/contrib/amd/fsinfo/fsi_gram.y stable/11/contrib/amd/fsinfo/fsi_lex.l stable/11/contrib/amd/fsinfo/fsi_util.c stable/11/contrib/amd/fsinfo/fsinfo.8 stable/11/contrib/amd/fsinfo/fsinfo.c stable/11/contrib/amd/fsinfo/fsinfo.h stable/11/contrib/amd/fsinfo/wr_atab.c stable/11/contrib/amd/fsinfo/wr_bparam.c stable/11/contrib/amd/fsinfo/wr_dumpset.c stable/11/contrib/amd/fsinfo/wr_exportfs.c stable/11/contrib/amd/fsinfo/wr_fstab.c stable/11/contrib/amd/hlfsd/hlfsd.8 stable/11/contrib/amd/hlfsd/hlfsd.c stable/11/contrib/amd/hlfsd/hlfsd.h stable/11/contrib/amd/hlfsd/homedir.c stable/11/contrib/amd/hlfsd/nfs_prot_svc.c stable/11/contrib/amd/hlfsd/stubs.c stable/11/contrib/amd/include/am_compat.h stable/11/contrib/amd/include/am_defs.h stable/11/contrib/amd/include/am_utils.h stable/11/contrib/amd/include/am_xdr_func.h stable/11/contrib/amd/include/amq_defs.h stable/11/contrib/amd/include/mount_headers1.h stable/11/contrib/amd/include/mount_headers2.h stable/11/contrib/amd/ldap-id.ms stable/11/contrib/amd/ldap-id.txt stable/11/contrib/amd/libamu/amu.h stable/11/contrib/amd/libamu/hasmntopt.c stable/11/contrib/amd/libamu/misc_rpc.c stable/11/contrib/amd/libamu/mount_fs.c stable/11/contrib/amd/libamu/mtab.c stable/11/contrib/amd/libamu/nfs_prot_xdr.c stable/11/contrib/amd/libamu/strerror.c stable/11/contrib/amd/libamu/strutil.c stable/11/contrib/amd/libamu/wire.c stable/11/contrib/amd/libamu/xdr_func.c stable/11/contrib/amd/libamu/xutil.c stable/11/contrib/amd/mk-amd-map/mk-amd-map.8 stable/11/contrib/amd/mk-amd-map/mk-amd-map.c stable/11/contrib/amd/scripts/amd.conf-sample stable/11/contrib/amd/scripts/amd.conf.5 stable/11/contrib/amd/scripts/automount2amd.8 stable/11/contrib/amd/scripts/fixrmtab.in stable/11/contrib/amd/vers.m4 stable/11/contrib/amd/wire-test/wire-test.8 stable/11/contrib/amd/wire-test/wire-test.c stable/11/usr.sbin/amd/amd/Makefile stable/11/usr.sbin/amd/fsinfo/Makefile stable/11/usr.sbin/amd/include/config.h Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/amd/AUTHORS ============================================================================== --- stable/10/contrib/amd/AUTHORS Fri Dec 23 21:56:08 2016 (r310489) +++ stable/10/contrib/amd/AUTHORS Fri Dec 23 22:42:14 2016 (r310490) @@ -6,22 +6,22 @@ This file lists the ones who contributed particular order, and I thank them all. This is of course not to diminish the smaller contributes of the many others. Thank you all. -* Erez Zadok +* Erez Zadok The most significant changes were made by Erez Zadok in terms of bug fixes, ports, and new features added. Erez Zadok is the current maintainer of am-utils, as of January 1997. -* Ion Badulescu +* Ion Badulescu Co-maintainer of am-utils since late 1999: Linux and Solaris autofs support, Linux NFSv3 support, major code reorganization, etc... -* Randall S. Winchester +* Randall S. Winchester May 7, 1997: contributed a special version of upl102 that included NFS V.3 support. Some of the code was contributed by Christos Zoulas -. I (Erez) ported these changes to am-utils. +. I (Erez) ported these changes to am-utils. September 12, 1997: lots of small prototype cleanups and fixes to numerous files. @@ -35,12 +35,12 @@ February 1, 1998: fixes for NetBSD to be September 4, 1999: assorted fixes for NetBSD 1.4+. -* Hannes Reinecke +* Hannes Reinecke Back in 1995, contributed code for linux. A new parser for file system specific options that only exist under linux. -* Leif Johansson +* Leif Johansson June 22, 1997: minor patch to ensure that systems without an RE library work. @@ -52,7 +52,7 @@ functions. Contributed scripts/amd2ldif August 4, 1997: info_ldap.c fixes and adding two new amd.conf ldap variables: ldap_cache_seconds and ldap_cache_maxmem. -* Andreas Stolcke +* Andreas Stolcke June 22, 1997: patches to ensure that proto= and vers= options work properly in mount tables and can be overridden. Later on, more code @@ -68,11 +68,11 @@ message. December 19, 1997: detected an FMR (Free Memory Read) in amd/mntfs.c, uninit_mntfs(). -* Danny Braniss +* Danny Braniss July, 6 1997: contributed patches to hesiod on bsdi3. -* Tom Schmidt +* Tom Schmidt July 10, 1997: Recommdation to include libgdbm if libc has no dbm_open. Patches for netgrp(host) command. Mods to aux/config.guess to recognize @@ -86,7 +86,7 @@ IFF_ROUTE instead of IFF_LOOPBACK. May 30, 2000: correct logging types for addopts/mergeopts messages. -* Daniel S. Riley +* Daniel S. Riley July 11, 1997: fixes to DU-4.0 to support string POSIX.1 signals, and struct sockaddr with sa_len field. @@ -99,15 +99,15 @@ grpid, nosuid, and actimo. August 15, 1998: fix memory leak in processing of /defaults, and avoid accessing uninitialized memory in osf1. -* Roman Hodek +* Roman Hodek July 23, 1997: Got lots of patches from the Debian Linux folks, who fixed several generic bugs, and one serious one for Linux. The latter involved using connected sockets for NFS mounts on kernels 1.3.10 and older. Roman's -work is baed on amd-upl102, and work from Ian Murdock -and Dominik Kubla . +work is baed on amd-upl102, and work from Ian Murdock +and Dominik Kubla . -* Rainer Orth +* Rainer Orth August 6, 1997: assorted fixes to support hesiod-1.3, solaris 2.4 (which I already fixed but did not release yet), and support for $LDFLAGS at @@ -132,34 +132,34 @@ mount tables in Solaris 8. February 9, 2000: new debug options hrtime (hi-res timer) and xdrtrace. bug fixes. -* Jason Thorpe +* Jason Thorpe August 25, 1997: make amd work when talking to NIS+ servers in NIS compatibility mode. Fix originally came from Matthieu Herrb -. +. -* Chris Metcalf +* Chris Metcalf August 29, 1997: patch to make amd use FQHN for NFS/RPC authentication, useful esp. for cross-domain NFS mounts. September 2, 1997: if plock() succeeded, don't display errno string. -* Enami Tsugutomo +* Enami Tsugutomo September 4, 1997: don't ping remote servers with NFS V.3 always, but V.2, regardless of client's NFS version. (conf/transp/transp_sockets.c) -* Dan Riley +* Dan Riley September 19, 1997: make sure that amd works with more secure portmappers that do not allow forwarding of RPC messages to other services. -* Wolfgang Rupprecht +* Wolfgang Rupprecht August 10, 1997: netbsd and other bsd systems have a mask flag for pcfs_args (msdos mount). -* Christos Zoulas +* Christos Zoulas September 25, 1997: fix to initialize uid/gid fields of pcfs_args_t on netbsd. @@ -181,7 +181,7 @@ TLI implementations. Patch to print ver options had been initialized, so we can print domain, host, and hostd. Linux patch to use umount2(2) if umount(2) fails. -* Bill Paul +* Bill Paul November 5, 1997: NFS v.3 support for AIX 4.2.1, which does *not* include headers for this. Bill had to guess at the right structures, field names, @@ -189,26 +189,26 @@ sizes, alignment, etc. January 15, 1999: small ldap bug fixes. -* Stefan Vogel +* Stefan Vogel November 14, 1997: typo in the subscription instructions to amd-dev. -* Guntram Wolski +* Guntram Wolski November 15, 1997: pointed out mismatching documentation for the -o option. -* Michael Hucka +* Michael Hucka January 11, 1997: pointed out reversed definition of NFS mount options vers and proto. -* Albert Chin +* Albert Chin January 12, 1998: minor bug in output of amd -H. June 23, 2005: assortment of small compile bugs on aix4, and solaris 5/6/7. -* Thomas Richter +* Thomas Richter January 13, 1998: use case insensitive comparisons for variables that need it (such as all hostname related ones, and more). @@ -216,11 +216,11 @@ it (such as all hostname related ones, a July 20, 1998: don't leak memory in the private version of yp_all (when vendor yp_all is bad). -* Fred Korz +* Fred Korz January 30, 1998: minor typo fixed to tftp example in am-utils.texi. -* Donald Buczek +* Donald Buczek March 6, 1998: correctly inherit existing NFS V.3 mounts upon restart. @@ -230,36 +230,36 @@ March 20, 1998: do not close stdout in c allow startup script to redirect it. Set a temporary secure umask(0022) before writing log file and restore it afterwards. -* Matthew Crosby +* Matthew Crosby April 20, 1998: allow arbitrary number of interfaces in wire listing. -* David O'Brien +* David O'Brien September 4, 1998: bug fix to avoid overrunning hostname buffer, and minor amd.conf man page typo correction. September 22, 1999: use more secure vsnprintf in real_plog(). -* Danny Rathjens +* Danny Rathjens October 29, 1998: swap arguments to kill(2) in amd.c. -* Mike Mitchell +* Mike Mitchell November 3, 1998: amd/nfs_subr.c (nfsproc_lookup_2_svc): try to avoid a race condition between unmounting and re-mounting an entry, by increasing the ttl of a looked up entry before unmounting it. -* Douglas K. Rand" +* Douglas K. Rand" December 3, 1998: case insensitive host name match for nfsl. -* David Wolfskill +* David Wolfskill January 28, 1999: don't turn on/off noconn option if it was already in that state. -* Jeffrey C Honig +* Jeffrey C Honig March 14, 1999: clean up more autogenerated files upon "make distclean". March 15, 1999: avoid overly verbose NIS warning even on systems that don't @@ -271,30 +271,30 @@ detection for bsdi4. September 17, 1999: fixes to expn. -* Paul Balyoz +* Paul Balyoz March 26, 1999: ensure lostaltmail displays Y2K compliant dates. -* Jon Peatfield +* Jon Peatfield March 30, 1999: turn off incomplete NFS V.3 support in HPUX 10.20. September 22, 1999: safe reloading of maps without first clearing old copies, and using cached copies if map failed to reload. -* Peter Breitenlohner +* Peter Breitenlohner July 24, 1999: patch for linux 2.2.x to work with older libc5 systems, and nis_isup mis-logic fixes. December 13, 2001: report typos in scripts/amd.conf.5. -* Dale Talcott +* Dale Talcott July 26, 1999: added NFS3 support for AIX mounting. -* Christophe Kalt +* Christophe Kalt July 14, 1999: add netgrpd() syntax function which uses FQHN. -* Andrew J. Korty +* Andrew J. Korty September 5, 1999: pawd works for type:=nfsl. -* Nick Williams +* Nick Williams September 1, 1999: bug fix for incorrect symlinks when two locations are requested simultaneously. @@ -306,38 +306,38 @@ doing rapid mounts and umounts in succes June 5, 2000: better handling of potential race-conditions during rapid u/mounts. Correctly update d_drops stats for amq -s. -* Johann Pfefferl +* Johann Pfefferl November 16, 1999: fix to ldap code so repeated calls to string2he don't corrupt the string passed. -* Amitha Perera +* Amitha Perera December 9, 1999: detect all wire() interfaces correctly. -* Steven Danz +* Steven Danz January 25, 2000: allow browsable auto maps. -* Wolfram Klaus . +* Wolfram Klaus . November 21, 2000: recognize proplist mnttab flag. -* Thomas Klausner +* Thomas Klausner November 21, 2000: lots of NetBSD fixes (many of which are generic). April 18, 2003: patch to reference am-utils info pages in man page. November 28, 2004: small fixes to typos in amd.conf(5) man page. -* Olaf Kirch +* Olaf Kirch February 1, 2001: important Linux NFS error number mapping fixed -* Ahmon Dancy +* Ahmon Dancy February 9, 2001: Apple Rhapsody/Darwin/OS X port -* Sebastien Bahloul +* Sebastien Bahloul July 3, 2001: LDAP fixes and updates to support new APIs March 27, 2002: LDAP bug and port to HPUX-11. -* Philippe Troin +* Philippe Troin July 12, 2001: Proper handling of GNU getopt, support for optionally disabling LDAP/Hesiod, fixes for the dev/nodev option on Linux. Texi documentation fix. @@ -348,65 +348,65 @@ generic mount option. July 17, 2003: pref:=null core dump fix. libgdbm portability. tcpd/librap support. And a few other things for the 6.0 branch. -* Trond Myklebust +* Trond Myklebust January 10, 2002: Proper initialization of the timeo parameter on Linux, TCP _must_ have a timeout 2 orders of magnitude larger than UDP -* George Ross +* George Ross April 29, 2002: Rework of old code, support for wildcards in LDAP queries, and an FD leak fix. Amd -A support. October 21, 2002: ldap_unbind fix for SIGPIPE, and support for LDAPv3 -protocol version parameter (with Tim Colles ). +protocol version parameter (with Tim Colles ). -* Matthias Scheler +* Matthias Scheler June 14, 2002: patch to use "xlatecookie" NFS mount option. -* Jun-ichiro itojun Hagino . +* Jun-ichiro itojun Hagino . June 11, 2002: minor fixes to support NetBSD 1.6A. -* Sean Fagan +* Sean Fagan March 14, 2003: detect and use the MNT2_GEN_OPT_AUTOMNTFS mount flag on OS X / Darwin. -* Hendrik Scholz +* Hendrik Scholz June 9, 2003: mk-amd-map should open temp db file using O_EXCL. -* Mark Davies +* Mark Davies July 14, 2003: define "xlatecookie" mnttab option if not defined (for NetBSD). Support null hesiod entries if they start with a ".". -* Eric S. Raymond +* Eric S. Raymond December 9, 2003: fix unbalanced [] typo in fsinfo man page. -* Martin Blapp +* Martin Blapp July 6, 2004: recognize fields in pcfs_args_t in FreeBSD 5. -* Dan Nelson +* Dan Nelson August 2, 2004: pawd to recognize "host" type mounts. -* Hauke Fath +* Hauke Fath August 3, 2004: pawd to recognize "linkx" type mounts. -* Michael van Elst +* Michael van Elst September 1, 2004: bug fix to avoid race condition in calls to mntctl on AIX. -* Jonathan Chen +* Jonathan Chen October 22, 2004: patch/fix to move mlock/mlockall/plock code after the fork(). June 29, 2005: core dump going off end of exported_ap[] array. September 29, 2005: patch/fix for pawd not to go into an infinite loop. October 25, 2005: patch/fix for pawd to repeatedly resolve path. -* David Rage +* David Rage January 17, 2005: prevent Amd from logging 'Read-only filesystem' errors when the mount point has an ancestor (i.e. '/') that is mounted read-only. -* Kevin Layer +* Kevin Layer January 28, 2005: basic instructions how to setup Amd on Mac OS-X. -* Dan Ottavio +* Dan Ottavio March 2, 2005: new global amd.conf option debug_mtab_file, to set the debug mtab file when using debug_options=mtab. Default has changed from "./mtab" to "/tmp/mtab" to avoid security problem. Bug fixed to ensure that Amd @@ -415,16 +415,13 @@ terminates properly even mtab file doesn * Erik Kline January 3, 2005: implementation of executable maps for Amd. -* Jim Zajkowski +* Jim Zajkowski March 14, 2005: small patch to amd2ldif. * Adam Morley January 27, 2005: synchronize what amd2ldif does vs. what the ldap.schema expects. -* Graeme Wilford +* Graeme Wilford July 4, 2005: buffer overflow in pawd. -* Steve Plite -September 22, 2005: repair reversed meaning of D_AMQ, so amq will unregister -on exit. Modified: stable/10/contrib/amd/BUGS ============================================================================== --- stable/10/contrib/amd/BUGS Fri Dec 23 21:56:08 2016 (r310489) +++ stable/10/contrib/amd/BUGS Fri Dec 23 22:42:14 2016 (r310490) @@ -1,7 +1,7 @@ LIST OF KNOWN BUGS IN AM-UTILS OR OPERATING SYSTEMS Note: report am-utils bugs via Bugzilla to https://bugzilla.am-utils.org/ or -by email to the am-utils@am-utils.org mailing list. +by email to the am-utils mailing list (see www.am-utils.org). (1) mips-sgi-irix* @@ -98,11 +98,11 @@ diff -u -r1.1 utsname.h (4) powerpc-ibm-aix4.2.1.0 -[4A] "Randall S. Winchester" reports that for amd to +[4A] "Randall S. Winchester" reports that for amd to start, you need to kill and restart rpc.mountd and possibly also make sure that nfsd is running. Normally these are not required. -[4B] "Stefan Vogel" reports that if your amq +[4B] "Stefan Vogel" reports that if your amq executable dump core unexpectedly, then it may be a bug in gcc 2.7.x. Upgrade to gcc 2.8.x or use IBM's xlC compiler. @@ -123,7 +123,7 @@ but it is not yet in the glibc-2.0.7-19 A bug in libc results in an amq binary that doesn't work; amq -v dumps core in xdr_string. There is no known fix (source code or vendor patch) at this -time. (Please let am-utils@am-utils.org know if you know of a fix.) +time. (Please let us know if you have a fix; see www.am-utils.org.) (7) *-aix4.3.2.0 Modified: stable/10/contrib/amd/COPYING ============================================================================== --- stable/10/contrib/amd/COPYING Fri Dec 23 21:56:08 2016 (r310489) +++ stable/10/contrib/amd/COPYING Fri Dec 23 22:42:14 2016 (r310490) @@ -1,4 +1,4 @@ -Copyright (c) 1997-2006 Erez Zadok +Copyright (c) 1997-2014 Erez Zadok Copyright (c) 1989 Jan-Simon Pendry Copyright (c) 1989 Imperial College of Science, Technology & Medicine Copyright (c) 1989 The Regents of the University of California. @@ -15,12 +15,7 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgment: - This product includes software developed by the University of - California, Berkeley and its contributors, as well as the Trustees of - Columbia University. -4. Neither the name of the University nor the names of its contributors +3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. Modified: stable/10/contrib/amd/ChangeLog ============================================================================== --- stable/10/contrib/amd/ChangeLog Fri Dec 23 21:56:08 2016 (r310489) +++ stable/10/contrib/amd/ChangeLog Fri Dec 23 22:42:14 2016 (r310490) @@ -1,14 +1,564 @@ -2006-05-11 Erez Zadok +2014-10-28 Christos Zoulas ******************************************************************* - *** Released am-utils-6.1.5 *** + *** Released am-utils-6.2 *** ******************************************************************* -2006-05-10 Erez Zadok + * add ylwrap.amd, sick and tired of patching broken ylwrap. + +2014-09-05 Christos Zoulas + + * factor out the size check for both readdir methods + (raven at themaw.net) + +2014-09-03 Christos Zoulas + + * configure test for 64 bit xdr function (raven at themaw.net) + +2014-09-01 Christos Zoulas + + * bug fix from raven at themaw.net to prevent writing v3 handle + to a v2 structure. + +2014-07-21 Christos Zoulas + + * fix permission problems with access + * auto_nfs_version = 3 now works for me. + +2014-07-20 Christos Zoulas + + * refresh some autoconf files + * force autoconf version since earlier versions don't work + * changes from raven at themaw.net to support NFSv3 for automounted + toplevel filesystems presented to the list in May. A few bug fixes + and integration changes by me. The code now works well enough to + mount the filesystem with NFSv3 and automount children but readdir + does not work yet (so no listing of automounted filesystems). + The new code is not enabled by default. To enable use + auto_nfs_version = 3 + in your configuration file. + +2014-03-26 Christos Zoulas + + From Ian Kent + + * use mktemp in scripts/fixrmtab + * fix documentatio nits + * [linux] Add ext2, ext3, ext4 specific mount options + * fix tcpwrappers (hosts.{allow,deny} problems for specific host + entries + +2014-03-20 Christos Zoulas + + + * don't background autofs umount + * avoid fh NULL dereference on umount + * handle ENOENT umount return for autofs mounts + * fix error message in get_nfs_version + * fix debug log deadlock + * [linux] retry umount on EBUSY + * handle failed umount on exit + +2014-03-09 Christos Zoulas + + * Remove BSD advertising clause. + * Remove expn program which is not used by anything + +2013-12-05 Christos Zoulas + + * Change the way we handle multiple lex scanners and yacc parsers + in a single program. Our old patch to ylwrap does not work anymore + because the bison parsers need shared symbols that start with yy + and we can't easily select which ones work. So now we use -P and + -p to let lex and yacc do the work for us. This requires a patch + to ylwrap, but it is smaller. + + +2013-12-05 Christos Zoulas + + * Change the way we handle multiple lex scanners and yacc parsers + in a single program. Our old patch to ylwrap does not work anymore + because the bison parsers need shared symbols that start with yy + and we can't easily select which ones work. So now we use -P and + -p to let lex and yacc do the work for us. This requires a patch + to ylwrap, but it is smaller. + +2013-05-14 Christos Zoulas + + * update to handle new autoconf and regen files + +2012-11-23 Christos Zoulas + + * recognize mountport=, noacl options + * simplify the bootstrap process, by forcing + all the files to be rebuild with autoreconf -f - i + +2012-10-03 Christos Zoulas + + * add missing ops_nfs4.c to the Makefile.am + +2012-09-14 Christos Zoulas + + * add locking option handling for lustre + * fix noatime, nodiratime, mandlock for linux + +2012-07-25 Christos Zoulas + + * bug fixes for lustre rhost parsing + +2012-06-27 Christos Zoulas + + * Disable 1/2-baked sun map support to avoid SIGSEGV + +2012-06-16 Christos Zoulas + + ******************************************************************* + *** Released am-utils-6.2-rc1 *** + ******************************************************************* + + * Fix libtool.m4 to work with later versions of autoconf. + * In buildall, use eval so that quoted strings work + * Centralize nfs version checking function, and introduce + new configuration variable nfs_vers_ping, which is the + max version we ping for. This is not documented yet, because + there might be a better way separate the max version we can + use vs the max version we ping for. + +2012-06-09 Christos Zoulas + + * fix issue with parsing nfsv4 security option strings + +2012-05-01 Christos Zoulas + + * Handle EPERM return from v4 file handles + in old linux kernels + +2012-03-09 Christos Zoulas + + * fix linux autofs detection + * fix wrong types in new amq mount xdr processing + +2012-01-25 Christos Zoulas + + * FreeBSD portability fixes + +2012-01-23 Christos Zoulas + + * Avoid type punned warnings + +2011-12-29 Christos Zoulas + + * fix bug I introduced in get_nfs_version that caused it to return 0 + * add direct support for ext{2,3,4} + +2011-12-15 Christos Zoulas + + * Include on linux, to grab extra mount flags + * Add support for lustre + +2011-11-28 Christos Zoulas + + * For nfsl mounts, match against either the short local + host name or the fqdn name. + +2011-10-06 Christos Zoulas + + * Add NFSv4 support (loosely based on Ramya's code). + Currently if the NFSv4 mount fails with ENOENT we fail + back to NFSv3, unless -DNO_FALLBACK. + * Replace strdup with xstrdup. It is not nice to replace + system functions with ones that behave differently. + * Add various consistency checks (caller function checks + variable for NULL, but callee does not). + * Fix error handling in various paths. + * Don't check before using XFREE(). free(NULL) works. + +2011-09-15 Christos Zoulas + + * amq -i addition (prints info about the map files) + +2011-09-14 Christos Zoulas + + * Solaris OS and compiler fixes from: + Hofmann, Frank + Sayle, Alex + - (void)&var generates warnings, removed + - __inline is invalid, changed with inline + - and other headers have extra dependendcies + ` +2011-08-11 Christos Zoulas + + * fix potential buffer overflow in expand_error() + (Richard Kettlewell). Does not seem to be exploitable. + + * simplify %option parsing to appease ancient flex. + +2011-06-21 Christos Zoulas + + * add support for linux autofs version 5 (untested) + +2011-06-18 Christos Zoulas + + * roll back to an older version of libtool that works + + * newer versions of config.guess and config.sub + + * minor fixes to buildall + +2011-05-19 Christos Zoulas + + * m4/macros/libtool.m4: for AIX AC_LANG_PROGRAM is incorrectly + used and the latest autoconf gives an error. For now just + quote it. + + * configure.in: Fedora Core 15 and RedHat 6 now don't define + af_family_t in , but in . + Include so that we get + indirectly. This caused the detection + test to fail. + +2010-11-24 Erez Zadok + + * m4/macros/os_cflags.m4: for linux, define _GNU_SOURCE (to get + definitions for O_LARGEFILE and more). + +2010-11-20 Christos Zoulas + + * Update news items, add release readme, mark as rc1 + + * Fix addopts code to work with options that are key=value + when the built-in hasmntopt() code is not used. The problem + was that the code passed "key=" to hasmntopt not "key". + +2009-12-10 Christos Zoulas + + * Copy all fields of the am_opts structure + When we introduced am_loc we also added a function to + create a duplicate of an am_opts structure. As it turns + out, that only made a partial copy of the struct and some + fields (e.g. opt_cache) was left blank in the new structure. + Unfortunately any code that was checking the options + through the mntfs structure was mislead by the partial + copy: caching was disabled completely, for example, and + since browsing relies on caching being enabled it wasn't + working either. + From: Krisztian Kovacs + + * Initialize RPC authentication flavor to AUTH_UNIX instead + of zero. RHEL 5 uses version 6 of the mount_arg structure + that includes the desired RPC authorization flavour. + Unfortunately amd initializes that value to zero, meaning + AUTH_NULL, resulting in all NFS servers denying operations. + From: Krisztian Kovacs + + * Make sure to remove nodes in the proper order when going + down. Depending on what order the nodes got created it's + possible that the parent of a node has a bigger am_mapno + (index in exported_ap[]) so that it gets freed before + its child while the child's am_parent pointer is still + pointing to the already freed block of memory. + This change makes sure that umount_exported() cleans up + all children of a node first before freeing the node. + From: Krisztian Kovacs + + * Fix Linux-specific stuff in ops_tmpfs.c + AUTOFS_TMPFS_FS_FLAGS is defined only in the Linux-specific + conf_linux.c file, so it cannot be built on Solaris. + From: Krisztian Kovacs + + * Add missing parenthesis to fix defined(XXX + From: Krisztian Kovacs + + * In the previous commit we've already made a change that + makes this code unnecessary since the node is returned + even if the backing file server is known to be down. + Since the code path is unused it should be removed. + From: Krisztian Kovacs + + * amfs_generic_lookup_child() tries to find an alternate + file server if it detects that the current one is down. + However, in the comparison used to decide if a possible + mount is the same as the current one it compares the am_loc + pointers instead of the actual mntfs pointers. Since + amfs_lookup_one_location() creates a brand new am_loc + structure for the returned mntfs structure the am_loc + pointer will be different even if the mntfs it's pointing + to is the same. + This tricks amfs_generic_lookup_child() think it has + found an alternate file server while it hasn't and thus + starts multiple racing mounts for the very same node and + mntfs. + From: Krisztian Kovacs + + * In the new am_loc scheme mounted mntfs structures still + have their mf_fo structure left intact. So when restart + creates a fake mntfs for an already mounted filesystem it + should not free mf_fo right away. + From: Krisztian Kovacs + + * Setting the error flag of the mntfs for which the share + is already mounted results in the mount point not being + removed when it times out. (Amd considers it an error + mntfs and thus umount becomse a no-op.) + From: Krisztian Kovacs + + * Right now AMD sets all timeout values to their defaults + even if you explicitly set them to zero. This patch + introduces separate flags that store if the respective + values have been set and the code path setting default + values checks these flags instead of testing the values + for zero. [Linux only] + From: Krisztian Kovacs + + * Fix mntfs related lookup/(un)mount race conditions, by + introducing a new structure linking an mntfs to a node. + From: Krisztian Kovacs + + * We have to free the buffers allocated by the XDR routines when + decoding the mount response after copying them to their final place. + From: Krisztian Kovacs + +2009-12-09 Christos Zoulas + + * Free continuation in amfs_retry() if we don't call amfs_bgmount() + Normally it's amfs_bgmount() which frees the continuation. However, if + the mount is already in progress and we're in amfs_retry() for another + node we don't try mounting the filesystem once again. Still, we have + to free the continuation as we won't get called again and thus would + leak the continuation structure and our am_loc references. + From: Krisztian Kovacs + + * Fix use-after-free and double free of mntfs private data + ops_nfs.c(nfs_init) does not clear private data pointer after free(). + This leads to use-after-free and double free in case mount() fails. + (found by valgrind) + From: Krisztian Kovacs + +2009-11-23 Christos Zoulas + + * The temporary filename buffer was leaked in lock_mtab(). + From: Krisztian Kovacs + +2009-10-27 Christos Zoulas + + * Deal with errno.h->sys/errno.h better + +2009-10-26 Christos Zoulas + + * Fix issue with autoconf 2.63 + + * Fix compile warnings for gcc-4.4.x + +2009-04-15 Christos Zoulas + + * Share the LDAP connection between different maps to save resources + on the LDAP server. (Olaf Flebbe ) + +2009-03-20 Christos Zoulas + + * Fix largefile re-definitions + + * Fix compilation error caused in previous patch + +2009-02-19 Christos Zoulas + + * Add a synchronous unmount amq rpc that will wait for the remote + filesystem to be unmounted, or return an error. Enabled by amq -uu + +2009-01-11 Erez Zadok + + * amd/ops_udf.c: don't define functions/variables which may not be + used. + + * amd/ops_tmpfs.c (mount_tmpfs): force gcc not to complain about + unused variables. + + * config.guess.long: properly support Fedora Core. + +2009-01-09 Christos Zoulas + + * Fix nfs mounts on linux 2.6.26 by explicitly initializing context. + + * Treat an empty sublink as an unset sublink; this allows us to + say sublink:=; in a spec to override the default. (This produces + Bad selector error, but it works. XXX: We need to decide how to + unset a selector. I proposed an unset keyword a while ago). + +2009-01-06 Christos Zoulas + + * re-renerate all generated files with newer versions of the + auto-tools. + + * move INSTALL to INSTALL.am-utils to avoid conflicts + + * fix incompatibilities with new m4 and new autoconf. + + * add UDF filesystem support. + + * fix NetBSD nfs file handle detection. + +2009-01-02 Christos Zoulas + + * add nocasetrans, nojoliet, rrcaseins for cd9660 filesystems + +2008-12-03 Christos Zoulas + + * allow ldap queries try a comma-separated list of servers given as: + + ldap_hostports = host1:port1,host2,host3:port3 + + original patch from Florian Geyer + +2008-09-19 Christos Zoulas + + * the auth_create gid on NetBSD is int + + * deal with lossage from flex -P + + * fix missing/incorrect prototypes + +2008-09-17 Christos Zoulas + + * fix manual page section issues (sorting, non-existant) + + * add missing forward declarations + + * avoid null pointer derefs (coverity) + + * more portable endian detection support + + * implement tmpfs support + + * use sizeof var instead of constant + + * fix yyerror declaration and definition + + * fix yy function renaming, and correct some renaming issues. + + * work around automake < 1.9 issue where ylwrap is not being run + for a single yacc or lex file. + + * NetBSD + - handle headers that need other headers to compile + - add exfs and tmpfs specific glue + - add options log, noatime, nocoredump, nodevmtime, softdep, + symperm, union + - NetBSD's new mount system call needs the size of the opaque + filesystem specific structure, but passing 0 for now works. + We would need to change a lot more code to pass the size from + the fs-specific calls, so for now punt. + - recvfrom takes socklen_t * on NetBSD + - handle newer NetBSD using statvfs + - NetBSD calls its ufs ffs + + * Linux + - Most recent kernels have trouble with trying to parse the pid + hostname and do locking. What before was a silent failure, now + there is a warning printed and the mount is rejected. This is + the simplest fix: + (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=479884) + +2007-04-13 Erez Zadok + + * amd/sun_map.c (sun_append_str): When translating '&' from Sun + automounter maps, replace it with "${key}" in the Amd map, not + with the value of the key at the time. This way '*' maps work + too. + + * config.guess.long: don't use -q option to grep because some + systems don't support it. Bug fix for solaris. + +2007-03-11 Christos Zoulas + + * amd/opts.c (expand_op): Don't call xstrlcpy() to truncate a + string. It causes spurious xstrlcpy() syslog() errors. Use + memcpy() and explicitly terminate the string. + +2007-01-20 Erez Zadok + + * updated copyright year to 2007 on all files. + +2006-12-27 Erez Zadok + + * minor new port: ia64-hp-hpux11.23 + + * m4/macros/check_libwrap_severity.m4 (LIBS): also test if caller + needs to define rfc931_timeout. + + * amd/sun2amd.c: define rfc931_timeout and allow/deny_severity for + libwrap. + + * amd/amq_svc.c: some versions of libwrap require the caller to + define rfc931_timeout in addition to allow/deny_severity. + + * amd/amfs_toplvl.c (amfs_toplvl_init): properly detect when + forced unmount functionality exists for all systems. + + * libamu/mount_fs.c (compute_nfs_args): reset nfs_args_t->pathconf + only if field exists. + + * conf/nfs_prot/nfs_prot_hpux11.h: prevent HPUX 11.23 from + including or (TLI definitions are already + included from elsewhere). + + * configure.in: detect nfs_args_t->pathconf field. + +2006-11-27 Erez Zadok + + * doc/Makefile.am: properly publish html files using newer + text2html. + +2006-11-27 Erez Zadok + + * doc/Makefile.am: obfuscate emails in ChangeLog before it is *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Sat Dec 24 13:00:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93DDEC8E54C; Sat, 24 Dec 2016 13:00:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4A9921DE0; Sat, 24 Dec 2016 13:00:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOD0Jm1024475; Sat, 24 Dec 2016 13:00:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOD0JLw024474; Sat, 24 Dec 2016 13:00:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612241300.uBOD0JLw024474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 24 Dec 2016 13:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310507 - stable/10/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 13:00:20 -0000 Author: ngie Date: Sat Dec 24 13:00:19 2016 New Revision: 310507 URL: https://svnweb.freebsd.org/changeset/base/310507 Log: MFstable/11 r310506: MFC r309837: Change the process limits for RLIMIT_MEMLOCK to RLIM_INFINITY when executing :mincore_resid The default process limits in FreeBSD is 64kB for unprivileged users, which empirically is too low to run the :mincore_resid testcase. Process limits are inherited, so even though the default limit for root users is RLIM_INFINITY, the inherited limit with "sudo" with the default login.conf will be 64kB. Use setrlimit to set rlim_max for RLIMIT_MEMLOCK to RLIM_INFINITY to avoid ENOMEM issues when calling mlock to wire the mmap'ed address space. setrlimit requires root access to increase rlim_max, so require root privileges when running the test Discovered when executing the tests with sudo, e.g. "sudo kyua test -k /usr/tests/lib/libc/sys/Kyuafile mincore_test" Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Dec 24 12:58:33 2016 (r310506) +++ stable/10/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Sat Dec 24 13:00:19 2016 (r310507) @@ -144,6 +144,9 @@ ATF_TC_WITH_CLEANUP(mincore_resid); ATF_TC_HEAD(mincore_resid, tc) { atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(mincore_resid, tc) @@ -155,6 +158,13 @@ ATF_TC_BODY(mincore_resid, tc) struct rlimit rlim; ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0); +#ifdef __FreeBSD__ + /* + * Bump the mlock limit to unlimited so the rest of the testcase + * passes instead of failing on the mlock call. + */ + rlim.rlim_max = RLIM_INFINITY; +#endif rlim.rlim_cur = rlim.rlim_max; ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0); @@ -206,8 +216,9 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - ATF_REQUIRE_MSG(mlock(addr, npgs * page) == 0, "mlock failed: %s", - strerror(errno)); + if (mlock(addr, npgs * page) == -1 && errno != ENOMEM) + atf_tc_skip("could not wire anonymous test area, system might " + "be low on memory"); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); ATF_REQUIRE(munmap(addr, npgs * page) == 0); From owner-svn-src-stable-10@freebsd.org Sat Dec 24 13:28:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 758BBC8F2C6; Sat, 24 Dec 2016 13:28:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 44A441E59; Sat, 24 Dec 2016 13:28:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBODSdlP038492; Sat, 24 Dec 2016 13:28:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBODSd0D038490; Sat, 24 Dec 2016 13:28:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241328.uBODSd0D038490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 13:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310508 - in stable/10/sys/ia64: ia64 include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 13:28:40 -0000 Author: avg Date: Sat Dec 24 13:28:39 2016 New Revision: 310508 URL: https://svnweb.freebsd.org/changeset/base/310508 Log: define Maxmem for ia64, the only platform that didn't have it This is a direct commit to stable/10 as the platform was removed in the newer branches. Maxmem is required for compiling fwohci(4) on ia64 since commit r310081, MFC of r277511. It was easier to add Maxmem than to make a special case for ia64 in fwohci. Reported by: jhb, gjb Discussed with: kib, jhb Modified: stable/10/sys/ia64/ia64/physmem.c stable/10/sys/ia64/include/md_var.h Modified: stable/10/sys/ia64/ia64/physmem.c ============================================================================== --- stable/10/sys/ia64/ia64/physmem.c Sat Dec 24 13:00:19 2016 (r310507) +++ stable/10/sys/ia64/ia64/physmem.c Sat Dec 24 13:28:39 2016 (r310508) @@ -38,7 +38,7 @@ static u_int phys_avail_segs; vm_paddr_t phys_avail[2 * VM_PHYSSEG_MAX + 2]; vm_paddr_t paddr_max; - +long Maxmem; long realmem; static u_int @@ -168,6 +168,12 @@ ia64_physmem_fini(void) size = 1U << 27; realmem = (realmem + size - 1) & ~(size - 1); realmem = atop(realmem); + + /* + * Maxmem isn't the "maximum memory", it's one larger than the + * highest page of the physical address space. + */ + Maxmem = atop(paddr_max); return (0); } Modified: stable/10/sys/ia64/include/md_var.h ============================================================================== --- stable/10/sys/ia64/include/md_var.h Sat Dec 24 13:00:19 2016 (r310507) +++ stable/10/sys/ia64/include/md_var.h Sat Dec 24 13:28:39 2016 (r310508) @@ -75,6 +75,7 @@ struct ia64_init_return { extern uint64_t ia64_lapic_addr; extern vm_paddr_t paddr_max; +extern long Maxmem; extern u_int busdma_swi_pending; void *acpi_find_table(const char *sig); From owner-svn-src-stable-10@freebsd.org Sat Dec 24 13:36:35 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D908EC8F5F5; Sat, 24 Dec 2016 13:36:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6CC723C7; Sat, 24 Dec 2016 13:36:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA25273; Sat, 24 Dec 2016 15:36:32 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cKmUy-000H13-Oz; Sat, 24 Dec 2016 15:36:32 +0200 Subject: Re: svn commit: r308371 - in stable/10: share/man/man4 sys/conf sys/dev/jedec_ts sys/modules/i2c sys/modules/i2c/jedec_ts To: John Baldwin References: <201611061356.uA6DuYcO079294@repo.freebsd.org> <1625245.4edrXav981@ralph.baldwin.cx> <912ba7fd-353c-006e-ef65-faa12b83de9f@FreeBSD.org> <2547422.gn4y6NaJ31@ralph.baldwin.cx> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-10@FreeBSD.org From: Andriy Gapon Message-ID: <9c234848-2d27-b417-b78d-18bde988bc07@FreeBSD.org> Date: Sat, 24 Dec 2016 15:35:37 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <2547422.gn4y6NaJ31@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 13:36:36 -0000 On 19/12/2016 18:55, John Baldwin wrote: > Yes. Well, it fixes linking of kernels at least. Now make tinderbox > on 10 fails for the following kernels: > > _.ia64.GENERIC: Maxmem is not available on ia64. It is spelled > paddr_max instead. The firewire code is trying to use Maxmem. > _.ia64.LINT: Same. > _.arm.LINT: Many link errors and warnings, though lack of 'kbd_*' symbols > seems to be the only actual errors. > > I suspect you recently MFC'd changes to fwohci.c that are using Maxmem. > However, I'm not sure it is worth fixing fwohci on ia64. The ia64 problem should be fixed now. I added Maxmem as we discussed. -- Andriy Gapon From owner-svn-src-stable-10@freebsd.org Sat Dec 24 14:13:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 695C2C8FECD; Sat, 24 Dec 2016 14:13:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2A2F81B60; Sat, 24 Dec 2016 14:13:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOEDMTv058555; Sat, 24 Dec 2016 14:13:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOEDMnh058551; Sat, 24 Dec 2016 14:13:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241413.uBOEDMnh058551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 14:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310510 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 14:13:23 -0000 Author: avg Date: Sat Dec 24 14:13:21 2016 New Revision: 310510 URL: https://svnweb.freebsd.org/changeset/base/310510 Log: MFC r309097: MFV r308987: 7180 potential race between zfs_suspend_fs+zfs_resume_fs and zfs_ioc_rename Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Dec 24 14:12:52 2016 (r310509) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Dec 24 14:13:21 2016 (r310510) @@ -142,7 +142,7 @@ extern uint_t zfs_fsyncer_key; extern int zfs_super_owner; extern int zfs_suspend_fs(zfsvfs_t *zfsvfs); -extern int zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname); +extern int zfs_resume_fs(zfsvfs_t *zfsvfs, struct dsl_dataset *ds); extern int zfs_userspace_one(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, const char *domain, uint64_t rid, uint64_t *valuep); extern int zfs_userspace_many(zfsvfs_t *zfsvfs, zfs_userquota_prop_t type, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Dec 24 14:12:52 2016 (r310509) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Dec 24 14:13:21 2016 (r310510) @@ -3788,12 +3788,15 @@ zfs_ioc_rollback(const char *fsname, nvl int error; if (getzfsvfs(fsname, &zfsvfs) == 0) { + dsl_dataset_t *ds; + + ds = dmu_objset_ds(zfsvfs->z_os); error = zfs_suspend_fs(zfsvfs); if (error == 0) { int resume_err; error = dsl_dataset_rollback(fsname, zfsvfs, outnvl); - resume_err = zfs_resume_fs(zfsvfs, fsname); + resume_err = zfs_resume_fs(zfsvfs, ds); error = error ? error : resume_err; } #ifdef illumos @@ -4444,8 +4447,10 @@ zfs_ioc_recv(zfs_cmd_t *zc) if (getzfsvfs(tofs, &zfsvfs) == 0) { /* online recv */ + dsl_dataset_t *ds; int end_err; + ds = dmu_objset_ds(zfsvfs->z_os); error = zfs_suspend_fs(zfsvfs); /* * If the suspend fails, then the recv_end will @@ -4453,7 +4458,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) */ end_err = dmu_recv_end(&drc, zfsvfs); if (error == 0) - error = zfs_resume_fs(zfsvfs, tofs); + error = zfs_resume_fs(zfsvfs, ds); error = error ? error : end_err; #ifdef illumos VFS_RELE(zfsvfs->z_vfs); @@ -4999,11 +5004,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc) * objset needs to be closed & reopened (to grow the * objset_phys_t). Suspend/resume the fs will do that. */ + dsl_dataset_t *ds; + + ds = dmu_objset_ds(zfsvfs->z_os); error = zfs_suspend_fs(zfsvfs); if (error == 0) { dmu_objset_refresh_ownership(zfsvfs->z_os, zfsvfs); - error = zfs_resume_fs(zfsvfs, zc->zc_name); + error = zfs_resume_fs(zfsvfs, ds); } } if (error == 0) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 24 14:12:52 2016 (r310509) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 24 14:13:21 2016 (r310510) @@ -2226,7 +2226,7 @@ zfs_suspend_fs(zfsvfs_t *zfsvfs) * zfsvfs, held, and long held on entry. */ int -zfs_resume_fs(zfsvfs_t *zfsvfs, const char *osname) +zfs_resume_fs(zfsvfs_t *zfsvfs, dsl_dataset_t *ds) { int err; znode_t *zp; @@ -2235,14 +2235,13 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); /* - * We already own this, so just hold and rele it to update the - * objset_t, as the one we had before may have been evicted. + * We already own this, so just update the objset_t, as the one we + * had before may have been evicted. */ objset_t *os; - VERIFY0(dmu_objset_hold(osname, zfsvfs, &os)); - VERIFY3P(os->os_dsl_dataset->ds_owner, ==, zfsvfs); - VERIFY(dsl_dataset_long_held(os->os_dsl_dataset)); - dmu_objset_rele(os, zfsvfs); + VERIFY3P(ds->ds_owner, ==, zfsvfs); + VERIFY(dsl_dataset_long_held(ds)); + VERIFY0(dmu_objset_from_ds(ds, &os)); err = zfsvfs_init(zfsvfs, os); if (err != 0) From owner-svn-src-stable-10@freebsd.org Sat Dec 24 14:17:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC950C8FFDF; Sat, 24 Dec 2016 14:17:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 91A1B1D9F; Sat, 24 Dec 2016 14:17:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOEHoFB058813; Sat, 24 Dec 2016 14:17:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOEHodj058810; Sat, 24 Dec 2016 14:17:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241417.uBOEHodj058810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 14:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310512 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 14:17:51 -0000 Author: avg Date: Sat Dec 24 14:17:50 2016 New Revision: 310512 URL: https://svnweb.freebsd.org/changeset/base/310512 Log: MFC r309098: MFV r308988: 7199, 7200 dsl_dataset_rollback_sync may try to free already free blocks Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Dec 24 14:17:41 2016 (r310511) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Dec 24 14:17:50 2016 (r310512) @@ -88,6 +88,8 @@ extern inline dsl_dataset_phys_t *dsl_da extern int spa_asize_inflation; +static zil_header_t zero_zil; + /* * Figure out how much of this delta should be propogated to the dsl_dir * layer. If there's a refreservation, that space has already been @@ -132,6 +134,7 @@ dsl_dataset_block_born(dsl_dataset_t *ds return; } + ASSERT3U(bp->blk_birth, >, dsl_dataset_phys(ds)->ds_prev_snap_txg); dmu_buf_will_dirty(ds->ds_dbuf, tx); mutex_enter(&ds->ds_lock); delta = parent_delta(ds, used); @@ -902,8 +905,20 @@ dsl_dataset_zero_zil(dsl_dataset_t *ds, objset_t *os; VERIFY0(dmu_objset_from_ds(ds, &os)); - bzero(&os->os_zil_header, sizeof (os->os_zil_header)); - dsl_dataset_dirty(ds, tx); + if (bcmp(&os->os_zil_header, &zero_zil, sizeof (zero_zil)) != 0) { + dsl_pool_t *dp = ds->ds_dir->dd_pool; + zio_t *zio; + + bzero(&os->os_zil_header, sizeof (os->os_zil_header)); + + zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); + dsl_dataset_sync(ds, zio, tx); + VERIFY0(zio_wait(zio)); + + /* dsl_dataset_sync_done will drop this reference. */ + dmu_buf_add_ref(ds->ds_dbuf, ds); + dsl_dataset_sync_done(ds, tx); + } } uint64_t @@ -1083,8 +1098,10 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu if (dsl_dataset_phys(ds)->ds_next_snap_obj != 0) panic("dirtying snapshot!"); - dp = ds->ds_dir->dd_pool; + /* Must not dirty a dataset in the same txg where it got snapshotted. */ + ASSERT3U(tx->tx_txg, >, dsl_dataset_phys(ds)->ds_prev_snap_txg); + dp = ds->ds_dir->dd_pool; if (txg_list_add(&dp->dp_dirty_datasets, ds, tx->tx_txg)) { /* up the hold count until we can be written out */ dmu_buf_add_ref(ds->ds_dbuf, ds); @@ -1339,8 +1356,6 @@ void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx) { - static zil_header_t zero_zil; - dsl_pool_t *dp = ds->ds_dir->dd_pool; dmu_buf_t *dbuf; dsl_dataset_phys_t *dsphys; @@ -1359,6 +1374,10 @@ dsl_dataset_snapshot_sync_impl(dsl_datas bcmp(&os->os_phys->os_zil_header, &zero_zil, sizeof (zero_zil)) == 0); + /* Should not snapshot a dirty dataset. */ + ASSERT(!txg_list_member(&ds->ds_dir->dd_pool->dp_dirty_datasets, + ds, tx->tx_txg)); + dsl_fs_ss_count_adjust(ds->ds_dir, 1, DD_FIELD_SNAPSHOT_COUNT, tx); /* @@ -1718,6 +1737,27 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ } } +static int +deadlist_enqueue_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) +{ + dsl_deadlist_t *dl = arg; + dsl_deadlist_insert(dl, bp, tx); + return (0); +} + +void +dsl_dataset_sync_done(dsl_dataset_t *ds, dmu_tx_t *tx) +{ + objset_t *os = ds->ds_objset; + + bplist_iterate(&ds->ds_pending_deadlist, + deadlist_enqueue_cb, &ds->ds_deadlist, tx); + + ASSERT(!dmu_objset_is_dirty(os, dmu_tx_get_txg(tx))); + + dmu_buf_rele(ds->ds_dbuf, ds); +} + static void get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) { @@ -2237,6 +2277,18 @@ dsl_dataset_rollback_check(void *arg, dm return (SET_ERROR(EINVAL)); } + /* + * No rollback to a snapshot created in the current txg, because + * the rollback may dirty the dataset and create blocks that are + * not reachable from the rootbp while having a birth txg that + * falls into the snapshot's range. + */ + if (dmu_tx_is_syncing(tx) && + dsl_dataset_phys(ds)->ds_prev_snap_txg >= tx->tx_txg) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(EAGAIN)); + } + /* must not have any bookmarks after the most recent snapshot */ nvlist_t *proprequest = fnvlist_alloc(); fnvlist_add_boolean(proprequest, zfs_prop_to_name(ZFS_PROP_CREATETXG)); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Dec 24 14:17:41 2016 (r310511) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Dec 24 14:17:50 2016 (r310512) @@ -528,14 +528,6 @@ dsl_pool_mos_diduse_space(dsl_pool_t *dp mutex_exit(&dp->dp_lock); } -static int -deadlist_enqueue_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) -{ - dsl_deadlist_t *dl = arg; - dsl_deadlist_insert(dl, bp, tx); - return (0); -} - static void dsl_pool_sync_mos(dsl_pool_t *dp, dmu_tx_t *tx) { @@ -636,11 +628,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t * - release hold from dsl_dataset_dirty() */ while ((ds = list_remove_head(&synced_datasets)) != NULL) { - objset_t *os = ds->ds_objset; - bplist_iterate(&ds->ds_pending_deadlist, - deadlist_enqueue_cb, &ds->ds_deadlist, tx); - ASSERT(!dmu_objset_is_dirty(os, txg)); - dmu_buf_rele(ds->ds_dbuf, ds); + dsl_dataset_sync_done(ds, tx); } while ((dd = txg_list_remove(&dp->dp_dirty_dirs, txg)) != NULL) { dsl_dir_sync(dd, tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Dec 24 14:17:41 2016 (r310511) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Sat Dec 24 14:17:50 2016 (r310512) @@ -274,6 +274,7 @@ boolean_t dsl_dataset_modified_since_sna dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); +void dsl_dataset_sync_done(dsl_dataset_t *os, dmu_tx_t *tx); void dsl_dataset_block_born(dsl_dataset_t *ds, const blkptr_t *bp, dmu_tx_t *tx); From owner-svn-src-stable-10@freebsd.org Sat Dec 24 14:23:15 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F33C8E337; Sat, 24 Dec 2016 14:23:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 BA8CC635; Sat, 24 Dec 2016 14:23:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOENEVW062705; Sat, 24 Dec 2016 14:23:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOENErn062704; Sat, 24 Dec 2016 14:23:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241423.uBOENErn062704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 14:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310514 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 14:23:16 -0000 Author: avg Date: Sat Dec 24 14:23:14 2016 New Revision: 310514 URL: https://svnweb.freebsd.org/changeset/base/310514 Log: MFC r309099: MFV r308990: 7181 race between zfs_mount and zfs_ioc_rollback Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 24 14:23:09 2016 (r310513) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Dec 24 14:23:14 2016 (r310514) @@ -1040,13 +1040,6 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t if (error) return (error); - /* - * Set the objset user_ptr to track its zfsvfs. - */ - mutex_enter(&zfsvfs->z_os->os_user_ptr_lock); - dmu_objset_set_user(zfsvfs->z_os, zfsvfs); - mutex_exit(&zfsvfs->z_os->os_user_ptr_lock); - zfsvfs->z_log = zil_open(zfsvfs->z_os, zfs_get_data); /* @@ -1107,6 +1100,13 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t zfsvfs->z_vfs->vfs_flag |= readonly; /* restore readonly bit */ } + /* + * Set the objset user_ptr to track its zfsvfs. + */ + mutex_enter(&zfsvfs->z_os->os_user_ptr_lock); + dmu_objset_set_user(zfsvfs->z_os, zfsvfs); + mutex_exit(&zfsvfs->z_os->os_user_ptr_lock); + return (0); } From owner-svn-src-stable-10@freebsd.org Sat Dec 24 14:25:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61674C8E4CB; Sat, 24 Dec 2016 14:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3B6D7A36; Sat, 24 Dec 2016 14:25:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOEPQGY062997; Sat, 24 Dec 2016 14:25:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOEPQOr062994; Sat, 24 Dec 2016 14:25:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241425.uBOEPQOr062994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 14:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310516 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 14:25:27 -0000 Author: avg Date: Sat Dec 24 14:25:25 2016 New Revision: 310516 URL: https://svnweb.freebsd.org/changeset/base/310516 Log: MFC r309250: MFV r309249: 3821 Race in rollback, zil close, and zil flush Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Dec 24 14:25:20 2016 (r310515) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Sat Dec 24 14:25:25 2016 (r310516) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -685,9 +685,16 @@ dsl_pool_sync_done(dsl_pool_t *dp, uint6 { zilog_t *zilog; - while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + while (zilog = txg_list_head(&dp->dp_dirty_zilogs, txg)) { dsl_dataset_t *ds = dmu_objset_ds(zilog->zl_os); + /* + * We don't remove the zilog from the dp_dirty_zilogs + * list until after we've cleaned it. This ensures that + * callers of zilog_is_dirty() receive an accurate + * answer when they are racing with the spa sync thread. + */ zil_clean(zilog, txg); + (void) txg_list_remove_this(&dp->dp_dirty_zilogs, zilog, txg); ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); dmu_buf_rele(ds->ds_dbuf, zilog); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 24 14:25:20 2016 (r310515) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Dec 24 14:25:25 2016 (r310516) @@ -6881,8 +6881,6 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_config_syncing = NULL; } - spa->spa_ubsync = spa->spa_uberblock; - dsl_pool_sync_done(dp, txg); mutex_enter(&spa->spa_alloc_lock); @@ -6907,6 +6905,13 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_pass = 0; + /* + * Update the last synced uberblock here. We want to do this at + * the end of spa_sync() so that consumers of spa_last_synced_txg() + * will be guaranteed that all the processing associated with + * that txg has been completed. + */ + spa->spa_ubsync = spa->spa_uberblock; spa_config_exit(spa, SCL_CONFIG, FTAG); spa_handle_ignored_writes(spa); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 24 14:25:20 2016 (r310515) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Dec 24 14:25:25 2016 (r310516) @@ -20,8 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -495,6 +494,27 @@ zilog_dirty(zilog_t *zilog, uint64_t txg } } +/* + * Determine if the zil is dirty in the specified txg. Callers wanting to + * ensure that the dirty state does not change must hold the itxg_lock for + * the specified txg. Holding the lock will ensure that the zil cannot be + * dirtied (zil_itx_assign) or cleaned (zil_clean) while we check its current + * state. + */ +boolean_t +zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + + if (txg_list_member(&dp->dp_dirty_zilogs, zilog, txg & TXG_MASK)) + return (B_TRUE); + return (B_FALSE); +} + +/* + * Determine if the zil is dirty. The zil is considered dirty if it has + * any pending itx records that have not been cleaned by zil_clean(). + */ boolean_t zilog_is_dirty(zilog_t *zilog) { @@ -1058,8 +1078,6 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it return (NULL); ASSERT(lwb->lwb_buf != NULL); - ASSERT(zilog_is_dirty(zilog) || - spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) dlen = P2ROUNDUP_TYPED( @@ -1392,6 +1410,11 @@ zil_get_commit_list(zilog_t *zilog) else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. That's okay since we'll + * only commit things in the future. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1401,6 +1424,16 @@ zil_get_commit_list(zilog_t *zilog) continue; } + /* + * If we're adding itx records to the zl_itx_commit_list, + * then the zil better be dirty in this "txg". We can assert + * that here since we're holding the itxg_lock which will + * prevent spa_sync from cleaning it. Once we add the itxs + * to the zl_itx_commit_list we must commit it to disk even + * if it's unnecessary (i.e. the txg was synced). + */ + ASSERT(zilog_is_dirty_in_txg(zilog, txg) || + spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); list_move_tail(commit_list, &itxg->itxg_itxs->i_sync_list); push_sod += itxg->itxg_sod; itxg->itxg_sod = 0; @@ -1426,6 +1459,10 @@ zil_async_to_sync(zilog_t *zilog, uint64 else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1497,8 +1534,14 @@ zil_commit_writer(zilog_t *zilog) DTRACE_PROBE1(zil__cw1, zilog_t *, zilog); while (itx = list_head(&zilog->zl_itx_commit_list)) { txg = itx->itx_lr.lrc_txg; - ASSERT(txg); + ASSERT3U(txg, !=, 0); + /* + * This is inherently racy and may result in us writing + * out a log block for a txg that was just synced. This is + * ok since we'll end cleaning up that log block the next + * time we call zil_sync(). + */ if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa)) lwb = zil_lwb_commit(zilog, itx, lwb); list_remove(&zilog->zl_itx_commit_list, itx); @@ -1815,7 +1858,10 @@ zil_close(zilog_t *zilog) mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); - ASSERT(!zilog_is_dirty(zilog)); + + if (zilog_is_dirty(zilog)) + zfs_dbgmsg("zil (%p) is dirty, txg %llu", zilog, txg); + VERIFY(!zilog_is_dirty(zilog)); taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; From owner-svn-src-stable-10@freebsd.org Sat Dec 24 14:48:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F154C8D13A; Sat, 24 Dec 2016 14:48:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2487A1E0A; Sat, 24 Dec 2016 14:48:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBOEmSct071896; Sat, 24 Dec 2016 14:48:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBOEmSLF071895; Sat, 24 Dec 2016 14:48:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201612241448.uBOEmSLF071895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 24 Dec 2016 14:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r310521 - stable/10/sys/dev/iicbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2016 14:48:29 -0000 Author: avg Date: Sat Dec 24 14:48:28 2016 New Revision: 310521 URL: https://svnweb.freebsd.org/changeset/base/310521 Log: MFC r308530: iicsmb: SMB_MAXBLOCKSIZE can be used again Modified: stable/10/sys/dev/iicbus/iicsmb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicsmb.c ============================================================================== --- stable/10/sys/dev/iicbus/iicsmb.c Sat Dec 24 14:44:25 2016 (r310520) +++ stable/10/sys/dev/iicbus/iicsmb.c Sat Dec 24 14:48:28 2016 (r310521) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "iicbus_if.h" @@ -432,7 +433,7 @@ iicsmb_bwrite(device_t dev, u_char slave }; int error; - if (count > 32 || count == 0) + if (count > SMB_MAXBLOCKSIZE || count == 0) return (SMB_EINVAL); error = TRANSFER_MSGS(dev, msgs); return (iic2smb_error(error)); @@ -450,12 +451,6 @@ iicsmb_bread(device_t dev, u_char slave, }; device_t parent = device_get_parent(dev); int error; - u_char bufsz; - - /* Stash output buffer size before overwriting it. */ - bufsz = *count; - if (bufsz == 0) - return (SMB_EINVAL); /* Have to do this because the command is split in two transfers. */ error = iicbus_request_bus(parent, dev, IIC_WAIT); @@ -465,18 +460,13 @@ iicsmb_bread(device_t dev, u_char slave, /* * If the slave offers an empty or a too long reply, * read one byte to generate the stop or abort. - * XXX 32 is hardcoded until SMB_MAXBLOCKSIZE is restored - * to sanity. */ - if (*count > 32 || *count == 0) + if (*count > SMB_MAXBLOCKSIZE || *count == 0) block_msg[0].len = 1; - /* If longer than the buffer, then clamp at the buffer size. */ - if (*count > bufsz) - block_msg[0].len = bufsz; else block_msg[0].len = *count; error = TRANSFER_MSGS(dev, block_msg); - if (*count > 32 || *count == 0) + if (*count > SMB_MAXBLOCKSIZE || *count == 0) error = SMB_EINVAL; } (void)iicbus_release_bus(parent, dev);