From owner-svn-src-stable@freebsd.org Sun Oct 27 03:46:02 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6EED159CEB; Sun, 27 Oct 2019 03:46:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4713ff5Sjtz4Flb; Sun, 27 Oct 2019 03:46:02 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DF981B6DA; Sun, 27 Oct 2019 03:46:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9R3k2P7020136; Sun, 27 Oct 2019 03:46:02 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R3k2aW020135; Sun, 27 Oct 2019 03:46:02 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270346.x9R3k2aW020135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 03:46:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354122 - stable/12/sbin/fsck_ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sbin/fsck_ffs X-SVN-Commit-Revision: 354122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2019 03:46:03 -0000 Author: mckusick Date: Sun Oct 27 03:46:00 2019 New Revision: 354122 URL: https://svnweb.freebsd.org/changeset/base/354122 Log: MFC of 353903 Fix uninitialized variable in SUJ recovery. Modified: stable/12/sbin/fsck_ffs/suj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/suj.c ============================================================================== --- stable/12/sbin/fsck_ffs/suj.c Sat Oct 26 21:19:55 2019 (r354121) +++ stable/12/sbin/fsck_ffs/suj.c Sun Oct 27 03:46:00 2019 (r354122) @@ -1544,7 +1544,7 @@ ino_trunc(ino_t ino, off_t size) /* If we freed everything in this indirect free the indir. */ if (lastlbn > lbn) continue; - blk_free(DIP(ip, di_ib[i]), 0, frags); + blk_free(DIP(ip, di_ib[i]), 0, fs->fs_frag); DIP_SET(ip, di_ib[i], 0); } ino_dirty(ino); From owner-svn-src-stable@freebsd.org Sun Oct 27 03:47:16 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB351159F60; Sun, 27 Oct 2019 03:47:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4713h461wTz4Fvg; Sun, 27 Oct 2019 03:47:16 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B33951B6DD; Sun, 27 Oct 2019 03:47:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9R3lG7V020243; Sun, 27 Oct 2019 03:47:16 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R3lGuZ020242; Sun, 27 Oct 2019 03:47:16 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270347.x9R3lGuZ020242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 03:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354123 - stable/11/sbin/fsck_ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sbin/fsck_ffs X-SVN-Commit-Revision: 354123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2019 03:47:17 -0000 Author: mckusick Date: Sun Oct 27 03:47:16 2019 New Revision: 354123 URL: https://svnweb.freebsd.org/changeset/base/354123 Log: MFC of 353903 Fix uninitialized variable in SUJ recovery. Modified: stable/11/sbin/fsck_ffs/suj.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/suj.c ============================================================================== --- stable/11/sbin/fsck_ffs/suj.c Sun Oct 27 03:46:00 2019 (r354122) +++ stable/11/sbin/fsck_ffs/suj.c Sun Oct 27 03:47:16 2019 (r354123) @@ -1566,7 +1566,7 @@ ino_trunc(ino_t ino, off_t size) /* If we freed everything in this indirect free the indir. */ if (lastlbn > lbn) continue; - blk_free(DIP(ip, di_ib[i]), 0, frags); + blk_free(DIP(ip, di_ib[i]), 0, fs->fs_frag); DIP_SET(ip, di_ib[i], 0); } ino_dirty(ino); From owner-svn-src-stable@freebsd.org Sun Oct 27 04:09:26 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC7D15C095; Sun, 27 Oct 2019 04:09:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47149d3PL2z4H8L; Sun, 27 Oct 2019 04:09:25 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCB711BA9D; Sun, 27 Oct 2019 04:09:24 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9R49OCk032207; Sun, 27 Oct 2019 04:09:24 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R49O1w032206; Sun, 27 Oct 2019 04:09:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270409.x9R49O1w032206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 04:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354124 - stable/12/sys/ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/ufs/ufs X-SVN-Commit-Revision: 354124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2019 04:09:26 -0000 Author: mckusick Date: Sun Oct 27 04:09:24 2019 New Revision: 354124 URL: https://svnweb.freebsd.org/changeset/base/354124 Log: MFC of 354050 Ensure that ctime update is visible immediately Modified: stable/12/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 03:47:16 2019 (r354123) +++ stable/12/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:09:24 2019 (r354124) @@ -1178,6 +1178,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) */ if (ip) { ip->i_effnlink--; + ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(dvp)) { softdep_setup_unlink(dp, ip); } else { @@ -1291,6 +1292,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) * necessary. */ oip->i_effnlink--; + oip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(vdp)) { softdep_setup_unlink(dp, oip); } else { From owner-svn-src-stable@freebsd.org Sun Oct 27 04:10:50 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1304215C257; Sun, 27 Oct 2019 04:10:50 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4714CF68qlz4HJR; Sun, 27 Oct 2019 04:10:49 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2B791BAC6; Sun, 27 Oct 2019 04:10:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9R4AnYQ032349; Sun, 27 Oct 2019 04:10:49 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R4AnNI032348; Sun, 27 Oct 2019 04:10:49 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201910270410.x9R4AnNI032348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 27 Oct 2019 04:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354125 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ufs X-SVN-Commit-Revision: 354125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2019 04:10:50 -0000 Author: mckusick Date: Sun Oct 27 04:10:49 2019 New Revision: 354125 URL: https://svnweb.freebsd.org/changeset/base/354125 Log: MFC of 354050 Ensure that ctime update is visible immediately Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:09:24 2019 (r354124) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Sun Oct 27 04:10:49 2019 (r354125) @@ -1176,6 +1176,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) */ if (ip) { ip->i_effnlink--; + ip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(dvp)) { softdep_setup_unlink(dp, ip); } else { @@ -1289,6 +1290,7 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) * necessary. */ oip->i_effnlink--; + oip->i_flag |= IN_CHANGE; if (DOINGSOFTDEP(vdp)) { softdep_setup_unlink(dp, oip); } else { From owner-svn-src-stable@freebsd.org Sun Oct 27 09:28:34 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A271E170F71; Sun, 27 Oct 2019 09:28:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471CFt3rMPz4WCq; Sun, 27 Oct 2019 09:28:34 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66CE91F304; Sun, 27 Oct 2019 09:28:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9R9SY5I020252; Sun, 27 Oct 2019 09:28:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9R9SXnl020247; Sun, 27 Oct 2019 09:28:33 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910270928.x9R9SXnl020247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 27 Oct 2019 09:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354128 - in stable/12: sys/dev/netmap tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: sys/dev/netmap tools/tools/netmap X-SVN-Commit-Revision: 354128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2019 09:28:34 -0000 Author: vmaffione Date: Sun Oct 27 09:28:33 2019 New Revision: 354128 URL: https://svnweb.freebsd.org/changeset/base/354128 Log: MFC r353775 netmap: minor misc improvements - use ring->head rather than ring->cur in lb(8) - use strlcat() rather than strncat() - fix bandwidth computation in pkt-gen(8) Modified: stable/12/sys/dev/netmap/netmap.c stable/12/sys/dev/netmap/netmap_legacy.c stable/12/sys/dev/netmap/netmap_mem2.c stable/12/tools/tools/netmap/lb.c stable/12/tools/tools/netmap/pkt-gen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/netmap/netmap.c ============================================================================== --- stable/12/sys/dev/netmap/netmap.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap.c Sun Oct 27 09:28:33 2019 (r354128) @@ -3316,7 +3316,8 @@ nmreq_getoption(struct nmreq_header *hdr, uint16_t req if (!hdr->nr_options) return NULL; - opt_tab = (struct nmreq_option **)(hdr->nr_options) - (NETMAP_REQ_OPT_MAX + 1); + opt_tab = (struct nmreq_option **)((uintptr_t)hdr->nr_options) - + (NETMAP_REQ_OPT_MAX + 1); return opt_tab[reqtype]; } Modified: stable/12/sys/dev/netmap/netmap_legacy.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_legacy.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap_legacy.c Sun Oct 27 09:28:33 2019 (r354128) @@ -100,7 +100,7 @@ nmreq_register_from_legacy(struct nmreq *nmr, struct n /* No space for the pipe suffix. */ return ENOBUFS; } - strncat(hdr->nr_name, suffix, strlen(suffix)); + strlcat(hdr->nr_name, suffix, sizeof(hdr->nr_name)); req->nr_mode = NR_REG_ALL_NIC; req->nr_ringid = 0; } Modified: stable/12/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/12/sys/dev/netmap/netmap_mem2.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/sys/dev/netmap/netmap_mem2.c Sun Oct 27 09:28:33 2019 (r354128) @@ -2447,8 +2447,8 @@ netmap_mem_pt_guest_ifp_del(struct netmap_mem_d *nmd, } else { ptnmd->pt_ifs = curr->next; } - nm_prinf("removed (ifp=%p,nifp_offset=%u)", - curr->ifp, curr->nifp_offset); + nm_prinf("removed (ifp=%s,nifp_offset=%u)", + curr->ifp->if_xname, curr->nifp_offset); nm_os_free(curr); ret = 0; break; Modified: stable/12/tools/tools/netmap/lb.c ============================================================================== --- stable/12/tools/tools/netmap/lb.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/tools/tools/netmap/lb.c Sun Oct 27 09:28:33 2019 (r354128) @@ -652,7 +652,7 @@ int main(int argc, char **argv) /* extract the base name */ char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? glob_arg.ifname : glob_arg.ifname + 7; - strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN-1); + strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN - 1); for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) ; *nscan = '\0'; @@ -948,8 +948,8 @@ run: struct netmap_ring *rxring = NETMAP_RXRING(rxport->nmd->nifp, i); //D("prepare to scan rings"); - int next_cur = rxring->cur; - struct netmap_slot *next_slot = &rxring->slot[next_cur]; + int next_head = rxring->head; + struct netmap_slot *next_slot = &rxring->slot[next_head]; const char *next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); while (!nm_ring_empty(rxring)) { struct netmap_slot *rs = next_slot; @@ -963,14 +963,14 @@ run: non_ip++; // XXX ?? } // prefetch the buffer for the next round - next_cur = nm_ring_next(rxring, next_cur); - next_slot = &rxring->slot[next_cur]; + next_head = nm_ring_next(rxring, next_head); + next_slot = &rxring->slot[next_head]; next_buf = NETMAP_BUF(rxring, next_slot->buf_idx); __builtin_prefetch(next_buf); // 'B' is just a hashing seed rs->buf_idx = forward_packet(g, rs); rs->flags |= NS_BUF_CHANGED; - rxring->head = rxring->cur = next_cur; + rxring->head = rxring->cur = next_head; batch++; if (unlikely(batch >= glob_arg.batch)) { Modified: stable/12/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.c Sun Oct 27 08:35:29 2019 (r354127) +++ stable/12/tools/tools/netmap/pkt-gen.c Sun Oct 27 09:28:33 2019 (r354128) @@ -2634,7 +2634,7 @@ main_thread(struct glob_arg *g) D("%spps %s(%spkts %sbps in %llu usec) %.2f avg_batch %d min_space", norm(b1, pps, normalize), b4, norm(b2, (double)x.pkts, normalize), - norm(b3, (double)x.bytes*8+(double)x.pkts*g->framing, normalize), + norm(b3, 1000000*((double)x.bytes*8+(double)x.pkts*g->framing)/usec, normalize), (unsigned long long)usec, abs, (int)cur.min_space); prev = cur; @@ -2973,6 +2973,7 @@ main(int arc, char **argv) g.options |= OPT_DUMP; break; case 'C': + D("WARNING: the 'C' option is deprecated, use the '+conf:' libnetmap option instead"); g.nmr_config = strdup(optarg); break; case 'H': From owner-svn-src-stable@freebsd.org Mon Oct 28 01:44:32 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E38EC15FBD7; Mon, 28 Oct 2019 01:44:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471cw06TQ3z4N4W; Mon, 28 Oct 2019 01:44:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C15CE227B; Mon, 28 Oct 2019 01:44:32 +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 x9S1iWO0002631; Mon, 28 Oct 2019 01:44:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9S1iVDP002625; Mon, 28 Oct 2019 01:44:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910280144.x9S1iVDP002625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 28 Oct 2019 01:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354131 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 01:44:33 -0000 Author: rmacklem Date: Mon Oct 28 01:44:31 2019 New Revision: 354131 URL: https://svnweb.freebsd.org/changeset/base/354131 Log: MFC: r352636 Replace all mtx_lock()/mtx_unlock() on n_mtx with the macros. For a long time, some places in the NFS code have locked/unlocked the NFS node lock with the macros NFSLOCKNODE()/NFSUNLOCKNODE() whereas others have simply used mtx_lock()/mtx_unlock(). Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called, replace all occurrences of mtx_lock/mtx_unlock with the macros to simply making the change to an sx lock in future commit. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clnode.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clsubs.c stable/12/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 01:44:31 2019 (r354131) @@ -857,11 +857,11 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); #define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - mtx_lock(&((n)->n_mtx)); \ + NFSLOCKNODE(n); \ (n)->n_mtime = (a)->na_mtime; \ if (v4) \ (n)->n_change = (a)->na_filerev; \ - mtx_unlock(&((n)->n_mtx)); \ + NFSUNLOCKNODE(n); \ } \ } while (0) Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 01:44:31 2019 (r354131) @@ -101,9 +101,9 @@ ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) int biosize, bcount; np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); biosize = vp->v_bufobj.bo_bsize; bcount = biosize; @@ -144,13 +144,13 @@ ncl_getpages(struct vop_getpages_args *ap) } if (newnfs_directio_enable && !newnfs_directio_allow_mmap) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_getpages: called on non-cacheable vnode\n"); return (VM_PAGER_ERROR); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } mtx_lock(&nmp->nm_mtx); @@ -301,12 +301,12 @@ ncl_putpages(struct vop_putpages_args *ap) } else mtx_unlock(&nmp->nm_mtx); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (newnfs_directio_enable && !newnfs_directio_allow_mmap && (np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_putpages: called on noncache-able vnode\n"); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * When putting pages, do not extend file past EOF. @@ -316,7 +316,7 @@ ncl_putpages(struct vop_putpages_args *ap) if (count < 0) count = 0; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); for (i = 0; i < npages; i++) rtvals[i] = VM_PAGER_ERROR; @@ -374,9 +374,9 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type != VREG) { if (vp->v_type != VDIR) panic("nfs: bioread, not dir"); @@ -390,28 +390,28 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NSIZECHANGED) || (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type == VDIR) ncl_invaldir(vp); error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); if (error != 0) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; np->n_flag &= ~NSIZECHANGED; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } out: ncl_excl_finish(vp, old_lock); @@ -474,9 +474,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof do { u_quad_t nsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); switch (vp->v_type) { case VREG: @@ -883,13 +883,13 @@ ncl_write(struct vop_write_args *ap) ("ncl_write proc")); if (vp->v_type != VREG) return (EIO); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (np->n_error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); mtx_lock(&nmp->nm_mtx); if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { @@ -906,9 +906,9 @@ ncl_write(struct vop_write_args *ap) * mode or if we are appending. */ if (ioflag & (IO_APPEND | IO_SYNC)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef notyet /* Needs matching nonblock semantics elsewhere, too. */ /* * Require non-blocking, synchronous writes to @@ -925,13 +925,13 @@ ncl_write(struct vop_write_args *ap) if (error != 0) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } orig_resid = uio->uio_resid; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); orig_size = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If IO_APPEND then load uio_offset. We restart here if we cannot @@ -943,9 +943,9 @@ ncl_write(struct vop_write_args *ap) error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); uio->uio_offset = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (uio->uio_offset < 0) @@ -979,9 +979,9 @@ ncl_write(struct vop_write_args *ap) if (!(ioflag & IO_SYNC)) { int nflag; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nflag = np->n_flag; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nflag & NMODIFIED) { BO_LOCK(&vp->v_bufobj); if (vp->v_bufobj.bo_dirty.bv_cnt != 0) { @@ -1018,7 +1018,7 @@ again: * Handle direct append and file extension cases, calculate * unaligned buffer size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NHASBEENLOCKED) == 0 && (nmp->nm_flag & NFSMNT_NONCONTIGWR) != 0) noncontig_write = 1; @@ -1028,7 +1028,7 @@ again: (noncontig_write != 0 && lbn == (np->n_size / biosize) && uio->uio_offset + n > np->n_size)) && n) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * Get the buffer (in its pre-append state to maintain * B_CACHE if it was previously set). Resize the @@ -1041,11 +1041,11 @@ again: if (bp != NULL) { long save; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); save = bp->b_flags & B_CACHE; bcount = on + n; @@ -1067,15 +1067,15 @@ again: else bcount = np->n_size - (off_t)lbn * biosize; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); bp = nfs_getcacheblk(vp, lbn, bcount, td); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (uio->uio_offset + n > np->n_size) { np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (!bp) { @@ -1124,9 +1124,9 @@ again: } if (bp->b_wcred == NOCRED) bp->b_wcred = crhold(cred); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If dirtyend exceeds file size, chop it down. This should @@ -1369,13 +1369,13 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre * Invalidate the attribute cache, since writes to a DS * won't update the size attribute. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; } else - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_directio_asyncwr == 0) np->n_flag &= ~NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); out: ncl_excl_finish(vp, old_lock); return error; @@ -1517,10 +1517,10 @@ again: TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - mtx_lock(&(VTONFS(bp->b_vp))->n_mtx); + NFSLOCKNODE(VTONFS(bp->b_vp)); VTONFS(bp->b_vp)->n_flag |= NMODIFIED; VTONFS(bp->b_vp)->n_directio_asyncwr++; - mtx_unlock(&(VTONFS(bp->b_vp))->n_mtx); + NFSUNLOCKNODE(VTONFS(bp->b_vp)); } mtx_unlock(&ncl_iod_mutex); return (0); @@ -1552,7 +1552,7 @@ ncl_doio_directwrite(struct buf *bp) free(uiop, M_NFSDIRECTIO); if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { struct nfsnode *np = VTONFS(bp->b_vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFSHASPNFS(VFSTONFS(vnode_mount(bp->b_vp)))) { /* * Invalidate the attribute cache, since writes to a DS @@ -1568,7 +1568,7 @@ ncl_doio_directwrite(struct buf *bp) wakeup((caddr_t)&np->n_directio_asyncwr); } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_vp = NULL; relpbuf(bp, &ncl_pbuf_freecnt); @@ -1640,14 +1640,14 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre } /* ASSERT_VOP_LOCKED(vp, "ncl_doio"); */ if (p && vp->v_writecount <= -1) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFS_TIMESPEC_COMPARE(&np->n_mtime, &np->n_vattr.na_mtime)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); PROC_LOCK(p); killproc(p, "text file modification"); PROC_UNLOCK(p); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } break; case VLNK: @@ -1706,10 +1706,10 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre /* * Setup for actual write */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size) bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (bp->b_dirtyend > bp->b_dirtyoff) { io.iov_len = uiop->uio_resid = bp->b_dirtyend @@ -1802,11 +1802,11 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre bp->b_ioflags |= BIO_ERROR; bp->b_flags |= B_INVAL; bp->b_error = np->n_error = error; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NWRITEERR; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_dirtyoff = bp->b_dirtyend = 0; } @@ -1839,10 +1839,10 @@ ncl_meta_setsize(struct vnode *vp, struct thread *td, int biosize = vp->v_bufobj.bo_bsize; int error = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; np->n_size = nsize; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nsize < tsize) { struct buf *bp; Modified: stable/12/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnode.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clnode.c Mon Oct 28 01:44:31 2019 (r354131) @@ -219,7 +219,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread } else sp = NULL; if (sp != NULL) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); (void) ncl_vinvalbuf(vp, 0, td, 1); /* * Remove the silly file that was rename'd earlier @@ -228,7 +228,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread crfree(sp->s_cred); TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); taskqueue_enqueue(taskqueue_thread, &sp->s_task); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } } @@ -260,7 +260,7 @@ ncl_inactive(struct vop_inactive_args *ap) } np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); /* @@ -271,7 +271,7 @@ ncl_inactive(struct vop_inactive_args *ap) * None of the other flags are meaningful after the vnode is unused. */ np->n_flag &= (NMODIFIED | NDSCOMMIT); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (0); } @@ -292,9 +292,9 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (nfs_reclaim_p != NULL) nfs_reclaim_p(ap); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * Destroy the vm object and flush associated pages. @@ -353,11 +353,11 @@ ncl_invalcaches(struct vnode *vp) struct nfsnode *np = VTONFS(vp); int i; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } Modified: stable/12/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clport.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clport.c Mon Oct 28 01:44:31 2019 (r354131) @@ -742,12 +742,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode if (*tl == newnfs_true) { NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED); if (wccflagp != NULL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == fxdr_unsigned(u_int32_t, *(tl + 2)) && np->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } error = nfscl_postop_attr(nd, nap, flagp, stuff); @@ -768,12 +768,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode nd->nd_flag |= ND_NOMOREDATA; if (wccflagp != NULL && nfsva.na_vattr.va_mtime.tv_sec != 0) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == nfsva.na_vattr.va_mtime.tv_sec && np->n_mtime.tv_nsec == nfsva.na_vattr.va_mtime.tv_sec); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } nfsmout: Modified: stable/12/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clrpcops.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clrpcops.c Mon Oct 28 01:44:31 2019 (r354131) @@ -5952,9 +5952,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i error = EIO; } else { commit_thru_mds = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (docommit != 0) { if (error == 0) @@ -5968,9 +5968,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, @@ -6036,9 +6036,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * transfer = dp->nfsdi_rsize; else transfer = dp->nfsdi_wsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (len > transfer && docommit == 0) xfer = transfer; else @@ -6075,9 +6075,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) { error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, Modified: stable/12/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clsubs.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 01:44:31 2019 (r354131) @@ -121,20 +121,20 @@ ncl_uninit(struct vfsconf *vfsp) void ncl_dircookie_lock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (np->n_flag & NDIRCOOKIELK) (void) msleep(&np->n_flag, &np->n_mtx, PZERO, "nfsdirlk", 0); np->n_flag |= NDIRCOOKIELK; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } void ncl_dircookie_unlock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDIRCOOKIELK; wakeup(&np->n_flag); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bool @@ -190,7 +190,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper vap = &np->n_vattr.na_vattr; nmp = VFSTONFS(vp->v_mount); mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ timeo = (time_second - np->n_mtime.tv_sec) / 10; @@ -225,7 +225,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if ((time_second - np->n_attrstamp) >= timeo && (mustflush != 0 || np->n_attrstamp == 0)) { nfsstatsv1.attrcache_misses++; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } @@ -252,7 +252,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if (np->n_flag & NUPD) vaper->va_mtime = np->n_mtim; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap); return (0); } Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Oct 27 21:07:50 2019 (r354130) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Mon Oct 28 01:44:31 2019 (r354131) @@ -285,7 +285,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); if (!error) { lrupos = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (np->n_accesscache[i].uid == cred->cr_uid) { np->n_accesscache[i].mode = rmode; @@ -301,7 +301,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t np->n_accesscache[lrupos].mode = rmode; np->n_accesscache[lrupos].stamp = time_second; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (retmode != NULL) *retmode = rmode; KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0); @@ -396,7 +396,7 @@ nfs_access(struct vop_access_args *ap) * this request? */ gotahit = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (ap->a_cred->cr_uid == np->n_accesscache[i].uid) { if (time_second < (np->n_accesscache[i].stamp @@ -408,7 +408,7 @@ nfs_access(struct vop_access_args *ap) break; } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef KDTRACE_HOOKS if (gotahit != 0) KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, @@ -440,14 +440,14 @@ nfs_access(struct vop_access_args *ap) * After calling nfsspec_access, we should have the correct * file size cached. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (ap->a_cred->cr_uid == 0 && (ap->a_accmode & VREAD) && VTONFS(vp)->n_size > 0) { struct iovec aiov; struct uio auio; char buf[1]; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); aiov.iov_base = buf; aiov.iov_len = 1; auio.uio_iov = &aiov; @@ -473,7 +473,7 @@ nfs_access(struct vop_access_args *ap) else error = EACCES; } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (error); } } @@ -518,52 +518,52 @@ nfs_open(struct vop_open_args *ap) * Now, if this Open will be doing reading, re-validate/flush the * cache, so that Close/Open coherency is maintained. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((NFS_ISV4(vp) && np->n_change != vattr.va_filerev) || NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; @@ -576,14 +576,14 @@ nfs_open(struct vop_open_args *ap) if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { if (np->n_directio_opens == 0) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NNONCACHE; } np->n_directio_opens++; @@ -605,7 +605,7 @@ nfs_open(struct vop_open_args *ap) np->n_writecred = crhold(ap->a_cred); } else cred = NULL; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (cred != NULL) crfree(cred); @@ -632,9 +632,9 @@ nfs_open(struct vop_open_args *ap) /* And, finally, make sure that n_mtime is up to date. */ np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = np->n_vattr.na_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (0); } @@ -709,9 +709,9 @@ nfs_close(struct vop_close_args *ap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (NFS_ISV3(vp)) { /* * Under NFSv3 we have dirty buffers to dispose of. We @@ -745,7 +745,7 @@ nfs_close(struct vop_close_args *ap) } else { error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * Invalidate the attribute cache in all cases. @@ -770,7 +770,7 @@ nfs_close(struct vop_close_args *ap) np->n_flag &= ~NWRITEERR; error = np->n_error; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (NFS_ISV4(vp)) { @@ -804,13 +804,13 @@ nfs_close(struct vop_close_args *ap) ("nfs_close: dirty unflushed (%d) directio buffers\n", np->n_directio_asyncwr)); if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); KASSERT((np->n_directio_opens > 0), ("nfs_close: unexpectedly value (0) of n_directio_opens\n")); np->n_directio_opens--; if (np->n_directio_opens == 0) np->n_flag &= ~NNONCACHE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (localcred) NFSFREECRED(cred); @@ -834,10 +834,10 @@ nfs_getattr(struct vop_getattr_args *ap) /* * Update local times for special files. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & (NACC | NUPD)) np->n_flag |= NCHG; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * First look in the cache. */ @@ -951,14 +951,14 @@ nfs_setattr(struct vop_setattr_args *ap) * V_SAVE races that might setsize a lower * value. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_meta_setsize(vp, td, vap->va_size); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, vap->va_size == 0 ? 0 : V_SAVE, td, 1); if (error != 0) { @@ -971,34 +971,34 @@ nfs_setattr(struct vop_setattr_args *ap) */ nfscl_delegmodtime(vp); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * np->n_size has already been set to vap->va_size * in ncl_meta_setsize(). We must set it again since * nfs_loadattrcache() could be called through * ncl_meta_setsize() and could modify np->n_size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_vattr.na_size = np->n_size = vap->va_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) && vp->v_type == VREG) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error == EINTR || error == EIO) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } error = nfs_setattrrpc(vp, vap, ap->a_cred, td); if (error && vap->va_size != VNOVAL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = np->n_vattr.na_size = tsize; vnode_pager_setsize(vp, tsize); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (error); } @@ -1015,11 +1015,11 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, st struct nfsvattr nfsva; if (NFS_ISV34(vp)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; np->n_flag |= NDELEGMOD; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); } error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag, @@ -1067,12 +1067,12 @@ nfs_lookup(struct vop_lookup_args *ap) np = VTONFS(dvp); /* For NFSv4, wait until any remove is done. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (NFSHASNFSV4(nmp) && (np->n_flag & NREMOVEINPROG)) { np->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)np, &np->n_mtx, PZERO, "nfslkup", 0); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); @@ -1114,10 +1114,10 @@ nfs_lookup(struct vop_lookup_args *ap) if (!(nmp->nm_flag & NFSMNT_NOCTO) && (flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { - mtx_lock(&newnp->n_mtx); + NFSLOCKNODE(newnp); newnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&newnp->n_mtx); + NFSUNLOCKNODE(newnp); } if (nfscl_nodeleg(newvp, 0) == 0 || ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && @@ -1200,14 +1200,14 @@ nfs_lookup(struct vop_lookup_args *ap) * has changed. Don't bother adding the entry * if the directory has already changed. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (timespeccmp(&np->n_vattr.na_mtime, &dnfsva.na_mtime, ==)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); cache_enter_time(dvp, NULL, cnp, &dnfsva.na_mtime, NULL); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (ENOENT); } @@ -1295,10 +1295,10 @@ nfs_lookup(struct vop_lookup_args *ap) * are fetched in nfs_open() since we did not * fetch attributes from the LOOKUP reply. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1492,13 +1492,13 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, st vap->va_gid); } dnp = VTONFS(dvp); - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1569,12 +1569,12 @@ nfs_create(struct vop_create_args *ap) nmp = VFSTONFS(vnode_mount(dvp)); again: /* For NFSv4, wait until any remove is done. */ - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); while (NFSHASNFSV4(nmp) && (dnp->n_flag & NREMOVEINPROG)) { dnp->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)dnp, &dnp->n_mtx, PZERO, "nfscrt", 0); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); cverf = nfs_get_cverf(); error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, @@ -1640,13 +1640,13 @@ again: error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1705,9 +1705,9 @@ nfs_remove(struct vop_remove_args *ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); return (error); } @@ -1739,29 +1739,29 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, cha struct nfsnode *dnp = VTONFS(dvp); int error = 0, dattrflag; - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NREMOVEINPROG; - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); error = nfsrpc_remove(dvp, name, namelen, vp, cred, td, &dnfsva, &dattrflag, NULL); - mtx_lock(&dnp->n_mtx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Mon Oct 28 13:06:02 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3584F1A2459; Mon, 28 Oct 2019 13:06:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 471w2L0gj3z3Qk4; Mon, 28 Oct 2019 13:06:02 +0000 (UTC) (envelope-from lwhsu@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEA0F9DE1; Mon, 28 Oct 2019 13:06:01 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SD61BG001670; Mon, 28 Oct 2019 13:06:01 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SD61LZ001669; Mon, 28 Oct 2019 13:06:01 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201910281306.x9SD61LZ001669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 28 Oct 2019 13:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354134 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 354134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 13:06:02 -0000 Author: lwhsu Date: Mon Oct 28 13:06:01 2019 New Revision: 354134 URL: https://svnweb.freebsd.org/changeset/base/354134 Log: MFC r350211, r350220, r350235, r350238-r350239, r350295, r350512, r350700, r352219 r350211: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_child_detached_unrelated_debugger PR: 239292 Sponsored by: The FreeBSD Foundation r350220: Fix URL. Sponsored by: The FreeBSD Foundation r350235: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__PT_KILL_competing_stop PR: 220841 Sponsored by: The FreeBSD Foundation r350238: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_both_attached_unrelated_debugger PR: 239397 Sponsored by: The FreeBSD Foundation r350239: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_sees_exit_after_child_debugger PR: 239399 Sponsored by: The FreeBSD Foundation r350295: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__follow_fork_parent_detached_unrelated_debugger PR: 239425 Sponsored by: The FreeBSD Foundation r350512: Only skip test cases sometimes failing in CI when they are running in CI Suggested by: jhb Sponsored by: The FreeBSD Foundation r350700: Get configuration variable with default value for not breaking default setting Reported by: markj Sponsored by: The FreeBSD Foundation r352219: Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__getppid PR: 240510 Sponsored by: The FreeBSD Foundation Modified: stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Mon Oct 28 12:40:12 2019 (r354133) +++ stable/11/tests/sys/kern/ptrace_test.c Mon Oct 28 13:06:01 2019 (r354134) @@ -260,6 +260,9 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug int cpipe[2], dpipe[2], status; char c; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239399"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); @@ -801,6 +804,9 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239397"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -869,6 +875,9 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239292"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -932,6 +941,9 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela pid_t children[2], fpid, wpid; int cpipe[2], status; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/239425"); + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { @@ -994,6 +1006,10 @@ ATF_TC_BODY(ptrace__getppid, tc) int cpipe[2], dpipe[2], status; char c; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240510"); + + ATF_REQUIRE(pipe(cpipe) == 0); ATF_REQUIRE((child = fork()) != -1); @@ -2077,6 +2093,9 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) lwpid_t main_lwp; struct ptrace_lwpinfo pl; struct sched_param sched_param; + + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/220841"); ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { From owner-svn-src-stable@freebsd.org Mon Oct 28 18:37:34 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5D6B159C31; Mon, 28 Oct 2019 18:37:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4723Nt3tKyz4Mcc; Mon, 28 Oct 2019 18:37:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FDC5DB2C; Mon, 28 Oct 2019 18:37:34 +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 x9SIbY6t001506; Mon, 28 Oct 2019 18:37:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SIbXGc001504; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910281837.x9SIbXGc001504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Oct 2019 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354136 - in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Commit-Revision: 354136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 18:37:34 -0000 Author: dim Date: Mon Oct 28 18:37:32 2019 New Revision: 354136 URL: https://svnweb.freebsd.org/changeset/base/354136 Log: MFC r353933: Slightly expand description of WITH_SHARED_TOOLCHAIN, add a corresponding WITHOUT_SHARED_TOOLCHAIN description, and regenerate src.conf(5). Added: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/11/share/man/man5/src.conf.5 stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/12/share/man/man5/src.conf.5 stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Mon Oct 28 17:12:45 2019 (r354135) +++ stable/11/share/man/man5/src.conf.5 Mon Oct 28 18:37:32 2019 (r354136) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 21, 2019 +.Dd October 28, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1492,7 +1492,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 Copied: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN (from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136, copy of r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build the toolchain binaries as statically linked executables. +The set includes +.Xr cc 1 , +.Xr make 1 +and necessary utilities like assembler, linker and library archive manager. Modified: stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN ============================================================================== --- stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 17:12:45 2019 (r354135) +++ stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 From owner-svn-src-stable@freebsd.org Mon Oct 28 18:37:33 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0776159C2B; Mon, 28 Oct 2019 18:37:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4723Ns5Rwrz4Mcb; Mon, 28 Oct 2019 18:37:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98E10DB2B; Mon, 28 Oct 2019 18:37:33 +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 x9SIbXGY001498; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SIbXj7001496; Mon, 28 Oct 2019 18:37:33 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201910281837.x9SIbXj7001496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Oct 2019 18:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354136 - in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/share/man/man5 11/tools/build/options 12/share/man/man5 12/tools/build/options X-SVN-Commit-Revision: 354136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 18:37:34 -0000 Author: dim Date: Mon Oct 28 18:37:32 2019 New Revision: 354136 URL: https://svnweb.freebsd.org/changeset/base/354136 Log: MFC r353933: Slightly expand description of WITH_SHARED_TOOLCHAIN, add a corresponding WITHOUT_SHARED_TOOLCHAIN description, and regenerate src.conf(5). Added: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/12/share/man/man5/src.conf.5 stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/tools/build/options/WITHOUT_SHARED_TOOLCHAIN - copied unchanged from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Modified: stable/11/share/man/man5/src.conf.5 stable/11/tools/build/options/WITH_SHARED_TOOLCHAIN Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Oct 28 17:12:45 2019 (r354135) +++ stable/12/share/man/man5/src.conf.5 Mon Oct 28 18:37:32 2019 (r354136) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd October 21, 2019 +.Dd October 28, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1700,7 +1700,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 Copied: stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN (from r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136, copy of r353933, head/tools/build/options/WITHOUT_SHARED_TOOLCHAIN) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to build the toolchain binaries as statically linked executables. +The set includes +.Xr cc 1 , +.Xr make 1 +and necessary utilities like assembler, linker and library archive manager. Modified: stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN ============================================================================== --- stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 17:12:45 2019 (r354135) +++ stable/12/tools/build/options/WITH_SHARED_TOOLCHAIN Mon Oct 28 18:37:32 2019 (r354136) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -Set to build the toolchain binaries shared. +Set to build the toolchain binaries as dynamically linked executables. The set includes .Xr cc 1 , .Xr make 1 From owner-svn-src-stable@freebsd.org Mon Oct 28 21:51:46 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7095A15DE83; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4727hy2Nzfz4Xmb; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36BA8FEC5; Mon, 28 Oct 2019 21:51:46 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9SLpkLw017175; Mon, 28 Oct 2019 21:51:46 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SLpjs4017173; Mon, 28 Oct 2019 21:51:45 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201910282151.x9SLpjs4017173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Mon, 28 Oct 2019 21:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354141 - stable/12/usr.bin/fstat X-SVN-Group: stable-12 X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: stable/12/usr.bin/fstat X-SVN-Commit-Revision: 354141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 21:51:46 -0000 Author: jlh Date: Mon Oct 28 21:51:45 2019 New Revision: 354141 URL: https://svnweb.freebsd.org/changeset/base/354141 Log: MFC r353769, r354140: Add the fstat -s option to display socket information. Grammar fix. Modified: stable/12/usr.bin/fstat/fstat.1 stable/12/usr.bin/fstat/fstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fstat/fstat.1 ============================================================================== --- stable/12/usr.bin/fstat/fstat.1 Mon Oct 28 21:48:20 2019 (r354140) +++ stable/12/usr.bin/fstat/fstat.1 Mon Oct 28 21:51:45 2019 (r354141) @@ -28,7 +28,7 @@ .\" @(#)fstat.1 8.3 (Berkeley) 2/25/94 .\" $FreeBSD$ .\" -.Dd September 28, 2011 +.Dd October 19, 2019 .Dt FSTAT 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd identify active files .Sh SYNOPSIS .Nm -.Op Fl fmnv +.Op Fl fmnsv .Op Fl M Ar core .Op Fl N Ar system .Op Fl p Ar pid @@ -85,6 +85,8 @@ in and print the mode of the file in octal instead of symbolic form. .It Fl p Report all files open by the specified process. +.It Fl s +Print socket endpoint information. .It Fl u Report all files open by the specified user. .It Fl v @@ -199,9 +201,6 @@ For tcp, it is the address of the tcpcb, and for udp, For unix domain sockets, its the address of the socket pcb and the address of the connected pcb (if connected). Otherwise the protocol number and address of the socket itself are printed. -The attempt is to make enough information available to -permit further analysis without duplicating -.Xr netstat 1 . .Pp For example, the addresses mentioned above are the addresses which the .Dq Li netstat -A @@ -211,6 +210,15 @@ connected unix domain stream socket. A unidirectional unix domain socket indicates the direction of flow with an arrow (``<-'' or ``->''), and a full duplex socket shows a double arrow (``<->''). +.Pp +When the +.Fl s +flag is used, socket endpoint information is shown after the address of the +socket. +For internet sockets the local and remote addresses are shown, separated with +a double arrow (``<->''). +For unix/local sockets either the local or remote address is shown, depending +on which one is available. .Sh SEE ALSO .Xr netstat 1 , .Xr nfsstat 1 , Modified: stable/12/usr.bin/fstat/fstat.c ============================================================================== --- stable/12/usr.bin/fstat/fstat.c Mon Oct 28 21:48:20 2019 (r354140) +++ stable/12/usr.bin/fstat/fstat.c Mon Oct 28 21:51:45 2019 (r354141) @@ -40,9 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + #include #include #include @@ -61,6 +64,7 @@ __FBSDID("$FreeBSD$"); static int fsflg, /* show files on same filesystem as file(s) argument */ pflg, /* show files open by a particular pid */ + sflg, /* show socket details */ uflg; /* show files open by a particular (effective) user */ static int checkfile; /* restrict to particular files or filesystems */ static int nflg; /* (numerical) display f.s. and rdev as dev_t */ @@ -108,7 +112,7 @@ do_fstat(int argc, char **argv) arg = 0; what = KERN_PROC_PROC; nlistf = memf = NULL; - while ((ch = getopt(argc, argv, "fmnp:u:vN:M:")) != -1) + while ((ch = getopt(argc, argv, "fmnp:su:vN:M:")) != -1) switch((char)ch) { case 'f': fsflg = 1; @@ -135,6 +139,9 @@ do_fstat(int argc, char **argv) what = KERN_PROC_PID; arg = atoi(optarg); break; + case 's': + sflg = 1; + break; case 'u': if (uflg++) usage(); @@ -314,6 +321,55 @@ print_file_info(struct procstat *procstat, struct file putchar('\n'); } +static char * +addr_to_string(struct sockaddr_storage *ss, char *buffer, int buflen) +{ + char buffer2[INET6_ADDRSTRLEN]; + struct sockaddr_in6 *sin6; + struct sockaddr_in *sin; + struct sockaddr_un *sun; + + switch (ss->ss_family) { + case AF_LOCAL: + sun = (struct sockaddr_un *)ss; + if (strlen(sun->sun_path) == 0) + strlcpy(buffer, "-", buflen); + else + strlcpy(buffer, sun->sun_path, buflen); + break; + + case AF_INET: + sin = (struct sockaddr_in *)ss; + if (sin->sin_addr.s_addr == INADDR_ANY) + snprintf(buffer, buflen, "%s:%d", "*", + ntohs(sin->sin_port)); + else if (inet_ntop(AF_INET, &sin->sin_addr, buffer2, + sizeof(buffer2)) != NULL) + snprintf(buffer, buflen, "%s:%d", buffer2, + ntohs(sin->sin_port)); + break; + + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ss; + if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) + snprintf(buffer, buflen, "%s.%d", "*", + ntohs(sin6->sin6_port)); + else if (inet_ntop(AF_INET6, &sin6->sin6_addr, buffer2, + sizeof(buffer2)) != NULL) + snprintf(buffer, buflen, "%s.%d", buffer2, + ntohs(sin6->sin6_port)); + else + strlcpy(buffer, "-", buflen); + break; + + default: + strlcpy(buffer, "", buflen); + break; + } + return buffer; +} + + static void print_socket_info(struct procstat *procstat, struct filestat *fst) { @@ -329,6 +385,8 @@ print_socket_info(struct procstat *procstat, struct fi struct sockstat sock; struct protoent *pe; char errbuf[_POSIX2_LINE_MAX]; + char src_addr[PATH_MAX], dst_addr[PATH_MAX]; + struct sockaddr_un *sun; int error; static int isopen; @@ -368,6 +426,11 @@ print_socket_info(struct procstat *procstat, struct fi } else if (sock.so_pcb != 0) printf(" %lx", (u_long)sock.so_pcb); + if (!sflg) + break; + printf(" %s <-> %s", + addr_to_string(&sock.sa_local, src_addr, sizeof(src_addr)), + addr_to_string(&sock.sa_peer, dst_addr, sizeof(dst_addr))); break; case AF_UNIX: /* print address of pcb and connected pcb */ @@ -385,8 +448,25 @@ print_socket_info(struct procstat *procstat, struct fi *cp = '\0'; printf(" %s %lx", shoconn, (u_long)sock.unp_conn); - } + } } + if (!sflg) + break; + sun = (struct sockaddr_un *)&sock.sa_local; + /* + * While generally we like to print two addresses, + * local and peer, for sockets, it turns out to be + * more useful to print the first non-null address for + * local sockets, as typically they aren't bound and + * connected, and the path strings can get long. + */ + if (sun->sun_path[0] != 0) + addr_to_string(&sock.sa_local, + src_addr, sizeof(src_addr)); + else + addr_to_string(&sock.sa_peer, + src_addr, sizeof(src_addr)); + printf(" %s", src_addr); break; default: /* print protocol number and socket address */ From owner-svn-src-stable@freebsd.org Mon Oct 28 22:54:37 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBA3415F0EF; Mon, 28 Oct 2019 22:54:37 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47295T4WdRz4bpl; Mon, 28 Oct 2019 22:54:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E6B6189D4; Mon, 28 Oct 2019 22:54:37 +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 x9SMsbMi055057; Mon, 28 Oct 2019 22:54:37 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9SMsaXO055052; Mon, 28 Oct 2019 22:54:36 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910282254.x9SMsaXO055052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 28 Oct 2019 22:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354142 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Oct 2019 22:54:37 -0000 Author: rmacklem Date: Mon Oct 28 22:54:36 2019 New Revision: 354142 URL: https://svnweb.freebsd.org/changeset/base/354142 Log: MFC: r352664 Replace all mtx_lock()/mtx_unlock() on the iod lock with macros. Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called and the iod lock is held when the NFS node lock is acquired, the iod mutex will need to be changed to an sx lock as well. To simply the future commit that changes both the NFS node lock and iod lock to sx locks, this commit replaces all mtx_lock()/mtx_unlock() calls on the iod lock with macros. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clbio.c stable/12/sys/fs/nfsclient/nfs_clnfsiod.c stable/12/sys/fs/nfsclient/nfs_clsubs.c stable/12/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfs/nfsport.h Mon Oct 28 22:54:36 2019 (r354142) @@ -690,6 +690,8 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) +#define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) +#define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSPROCLISTLOCK() sx_slock(&allproc_lock) Modified: stable/12/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clbio.c Mon Oct 28 22:54:36 2019 (r354142) @@ -1410,11 +1410,11 @@ ncl_asyncio(struct nfsmount *nmp, struct buf *bp, stru * To avoid this deadlock, don't allow the async nfsiod threads to * perform Readdirplus RPCs. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && (nmp->nm_bufqiods > ncl_numasync / 2)) || (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return(EIO); } again: @@ -1481,7 +1481,7 @@ again: if (error) { error2 = newnfs_sigintr(nmp, td); if (error2) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (error2); } if (slpflag == PCATCH) { @@ -1522,11 +1522,11 @@ again: VTONFS(bp->b_vp)->n_directio_asyncwr++; NFSUNLOCKNODE(VTONFS(bp->b_vp)); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * All the iods are busy on other mounts, so return EIO to Modified: stable/12/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Mon Oct 28 22:54:36 2019 (r354142) @@ -106,7 +106,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &newmin, 0, req); if (error || (req->newptr == NULL)) return (error); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (newmin > ncl_iodmax) { error = EINVAL; goto out; @@ -121,7 +121,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) for (i = nfs_iodmin - ncl_numasync; i > 0; i--) nfs_nfsiodnew_sync(); out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -140,7 +140,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) return (error); if (newmax > NFS_MAXASYNCDAEMON) return (EINVAL); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = newmax; if (ncl_numasync <= ncl_iodmax) goto out; @@ -157,7 +157,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) iod--; } out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -178,10 +178,10 @@ nfs_nfsiodnew_sync(void) } if (i == ncl_iodmax) return (0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "newnfs %d", i); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (error == 0) { ncl_numasync++; ncl_iodwant[i] = NFSIOD_AVAILABLE; @@ -194,12 +194,12 @@ void ncl_nfsiodnew_tq(__unused void *arg, int pending) { - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); while (pending > 0) { pending--; nfs_nfsiodnew_sync(); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } void @@ -217,7 +217,7 @@ nfsiod_setup(void *dummy) TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); nfscl_init(); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* Silently limit the start number of nfsiod's */ if (nfs_iodmin > NFS_MAXASYNCDAEMON) nfs_iodmin = NFS_MAXASYNCDAEMON; @@ -227,7 +227,7 @@ nfsiod_setup(void *dummy) if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } SYSINIT(newnfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); @@ -248,7 +248,7 @@ nfssvc_iod(void *instance) int myiod, timo; int error = 0; - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); myiod = (int *)instance - nfs_asyncdaemon; /* * Main loop @@ -291,7 +291,7 @@ nfssvc_iod(void *instance) nmp->nm_bufqwant = 0; wakeup(&nmp->nm_bufq); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if (bp->b_flags & B_DIRECT) { KASSERT((bp->b_iocmd == BIO_WRITE), ("nfscvs_iod: BIO_WRITE not set")); (void)ncl_doio_directwrite(bp); @@ -303,7 +303,7 @@ nfssvc_iod(void *instance) (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, NULL, 0); } - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* * Make sure the nmp hasn't been dismounted as soon as * ncl_doio() completes for the last buffer. @@ -335,7 +335,7 @@ finish: /* Someone may be waiting for the last nfsiod to terminate. */ if (--ncl_numasync == 0) wakeup(&ncl_numasync); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if ((error == 0) || (error == EWOULDBLOCK)) kproc_exit(0); /* Abnormal termination */ Modified: stable/12/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clsubs.c Mon Oct 28 22:54:36 2019 (r354142) @@ -102,7 +102,7 @@ ncl_uninit(struct vfsconf *vfsp) * Tell all nfsiod processes to exit. Clear ncl_iodmax, and wakeup * any sleeping nfsiods so they check ncl_iodmax and exit. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = 0; for (i = 0; i < ncl_numasync; i++) if (ncl_iodwant[i] == NFSIOD_AVAILABLE) @@ -110,7 +110,7 @@ ncl_uninit(struct vfsconf *vfsp) /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ while (ncl_numasync) msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); ncl_nhuninit(); return (0); #else Modified: stable/12/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvfsops.c Mon Oct 28 21:51:45 2019 (r354141) +++ stable/12/sys/fs/nfsclient/nfs_clvfsops.c Mon Oct 28 22:54:36 2019 (r354142) @@ -1714,13 +1714,13 @@ nfs_unmount(struct mount *mp, int mntflags) mtx_unlock(&nmp->nm_mtx); } /* Make sure no nfsiods are assigned to this mount. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); for (i = 0; i < NFS_MAXASYNCDAEMON; i++) if (ncl_iodmount[i] == nmp) { ncl_iodwant[i] = NFSIOD_AVAILABLE; ncl_iodmount[i] = NULL; } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * We can now set mnt_data to NULL and wait for From owner-svn-src-stable@freebsd.org Tue Oct 29 18:06:00 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C463615F341; Tue, 29 Oct 2019 18:06:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472ff04qwfz3NDC; Tue, 29 Oct 2019 18:06:00 +0000 (UTC) (envelope-from jkim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8944225B79; Tue, 29 Oct 2019 18:06:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TI60Jh035838; Tue, 29 Oct 2019 18:06:00 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TI60qC035837; Tue, 29 Oct 2019 18:06:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201910291806.x9TI60qC035837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 29 Oct 2019 18:06:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354150 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 354150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2019 18:06:00 -0000 Author: jkim Date: Tue Oct 29 18:06:00 2019 New Revision: 354150 URL: https://svnweb.freebsd.org/changeset/base/354150 Log: MFC: r353907 Belatedly remove stale debug symbols. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Oct 29 17:36:06 2019 (r354149) +++ stable/12/ObsoleteFiles.inc Tue Oct 29 18:06:00 2019 (r354150) @@ -516,6 +516,16 @@ OLD_FILES+=usr/include/openssl/kssl.h OLD_FILES+=usr/include/openssl/pqueue.h OLD_FILES+=usr/include/openssl/ssl23.h OLD_FILES+=usr/include/openssl/ui_compat.h +OLD_FILES+=usr/lib/debug/usr/lib/engines/lib4758cca.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libaep.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libatalla.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libcapi.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libchil.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libcswift.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libgost.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libnuron.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libsureware.so.debug +OLD_FILES+=usr/lib/debug/usr/lib/engines/libubsec.so.debug OLD_FILES+=usr/share/openssl/man/man1/dss1.1.gz OLD_FILES+=usr/share/openssl/man/man1/md2.1.gz OLD_FILES+=usr/share/openssl/man/man1/md4.1.gz From owner-svn-src-stable@freebsd.org Tue Oct 29 19:36:22 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 684FA1624E7; Tue, 29 Oct 2019 19:36:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472hfG1JD7z3ylb; Tue, 29 Oct 2019 19:36:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1166126BC5; Tue, 29 Oct 2019 19:36:22 +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 x9TJaLJg089559; Tue, 29 Oct 2019 19:36:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TJaLJW089558; Tue, 29 Oct 2019 19:36:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910291936.x9TJaLJW089558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 29 Oct 2019 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354153 - in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 354153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2019 19:36:22 -0000 Author: cy Date: Tue Oct 29 19:36:21 2019 New Revision: 354153 URL: https://svnweb.freebsd.org/changeset/base/354153 Log: MFC r352784: Sync with source: Only a role of "ipf" is currently supported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 Modified: stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/11/contrib/ipfilter/man/ippool.8 Tue Oct 29 18:36:16 2019 (r354152) +++ stable/11/contrib/ipfilter/man/ippool.8 Tue Oct 29 19:36:21 2019 (r354153) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with From owner-svn-src-stable@freebsd.org Tue Oct 29 19:36:22 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE3841624EC; Tue, 29 Oct 2019 19:36:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472hfG3lZdz3ylc; Tue, 29 Oct 2019 19:36:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6148926BC6; Tue, 29 Oct 2019 19:36:22 +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 x9TJaM19089565; Tue, 29 Oct 2019 19:36:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TJaMkt089564; Tue, 29 Oct 2019 19:36:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910291936.x9TJaMkt089564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 29 Oct 2019 19:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354153 - in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 354153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2019 19:36:22 -0000 Author: cy Date: Tue Oct 29 19:36:21 2019 New Revision: 354153 URL: https://svnweb.freebsd.org/changeset/base/354153 Log: MFC r352784: Sync with source: Only a role of "ipf" is currently supported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 Modified: stable/12/contrib/ipfilter/man/ippool.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/man/ippool.8 Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ippool.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ippool.8 Tue Oct 29 18:36:16 2019 (r354152) +++ stable/12/contrib/ipfilter/man/ippool.8 Tue Oct 29 19:36:21 2019 (r354153) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with From owner-svn-src-stable@freebsd.org Wed Oct 30 01:24:28 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F04AA172E11; Wed, 30 Oct 2019 01:24:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rMw62K0z4GWD; Wed, 30 Oct 2019 01:24:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35D22B31; Wed, 30 Oct 2019 01:24:28 +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 x9U1OSbq095097; Wed, 30 Oct 2019 01:24:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1OS6w095095; Wed, 30 Oct 2019 01:24:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201910300124.x9U1OS6w095095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 30 Oct 2019 01:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354160 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 354160 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 01:24:29 -0000 Author: cy Date: Wed Oct 30 01:24:28 2019 New Revision: 354160 URL: https://svnweb.freebsd.org/changeset/base/354160 Log: MFC r354129: Remove trailing tab. Modified: stable/12/libexec/rc/rc.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.subr ============================================================================== --- stable/12/libexec/rc/rc.subr Tue Oct 29 21:25:19 2019 (r354159) +++ stable/12/libexec/rc/rc.subr Wed Oct 30 01:24:28 2019 (r354160) @@ -1266,7 +1266,7 @@ $command $rc_flags $command_args" ${PROTECT} -p ${pid} ;; esac - fi + fi ;; esac From owner-svn-src-stable@freebsd.org Wed Oct 30 01:35:03 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 093E21734DB; Wed, 30 Oct 2019 01:35:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rc66Zgtz4H1X; Wed, 30 Oct 2019 01:35:02 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C531D2D08; Wed, 30 Oct 2019 01:35:02 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U1Z2Cr001113; Wed, 30 Oct 2019 01:35:02 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1Z1lr001102; Wed, 30 Oct 2019 01:35:01 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300135.x9U1Z1lr001102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 01:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354161 - in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 354161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 01:35:03 -0000 Author: asomers Date: Wed Oct 30 01:35:00 2019 New Revision: 354161 URL: https://svnweb.freebsd.org/changeset/base/354161 Log: MFC r352404, r352413-r352414 r352404: fusefs: fix some minor issues with fuse_vnode_setparent * When unparenting a vnode, actually clear the flag. AFAIK this is basically a no-op because we only unparent a vnode when reclaiming it or when unlinking. * There's no need to call fuse_vnode_setparent during reclaim, because we're about to free the vnode data anyway. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21630 r352413: fusefs: fix some minor Coverity CIDs in the tests Where open(2) is expected to fail, the tests should assert or expect that its return value is -1. These tests all accepted too much but happened to pass anyway. Reported by: Coverity Coverity CID: 1404512, 1404378, 1404504, 1404483 Sponsored by: The FreeBSD Foundation r352414: fusefs: initialize C++ classes the Coverity way Coverity complained that I wasn't initializing some class members until the SetUp method. Do it in the constructor instead. Reported by: Coverity Coverity CIDs: 1404352, 1404378 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/fs/fuse/fuse_node.h stable/12/sys/fs/fuse/fuse_vnops.c stable/12/tests/sys/fs/fusefs/create.cc stable/12/tests/sys/fs/fusefs/default_permissions.cc stable/12/tests/sys/fs/fusefs/io.cc stable/12/tests/sys/fs/fusefs/mknod.cc stable/12/tests/sys/fs/fusefs/opendir.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_node.h ============================================================================== --- stable/12/sys/fs/fuse/fuse_node.h Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/sys/fs/fuse/fuse_node.h Wed Oct 30 01:35:00 2019 (r354161) @@ -174,6 +174,8 @@ fuse_vnode_setparent(struct vnode *vp, struct vnode *d MPASS(dvp->v_type == VDIR); VTOFUD(vp)->parent_nid = VTOI(dvp); VTOFUD(vp)->flag |= FN_PARENT_NID; + } else { + VTOFUD(vp)->flag &= ~FN_PARENT_NID; } } Modified: stable/12/sys/fs/fuse/fuse_vnops.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_vnops.c Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/sys/fs/fuse/fuse_vnops.c Wed Oct 30 01:35:00 2019 (r354161) @@ -1526,11 +1526,10 @@ fuse_vnop_reclaim(struct vop_reclaim_args *ap) fuse_filehandle_close(vp, fufh, td, NULL); } - if ((!fuse_isdeadfs(vp)) && (fvdat->nlookup)) { + if (!fuse_isdeadfs(vp) && fvdat->nlookup > 0) { fuse_internal_forget_send(vnode_mount(vp), td, NULL, VTOI(vp), fvdat->nlookup); } - fuse_vnode_setparent(vp, NULL); cache_purge(vp); vfs_hash_remove(vp); vnode_destroy_vobject(vp); Modified: stable/12/tests/sys/fs/fusefs/create.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/create.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/create.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -204,7 +204,7 @@ TEST_F(Create, eexist) EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EEXIST)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EEXIST, errno); } @@ -342,7 +342,7 @@ TEST_F(Create, eperm) .WillOnce(Invoke(ReturnErrno(ENOENT))); expect_create(RELPATH, mode, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); EXPECT_EQ(EPERM, errno); } Modified: stable/12/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/default_permissions.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/default_permissions.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -749,7 +749,7 @@ TEST_F(Open, eacces) expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755, UINT64_MAX, 1); expect_lookup(RELPATH, ino, S_IFREG | 0644, UINT64_MAX); - EXPECT_NE(0, open(FULLPATH, O_RDWR)); + EXPECT_EQ(-1, open(FULLPATH, O_RDWR)); EXPECT_EQ(EACCES, errno); } Modified: stable/12/tests/sys/fs/fusefs/io.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/io.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/io.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -108,11 +108,11 @@ int m_backing_fd, m_control_fd, m_test_fd; off_t m_filesize; bool m_direct_io; -Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_direct_io(false) {}; +Io(): m_backing_fd(-1), m_control_fd(-1), m_test_fd(-1), m_filesize(0), + m_direct_io(false) {}; void SetUp() { - m_filesize = 0; m_backing_fd = open("backing_file", O_RDWR | O_CREAT | O_TRUNC, 0644); if (m_backing_fd < 0) FAIL() << strerror(errno); Modified: stable/12/tests/sys/fs/fusefs/mknod.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/mknod.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/mknod.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -55,8 +55,11 @@ const static mode_t c_umask = 022; public: -virtual void SetUp() { +Mknod() { m_oldmask = umask(c_umask); +} + +virtual void SetUp() { if (geteuid() != 0) { GTEST_SKIP() << "Only root may use most mknod(2) variations"; } Modified: stable/12/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/opendir.cc Wed Oct 30 01:24:28 2019 (r354160) +++ stable/12/tests/sys/fs/fusefs/opendir.cc Wed Oct 30 01:35:00 2019 (r354161) @@ -103,7 +103,7 @@ TEST_F(Opendir, eperm) expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(EPERM)); - EXPECT_NE(0, open(FULLPATH, O_DIRECTORY)); + EXPECT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(EPERM, errno); } From owner-svn-src-stable@freebsd.org Wed Oct 30 01:41:50 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 548331738B2; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472rly1fKRz4HbJ; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D6C12E94; Wed, 30 Oct 2019 01:41:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U1fnL0005494; Wed, 30 Oct 2019 01:41:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1fn2j005493; Wed, 30 Oct 2019 01:41:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300141.x9U1fn2j005493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 01:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354163 - stable/12/usr.bin/tftp X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/usr.bin/tftp X-SVN-Commit-Revision: 354163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 01:41:50 -0000 Author: asomers Date: Wed Oct 30 01:41:49 2019 New Revision: 354163 URL: https://svnweb.freebsd.org/changeset/base/354163 Log: MFC r353068: tftp: fix two minor Coverity CIDs Reported by: Coverity CID 1394842: file descriptor leak in an error path CID 1007603: single byte array overflow Differential Revision: https://reviews.freebsd.org/D21695 Modified: stable/12/usr.bin/tftp/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/tftp/main.c ============================================================================== --- stable/12/usr.bin/tftp/main.c Wed Oct 30 01:41:14 2019 (r354162) +++ stable/12/usr.bin/tftp/main.c Wed Oct 30 01:41:49 2019 (r354163) @@ -491,6 +491,7 @@ put(int argc, char *argv[]) if (fstat(fd, &sb) < 0) { warn("%s", cp); + close(fd); return; } asprintf(&options[OPT_TSIZE].o_request, "%ju", sb.st_size); @@ -746,7 +747,7 @@ command(bool interactive, EditLine *el, History *hist, exit(0); len = MIN(MAXLINE, num); memcpy(line, bp, len); - line[len] = '\0'; + line[len - 1] = '\0'; history(hist, hep, H_ENTER, bp); } else { line[0] = 0; From owner-svn-src-stable@freebsd.org Wed Oct 30 01:57:41 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E260E1744BC; Wed, 30 Oct 2019 01:57:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472s6F5k9Pz4JLw; Wed, 30 Oct 2019 01:57:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7A8E30A7; Wed, 30 Oct 2019 01:57:41 +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 x9U1vfMX013157; Wed, 30 Oct 2019 01:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U1vf4u013155; Wed, 30 Oct 2019 01:57:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910300157.x9U1vf4u013155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 30 Oct 2019 01:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354164 - in stable/12/sys/fs: nfs nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 354164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 01:57:41 -0000 Author: rmacklem Date: Wed Oct 30 01:57:40 2019 New Revision: 354164 URL: https://svnweb.freebsd.org/changeset/base/354164 Log: MFC: r352736 Replace all mtx_assert() calls for n_mtx and ncl_iod_mutex with macros. To be consistent with replacing the mtx_lock()/mtx_unlock() calls on the NFS node mutex (n_mtx) and ncl_iod_mutex, this patch replaces all mtx_assert() calls on these mutexes with macros as well. This will simplify changing these locks to sx locks in a future commit. However, this change may be delayed indefinitely, since it appears there is a deadlock when vnode_pager_setsize() is called to shrink the size and the NFS node lock is held. There is no semantic change as a result of this commit. Modified: stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clnfsiod.c stable/12/sys/fs/nfsclient/nfs_clnode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfs/nfsport.h Wed Oct 30 01:57:40 2019 (r354164) @@ -688,10 +688,12 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKV4ROOTMUTEX() mtx_unlock(&nfs_v4root_mutex) #define NFSLOCKNODE(n) mtx_lock(&((n)->n_mtx)) #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) +#define NFSASSERTNODE(n) mtx_assert(&((n)->n_mtx), MA_OWNED) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) #define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) #define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) +#define NFSASSERTIOD() mtx_assert(&ncl_iod_mutex, MA_OWNED) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSPROCLISTLOCK() sx_slock(&allproc_lock) Modified: stable/12/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfsclient/nfs_clnfsiod.c Wed Oct 30 01:57:40 2019 (r354164) @@ -169,7 +169,7 @@ nfs_nfsiodnew_sync(void) { int error, i; - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); for (i = 0; i < ncl_iodmax; i++) { if (nfs_asyncdaemon[i] == 0) { nfs_asyncdaemon[i] = 1; @@ -206,7 +206,7 @@ void ncl_nfsiodnew(void) { - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); taskqueue_enqueue(taskqueue_thread, &ncl_nfsiodnew_task); } Modified: stable/12/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clnode.c Wed Oct 30 01:41:49 2019 (r354163) +++ stable/12/sys/fs/nfsclient/nfs_clnode.c Wed Oct 30 01:57:40 2019 (r354164) @@ -212,7 +212,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread ASSERT_VOP_ELOCKED(vp, "releasesillyrename"); np = VTONFS(vp); - mtx_assert(&np->n_mtx, MA_OWNED); + NFSASSERTNODE(np); if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; From owner-svn-src-stable@freebsd.org Wed Oct 30 02:03:43 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3B11747D6; Wed, 30 Oct 2019 02:03:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472sFB6XdRz4JlK; Wed, 30 Oct 2019 02:03:42 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4AA6327B; Wed, 30 Oct 2019 02:03:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U23gI7018621; Wed, 30 Oct 2019 02:03:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U23b7U018593; Wed, 30 Oct 2019 02:03:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300203.x9U23b7U018593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 02:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354165 - in stable/12: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zdb tests/sys/cddl/zfs/tests/cli_root/zpool_add tests/sys/cddl/zfs/tests/cli_root/zpool_create tes... X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: . tests/sys/cddl/zfs/include tests/sys/cddl/zfs/tests/cli_root/zdb tests/sys/cddl/zfs/tests/cli_root/zpool_add tests/sys/cddl/zfs/tests/cli_root/zpool_create tests/sys/cddl/zfs/tests/cli... X-SVN-Commit-Revision: 354165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 02:03:43 -0000 Author: asomers Date: Wed Oct 30 02:03:37 2019 New Revision: 354165 URL: https://svnweb.freebsd.org/changeset/base/354165 Log: MFC r353117-r353118, r353281-r353282, r353284-r353289, r353309-r353310, r353360-r353361, r353366, r353379 r353117: ZFS: the hotspare_add_004_neg test needs at least two disks Sponsored by: Axcient r353118: ZFS: fix several of the "zpool create" tests * Remove zpool_create_013_neg. FreeBSD doesn't have an equivalent of Solaris's metadevices. GEOM would be the equivalent, but since all geoms are the same from ZFS's perspective, this test would be redundant with zpool_create_012_neg * Remove zpool_create_014_neg. FreeBSD does not support swapping to regular files. * Remove zpool_create_016_pos. This test is redundant with literally every other test that creates a disk-backed pool. * s:/etc/vfstab:/etc/fstab in zpool_create_011_neg * Delete the VTOC-related portion of zpool_create_008_pos. FreeBSD doesn't use VTOC. * Replace dumpadm with dumpon and swap with swapon in multiple tests. * In zpool_create_015_neg, don't require "zpool create -n" to fail. It's reasonable for that variant to succeed, because it doesn't actually open the zvol. * Greatly simplify zpool_create_012_neg. Make it safer, too, but not interfering with the system's regular swap devices. * Expect zpool_create_011_neg to fail (PR 241070) * Delete some redundant cleanup steps in various tests * Remove some unneeeded ATF timeout specifications. The default is fine. PR: 241070 Sponsored by: Axcient r353281: ZFS: fix several zvol_misc tests * Adapt zvol_misc_001_neg to use dumpon instead of Solaris's dumpadm * Disable zvol_misc_003_neg, zvol_misc_005_neg, and zvol_misc_006_pos, because they involve using a zvol as a dump device, which FreeBSD does not yet support. Sponsored by: Axcient r353282: zfs: fix the slog_012_neg test This test attempts to corrupt a file-backed vdev by deleting it and then recreating it with truncate. But that doesn't work, because the pool already has the vdev open, and it happily hangs on to the open-but-deleted file. Fix by truncating the file without deleting it. Sponsored by: Axcient r353284: ZFS: fix the zpool_get_002_pos test ZFS has grown some additional properties that hadn't been added to the config file yet. While I'm here, improve the error message, and remove a superfluous command. Sponsored by: Axcient r353285: zfs: fix the zdb_001_neg test The test needed to be updated for r331701 (MFV illumos 8671400), which added a "-k" option. Sponsored by: Axcient r353286: zfs: skip the zfsd tests if zfsd is not running Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21878 r353287: ZFS: fix the delegate tests These tests have never worked correctly * Replace runwattr with sudo * Fix a scoping bug with the "dtst" variable * Cleanup user properties created during tests * Eliminate the checks for refreservation and send support. They will always be supported. * Fix verify_fs_snapshot. It seemed to assume that permissions would not yet be delegated, but that's not how it's actually used. * Combine verify_fs_promote with verify_vol_promote * Remove some useless sleeps * Fix backwards condition in verify_vol_volsize * Remove some redundant cleanup steps in the tests. cleanup.ksh will handle everything. * Disable some parts of the tests that FreeBSD doesn't support: * Creating snapshots with mkdir * devices * shareisci * sharenfs * xattr * zoned The sharenfs parts could probably be reenabled with more work to remove the Solarisms. Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21898 r353288: ZFS: mark hotspare_scrub_002_pos as an expected failure "zpool scrub" doesn't detect all errors on active spares in raidz arrays PR: 241069 Sponsored by: Axcient r353289: ZFS: fix the redundancy tests * Fix force_sync_path, which ensures that a file is fully flushed to disk. Apparently "zpool history"'s performance has improved, but exporting and importing the pool still works. * Fix file_dva by using undocumented zdb syntax to clarify that we're interested in the pool's root file system, not the pool itself. This should also fix the zpool_clear_001_pos test. * Remove a redundant cleanup step Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21901 r353309: zfs: fix the zfsd_autoreplace_003_pos test The test declared that it only needed 5 disks, but actually tried to use 6. Fix it to use just 5, which is all it really needs. Sponsored by: Axcient r353310: zfs: fix the zfsd_hotspare_007_pos test It was trying to destroy the pool while zfsd was detaching the spare, and "zpool destroy" failed. Fix by waiting until the spare has fully detached. Sponsored by: Axcient r353360: ZFS: multiple fixes to the zpool_import tests * Don't create a UFS mountpoint just to store some temporary files. The tests should always be executed with a sufficiently large TMPDIR. Creating the UFS mountpoint is not only unneccessary, but it slowed zpool_import_missing_002_pos greatly, because that test moves large files between TMPDIR and the UFS mountpoint. This change also allows many of the tests to be executed with just a single test disk, instead of two. * Move zpool_import_missing_002_pos's backup device dir from / to $PWD to prevent cross-device moves. On my system, these two changes improved that test's speed by 39x. It should also prevent ENOSPC errors seen in CI. * If insufficient disks are available, don't try to partition one of them. Just rely on Kyua to skip the test. Users who care will configure Kyua with sufficient disks. Sponsored by: Axcient r353361: ZFS: in the tests, don't override PWD The ZFS test suite was overriding the common $PWD variable with the path to the pwd command, even though no test wanted to use it that way. Most tests didn't notice, because ksh93 eventually restored it to its proper meaning. Sponsored by: Axcient r353366: ZFS: fix the zpool_add_010_pos test The test is necessarily racy, because it depends on being able to complete a "zpool add" before a previous resilver finishes. But it was racier than it needed to be. Move the first "zpool add" to before the resilver starts. Sponsored by: Axcient r353379: zfs: multiple improvements to the zpool_add tests * Don't partition a disk if too few are available. Just rely on Kyua to ensure that the tests aren't run with insufficient disks. * Remove redundant cleanup steps * In zpool_add_003_pos, store the temporary file in $PWD so Kyua will automatically clean it up. * Update zpool_add_005_pos to use dumpon instead of dumpadm. This test had never been ported to FreeBSD. * In zpool_add_005_pos, don't format the dump disk with UFS. That was pointless. Sponsored by: Axcient > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization (each collaborator). > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. _M 12 M 12/ObsoleteFiles.inc M 12/tests/sys/cddl/zfs/include/commands.txt M 12/tests/sys/cddl/zfs/include/libtest.kshlib M 12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh D 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/cleanup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/setup.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.cfg M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_all_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh M 12/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh M 12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh M 12/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh M 12/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib M 12/tests/sys/cddl/zfs/tests/redundancy/redundancy_001_pos.ksh M 12/tests/sys/cddl/zfs/tests/slog/slog_012_neg.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh M 12/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh M 12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh M 12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_test.sh Deleted: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh Modified: stable/12/ObsoleteFiles.inc stable/12/tests/sys/cddl/zfs/include/commands.txt stable/12/tests/sys/cddl/zfs/include/libtest.kshlib stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/cleanup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/setup.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import.cfg stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_all_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_import/zpool_import_test.sh stable/12/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_002_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_007_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_010_pos.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_allow_test.sh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_007_neg.ksh stable/12/tests/sys/cddl/zfs/tests/delegate/zfs_unallow_test.sh stable/12/tests/sys/cddl/zfs/tests/hotspare/hotspare_test.sh stable/12/tests/sys/cddl/zfs/tests/redundancy/redundancy.kshlib stable/12/tests/sys/cddl/zfs/tests/redundancy/redundancy_001_pos.ksh stable/12/tests/sys/cddl/zfs/tests/slog/slog_012_neg.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_autoreplace_003_pos.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_hotspare_007_pos.ksh stable/12/tests/sys/cddl/zfs/tests/zfsd/zfsd_test.sh stable/12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh stable/12/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/ObsoleteFiles.inc Wed Oct 30 02:03:37 2019 (r354165) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20191003: Remove useless ZFS tests +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_013_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_014_neg.ksh +OLD_FILES+=usr/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_016_pos.ksh # 20190811: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9 # 20190723: new clang import which bumps version from 8.0.0 to 8.0.1. Modified: stable/12/tests/sys/cddl/zfs/include/commands.txt ============================================================================== --- stable/12/tests/sys/cddl/zfs/include/commands.txt Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/include/commands.txt Wed Oct 30 02:03:37 2019 (r354165) @@ -65,6 +65,7 @@ /usr/bin/dirname /usr/bin/du #%%STFSUITEDIR%%/bin/dumpadm +/sbin/dumpon /bin/echo /usr/bin/egrep /usr/bin/env @@ -131,7 +132,6 @@ /bin/pkill /bin/ps #/usr/sbin/psrinfo -/bin/pwd /usr/sbin/quotaon /bin/rcp /sbin/reboot Modified: stable/12/tests/sys/cddl/zfs/include/libtest.kshlib ============================================================================== --- stable/12/tests/sys/cddl/zfs/include/libtest.kshlib Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/include/libtest.kshlib Wed Oct 30 02:03:37 2019 (r354165) @@ -2676,8 +2676,7 @@ function gen_dataset_name # # Ensure that a given path has been synced, not just ZIL committed. # -# XXX The implementation currently requires calling 'zpool history'. On -# FreeBSD, the sync(8) command (via $SYNC) calls zfs_sync() which just +# XXX On FreeBSD, the sync(8) command (via $SYNC) calls zfs_sync() which just # does a zil_commit(), as opposed to a txg_wait_synced(). For things that # require writing to their final destination (e.g. for intentional # corruption purposes), zil_commit() is not good enough. @@ -2686,10 +2685,8 @@ function force_sync_path # path { typeset path="$1" - zfspath=$($DF $path 2>/dev/null | tail -1 | cut -d" " -f1 | cut -d/ -f1) - [ -z "$zfspath" ] && return false - log_note "Force syncing ${zfspath} for ${path} ..." - $ZPOOL history $zfspath >/dev/null 2>&1 + log_must $ZPOOL export $TESTPOOL + log_must $ZPOOL import -d $path $TESTPOOL } # @@ -3326,7 +3323,7 @@ function file_dva # dataset filepath [level] [offset] # The inner match is for 'DVA[0]=<0:1b412600:200>', in which the # text surrounding the actual DVA is a fixed size with 8 characters # before it and 1 after. - $ZDB -P -vvvvv $dataset $inode | \ + $ZDB -P -vvvvv "$dataset/" $inode | \ $AWK -v level=${level} -v dva_num=${dva_num} ' BEGIN { stage = 0; } (stage == 0) && ($1=="Object") { stage = 1; next; } Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zdb/zdb_001_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -69,7 +69,7 @@ set -A args "create" "add" "destroy" "import fakepool" "add mirror fakepool" "add raidz fakepool" \ "add raidz1 fakepool" "add raidz2 fakepool" \ "setvprop" "blah blah" "-%" "--?" "-*" "-=" \ - "-a" "-f" "-g" "-h" "-j" "-k" "-m" "-n" "-p" "-p /tmp" \ + "-a" "-f" "-g" "-h" "-j" "-m" "-n" "-p" "-p /tmp" \ "-r" "-t" "-w" "-x" "-y" "-z" \ "-D" "-E" "-G" "-H" "-I" "-J" "-K" "-M" \ "-N" "-Q" "-T" "-W" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/cleanup.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -32,6 +32,8 @@ . $STF_SUITE/include/libtest.kshlib . $STF_SUITE/tests/cli_root/zpool_add/zpool_add.kshlib +poolexists $TESTPOOL && \ + destroy_pool $TESTPOOL cleanup_devices $DISKS log_pass Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/setup.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -34,19 +34,4 @@ verify_runnable "global" -if [[ -n $DISK ]]; then - # - # Use 'zpool create' to clean up the infomation in - # in the given disk to avoid slice overlapping. - # - cleanup_devices $DISK - - partition_disk $SIZE $DISK 7 -else - for disk in `$ECHO $DISKSARRAY`; do - cleanup_devices $disk - partition_disk $SIZE $disk 7 - done -fi - log_pass Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_001_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,45 +58,24 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add ...' can add devices to the pool." -log_onexit cleanup - set -A keywords "" "mirror" "raidz" "raidz1" "spare" -typeset diskname=${disk#/dev/} +set_disks + typeset diskname0=${DISK0#/dev/} typeset diskname1=${DISK1#/dev/} +typeset diskname2=${DISK2#/dev/} +typeset diskname3=${DISK3#/dev/} +typeset diskname4=${DISK4#/dev/} -case $DISK_ARRAY_NUM in -0|1) - pooldevs="${diskname}p1 \ - /dev/${diskname}p1 \ - \"${diskname}p1 ${diskname}p2\"" - mirrordevs="\"/dev/${diskname}p1 ${diskname}p2\"" - raidzdevs="\"/dev/${diskname}p1 ${diskname}p2\"" +pooldevs="${diskname0}\ + \"/dev/${diskname0} ${diskname1}\" \ + \"${diskname0} ${diskname1} ${diskname2}\"" +mirrordevs="\"/dev/${diskname0} ${diskname1}\"" +raidzdevs="\"/dev/${diskname0} ${diskname1}\"" - ;; -2|*) - pooldevs="${diskname0}p1\ - \"/dev/${diskname0}p1 ${diskname1}p1\" \ - \"${diskname0}p1 ${diskname0}p2 ${diskname1}p2\"\ - \"${diskname0}p1 ${diskname1}p1 ${diskname0}p2\ - ${diskname1}p2\"" - mirrordevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - raidzdevs="\"/dev/${diskname0}p1 ${diskname1}p1\"" - - ;; -esac - typeset -i i=0 typeset vdev eval set -A poolarray $pooldevs @@ -107,7 +86,7 @@ while (( $i < ${#keywords[*]} )); do case ${keywords[i]} in ""|spare) for vdev in "${poolarray[@]}"; do - create_pool "$TESTPOOL" "${diskname}p6" + create_pool "$TESTPOOL" "${diskname3}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add -f "$TESTPOOL" ${keywords[i]} \ $vdev @@ -119,7 +98,7 @@ while (( $i < ${#keywords[*]} )); do mirror) for vdev in "${mirrorarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev @@ -131,7 +110,7 @@ while (( $i < ${#keywords[*]} )); do raidz|raidz1) for vdev in "${raidzarray[@]}"; do create_pool "$TESTPOOL" "${keywords[i]}" \ - "${diskname}p4" "${diskname}p5" + "${diskname3}" "${diskname4}" log_must poolexists "$TESTPOOL" log_must $ZPOOL add "$TESTPOOL" ${keywords[i]} \ $vdev Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_002_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -60,26 +60,18 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup -} - log_assert "'zpool add -f ...' can successfully add" \ "devices to the pool in some cases." -log_onexit cleanup - -create_pool "$TESTPOOL" mirror "${disk}p1" "${disk}p2" +create_pool "$TESTPOOL" mirror "${DISK0}" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add "$TESTPOOL" ${disk}p3 -log_mustnot iscontained "$TESTPOOL" "${disk}p3" +log_mustnot $ZPOOL add "$TESTPOOL" ${DISK2} +log_mustnot iscontained "$TESTPOOL" "${DISK2}" -log_must $ZPOOL add -f "$TESTPOOL" ${disk}p3 -log_must iscontained "$TESTPOOL" "${disk}p3" +log_must $ZPOOL add -f "$TESTPOOL" ${DISK2} +log_must iscontained "$TESTPOOL" "${DISK2}" log_pass "'zpool add -f ...' executes successfully." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_003_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,30 +58,19 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL +set_disks - partition_cleanup - - [[ -e $tmpfile ]] && \ - log_must $RM -f $tmpfile -} - log_assert "'zpool add -n ...' can display the configuration" \ "without actually adding devices to the pool." -log_onexit cleanup +tmpfile="zpool_add_003.tmp${TESTCASE_ID}" -tmpfile="$TMPDIR/zpool_add_003.tmp${TESTCASE_ID}" - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -$ZPOOL add -n "$TESTPOOL" ${disk}p2 > $tmpfile +$ZPOOL add -n "$TESTPOOL" ${DISK1} > $tmpfile -log_mustnot iscontained "$TESTPOOL" "${disk}p2" +log_mustnot iscontained "$TESTPOOL" "${DISK1}" str="would update '$TESTPOOL' to the following configuration:" $CAT $tmpfile | $GREP "$str" >/dev/null 2>&1 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_004_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,6 +58,8 @@ verify_runnable "global" +set_disks + function cleanup { poolexists $TESTPOOL && \ @@ -67,19 +69,16 @@ function cleanup log_must $ZFS destroy -f $TESTPOOL1/$TESTVOL poolexists $TESTPOOL1 && \ destroy_pool "$TESTPOOL1" - - partition_cleanup - } log_assert "'zpool add ...' can add zfs volume to the pool." log_onexit cleanup -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" log_must $ZFS create -V $VOLSIZE $TESTPOOL1/$TESTVOL Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_005_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -61,6 +61,8 @@ verify_runnable "global" +set_disks + function cleanup { poolexists "$TESTPOOL" && \ @@ -68,11 +70,7 @@ function cleanup poolexists "$TESTPOOL1" && \ destroy_pool "$TESTPOOL1" - if [[ -n $saved_dump_dev ]]; then - log_must eval "$DUMPADM -u -d $saved_dump_dev > /dev/null" - fi - - partition_cleanup + $DUMPON -r $dump_dev } log_assert "'zpool add' should fail with inapplicable scenarios." @@ -81,22 +79,20 @@ log_onexit cleanup mnttab_dev=$(find_mnttab_dev) vfstab_dev=$(find_vfstab_dev) -saved_dump_dev=$(save_dump_dev) -dump_dev=${disk}p3 +dump_dev=${DISK2} -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" -create_pool "$TESTPOOL1" "${disk}p2" +create_pool "$TESTPOOL1" "${DISK1}" log_must poolexists "$TESTPOOL1" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_mustnot $ZPOOL add -f "$TESTPOOL" $mnttab_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $vfstab_dev -log_must $ECHO "y" | $NEWFS /dev/$dump_dev > /dev/null 2>&1 -log_must $DUMPADM -u -d /dev/$dump_dev > /dev/null +log_must $DUMPON $dump_dev log_mustnot $ZPOOL add -f "$TESTPOOL" $dump_dev log_pass "'zpool add' should fail with inapplicable scenarios." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_006_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -66,16 +66,12 @@ function cleanup poolexists $TESTPOOL1 && \ destroy_pool $TESTPOOL1 - datasetexists $TESTPOOL/$TESTFS && \ - log_must $ZFS destroy -f $TESTPOOL/$TESTFS poolexists $TESTPOOL && \ destroy_pool $TESTPOOL if [[ -d $TESTDIR ]]; then log_must $RM -rf $TESTDIR fi - - partition_cleanup } @@ -101,7 +97,6 @@ function setup_vdevs # # Minus $largest_num/20 to leave 5% space for metadata. (( vdevs_num=largest_num - largest_num/20 )) file_size=64 - vdev=$disk else vdevs_num=$VDEVS_NUM (( file_size = fs_size / (1024 * 1024 * (vdevs_num + vdevs_num/20)) )) @@ -112,8 +107,8 @@ function setup_vdevs # (( slice_size = file_size * (vdevs_num + vdevs_num/20) )) wipe_partition_table $disk set_partition 0 "" ${slice_size}m $disk - vdev=${disk}p1 fi + vdev=${disk} create_pool $TESTPOOL $vdev [[ -d $TESTDIR ]] && \ @@ -143,17 +138,11 @@ log_assert " 'zpool add [-f]' can add large numbers of " pool without any errors." log_onexit cleanup -if [[ $DISK_ARRAY_NUM == 0 ]]; then - disk=$DISK -else - disk=$DISK0 -fi - vdevs_list="" vdevs_num=$VDEVS_NUM file_size=$FILE_SIZE -setup_vdevs $disk +setup_vdevs $DISK0 log_must $ZPOOL add -f "$TESTPOOL1" $vdevs_list log_must iscontained "$TESTPOOL1" "$vdevs_list" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_007_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,22 +57,14 @@ verify_runnable "global" -function cleanup -{ - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} +set_disks log_assert "'zpool add' should return an error with badly-formed parameters." -log_onexit cleanup - set -A args "" "-f" "-n" "-?" "-nf" "-fn" "-f -n" "--f" "-blah" \ - "-? $TESTPOOL ${disk}p2" + "-? $TESTPOOL ${DISK1}" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_008_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,23 +57,12 @@ verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup -} - log_assert "'zpool add' should return an error with nonexistent pools and vdevs" -log_onexit cleanup - -set -A args "" "-f nonexistent_pool ${disk}p2" \ +set -A args "" "-f nonexistent_pool ${DISK1}" \ "-f $TESTPOOL nonexistent_vdev" -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK0}" log_must poolexists "$TESTPOOL" typeset -i i=0 Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_009_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -58,26 +58,14 @@ verify_runnable "global" -function cleanup -{ - - poolexists "$TESTPOOL" && \ - destroy_pool "$TESTPOOL" - - partition_cleanup - -} - log_assert "'zpool add' should fail if vdevs are the same or vdev is " \ "contained in the given pool." -log_onexit cleanup - -create_pool "$TESTPOOL" "${disk}p1" +create_pool "$TESTPOOL" "${DISK1}" log_must poolexists "$TESTPOOL" -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p2 ${disk}p2 -log_mustnot $ZPOOL add -f "$TESTPOOL" ${disk}p1 +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK0} ${DISK0} +log_mustnot $ZPOOL add -f "$TESTPOOL" ${DISK1} log_pass "'zpool add' get fail as expected if vdevs are the same or vdev is " \ "contained in the given pool." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_010_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -31,25 +31,15 @@ verify_runnable "global" -function cleanup -{ - poolexists $TESTPOOL && \ - destroy_pool $TESTPOOL - - partition_cleanup -} - log_assert "'zpool add' can add devices, even if a replacing vdev with a spare child is present" -log_onexit cleanup - create_pool $TESTPOOL mirror ${DISK0} ${DISK1} # A replacing vdev will automatically detach the older member when resilvering # is complete. We don't want that to happen during this test, so write some # data just to slow down resilvering. $TIMEOUT 60s $DD if=/dev/zero of=/$TESTPOOL/zerofile bs=128k -log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK2} log_must $ZPOOL add $TESTPOOL spare ${DISK3} +log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK2} log_must $ZPOOL replace $TESTPOOL ${DISK0} ${DISK3} log_must $ZPOOL add $TESTPOOL spare ${DISK4} Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add_test.sh Wed Oct 30 02:03:37 2019 (r354165) @@ -39,7 +39,7 @@ zpool_add_001_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 5 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_001_pos.ksh || atf_fail "Testcase failed" } @@ -66,7 +66,7 @@ zpool_add_002_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_002_pos.ksh || atf_fail "Testcase failed" } @@ -93,7 +93,7 @@ zpool_add_003_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_003_pos.ksh || atf_fail "Testcase failed" } @@ -120,6 +120,7 @@ zpool_add_004_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg + verify_disk_count "$DISKS" 2 verify_zvol_recursive ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_004_pos.ksh || atf_fail "Testcase failed" @@ -138,7 +139,7 @@ atf_test_case zpool_add_005_pos cleanup zpool_add_005_pos_head() { atf_set "descr" "'zpool add' should fail with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_add_005_pos_body() @@ -147,8 +148,8 @@ zpool_add_005_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 3 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_005_pos.ksh || atf_fail "Testcase failed" } @@ -175,7 +176,7 @@ zpool_add_006_pos_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 2 + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_006_pos.ksh || atf_fail "Testcase failed" } @@ -202,7 +203,7 @@ zpool_add_007_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_007_neg.ksh || atf_fail "Testcase failed" } @@ -229,7 +230,7 @@ zpool_add_008_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_008_neg.ksh || atf_fail "Testcase failed" } @@ -256,7 +257,7 @@ zpool_add_009_neg_body() . $(atf_get_srcdir)/zpool_add.kshlib . $(atf_get_srcdir)/zpool_add.cfg - verify_disk_count "$DISKS" 1 + verify_disk_count "$DISKS" 2 ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_add_009_neg.ksh || atf_fail "Testcase failed" } Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/Makefile Wed Oct 30 02:03:37 2019 (r354165) @@ -13,8 +13,6 @@ TEST_METADATA+= is_exclusive=true ${PACKAGE}FILES+= zpool_create_003_pos.ksh ${PACKAGE}FILES+= zpool_create_020_pos.ksh ${PACKAGE}FILES+= zpool_create_017_neg.ksh -${PACKAGE}FILES+= zpool_create_013_neg.ksh -${PACKAGE}FILES+= zpool_create_016_pos.ksh ${PACKAGE}FILES+= zpool_create_012_neg.ksh ${PACKAGE}FILES+= zpool_create_006_pos.ksh ${PACKAGE}FILES+= zpool_create_002_pos.ksh @@ -22,7 +20,6 @@ ${PACKAGE}FILES+= zpool_create_021_pos.ksh ${PACKAGE}FILES+= zpool_create_007_neg.ksh ${PACKAGE}FILES+= setup.ksh ${PACKAGE}FILES+= cleanup.ksh -${PACKAGE}FILES+= zpool_create_014_neg.ksh ${PACKAGE}FILES+= zpool_create_010_neg.ksh ${PACKAGE}FILES+= zpool_create_019_pos.ksh ${PACKAGE}FILES+= zpool_create_008_pos.ksh Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create.kshlib Wed Oct 30 02:03:37 2019 (r354165) @@ -96,36 +96,22 @@ function clean_blockfile # # Find the storage device in /etc/vfstab # -function find_vfstab_dev +function find_fstab_dev { - typeset vfstab="/etc/vfstab" - typeset tmpfile="$TMPDIR/vfstab.tmp" - typeset vfstabdev - typeset vfstabdevs="" + typeset fstab="/etc/fstab" + typeset tmpfile="$TMPDIR/fstab.tmp" + typeset fstabdev + typeset fstabdevs="" typeset line - $CAT $vfstab | $GREP "^/dev" >$tmpfile + $CAT $fstab | $GREP "^/dev" >$tmpfile while read -r line do - vfstabdev=`$ECHO "$line" | $AWK '{print $1}'` - vfstabdev=${vfstabdev%%:} - vfstabdevs="$vfstabdev $vfstabdevs" + fstabdev=`$ECHO "$line" | $AWK '{print $1}'` + fstabdev=${fstabdev%%:} + fstabdevs="$fstabdev $fstabdevs" done <$tmpfile $RM -f $tmpfile - $ECHO $vfstabdevs + $ECHO $fstabdevs } - -# -# Save the systme current dump device configuration -# -function save_dump_dev -{ - - typeset dumpdev - typeset fnd="Dump device" - - dumpdev=`$DUMPADM | $GREP "$fnd" | $CUT -f2 -d : | \ - $AWK '{print $1}'` - $ECHO $dumpdev -} Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_008_pos.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -57,102 +57,24 @@ verify_runnable "global" -function cleanup -{ - if [[ $exported_pool == true ]]; then - if [[ $force_pool == true ]]; then - log_must $ZPOOL create -f $TESTPOOL ${disk}p1 - else - log_must $ZPOOL import $TESTPOOL - fi - fi - - if poolexists $TESTPOOL ; then - destroy_pool $TESTPOOL - fi - - if poolexists $TESTPOOL1 ; then - destroy_pool $TESTPOOL1 - fi - - # - # recover it back to EFI label - # - wipe_partition_table $disk -} - -# -# create overlap slice 0 and 1 on $disk -# -function create_overlap_slice -{ - typeset format_file=$TMPDIR/format_overlap.${TESTCASE_ID} - typeset disk=$1 - - $ECHO "partition" >$format_file - $ECHO "0" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "200m" >> $format_file - $ECHO "1" >> $format_file - $ECHO "" >> $format_file - $ECHO "" >> $format_file - $ECHO "0" >> $format_file - $ECHO "400m" >> $format_file - $ECHO "label" >> $format_file - $ECHO "" >> $format_file - $ECHO "q" >> $format_file - $ECHO "q" >> $format_file - - $FORMAT -e -s -d $disk -f $format_file - typeset -i ret=$? - $RM -fr $format_file - - if (( ret != 0 )); then - log_fail "unable to create overlap slice." - fi - - return 0 -} - log_assert "'zpool create' have to use '-f' scenarios" -log_onexit cleanup -typeset exported_pool=false -typeset force_pool=false - if [[ -n $DISK ]]; then disk=$DISK else disk=$DISK0 fi -# overlapped slices as vdev need -f to create pool - # Make the disk is EFI labeled first via pool creation create_pool $TESTPOOL $disk destroy_pool $TESTPOOL -# Make the disk is VTOC labeled since only VTOC label supports overlap -log_must labelvtoc $disk -log_must create_overlap_slice $disk - -log_mustnot $ZPOOL create $TESTPOOL ${disk}p1 -log_must $ZPOOL create -f $TESTPOOL ${disk}p1 -destroy_pool $TESTPOOL - # exported device to be as spare vdev need -f to create pool - -log_must $ZPOOL create -f $TESTPOOL $disk -destroy_pool $TESTPOOL log_must partition_disk $SIZE $disk 6 create_pool $TESTPOOL ${disk}p1 ${disk}p2 log_must $ZPOOL export $TESTPOOL -exported_pool=true log_mustnot $ZPOOL create $TESTPOOL1 ${disk}p3 spare ${disk}p2 create_pool $TESTPOOL1 ${disk}p3 spare ${disk}p2 -force_pool=true destroy_pool $TESTPOOL1 log_pass "'zpool create' have to use '-f' scenarios" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_011_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -41,7 +41,7 @@ # 'zpool create' will fail in the following cases: # existent pool; device is part of an active pool; nested virtual devices; # differently sized devices without -f option; device being currently -# mounted; devices in /etc/vfstab; specified as the dedicated dump device. +# mounted; devices in /etc/fstab; specified as the dedicated dump device. # # STRATEGY: # 1. Create case scenarios @@ -67,8 +67,8 @@ function cleanup destroy_pool $pool done - if [[ -n $saved_dump_dev ]]; then - log_must $DUMPADM -u -d $saved_dump_dev + if [[ -n $specified_dump_dev ]]; then + $DUMPON -r $specified_dump_dev fi } @@ -87,11 +87,11 @@ mirror2="${disk}p4 ${disk}p5" raidz1=$mirror1 raidz2=$mirror2 diff_size_dev="${disk}p6 ${disk}p7" -vfstab_dev=$(find_vfstab_dev) -specified_dump_dev=${disk}p1 -saved_dump_dev=$(save_dump_dev) +fstab_dev=$(find_fstab_dev) +specified_dump_dev=${disk} lba=$(get_partition_end $disk 6) +$GPART delete -i 7 $disk set_partition 7 "$lba" $SIZE1 $disk create_pool "$TESTPOOL" "$pooldev1" @@ -112,7 +112,7 @@ set -A arg "$TESTPOOL $pooldev2" \ "$TESTPOOL1 raidz $diff_size_dev" \ "$TESTPOOL1 raidz1 $diff_size_dev" \ "$TESTPOOL1 mirror $mirror1 spare $mirror2 spare $diff_size_dev" \ - "$TESTPOOL1 $vfstab_dev" \ + "$TESTPOOL1 $fstab_dev" \ "$TESTPOOL1 ${disk}s10" \ "$TESTPOOL1 spare $pooldev2" @@ -130,7 +130,7 @@ log_must $ZPOOL destroy -f $TESTPOOL log_must $ZPOOL create -f $TESTPOOL3 $disk log_must $ZPOOL destroy -f $TESTPOOL3 -log_must $DUMPADM -d /dev/$specified_dump_dev +log_must dumpon $specified_dump_dev log_mustnot $ZPOOL create -f $TESTPOOL1 "$specified_dump_dev" # Also check to see that in-use checking prevents us from creating Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_012_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -38,13 +38,12 @@ # # # DESCRIPTION: -# 'zpool create' will fail with formal disk slice in swap +# 'zpool create' will fail with disk in swap # # # STRATEGY: -# 1. Get all the disk devices in swap -# 2. For each device, try to create a new pool with this device -# 3. Verify the creation is failed. +# 1. Add a disk to swap +# 2. Try to create a pool on that disk. It should fail. # # TESTABILITY: explicit # @@ -60,21 +59,14 @@ verify_runnable "global" function cleanup { - if poolexists $TESTPOOL; then - destroy_pool $TESTPOOL - fi + $SWAPOFF $DISK0 } -typeset swap_disks=`$SWAP -l | $GREP "c[0-9].*d[0-9].*s[0-9]" | \ - $AWK '{print $1}'` -log_assert "'zpool create' should fail with disk slice in swap." +log_assert "'zpool create' should fail with disk in swap." log_onexit cleanup -for sdisk in $swap_disks; do - for opt in "-n" "" "-f"; do - log_mustnot $ZPOOL create $opt $TESTPOOL $sdisk - done -done +log_must $SWAPON $DISK0 +log_mustnot $ZPOOL create $TESTPOOL $DISK0 -log_pass "'zpool create' passed as expected with inapplicable scenario." +log_pass "'zpool create' cannot use a swap disk" Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_015_neg.ksh Wed Oct 30 02:03:37 2019 (r354165) @@ -62,16 +62,7 @@ verify_runnable "global" function cleanup { - # cleanup zfs pool and dataset - if datasetexists $vol_name; then - $SWAP -l | $GREP /dev/zvol/$vol_name > /dev/null 2>&1 - if [[ $? -eq 0 ]]; then - $SWAP -d /dev/zvol/${vol_name} - fi - fi - - destroy_pool $TESTPOOL1 - destroy_pool $TESTPOOL + $SWAPOFF /dev/zvol/${vol_name} } if [[ -n $DISK ]]; then @@ -80,7 +71,7 @@ else disk=$DISK0 fi -typeset pool_dev=${disk}p1 +typeset pool_dev=${disk} typeset vol_name=$TESTPOOL/$TESTVOL log_assert "'zpool create' should fail with zfs vol device in swap." @@ -91,13 +82,9 @@ log_onexit cleanup # create_pool $TESTPOOL $pool_dev log_must $ZFS create -V 100m $vol_name -log_must $SWAP -a /dev/zvol/$vol_name -for opt in "-n" "" "-f"; do +log_must $SWAPON /dev/zvol/$vol_name +for opt in "" "-f"; do log_mustnot $ZPOOL create $opt $TESTPOOL1 /dev/zvol/${vol_name} done - -# cleanup -log_must $SWAP -d /dev/zvol/${vol_name} -log_must $ZFS destroy $vol_name log_pass "'zpool create' passed as expected with inapplicable scenario." Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Wed Oct 30 01:57:40 2019 (r354164) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_create/zpool_create_test.sh Wed Oct 30 02:03:37 2019 (r354165) @@ -219,7 +219,7 @@ atf_test_case zpool_create_008_pos cleanup zpool_create_008_pos_head() { atf_set "descr" "'zpool create' have to use '-f' scenarios" - atf_set "require.progs" zpool format + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_008_pos_body() @@ -300,7 +300,7 @@ atf_test_case zpool_create_011_neg cleanup zpool_create_011_neg_head() { atf_set "descr" "'zpool create' should be failed with inapplicable scenarios." - atf_set "require.progs" dumpadm zpool + atf_set "require.progs" zpool atf_set "timeout" 2400 } zpool_create_011_neg_body() @@ -310,6 +310,7 @@ zpool_create_011_neg_body() . $(atf_get_srcdir)/zpool_create.cfg verify_disk_count "$DISKS" 1 + atf_expect_fail "PR 241070 dumpon opens geom devices non-exclusively" ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" ksh93 $(atf_get_srcdir)/zpool_create_011_neg.ksh || atf_fail "Testcase failed" } @@ -323,12 +324,11 @@ zpool_create_011_neg_cleanup() } -atf_test_case zpool_create_012_neg cleanup +atf_test_case zpool_create_012_neg zpool_create_012_neg_head() { atf_set "descr" "'zpool create' should fail with disk slice in swap." - atf_set "require.progs" zpool swap - atf_set "timeout" 2400 + atf_set "require.progs" zpool } zpool_create_012_neg_body() { @@ -336,78 +336,16 @@ zpool_create_012_neg_body() . $(atf_get_srcdir)/zpool_create.kshlib . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed" + verify_disk_count "$DISKS" 1 ksh93 $(atf_get_srcdir)/zpool_create_012_neg.ksh || atf_fail "Testcase failed" } -zpool_create_012_neg_cleanup() -{ - . $(atf_get_srcdir)/../../../include/default.cfg - . $(atf_get_srcdir)/zpool_create.kshlib - . $(atf_get_srcdir)/zpool_create.cfg - ksh93 $(atf_get_srcdir)/cleanup.ksh || atf_fail "Cleanup failed" -} - -atf_test_case zpool_create_013_neg cleanup -zpool_create_013_neg_head() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Oct 30 02:33:44 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 995B717596D; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472svr3MLZz4LQ8; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5668A399C; Wed, 30 Oct 2019 02:33:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9U2Xi1i036343; Wed, 30 Oct 2019 02:33:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U2XiS8036342; Wed, 30 Oct 2019 02:33:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201910300233.x9U2XiS8036342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 30 Oct 2019 02:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354166 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 02:33:44 -0000 Author: asomers Date: Wed Oct 30 02:33:43 2019 New Revision: 354166 URL: https://svnweb.freebsd.org/changeset/base/354166 Log: MFC r353439: MFZol: Fix performance of "zfs recv" with many deletions This patch fixes 2 issues with the DMU free throttle implemented in dmu_free_long_range(). The first issue is that get_next_chunk() was calculating the number of L1 blocks the free would dirty incorrectly. In some cases involving extremely large files, this code would greatly overestimate the number of affected L1 blocks, causing excessive calls to txg_wait_open(). This patch corrects the calculation. The second issue is that the free throttle uses the total number of free'd blocks in all (open, quiescing, and syncing) txgs to determine whether to throttle. This causes large frees (such as those created by the first issue) to cause 4 txg syncs before any further frees were allowed to proceed. This patch ensures that the accounting is done entirely in a per-txg fashion, so that frees from a given txg don't affect those that immediately follow it. Reviewed-by: Brian Behlendorf Reviewed-by: Matthew Ahrens Signed-off-by: Tom Caputi zfsonlinux/zfs@f4c594da94d856c422512a54e48070f890b2685b Freeing throttle should account for holes Deletion throttle currently does not account for holes in a file. This means that it can activate when it shouldn't. To fix it we switch the throttle to be based on the number of L1 blocks we will have to dirty when freeing Reviewed-by: Tom Caputi Reviewed-by: Matt Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Alek Pinchuk zfsonlinux/zfs@65282ee9e06b130f1f0169baf5d9bf0dd8fc1ef9 Submitted by: Alek Pinchuk Reviewed by: allanjude Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D21895 Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 02:03:37 2019 (r354165) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 02:33:43 2019 (r354166) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2019 Datto Inc. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -62,14 +63,15 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFL &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); /* - * Tunable to control percentage of dirtied blocks from frees in one TXG. - * After this threshold is crossed, additional dirty blocks from frees - * wait until the next TXG. + * Tunable to control percentage of dirtied L1 blocks from frees allowed into + * one TXG. After this threshold is crossed, additional dirty blocks from frees + * will wait until the next TXG. * A value of zero will disable this throttle. */ -uint32_t zfs_per_txg_dirty_frees_percent = 30; +uint32_t zfs_per_txg_dirty_frees_percent = 5; SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_percent, CTLFLAG_RWTUN, - &zfs_per_txg_dirty_frees_percent, 0, "Percentage of dirtied blocks from frees in one txg"); + &zfs_per_txg_dirty_frees_percent, 0, + "Percentage of dirtied indirect blocks from frees allowed in one txg"); /* * This can be used for testing, to ensure that certain actions happen @@ -683,11 +685,13 @@ dmu_prefetch(objset_t *os, uint64_t object, int64_t le * * On input, *start should be the first offset that does not need to be * freed (e.g. "offset + length"). On return, *start will be the first - * offset that should be freed. + * offset that should be freed and l1blks is set to the number of level 1 + * indirect blocks found within the chunk. */ static int -get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum) +get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t minimum, uint64_t *l1blks) { + uint64_t blks; uint64_t maxblks = DMU_MAX_ACCESS >> (dn->dn_indblkshift + 1); /* bytes of data covered by a level-1 indirect block */ uint64_t iblkrange = @@ -695,13 +699,23 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t ASSERT3U(minimum, <=, *start); - if (*start - minimum <= iblkrange * maxblks) { + /* + * Check if we can free the entire range assuming that all of the + * L1 blocks in this range have data. If we can, we use this + * worst case value as an estimate so we can avoid having to look + * at the object's actual data. + */ + uint64_t total_l1blks = + (roundup(*start, iblkrange) - (minimum / iblkrange * iblkrange)) / + iblkrange; + if (total_l1blks <= maxblks) { + *l1blks = total_l1blks; *start = minimum; return (0); } ASSERT(ISP2(iblkrange)); - for (uint64_t blks = 0; *start > minimum && blks < maxblks; blks++) { + for (blks = 0; *start > minimum && blks < maxblks; blks++) { int err; /* @@ -711,6 +725,7 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t * to search. */ (*start)--; + err = dnode_next_offset(dn, DNODE_FIND_BACKWARDS, start, 2, 1, 0); @@ -719,6 +734,7 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t *start = minimum; break; } else if (err != 0) { + *l1blks = blks; return (err); } @@ -727,6 +743,8 @@ get_next_chunk(dnode_t *dn, uint64_t *start, uint64_t } if (*start < minimum) *start = minimum; + *l1blks = blks; + return (0); } @@ -762,14 +780,14 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui dirty_frees_threshold = zfs_per_txg_dirty_frees_percent * zfs_dirty_data_max / 100; else - dirty_frees_threshold = zfs_dirty_data_max / 4; + dirty_frees_threshold = zfs_dirty_data_max / 20; if (length == DMU_OBJECT_END || offset + length > object_size) length = object_size - offset; while (length != 0) { uint64_t chunk_end, chunk_begin, chunk_len; - uint64_t long_free_dirty_all_txgs = 0; + uint64_t l1blks; dmu_tx_t *tx; if (dmu_objset_zfs_unmounting(dn->dn_objset)) @@ -778,7 +796,7 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui chunk_end = chunk_begin = offset + length; /* move chunk_begin backwards to the beginning of this chunk */ - err = get_next_chunk(dn, &chunk_begin, offset); + err = get_next_chunk(dn, &chunk_begin, offset, &l1blks); if (err) return (err); ASSERT3U(chunk_begin, >=, offset); @@ -786,24 +804,6 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui chunk_len = chunk_end - chunk_begin; - mutex_enter(&dp->dp_lock); - for (int t = 0; t < TXG_SIZE; t++) { - long_free_dirty_all_txgs += - dp->dp_long_free_dirty_pertxg[t]; - } - mutex_exit(&dp->dp_lock); - - /* - * To avoid filling up a TXG with just frees wait for - * the next TXG to open before freeing more chunks if - * we have reached the threshold of frees - */ - if (dirty_frees_threshold != 0 && - long_free_dirty_all_txgs >= dirty_frees_threshold) { - txg_wait_open(dp, 0); - continue; - } - tx = dmu_tx_create(os); dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_len); @@ -818,13 +818,42 @@ dmu_free_long_range_impl(objset_t *os, dnode_t *dn, ui return (err); } + uint64_t txg = dmu_tx_get_txg(tx); + mutex_enter(&dp->dp_lock); - dp->dp_long_free_dirty_pertxg[dmu_tx_get_txg(tx) & TXG_MASK] += - chunk_len; + uint64_t long_free_dirty = + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK]; mutex_exit(&dp->dp_lock); + + /* + * To avoid filling up a TXG with just frees, wait for + * the next TXG to open before freeing more chunks if + * we have reached the threshold of frees. + */ + if (dirty_frees_threshold != 0 && + long_free_dirty >= dirty_frees_threshold) { + dmu_tx_commit(tx); + txg_wait_open(dp, 0); + continue; + } + + /* + * In order to prevent unnecessary write throttling, for each + * TXG, we track the cumulative size of L1 blocks being dirtied + * in dnode_free_range() below. We compare this number to a + * tunable threshold, past which we prevent new L1 dirty freeing + * blocks from being added into the open TXG. See + * dmu_free_long_range_impl() for details. The threshold + * prevents write throttle activation due to dirty freeing L1 + * blocks taking up a large percentage of zfs_dirty_data_max. + */ + mutex_enter(&dp->dp_lock); + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] += + l1blks << dn->dn_indblkshift; + mutex_exit(&dp->dp_lock); DTRACE_PROBE3(free__long__range, - uint64_t, long_free_dirty_all_txgs, uint64_t, chunk_len, - uint64_t, dmu_tx_get_txg(tx)); + uint64_t, long_free_dirty, uint64_t, chunk_len, + uint64_t, txg); dnode_free_range(dn, chunk_begin, chunk_len, tx); dmu_tx_commit(tx); From owner-svn-src-stable@freebsd.org Wed Oct 30 07:54:35 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82BA917CC78; Wed, 30 Oct 2019 07:54:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4731232gPpz4Yqf; Wed, 30 Oct 2019 07:54:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EF2F73F0; Wed, 30 Oct 2019 07:54:35 +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 x9U7sZrZ024149; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U7sZ9t024148; Wed, 30 Oct 2019 07:54:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910300754.x9U7sZ9t024148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 07:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354168 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354168 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 07:54:35 -0000 Author: kib Date: Wed Oct 30 07:54:34 2019 New Revision: 354168 URL: https://svnweb.freebsd.org/changeset/base/354168 Log: MFC r353930: Fix undefined behavior. Modified: stable/12/sys/kern/vfs_subr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_subr.c ============================================================================== --- stable/12/sys/kern/vfs_subr.c Wed Oct 30 04:00:44 2019 (r354167) +++ stable/12/sys/kern/vfs_subr.c Wed Oct 30 07:54:34 2019 (r354168) @@ -1244,7 +1244,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; unsigned long onumvnodes; - int done, force, trigger, usevnodes; + int done, force, trigger, usevnodes, vsp; bool reclaim_nc_src; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, @@ -1272,7 +1272,8 @@ vnlru_proc(void) force = 1; vstir = 0; } - if (vspace() >= vlowat && force == 0) { + vsp = vspace(); + if (vsp >= vlowat && force == 0) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_free_list_mtx, @@ -1339,7 +1340,8 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - force = vspace() < vhiwat; + vsp = vspace(); + force = vsp < vhiwat; } } @@ -1416,8 +1418,10 @@ vtryrecycle(struct vnode *vp) static void vcheckspace(void) { + int vsp; - if (vspace() < vlowat && vnlruproc_sig == 0) { + vsp = vspace(); + if (vsp < vlowat && vnlruproc_sig == 0) { vnlruproc_sig = 1; wakeup(vnlruproc); } From owner-svn-src-stable@freebsd.org Wed Oct 30 08:06:23 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 399CB17D488; Wed, 30 Oct 2019 08:06:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4731Hg0Xvpz4ZJ1; Wed, 30 Oct 2019 08:06:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5F7D75AD; Wed, 30 Oct 2019 08:06:22 +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 x9U86Mnb029888; Wed, 30 Oct 2019 08:06:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9U86M1n029887; Wed, 30 Oct 2019 08:06:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201910300806.x9U86M1n029887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 30 Oct 2019 08:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354169 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 354169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 08:06:23 -0000 Author: kib Date: Wed Oct 30 08:06:22 2019 New Revision: 354169 URL: https://svnweb.freebsd.org/changeset/base/354169 Log: MFC r353930: Fix undefined behavior. Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Wed Oct 30 07:54:34 2019 (r354168) +++ stable/11/sys/kern/vfs_subr.c Wed Oct 30 08:06:22 2019 (r354169) @@ -1168,7 +1168,7 @@ vnlru_proc(void) { struct mount *mp, *nmp; unsigned long ofreevnodes, onumvnodes; - int done, force, reclaim_nc_src, trigger, usevnodes; + int done, force, reclaim_nc_src, trigger, usevnodes, vsp; EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc, SHUTDOWN_PRI_FIRST); @@ -1196,7 +1196,8 @@ vnlru_proc(void) force = 1; vstir = 0; } - if (vspace() >= vlowat && force == 0) { + vsp = vspace(); + if (vsp >= vlowat && force == 0) { vnlruproc_sig = 0; wakeup(&vnlruproc_sig); msleep(vnlruproc, &vnode_free_list_mtx, @@ -1264,7 +1265,8 @@ vnlru_proc(void) * After becoming active to expand above low water, keep * active until above high water. */ - force = vspace() < vhiwat; + vsp = vspace(); + force = vsp < vhiwat; } } @@ -1341,8 +1343,10 @@ vtryrecycle(struct vnode *vp) static void vcheckspace(void) { + int vsp; - if (vspace() < vlowat && vnlruproc_sig == 0) { + vsp = vspace(); + if (vsp < vlowat && vnlruproc_sig == 0) { vnlruproc_sig = 1; wakeup(vnlruproc); } From owner-svn-src-stable@freebsd.org Wed Oct 30 16:41:57 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB22915A429; Wed, 30 Oct 2019 16:41:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DkY4X92z4CWw; Wed, 30 Oct 2019 16:41:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EBBED3B2; Wed, 30 Oct 2019 16:41:57 +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 x9UGfvGp037629; Wed, 30 Oct 2019 16:41:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGfvY8037628; Wed, 30 Oct 2019 16:41:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301641.x9UGfvY8037628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354184 - stable/12/sys/arm/include X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/include X-SVN-Commit-Revision: 354184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:41:57 -0000 Author: avg Date: Wed Oct 30 16:41:57 2019 New Revision: 354184 URL: https://svnweb.freebsd.org/changeset/base/354184 Log: MFC r353165: align use of cp15_pmccntr_get with its availability Modified: stable/12/sys/arm/include/cpu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/include/cpu.h ============================================================================== --- stable/12/sys/arm/include/cpu.h Wed Oct 30 15:36:41 2019 (r354183) +++ stable/12/sys/arm/include/cpu.h Wed Oct 30 16:41:57 2019 (r354184) @@ -20,7 +20,7 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if __ARM_ARCH >= 6 +#if __ARM_ARCH > 6 || (__ARM_ARCH == 6 && defined(CPU_ARM1176)) #if (__ARM_ARCH > 6) && defined(DEV_PMU) if (pmu_attched) { u_int cpu; From owner-svn-src-stable@freebsd.org Wed Oct 30 16:45:26 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2FBC15A670; Wed, 30 Oct 2019 16:45:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DpZ4JPWz4Cs6; Wed, 30 Oct 2019 16:45:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D7E1D3EE; Wed, 30 Oct 2019 16:45:26 +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 x9UGjQEY040894; Wed, 30 Oct 2019 16:45:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGjPbe040889; Wed, 30 Oct 2019 16:45:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301645.x9UGjPbe040889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354185 - in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 354185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:45:26 -0000 Author: avg Date: Wed Oct 30 16:45:24 2019 New Revision: 354185 URL: https://svnweb.freebsd.org/changeset/base/354185 Log: MFC r353621: MFV r353619: 9691 fat zap should prefetch when iterating Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Wed Oct 30 16:45:24 2019 (r354185) @@ -21,6 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 by Delphix. All rights reserved. */ #include @@ -113,7 +114,18 @@ ddt_zap_walk(objset_t *os, uint64_t object, ddt_entry_ zap_attribute_t za; int error; - zap_cursor_init_serialized(&zc, os, object, *walk); + if (*walk == 0) { + /* + * We don't want to prefetch the entire ZAP object, because + * it can be enormous. Also the primary use of DDT iteration + * is for scrubbing, in which case we will be issuing many + * scrub i/os for each ZAP block that we read in, so + * reading the ZAP is unlikely to be the bottleneck. + */ + zap_cursor_init_noprefetch(&zc, os, object); + } else { + zap_cursor_init_serialized(&zc, os, object, *walk); + } if ((error = zap_cursor_retrieve(&zc, &za)) == 0) { uchar_t cbuf[sizeof (dde->dde_phys) + 1]; uint64_t csize = za.za_num_integers; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Oct 30 16:45:24 2019 (r354185) @@ -80,6 +80,13 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_per */ int zfs_object_remap_one_indirect_delay_ticks = 0; +/* + * Limit the amount we can prefetch with one call to this amount. This + * helps to limit the amount of memory that can be used by prefetching. + * Larger objects should be prefetched a bit at a time. + */ +uint64_t dmu_prefetch_max = 8 * SPA_MAXBLOCKSIZE; + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, FALSE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, TRUE, "object directory" }, @@ -641,6 +648,11 @@ dmu_prefetch(objset_t *os, uint64_t object, int64_t le rw_exit(&dn->dn_struct_rwlock); return; } + + /* + * See comment before the definition of dmu_prefetch_max. + */ + len = MIN(len, dmu_prefetch_max); /* * XXX - Note, if the dnode for the requested object is not Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Wed Oct 30 16:45:24 2019 (r354185) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright 2017 Nexenta Systems, Inc. */ @@ -347,6 +347,7 @@ typedef struct zap_cursor { uint64_t zc_serialized; uint64_t zc_hash; uint32_t zc_cd; + boolean_t zc_prefetch; } zap_cursor_t; typedef struct { @@ -373,6 +374,8 @@ typedef struct { * zapobj. You must _fini the cursor when you are done with it. */ void zap_cursor_init(zap_cursor_t *zc, objset_t *ds, uint64_t zapobj); +void zap_cursor_init_noprefetch(zap_cursor_t *zc, objset_t *os, + uint64_t zapobj); void zap_cursor_fini(zap_cursor_t *zc); /* Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Wed Oct 30 16:45:24 2019 (r354185) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -49,6 +49,36 @@ #include #include +/* + * If zap_iterate_prefetch is set, we will prefetch the entire ZAP object + * (all leaf blocks) when we start iterating over it. + * + * For zap_cursor_init(), the callers all intend to iterate through all the + * entries. There are a few cases where an error (typically i/o error) could + * cause it to bail out early. + * + * For zap_cursor_init_serialized(), there are callers that do the iteration + * outside of ZFS. Typically they would iterate over everything, but we + * don't have control of that. E.g. zfs_ioc_snapshot_list_next(), + * zcp_snapshots_iter(), and other iterators over things in the MOS - these + * are called by /sbin/zfs and channel programs. The other example is + * zfs_readdir() which iterates over directory entries for the getdents() + * syscall. /sbin/ls iterates to the end (unless it receives a signal), but + * userland doesn't have to. + * + * Given that the ZAP entries aren't returned in a specific order, the only + * legitimate use cases for partial iteration would be: + * + * 1. Pagination: e.g. you only want to display 100 entries at a time, so you + * get the first 100 and then wait for the user to hit "next page", which + * they may never do). + * + * 2. You want to know if there are more than X entries, without relying on + * the zfs-specific implementation of the directory's st_size (which is + * the number of entries). + */ +boolean_t zap_iterate_prefetch = B_TRUE; + int fzap_default_block_shift = 14; /* 16k blocksize */ extern inline zap_phys_t *zap_f_phys(zap_t *zap); @@ -1168,6 +1198,20 @@ fzap_cursor_retrieve(zap_t *zap, zap_cursor_t *zc, zap /* retrieve the next entry at or after zc_hash/zc_cd */ /* if no entry, return ENOENT */ + + /* + * If we are reading from the beginning, we're almost + * certain to iterate over the entire ZAP object. If there are + * multiple leaf blocks (freeblk > 2), prefetch the whole + * object, so that we read the leaf blocks concurrently. + * (Unless noprefetch was requested via zap_cursor_init_noprefetch()). + */ + if (zc->zc_hash == 0 && zap_iterate_prefetch && + zc->zc_prefetch && zap_f_phys(zap)->zap_freeblk > 2) { + dmu_prefetch(zc->zc_objset, zc->zc_zapobj, 0, 0, + zap_f_phys(zap)->zap_freeblk << FZAP_BLOCK_SHIFT(zap), + ZIO_PRIORITY_ASYNC_READ); + } if (zc->zc_leaf && (ZAP_HASH_IDX(zc->zc_hash, Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Oct 30 16:41:57 2019 (r354184) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Wed Oct 30 16:45:24 2019 (r354185) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. @@ -1394,9 +1394,9 @@ zap_remove_uint64(objset_t *os, uint64_t zapobj, const * Routines for iterating over the attributes. */ -void -zap_cursor_init_serialized(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, - uint64_t serialized) +static void +zap_cursor_init_impl(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, + uint64_t serialized, boolean_t prefetch) { zc->zc_objset = os; zc->zc_zap = NULL; @@ -1405,12 +1405,33 @@ zap_cursor_init_serialized(zap_cursor_t *zc, objset_t zc->zc_serialized = serialized; zc->zc_hash = 0; zc->zc_cd = 0; + zc->zc_prefetch = prefetch; } +void +zap_cursor_init_serialized(zap_cursor_t *zc, objset_t *os, uint64_t zapobj, + uint64_t serialized) +{ + zap_cursor_init_impl(zc, os, zapobj, serialized, B_TRUE); +} +/* + * Initialize a cursor at the beginning of the ZAP object. The entire + * ZAP object will be prefetched. + */ void zap_cursor_init(zap_cursor_t *zc, objset_t *os, uint64_t zapobj) { - zap_cursor_init_serialized(zc, os, zapobj, 0); + zap_cursor_init_impl(zc, os, zapobj, 0, B_TRUE); +} + +/* + * Initialize a cursor at the beginning, but request that we not prefetch + * the entire ZAP object. + */ +void +zap_cursor_init_noprefetch(zap_cursor_t *zc, objset_t *os, uint64_t zapobj) +{ + zap_cursor_init_impl(zc, os, zapobj, 0, B_FALSE); } void From owner-svn-src-stable@freebsd.org Wed Oct 30 16:47:06 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 962FC15A857; Wed, 30 Oct 2019 16:47:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DrV3TCRz4D3s; Wed, 30 Oct 2019 16:47:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC96D3F4; Wed, 30 Oct 2019 16:47:06 +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 x9UGl6C8041044; Wed, 30 Oct 2019 16:47:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGl6qW041043; Wed, 30 Oct 2019 16:47:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301647.x9UGl6qW041043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354186 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:47:06 -0000 Author: avg Date: Wed Oct 30 16:47:05 2019 New Revision: 354186 URL: https://svnweb.freebsd.org/changeset/base/354186 Log: MFC r353609: MFV r353608: 10165 libzpool: passing argument 1 to restrict-qualified parameter Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Oct 30 16:45:24 2019 (r354185) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Oct 30 16:47:05 2019 (r354186) @@ -2196,7 +2196,10 @@ dsl_get_mountpoint(dsl_dataset_t *ds, const char *dsna return (error); } - /* Process the dsname and source to find the full mountpoint string */ + /* + * Process the dsname and source to find the full mountpoint string. + * Can be skipped for 'legacy' or 'none'. + */ if (value[0] == '/') { char *buf = kmem_alloc(ZAP_MAXVALUELEN, KM_SLEEP); char *root = buf; @@ -2247,10 +2250,8 @@ dsl_get_mountpoint(dsl_dataset_t *ds, const char *dsna relpath); } kmem_free(buf, ZAP_MAXVALUELEN); - } else { - /* 'legacy' or 'none' */ - (void) snprintf(value, ZAP_MAXVALUELEN, "%s", value); } + return (0); } From owner-svn-src-stable@freebsd.org Wed Oct 30 16:49:45 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B88A215A952; Wed, 30 Oct 2019 16:49:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473DvY5BTyz4DCJ; Wed, 30 Oct 2019 16:49:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96B4DD3F6; Wed, 30 Oct 2019 16:49:45 +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 x9UGnjXt041220; Wed, 30 Oct 2019 16:49:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGni55041212; Wed, 30 Oct 2019 16:49:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301649.x9UGni55041212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354187 - in stable/12: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 354187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:49:45 -0000 Author: avg Date: Wed Oct 30 16:49:44 2019 New Revision: 354187 URL: https://svnweb.freebsd.org/changeset/base/354187 Log: MFC r353612: MFV r353611: 10330 merge recent ZoL vdev and metaslab changes Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Oct 30 16:49:44 2019 (r354187) @@ -901,11 +901,8 @@ dump_metaslab(metaslab_t *msp) if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - metaslab_load_wait(msp); - if (!msp->ms_loaded) { - VERIFY0(metaslab_load(msp)); - range_tree_stat_verify(msp->ms_allocatable); - } + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_allocatable); dump_metaslab_stats(msp); metaslab_unload(msp); mutex_exit(&msp->ms_lock); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Wed Oct 30 16:49:44 2019 (r354187) @@ -1467,7 +1467,7 @@ metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops; /* * Wait for any in-progress metaslab loads to complete. */ -void +static void metaslab_load_wait(metaslab_t *msp) { ASSERT(MUTEX_HELD(&msp->ms_lock)); @@ -1478,20 +1478,17 @@ metaslab_load_wait(metaslab_t *msp) } } -int -metaslab_load(metaslab_t *msp) +static int +metaslab_load_impl(metaslab_t *msp) { int error = 0; - boolean_t success = B_FALSE; ASSERT(MUTEX_HELD(&msp->ms_lock)); - ASSERT(!msp->ms_loaded); - ASSERT(!msp->ms_loading); + ASSERT(msp->ms_loading); - msp->ms_loading = B_TRUE; /* * Nobody else can manipulate a loading metaslab, so it's now safe - * to drop the lock. This way we don't have to hold the lock while + * to drop the lock. This way we don't have to hold the lock while * reading the spacemap from disk. */ mutex_exit(&msp->ms_lock); @@ -1508,29 +1505,49 @@ metaslab_load(metaslab_t *msp) msp->ms_start, msp->ms_size); } - success = (error == 0); - mutex_enter(&msp->ms_lock); - msp->ms_loading = B_FALSE; - if (success) { - ASSERT3P(msp->ms_group, !=, NULL); - msp->ms_loaded = B_TRUE; + if (error != 0) + return (error); - /* - * If the metaslab already has a spacemap, then we need to - * remove all segments from the defer tree; otherwise, the - * metaslab is completely empty and we can skip this. - */ - if (msp->ms_sm != NULL) { - for (int t = 0; t < TXG_DEFER_SIZE; t++) { - range_tree_walk(msp->ms_defer[t], - range_tree_remove, msp->ms_allocatable); - } + ASSERT3P(msp->ms_group, !=, NULL); + msp->ms_loaded = B_TRUE; + + /* + * If the metaslab already has a spacemap, then we need to + * remove all segments from the defer tree; otherwise, the + * metaslab is completely empty and we can skip this. + */ + if (msp->ms_sm != NULL) { + for (int t = 0; t < TXG_DEFER_SIZE; t++) { + range_tree_walk(msp->ms_defer[t], + range_tree_remove, msp->ms_allocatable); } - msp->ms_max_size = metaslab_block_maxsize(msp); } + msp->ms_max_size = metaslab_block_maxsize(msp); + + return (0); +} + +int +metaslab_load(metaslab_t *msp) +{ + ASSERT(MUTEX_HELD(&msp->ms_lock)); + + /* + * There may be another thread loading the same metaslab, if that's + * the case just wait until the other thread is done and return. + */ + metaslab_load_wait(msp); + if (msp->ms_loaded) + return (0); + VERIFY(!msp->ms_loading); + + msp->ms_loading = B_TRUE; + int error = metaslab_load_impl(msp); + msp->ms_loading = B_FALSE; cv_broadcast(&msp->ms_load_cv); + return (error); } @@ -2090,13 +2107,10 @@ metaslab_activate(metaslab_t *msp, int allocator, uint ASSERT(MUTEX_HELD(&msp->ms_lock)); if ((msp->ms_weight & METASLAB_ACTIVE_MASK) == 0) { - int error = 0; - metaslab_load_wait(msp); - if (!msp->ms_loaded) { - if ((error = metaslab_load(msp)) != 0) { - metaslab_group_sort(msp->ms_group, msp, 0); - return (error); - } + int error = metaslab_load(msp); + if (error != 0) { + metaslab_group_sort(msp->ms_group, msp, 0); + return (error); } if ((msp->ms_weight & METASLAB_ACTIVE_MASK) != 0) { /* @@ -2208,9 +2222,7 @@ metaslab_preload(void *arg) ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock)); mutex_enter(&msp->ms_lock); - metaslab_load_wait(msp); - if (!msp->ms_loaded) - (void) metaslab_load(msp); + (void) metaslab_load(msp); msp->ms_selected_txg = spa_syncing_txg(spa); mutex_exit(&msp->ms_lock); } Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Wed Oct 30 16:49:44 2019 (r354187) @@ -48,7 +48,6 @@ int metaslab_init(metaslab_group_t *, uint64_t, uint64 metaslab_t **); void metaslab_fini(metaslab_t *); -void metaslab_load_wait(metaslab_t *); int metaslab_load(metaslab_t *); void metaslab_unload(metaslab_t *); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Wed Oct 30 16:49:44 2019 (r354187) @@ -370,8 +370,8 @@ struct metaslab { uint64_t ms_initializing; /* leaves initializing this ms */ /* - * We must hold both ms_lock and ms_group->mg_lock in order to - * modify ms_loaded. + * We must always hold the ms_lock when modifying ms_loaded + * and ms_loading. */ boolean_t ms_loaded; boolean_t ms_loading; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Oct 30 16:49:44 2019 (r354187) @@ -163,34 +163,34 @@ static vdev_ops_t *vdev_ops_table[] = { }; -/* target number of metaslabs per top-level vdev */ -int vdev_max_ms_count = 200; -SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count, CTLFLAG_RWTUN, - &vdev_max_ms_count, 0, +/* default target for number of metaslabs per top-level vdev */ +int zfs_vdev_default_ms_count = 200; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_count, CTLFLAG_RWTUN, + &zfs_vdev_default_ms_count, 0, "Target number of metaslabs per top-level vdev"); /* minimum number of metaslabs per top-level vdev */ -int vdev_min_ms_count = 16; +int zfs_vdev_min_ms_count = 16; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, min_ms_count, CTLFLAG_RWTUN, - &vdev_min_ms_count, 0, + &zfs_vdev_min_ms_count, 0, "Minimum number of metaslabs per top-level vdev"); /* practical upper limit of total metaslabs per top-level vdev */ -int vdev_ms_count_limit = 1ULL << 17; +int zfs_vdev_ms_count_limit = 1ULL << 17; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_count_limit, CTLFLAG_RWTUN, - &vdev_ms_count_limit, 0, + &zfs_vdev_ms_count_limit, 0, "Maximum number of metaslabs per top-level vdev"); /* lower limit for metaslab size (512M) */ -int vdev_default_ms_shift = 29; +int zfs_vdev_default_ms_shift = 29; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, default_ms_shift, CTLFLAG_RWTUN, - &vdev_default_ms_shift, 0, + &zfs_vdev_default_ms_shift, 0, "Default shift between vdev size and number of metaslabs"); -/* upper limit for metaslab size (256G) */ -int vdev_max_ms_shift = 38; +/* upper limit for metaslab size (16G) */ +int zfs_vdev_max_ms_shift = 34; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, max_ms_shift, CTLFLAG_RWTUN, - &vdev_max_ms_shift, 0, + &zfs_vdev_max_ms_shift, 0, "Maximum shift between vdev size and number of metaslabs"); boolean_t vdev_validate_skip = B_FALSE; @@ -2205,16 +2205,24 @@ void vdev_metaslab_set_size(vdev_t *vd) { uint64_t asize = vd->vdev_asize; - uint64_t ms_count = asize >> vdev_default_ms_shift; + uint64_t ms_count = asize >> zfs_vdev_default_ms_shift; uint64_t ms_shift; /* * There are two dimensions to the metaslab sizing calculation: * the size of the metaslab and the count of metaslabs per vdev. - * In general, we aim for vdev_max_ms_count (200) metaslabs. The - * range of the dimensions are as follows: * - * 2^29 <= ms_size <= 2^38 + * The default values used below are a good balance between memory + * usage (larger metaslab size means more memory needed for loaded + * metaslabs; more metaslabs means more memory needed for the + * metaslab_t structs), metaslab load time (larger metaslabs take + * longer to load), and metaslab sync time (more metaslabs means + * more time spent syncing all of them). + * + * In general, we aim for zfs_vdev_default_ms_count (200) metaslabs. + * The range of the dimensions are as follows: + * + * 2^29 <= ms_size <= 2^34 * 16 <= ms_count <= 131,072 * * On the lower end of vdev sizes, we aim for metaslabs sizes of @@ -2223,35 +2231,41 @@ vdev_metaslab_set_size(vdev_t *vd) * of at least 16 metaslabs will override this minimum size goal. * * On the upper end of vdev sizes, we aim for a maximum metaslab - * size of 256GB. However, we will cap the total count to 2^17 - * metaslabs to keep our memory footprint in check. + * size of 16GB. However, we will cap the total count to 2^17 + * metaslabs to keep our memory footprint in check and let the + * metaslab size grow from there if that limit is hit. * * The net effect of applying above constrains is summarized below. * - * vdev size metaslab count - * -------------|----------------- - * < 8GB ~16 - * 8GB - 100GB one per 512MB - * 100GB - 50TB ~200 - * 50TB - 32PB one per 256GB - * > 32PB ~131,072 - * ------------------------------- + * vdev size metaslab count + * --------------|----------------- + * < 8GB ~16 + * 8GB - 100GB one per 512MB + * 100GB - 3TB ~200 + * 3TB - 2PB one per 16GB + * > 2PB ~131,072 + * -------------------------------- + * + * Finally, note that all of the above calculate the initial + * number of metaslabs. Expanding a top-level vdev will result + * in additional metaslabs being allocated making it possible + * to exceed the zfs_vdev_ms_count_limit. */ - if (ms_count < vdev_min_ms_count) - ms_shift = highbit64(asize / vdev_min_ms_count); - else if (ms_count > vdev_max_ms_count) - ms_shift = highbit64(asize / vdev_max_ms_count); + if (ms_count < zfs_vdev_min_ms_count) + ms_shift = highbit64(asize / zfs_vdev_min_ms_count); + else if (ms_count > zfs_vdev_default_ms_count) + ms_shift = highbit64(asize / zfs_vdev_default_ms_count); else - ms_shift = vdev_default_ms_shift; + ms_shift = zfs_vdev_default_ms_shift; if (ms_shift < SPA_MAXBLOCKSHIFT) { ms_shift = SPA_MAXBLOCKSHIFT; - } else if (ms_shift > vdev_max_ms_shift) { - ms_shift = vdev_max_ms_shift; + } else if (ms_shift > zfs_vdev_max_ms_shift) { + ms_shift = zfs_vdev_max_ms_shift; /* cap the total count to constrain memory footprint */ - if ((asize >> ms_shift) > vdev_ms_count_limit) - ms_shift = highbit64(asize / vdev_ms_count_limit); + if ((asize >> ms_shift) > zfs_vdev_ms_count_limit) + ms_shift = highbit64(asize / zfs_vdev_ms_count_limit); } vd->vdev_ms_shift = ms_shift; @@ -3611,13 +3625,17 @@ vdev_accessible(vdev_t *vd, zio_t *zio) boolean_t vdev_is_spacemap_addressable(vdev_t *vd) { + if (spa_feature_is_active(vd->vdev_spa, SPA_FEATURE_SPACEMAP_V2)) + return (B_TRUE); + /* - * Assuming 47 bits of the space map entry dedicated for the entry's - * offset (see description in space_map.h), we calculate the maximum - * address that can be described by a space map entry for the given - * device. + * If double-word space map entries are not enabled we assume + * 47 bits of the space map entry are dedicated to the entry's + * offset (see SM_OFFSET_BITS in space_map.h). We then use that + * to calculate the maximum address that can be described by a + * space map entry for the given device. */ - uint64_t shift = vd->vdev_ashift + 47; + uint64_t shift = vd->vdev_ashift + SM_OFFSET_BITS; if (shift >= 63) /* detect potential overflow */ return (B_TRUE); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Wed Oct 30 16:47:05 2019 (r354186) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c Wed Oct 30 16:49:44 2019 (r354187) @@ -353,16 +353,6 @@ vdev_initialize_ranges(vdev_t *vd, abd_t *data) } static void -vdev_initialize_ms_load(metaslab_t *msp) -{ - ASSERT(MUTEX_HELD(&msp->ms_lock)); - - metaslab_load_wait(msp); - if (!msp->ms_loaded) - VERIFY0(metaslab_load(msp)); -} - -static void vdev_initialize_mg_wait(metaslab_group_t *mg) { ASSERT(MUTEX_HELD(&mg->mg_ms_initialize_lock)); @@ -484,10 +474,10 @@ vdev_initialize_calculate_progress(vdev_t *vd) * metaslab. Load it and walk the free tree for more accurate * progress estimation. */ - vdev_initialize_ms_load(msp); + VERIFY0(metaslab_load(msp)); - for (range_seg_t *rs = avl_first(&msp->ms_allocatable->rt_root); rs; - rs = AVL_NEXT(&msp->ms_allocatable->rt_root, rs)) { + for (range_seg_t *rs = avl_first(&msp->ms_allocatable->rt_root); + rs; rs = AVL_NEXT(&msp->ms_allocatable->rt_root, rs)) { logical_rs.rs_start = rs->rs_start; logical_rs.rs_end = rs->rs_end; vdev_xlate(vd, &logical_rs, &physical_rs); @@ -615,7 +605,7 @@ vdev_initialize_thread(void *arg) vdev_initialize_ms_mark(msp); mutex_enter(&msp->ms_lock); - vdev_initialize_ms_load(msp); + VERIFY0(metaslab_load(msp)); range_tree_walk(msp->ms_allocatable, vdev_initialize_range_add, vd); From owner-svn-src-stable@freebsd.org Wed Oct 30 16:54:34 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E2A215AD60; Wed, 30 Oct 2019 16:54:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473F160Mthz4Dxp; Wed, 30 Oct 2019 16:54:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42C1D5C4; Wed, 30 Oct 2019 16:54:33 +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 x9UGsXO5046820; Wed, 30 Oct 2019 16:54:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGsXp5046819; Wed, 30 Oct 2019 16:54:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301654.x9UGsXp5046819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354188 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:54:34 -0000 Author: avg Date: Wed Oct 30 16:54:33 2019 New Revision: 354188 URL: https://svnweb.freebsd.org/changeset/base/354188 Log: MFC r353796: debug.kassert.warnings is a statistic, not a tunable Modified: stable/12/sys/kern/kern_shutdown.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_shutdown.c ============================================================================== --- stable/12/sys/kern/kern_shutdown.c Wed Oct 30 16:49:44 2019 (r354187) +++ stable/12/sys/kern/kern_shutdown.c Wed Oct 30 16:54:33 2019 (r354188) @@ -685,7 +685,7 @@ SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, KASSERT_R &kassert_do_log, 0, "If warn_only is enabled, log (1) or do not log (0) assertion violations"); -SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, KASSERT_RWTUN, +SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, CTLFLAG_RD | CTLFLAG_STATS, &kassert_warnings, 0, "number of KASSERTs that have been triggered"); SYSCTL_INT(_debug_kassert, OID_AUTO, log_panic_at, KASSERT_RWTUN, From owner-svn-src-stable@freebsd.org Wed Oct 30 16:56:26 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC3DF15AEBC; Wed, 30 Oct 2019 16:56:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473F3G4Rhbz4F7T; Wed, 30 Oct 2019 16:56:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CCB8D5C9; Wed, 30 Oct 2019 16:56:26 +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 x9UGuQ4x047003; Wed, 30 Oct 2019 16:56:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UGuQNg047002; Wed, 30 Oct 2019 16:56:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301656.x9UGuQNg047002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 16:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354189 - stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 354189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 16:56:26 -0000 Author: avg Date: Wed Oct 30 16:56:26 2019 New Revision: 354189 URL: https://svnweb.freebsd.org/changeset/base/354189 Log: MFC r354062: zfs.8: fix a typo in the date Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:54:33 2019 (r354188) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:56:26 2019 (r354189) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Octover 16, 2019 +.Dd October 16, 2019 .Dt ZFS 8 .Os .Sh NAME From owner-svn-src-stable@freebsd.org Wed Oct 30 17:02:31 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE2A115B26F; Wed, 30 Oct 2019 17:02:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473FBH57XSz4FfQ; Wed, 30 Oct 2019 17:02:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94872D79E; Wed, 30 Oct 2019 17:02:31 +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 x9UH2V3q052657; Wed, 30 Oct 2019 17:02:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UH2VP3052656; Wed, 30 Oct 2019 17:02:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910301702.x9UH2VP3052656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 30 Oct 2019 17:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354190 - stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 354190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 17:02:31 -0000 Author: avg Date: Wed Oct 30 17:02:31 2019 New Revision: 354190 URL: https://svnweb.freebsd.org/changeset/base/354190 Log: MFC r354062: zfs.8: fix a typo in the date Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 16:56:26 2019 (r354189) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Oct 30 17:02:31 2019 (r354190) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Octover 16, 2019 +.Dd October 16, 2019 .Dt ZFS 8 .Os .Sh NAME From owner-svn-src-stable@freebsd.org Wed Oct 30 17:06:12 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51BAF15B3CC; Wed, 30 Oct 2019 17:06:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473FGX1xsBz4G88; Wed, 30 Oct 2019 17:06:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25726D7A3; Wed, 30 Oct 2019 17:06:12 +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 x9UH6CXH052929; Wed, 30 Oct 2019 17:06:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UH63KR052885; Wed, 30 Oct 2019 17:06:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910301706.x9UH63KR052885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Oct 2019 17:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354191 - in stable/12/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Commit-Revision: 354191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 17:06:12 -0000 Author: brooks Date: Wed Oct 30 17:06:02 2019 New Revision: 354191 URL: https://svnweb.freebsd.org/changeset/base/354191 Log: MFC r353325, r353875 r353325: Update tcsh to 6.21.00. This is a bugfix release with no new features. A number of these fixes were previously merged into our tree. Sponsored by: DARPA, AFRL r353875: Update tcsh to git revision 83c5be0 bringing in a number of bug fixes. Reported by: sobomax Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22099 Added: stable/12/contrib/tcsh/README.md - copied, changed from r353325, head/contrib/tcsh/README.md Deleted: stable/12/contrib/tcsh/README stable/12/contrib/tcsh/README.imake Modified: stable/12/contrib/tcsh/Fixes stable/12/contrib/tcsh/Imakefile stable/12/contrib/tcsh/MAKEDIFFS stable/12/contrib/tcsh/MAKESHAR stable/12/contrib/tcsh/Makefile.in stable/12/contrib/tcsh/Makefile.std stable/12/contrib/tcsh/Makefile.vms stable/12/contrib/tcsh/Ported stable/12/contrib/tcsh/complete.tcsh stable/12/contrib/tcsh/config_f.h stable/12/contrib/tcsh/configure stable/12/contrib/tcsh/dotlock.c stable/12/contrib/tcsh/ed.chared.c stable/12/contrib/tcsh/ed.decls.h stable/12/contrib/tcsh/ed.defns.c stable/12/contrib/tcsh/ed.h stable/12/contrib/tcsh/ed.init.c stable/12/contrib/tcsh/ed.inputl.c stable/12/contrib/tcsh/ed.refresh.c stable/12/contrib/tcsh/ed.screen.c stable/12/contrib/tcsh/ed.term.c stable/12/contrib/tcsh/ed.term.h stable/12/contrib/tcsh/ed.xmap.c stable/12/contrib/tcsh/eight-bit.me stable/12/contrib/tcsh/gethost.c stable/12/contrib/tcsh/glob.3 stable/12/contrib/tcsh/glob.c stable/12/contrib/tcsh/glob.h stable/12/contrib/tcsh/host.defs stable/12/contrib/tcsh/imake.config stable/12/contrib/tcsh/ma.setp.c stable/12/contrib/tcsh/mi.termios.c stable/12/contrib/tcsh/mi.varargs.h stable/12/contrib/tcsh/nls/C/set1 stable/12/contrib/tcsh/nls/C/set10 stable/12/contrib/tcsh/nls/C/set11 stable/12/contrib/tcsh/nls/C/set12 stable/12/contrib/tcsh/nls/C/set13 stable/12/contrib/tcsh/nls/C/set14 stable/12/contrib/tcsh/nls/C/set15 stable/12/contrib/tcsh/nls/C/set16 stable/12/contrib/tcsh/nls/C/set17 stable/12/contrib/tcsh/nls/C/set18 stable/12/contrib/tcsh/nls/C/set19 stable/12/contrib/tcsh/nls/C/set2 stable/12/contrib/tcsh/nls/C/set20 stable/12/contrib/tcsh/nls/C/set21 stable/12/contrib/tcsh/nls/C/set22 stable/12/contrib/tcsh/nls/C/set23 stable/12/contrib/tcsh/nls/C/set24 stable/12/contrib/tcsh/nls/C/set25 stable/12/contrib/tcsh/nls/C/set26 stable/12/contrib/tcsh/nls/C/set27 stable/12/contrib/tcsh/nls/C/set29 stable/12/contrib/tcsh/nls/C/set3 stable/12/contrib/tcsh/nls/C/set30 stable/12/contrib/tcsh/nls/C/set31 stable/12/contrib/tcsh/nls/C/set4 stable/12/contrib/tcsh/nls/C/set5 stable/12/contrib/tcsh/nls/C/set6 stable/12/contrib/tcsh/nls/C/set7 stable/12/contrib/tcsh/nls/C/set8 stable/12/contrib/tcsh/nls/C/set9 stable/12/contrib/tcsh/nls/Makefile.in stable/12/contrib/tcsh/nls/catgen stable/12/contrib/tcsh/nls/et/set1 stable/12/contrib/tcsh/nls/et/set10 stable/12/contrib/tcsh/nls/et/set11 stable/12/contrib/tcsh/nls/et/set12 stable/12/contrib/tcsh/nls/et/set13 stable/12/contrib/tcsh/nls/et/set14 stable/12/contrib/tcsh/nls/et/set15 stable/12/contrib/tcsh/nls/et/set16 stable/12/contrib/tcsh/nls/et/set17 stable/12/contrib/tcsh/nls/et/set18 stable/12/contrib/tcsh/nls/et/set19 stable/12/contrib/tcsh/nls/et/set2 stable/12/contrib/tcsh/nls/et/set20 stable/12/contrib/tcsh/nls/et/set21 stable/12/contrib/tcsh/nls/et/set22 stable/12/contrib/tcsh/nls/et/set23 stable/12/contrib/tcsh/nls/et/set24 stable/12/contrib/tcsh/nls/et/set25 stable/12/contrib/tcsh/nls/et/set26 stable/12/contrib/tcsh/nls/et/set27 stable/12/contrib/tcsh/nls/et/set29 stable/12/contrib/tcsh/nls/et/set3 stable/12/contrib/tcsh/nls/et/set30 stable/12/contrib/tcsh/nls/et/set31 stable/12/contrib/tcsh/nls/et/set4 stable/12/contrib/tcsh/nls/et/set5 stable/12/contrib/tcsh/nls/et/set6 stable/12/contrib/tcsh/nls/et/set7 stable/12/contrib/tcsh/nls/et/set8 stable/12/contrib/tcsh/nls/et/set9 stable/12/contrib/tcsh/nls/finnish/set1 stable/12/contrib/tcsh/nls/finnish/set10 stable/12/contrib/tcsh/nls/finnish/set11 stable/12/contrib/tcsh/nls/finnish/set12 stable/12/contrib/tcsh/nls/finnish/set13 stable/12/contrib/tcsh/nls/finnish/set14 stable/12/contrib/tcsh/nls/finnish/set15 stable/12/contrib/tcsh/nls/finnish/set16 stable/12/contrib/tcsh/nls/finnish/set17 stable/12/contrib/tcsh/nls/finnish/set18 stable/12/contrib/tcsh/nls/finnish/set19 stable/12/contrib/tcsh/nls/finnish/set2 stable/12/contrib/tcsh/nls/finnish/set20 stable/12/contrib/tcsh/nls/finnish/set21 stable/12/contrib/tcsh/nls/finnish/set22 stable/12/contrib/tcsh/nls/finnish/set23 stable/12/contrib/tcsh/nls/finnish/set24 stable/12/contrib/tcsh/nls/finnish/set25 stable/12/contrib/tcsh/nls/finnish/set26 stable/12/contrib/tcsh/nls/finnish/set27 stable/12/contrib/tcsh/nls/finnish/set29 stable/12/contrib/tcsh/nls/finnish/set3 stable/12/contrib/tcsh/nls/finnish/set30 stable/12/contrib/tcsh/nls/finnish/set31 stable/12/contrib/tcsh/nls/finnish/set4 stable/12/contrib/tcsh/nls/finnish/set5 stable/12/contrib/tcsh/nls/finnish/set6 stable/12/contrib/tcsh/nls/finnish/set7 stable/12/contrib/tcsh/nls/finnish/set8 stable/12/contrib/tcsh/nls/finnish/set9 stable/12/contrib/tcsh/nls/french/set1 stable/12/contrib/tcsh/nls/french/set10 stable/12/contrib/tcsh/nls/french/set11 stable/12/contrib/tcsh/nls/french/set12 stable/12/contrib/tcsh/nls/french/set13 stable/12/contrib/tcsh/nls/french/set14 stable/12/contrib/tcsh/nls/french/set15 stable/12/contrib/tcsh/nls/french/set16 stable/12/contrib/tcsh/nls/french/set17 stable/12/contrib/tcsh/nls/french/set18 stable/12/contrib/tcsh/nls/french/set19 stable/12/contrib/tcsh/nls/french/set2 stable/12/contrib/tcsh/nls/french/set20 stable/12/contrib/tcsh/nls/french/set21 stable/12/contrib/tcsh/nls/french/set22 stable/12/contrib/tcsh/nls/french/set23 stable/12/contrib/tcsh/nls/french/set24 stable/12/contrib/tcsh/nls/french/set25 stable/12/contrib/tcsh/nls/french/set26 stable/12/contrib/tcsh/nls/french/set27 stable/12/contrib/tcsh/nls/french/set29 stable/12/contrib/tcsh/nls/french/set3 stable/12/contrib/tcsh/nls/french/set30 stable/12/contrib/tcsh/nls/french/set31 stable/12/contrib/tcsh/nls/french/set4 stable/12/contrib/tcsh/nls/french/set5 stable/12/contrib/tcsh/nls/french/set6 stable/12/contrib/tcsh/nls/french/set7 stable/12/contrib/tcsh/nls/french/set8 stable/12/contrib/tcsh/nls/french/set9 stable/12/contrib/tcsh/nls/german/set1 stable/12/contrib/tcsh/nls/german/set10 stable/12/contrib/tcsh/nls/german/set11 stable/12/contrib/tcsh/nls/german/set12 stable/12/contrib/tcsh/nls/german/set13 stable/12/contrib/tcsh/nls/german/set14 stable/12/contrib/tcsh/nls/german/set15 stable/12/contrib/tcsh/nls/german/set16 stable/12/contrib/tcsh/nls/german/set17 stable/12/contrib/tcsh/nls/german/set18 stable/12/contrib/tcsh/nls/german/set19 stable/12/contrib/tcsh/nls/german/set2 stable/12/contrib/tcsh/nls/german/set20 stable/12/contrib/tcsh/nls/german/set21 stable/12/contrib/tcsh/nls/german/set22 stable/12/contrib/tcsh/nls/german/set23 stable/12/contrib/tcsh/nls/german/set24 stable/12/contrib/tcsh/nls/german/set25 stable/12/contrib/tcsh/nls/german/set26 stable/12/contrib/tcsh/nls/german/set27 stable/12/contrib/tcsh/nls/german/set29 stable/12/contrib/tcsh/nls/german/set3 stable/12/contrib/tcsh/nls/german/set30 stable/12/contrib/tcsh/nls/german/set31 stable/12/contrib/tcsh/nls/german/set4 stable/12/contrib/tcsh/nls/german/set5 stable/12/contrib/tcsh/nls/german/set6 stable/12/contrib/tcsh/nls/german/set7 stable/12/contrib/tcsh/nls/german/set8 stable/12/contrib/tcsh/nls/german/set9 stable/12/contrib/tcsh/nls/greek/set1 stable/12/contrib/tcsh/nls/greek/set10 stable/12/contrib/tcsh/nls/greek/set11 stable/12/contrib/tcsh/nls/greek/set12 stable/12/contrib/tcsh/nls/greek/set13 stable/12/contrib/tcsh/nls/greek/set14 stable/12/contrib/tcsh/nls/greek/set15 stable/12/contrib/tcsh/nls/greek/set16 stable/12/contrib/tcsh/nls/greek/set17 stable/12/contrib/tcsh/nls/greek/set18 stable/12/contrib/tcsh/nls/greek/set19 stable/12/contrib/tcsh/nls/greek/set2 stable/12/contrib/tcsh/nls/greek/set20 stable/12/contrib/tcsh/nls/greek/set21 stable/12/contrib/tcsh/nls/greek/set22 stable/12/contrib/tcsh/nls/greek/set23 stable/12/contrib/tcsh/nls/greek/set24 stable/12/contrib/tcsh/nls/greek/set25 stable/12/contrib/tcsh/nls/greek/set26 stable/12/contrib/tcsh/nls/greek/set27 stable/12/contrib/tcsh/nls/greek/set29 stable/12/contrib/tcsh/nls/greek/set3 stable/12/contrib/tcsh/nls/greek/set30 stable/12/contrib/tcsh/nls/greek/set31 stable/12/contrib/tcsh/nls/greek/set4 stable/12/contrib/tcsh/nls/greek/set5 stable/12/contrib/tcsh/nls/greek/set6 stable/12/contrib/tcsh/nls/greek/set7 stable/12/contrib/tcsh/nls/greek/set8 stable/12/contrib/tcsh/nls/greek/set9 stable/12/contrib/tcsh/nls/italian/set1 stable/12/contrib/tcsh/nls/italian/set10 stable/12/contrib/tcsh/nls/italian/set11 stable/12/contrib/tcsh/nls/italian/set12 stable/12/contrib/tcsh/nls/italian/set13 stable/12/contrib/tcsh/nls/italian/set14 stable/12/contrib/tcsh/nls/italian/set15 stable/12/contrib/tcsh/nls/italian/set16 stable/12/contrib/tcsh/nls/italian/set17 stable/12/contrib/tcsh/nls/italian/set18 stable/12/contrib/tcsh/nls/italian/set19 stable/12/contrib/tcsh/nls/italian/set2 stable/12/contrib/tcsh/nls/italian/set20 stable/12/contrib/tcsh/nls/italian/set21 stable/12/contrib/tcsh/nls/italian/set22 stable/12/contrib/tcsh/nls/italian/set23 stable/12/contrib/tcsh/nls/italian/set24 stable/12/contrib/tcsh/nls/italian/set25 stable/12/contrib/tcsh/nls/italian/set26 stable/12/contrib/tcsh/nls/italian/set27 stable/12/contrib/tcsh/nls/italian/set29 stable/12/contrib/tcsh/nls/italian/set3 stable/12/contrib/tcsh/nls/italian/set30 stable/12/contrib/tcsh/nls/italian/set31 stable/12/contrib/tcsh/nls/italian/set4 stable/12/contrib/tcsh/nls/italian/set5 stable/12/contrib/tcsh/nls/italian/set6 stable/12/contrib/tcsh/nls/italian/set7 stable/12/contrib/tcsh/nls/italian/set8 stable/12/contrib/tcsh/nls/italian/set9 stable/12/contrib/tcsh/nls/ja/set1 stable/12/contrib/tcsh/nls/ja/set10 stable/12/contrib/tcsh/nls/ja/set11 stable/12/contrib/tcsh/nls/ja/set12 stable/12/contrib/tcsh/nls/ja/set13 stable/12/contrib/tcsh/nls/ja/set15 stable/12/contrib/tcsh/nls/ja/set16 stable/12/contrib/tcsh/nls/ja/set17 stable/12/contrib/tcsh/nls/ja/set18 stable/12/contrib/tcsh/nls/ja/set2 stable/12/contrib/tcsh/nls/ja/set21 stable/12/contrib/tcsh/nls/ja/set24 stable/12/contrib/tcsh/nls/ja/set29 stable/12/contrib/tcsh/nls/ja/set3 stable/12/contrib/tcsh/nls/ja/set30 stable/12/contrib/tcsh/nls/ja/set4 stable/12/contrib/tcsh/nls/ja/set5 stable/12/contrib/tcsh/nls/ja/set6 stable/12/contrib/tcsh/nls/ja/set7 stable/12/contrib/tcsh/nls/ja/set8 stable/12/contrib/tcsh/nls/russian/set1 stable/12/contrib/tcsh/nls/russian/set10 stable/12/contrib/tcsh/nls/russian/set11 stable/12/contrib/tcsh/nls/russian/set12 stable/12/contrib/tcsh/nls/russian/set13 stable/12/contrib/tcsh/nls/russian/set14 stable/12/contrib/tcsh/nls/russian/set15 stable/12/contrib/tcsh/nls/russian/set16 stable/12/contrib/tcsh/nls/russian/set17 stable/12/contrib/tcsh/nls/russian/set18 stable/12/contrib/tcsh/nls/russian/set19 stable/12/contrib/tcsh/nls/russian/set2 stable/12/contrib/tcsh/nls/russian/set20 stable/12/contrib/tcsh/nls/russian/set21 stable/12/contrib/tcsh/nls/russian/set22 stable/12/contrib/tcsh/nls/russian/set23 stable/12/contrib/tcsh/nls/russian/set24 stable/12/contrib/tcsh/nls/russian/set25 stable/12/contrib/tcsh/nls/russian/set26 stable/12/contrib/tcsh/nls/russian/set27 stable/12/contrib/tcsh/nls/russian/set29 stable/12/contrib/tcsh/nls/russian/set3 stable/12/contrib/tcsh/nls/russian/set30 stable/12/contrib/tcsh/nls/russian/set31 stable/12/contrib/tcsh/nls/russian/set4 stable/12/contrib/tcsh/nls/russian/set5 stable/12/contrib/tcsh/nls/russian/set6 stable/12/contrib/tcsh/nls/russian/set7 stable/12/contrib/tcsh/nls/russian/set8 stable/12/contrib/tcsh/nls/russian/set9 stable/12/contrib/tcsh/nls/spanish/set1 stable/12/contrib/tcsh/nls/spanish/set10 stable/12/contrib/tcsh/nls/spanish/set11 stable/12/contrib/tcsh/nls/spanish/set12 stable/12/contrib/tcsh/nls/spanish/set13 stable/12/contrib/tcsh/nls/spanish/set14 stable/12/contrib/tcsh/nls/spanish/set15 stable/12/contrib/tcsh/nls/spanish/set16 stable/12/contrib/tcsh/nls/spanish/set17 stable/12/contrib/tcsh/nls/spanish/set18 stable/12/contrib/tcsh/nls/spanish/set19 stable/12/contrib/tcsh/nls/spanish/set2 stable/12/contrib/tcsh/nls/spanish/set20 stable/12/contrib/tcsh/nls/spanish/set21 stable/12/contrib/tcsh/nls/spanish/set22 stable/12/contrib/tcsh/nls/spanish/set23 stable/12/contrib/tcsh/nls/spanish/set24 stable/12/contrib/tcsh/nls/spanish/set25 stable/12/contrib/tcsh/nls/spanish/set26 stable/12/contrib/tcsh/nls/spanish/set27 stable/12/contrib/tcsh/nls/spanish/set29 stable/12/contrib/tcsh/nls/spanish/set3 stable/12/contrib/tcsh/nls/spanish/set30 stable/12/contrib/tcsh/nls/spanish/set31 stable/12/contrib/tcsh/nls/spanish/set4 stable/12/contrib/tcsh/nls/spanish/set5 stable/12/contrib/tcsh/nls/spanish/set6 stable/12/contrib/tcsh/nls/spanish/set7 stable/12/contrib/tcsh/nls/spanish/set8 stable/12/contrib/tcsh/nls/spanish/set9 stable/12/contrib/tcsh/nls/ukrainian/set1 stable/12/contrib/tcsh/nls/ukrainian/set10 stable/12/contrib/tcsh/nls/ukrainian/set11 stable/12/contrib/tcsh/nls/ukrainian/set12 stable/12/contrib/tcsh/nls/ukrainian/set13 stable/12/contrib/tcsh/nls/ukrainian/set14 stable/12/contrib/tcsh/nls/ukrainian/set15 stable/12/contrib/tcsh/nls/ukrainian/set16 stable/12/contrib/tcsh/nls/ukrainian/set17 stable/12/contrib/tcsh/nls/ukrainian/set18 stable/12/contrib/tcsh/nls/ukrainian/set19 stable/12/contrib/tcsh/nls/ukrainian/set2 stable/12/contrib/tcsh/nls/ukrainian/set20 stable/12/contrib/tcsh/nls/ukrainian/set21 stable/12/contrib/tcsh/nls/ukrainian/set22 stable/12/contrib/tcsh/nls/ukrainian/set23 stable/12/contrib/tcsh/nls/ukrainian/set24 stable/12/contrib/tcsh/nls/ukrainian/set25 stable/12/contrib/tcsh/nls/ukrainian/set26 stable/12/contrib/tcsh/nls/ukrainian/set27 stable/12/contrib/tcsh/nls/ukrainian/set29 stable/12/contrib/tcsh/nls/ukrainian/set3 stable/12/contrib/tcsh/nls/ukrainian/set30 stable/12/contrib/tcsh/nls/ukrainian/set31 stable/12/contrib/tcsh/nls/ukrainian/set4 stable/12/contrib/tcsh/nls/ukrainian/set5 stable/12/contrib/tcsh/nls/ukrainian/set6 stable/12/contrib/tcsh/nls/ukrainian/set7 stable/12/contrib/tcsh/nls/ukrainian/set8 stable/12/contrib/tcsh/nls/ukrainian/set9 stable/12/contrib/tcsh/patchlevel.h stable/12/contrib/tcsh/pathnames.h stable/12/contrib/tcsh/sh.c stable/12/contrib/tcsh/sh.char.c stable/12/contrib/tcsh/sh.char.h stable/12/contrib/tcsh/sh.decls.h stable/12/contrib/tcsh/sh.dir.c stable/12/contrib/tcsh/sh.dir.h stable/12/contrib/tcsh/sh.dol.c stable/12/contrib/tcsh/sh.err.c stable/12/contrib/tcsh/sh.exec.c stable/12/contrib/tcsh/sh.exp.c stable/12/contrib/tcsh/sh.file.c stable/12/contrib/tcsh/sh.func.c stable/12/contrib/tcsh/sh.glob.c stable/12/contrib/tcsh/sh.h stable/12/contrib/tcsh/sh.hist.c stable/12/contrib/tcsh/sh.init.c stable/12/contrib/tcsh/sh.lex.c stable/12/contrib/tcsh/sh.misc.c stable/12/contrib/tcsh/sh.parse.c stable/12/contrib/tcsh/sh.print.c stable/12/contrib/tcsh/sh.proc.c stable/12/contrib/tcsh/sh.proc.h stable/12/contrib/tcsh/sh.sem.c stable/12/contrib/tcsh/sh.set.c stable/12/contrib/tcsh/sh.time.c stable/12/contrib/tcsh/sh.types.h stable/12/contrib/tcsh/snames.h stable/12/contrib/tcsh/tc.alloc.c stable/12/contrib/tcsh/tc.bind.c stable/12/contrib/tcsh/tc.const.c stable/12/contrib/tcsh/tc.decls.h stable/12/contrib/tcsh/tc.disc.c stable/12/contrib/tcsh/tc.func.c stable/12/contrib/tcsh/tc.h stable/12/contrib/tcsh/tc.nls.c stable/12/contrib/tcsh/tc.nls.h stable/12/contrib/tcsh/tc.os.c stable/12/contrib/tcsh/tc.os.h stable/12/contrib/tcsh/tc.printf.c stable/12/contrib/tcsh/tc.prompt.c stable/12/contrib/tcsh/tc.sched.c stable/12/contrib/tcsh/tc.sig.c stable/12/contrib/tcsh/tc.sig.h stable/12/contrib/tcsh/tc.str.c stable/12/contrib/tcsh/tc.vers.c stable/12/contrib/tcsh/tc.wait.h stable/12/contrib/tcsh/tc.who.c stable/12/contrib/tcsh/tcsh.man stable/12/contrib/tcsh/tcsh.man.new stable/12/contrib/tcsh/tcsh.man2html stable/12/contrib/tcsh/termcap.vms stable/12/contrib/tcsh/tw.color.c stable/12/contrib/tcsh/tw.comp.c stable/12/contrib/tcsh/tw.decls.h stable/12/contrib/tcsh/tw.h stable/12/contrib/tcsh/tw.help.c stable/12/contrib/tcsh/tw.init.c stable/12/contrib/tcsh/tw.parse.c stable/12/contrib/tcsh/tw.spell.c stable/12/contrib/tcsh/vms.termcap.c Modified: stable/12/contrib/tcsh/Fixes ============================================================================== --- stable/12/contrib/tcsh/Fixes Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Fixes Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,26 @@ - 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is + not a tty. + 4. Avoid infinite loops during history loads when merging, print a better + error for errors during history load. + 3. PR/88: Preserve empty arguments in :q + 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) + 1. PR/81: Fix range matching issue where we were comparing with the + range character instead of the start of range. [l-z]* would match foo + 12. V6.21.00 - 20190508 + 11. Abort history loading on words and lines too long + https://bugzilla.redhat.com/show_bug.cgi?id=1598502 + 10. PR/37: Introduce GetCmdChar() to avoid open coding array access. + 9. make closem() not close sockets so as not to affect nss_ldap. + tcsh never creates sockets so that's ok (Miloslav Trmac) + 8. PR/597: Make rmstar work with aliased rm + 7. convert match() from recursive to backtracking. + 6. Handle 8 bit characters in bindkey (Werner Fink) + 5. Look for tgetent in libtinfo as well (Werner Fink) + 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis) + 3. Fix out of bounds read (Brooks Davis) + 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 1. PR/471: Delay arginp parsing + 20. V6.20.00 - 20161124 19. Don't resize the screen if it did not change size. 18. V6.19.01 - 20161025 Modified: stable/12/contrib/tcsh/Imakefile ============================================================================== --- stable/12/contrib/tcsh/Imakefile Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Imakefile Wed Oct 30 17:06:02 2019 (r354191) @@ -1,6 +1,4 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ -XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB XCOMM @@ -522,12 +520,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ tc.vers.${SUF} tc.who.${SUF} -MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ - WishList config_f.h eight-bit.me glob.3 patchlevel.h \ - pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ - Makefile.win32 aclocal.m4 +MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ + FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ + tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ + Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ + Makefile.in configure.ac Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/12/contrib/tcsh/MAKEDIFFS ============================================================================== --- stable/12/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:06:02 2019 (r354191) @@ -2,7 +2,6 @@ # # MAKEDIFFS.sh: Make context diffs for the csh sources # -# $tcsh: MAKEDIFFS,v 3.1 2006/03/02 18:46:44 christos Exp $ XINUDIR=/usr/share/src/mtXinu/bin/csh BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh Modified: stable/12/contrib/tcsh/MAKESHAR ============================================================================== --- stable/12/contrib/tcsh/MAKESHAR Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/MAKESHAR Wed Oct 30 17:06:02 2019 (r354191) @@ -2,7 +2,6 @@ # # MAKESHAR.sh: Make a shar file for the sources # -# $tcsh: MAKESHAR,v 3.2 2006/03/02 18:46:44 christos Exp $ AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays WC=/usr/ucb/wc Modified: stable/12/contrib/tcsh/Makefile.in ============================================================================== --- stable/12/contrib/tcsh/Makefile.in Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.in Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ -# Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -407,11 +405,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ @@ -449,7 +447,7 @@ pure:$(P) ${OBJS} gethost: gethost.c sh.err.h tc.const.h sh.h rm -f gethost - ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c + ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $(srcdir)/gethost.c tc.defs.c: gethost host.defs @rm -f $@.tmp Modified: stable/12/contrib/tcsh/Makefile.std ============================================================================== --- stable/12/contrib/tcsh/Makefile.std Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.std Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ -# Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -317,11 +315,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/12/contrib/tcsh/Makefile.vms ============================================================================== --- stable/12/contrib/tcsh/Makefile.vms Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Makefile.vms Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ -# Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -295,11 +293,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/12/contrib/tcsh/Ported ============================================================================== --- stable/12/contrib/tcsh/Ported Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/Ported Wed Oct 30 17:06:02 2019 (r354191) @@ -338,7 +338,7 @@ CFLAGS : normal LIBES : -ltermcap OS : bsd 4.3reno CONFIG : bsdreno -NOTES : ttyname() is buggy. calls closedir() twice. See README +NOTES : ttyname() is buggy. calls closedir() twice. See BUILDING ENVIRON : n/a VERSION : 6.00.04 Copied and modified: stable/12/contrib/tcsh/README.md (from r353325, head/contrib/tcsh/README.md) ============================================================================== --- head/contrib/tcsh/README.md Tue Oct 8 20:59:31 2019 (r353325, copy source) +++ stable/12/contrib/tcsh/README.md Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -# Tcsh +# TCSH *C shell with file name completion and command line editing* @@ -14,10 +14,10 @@ PLEASE file any bug reports, fixes, and code for new f > https://bugs.astron.com/ Comments, questions, etc. (even flames) are welcome via email to -the Tcsh Bugs mailing list: +the tcsh mailing list: -> tcsh-bugs@astron.com -> https://mailman.astron.com/ +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh [![Build Status][status]][travis] Modified: stable/12/contrib/tcsh/complete.tcsh ============================================================================== --- stable/12/contrib/tcsh/complete.tcsh Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/complete.tcsh Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,4 @@ # -# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux Modified: stable/12/contrib/tcsh/config_f.h ============================================================================== --- stable/12/contrib/tcsh/config_f.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/config_f.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.52 2016/04/16 15:44:18 christos Exp $ */ /* * config_f.h -- configure various defines for tcsh * @@ -176,20 +175,6 @@ * FILEC support for old style file completion */ #define FILEC - -/* - * RCSID This defines if we want rcs strings in the binary or not - * - */ -#if !defined(lint) && !defined(SABER) && !defined(__CLCC__) -# ifndef __GNUC__ -# define RCSID(id) static char *rcsid = (id); -# else -# define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id); -# endif /* !__GNUC__ */ -#else -# define RCSID(id) /* Nothing */ -#endif /* !lint && !SABER */ /* Consistency checks */ #ifdef WIDE_STRINGS Modified: stable/12/contrib/tcsh/configure ============================================================================== --- stable/12/contrib/tcsh/configure Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/configure Wed Oct 30 17:06:02 2019 (r354191) @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tcsh 6.20.00. +# Generated by GNU Autoconf 2.69 for tcsh 6.21.00. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,10 +267,10 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://bugs.gw.com/ about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." +$0: https://bugs.astron.com/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -580,9 +580,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcsh' PACKAGE_TARNAME='tcsh' -PACKAGE_VERSION='6.20.00' -PACKAGE_STRING='tcsh 6.20.00' -PACKAGE_BUGREPORT='http://bugs.gw.com/' +PACKAGE_VERSION='6.21.00' +PACKAGE_STRING='tcsh 6.21.00' +PACKAGE_BUGREPORT='https://bugs.astron.com/' PACKAGE_URL='' ac_unique_file="tc.vers.c" @@ -1250,7 +1250,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcsh 6.20.00 to adapt to many kinds of systems. +\`configure' configures tcsh 6.21.00 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcsh 6.20.00:";; + short | recursive ) echo "Configuration of tcsh 6.21.00:";; esac cat <<\_ACEOF @@ -1348,7 +1348,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1411,7 +1411,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcsh configure 6.20.00 +tcsh configure 6.21.00 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1658,9 +1658,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf docume $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------- ## -## Report this to http://bugs.gw.com/ ## -## ---------------------------------- ##" +( $as_echo "## --------------------------------------- ## +## Report this to https://bugs.astron.com/ ## +## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcsh $as_me 6.20.00, which was +It was created by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4284,7 +4284,7 @@ return tgetent (); return 0; } _ACEOF -for ac_lib in '' termlib termcap curses ncurses; do +for ac_lib in '' termlib tinfo termcap curses ncurses; do if test -z "$ac_lib"; then ac_res="none required" else @@ -7350,7 +7350,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tcsh $as_me 6.20.00, which was +This file was extended by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7410,13 +7410,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tcsh config.status 6.20.00 +tcsh config.status 6.21.00 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/tcsh/dotlock.c ============================================================================== --- stable/12/contrib/tcsh/dotlock.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/dotlock.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -/* $NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp $ */ +/* NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "sh.h" -RCSID("$tcsh: dotlock.c,v 3.4 2015/11/03 21:04:13 christos Exp $") #include #ifndef O_SYNC Modified: stable/12/contrib/tcsh/ed.chared.c ============================================================================== --- stable/12/contrib/tcsh/ed.chared.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.chared.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $ */ /* * ed.chared.c: Character editing functions. */ @@ -71,9 +70,6 @@ */ #include "sh.h" - -RCSID("$tcsh: ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $") - #include "ed.h" #include "tw.h" #include "ed.defns.h" @@ -1105,8 +1101,7 @@ e_inc_search(int dir) if (GetNextChar(&ch) != 1) return(e_send_eof(0)); - switch (ch > NT_NUM_KEYS - ? F_INSERT : CurrentKeyMap[(unsigned char) ch]) { + switch (GetCmdChar(ch)) { case F_INSERT: case F_DIGIT: case F_MAGIC_SPACE: Modified: stable/12/contrib/tcsh/ed.decls.h ============================================================================== --- stable/12/contrib/tcsh/ed.decls.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.decls.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.46 2015/08/19 14:29:55 christos Exp $ */ /* * ed.decls.h: Editor external definitions */ @@ -250,6 +249,7 @@ extern CCRETVAL e_newline_down_hist (Char); * ed.inputl.c */ extern int Inputl (void); +extern int GetCmdChar (Char); extern int GetNextChar (Char *); extern void UngetNextChar (Char); extern void PushMacro (Char *); Modified: stable/12/contrib/tcsh/ed.defns.c ============================================================================== --- stable/12/contrib/tcsh/ed.defns.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.defns.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $ */ /* * ed.defns.c: Editor function definitions and initialization */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $") - #include "ed.h" static void ed_InitMetaBindings (void); @@ -265,26 +261,22 @@ PFCmd CcFuncTbl[] = { /* table of available command #define F_COMMAND_NORM 111 e_dabbrev_expand, #define F_DABBREV_EXPAND 112 - e_copy_to_clipboard, -#define F_COPY_CLIP 113 - e_paste_from_clipboard, -#define F_PASTE_CLIP 114 e_dosify_next, -#define F_DOSIFY_NEXT 115 +#define F_DOSIFY_NEXT 113 e_dosify_prev, -#define F_DOSIFY_PREV 116 +#define F_DOSIFY_PREV 114 e_page_up, -#define F_PAGE_UP 117 +#define F_PAGE_UP 115 e_page_down, -#define F_PAGE_DOWN 118 +#define F_PAGE_DOWN 116 e_yank_pop, -#define F_YANK_POP 119 +#define F_YANK_POP 117 e_newline_hold, -#define F_NEWLINE_HOLD 120 +#define F_NEWLINE_HOLD 118 e_newline_down_hist, -#define F_NEWLINE_DOWN_HIST 121 +#define F_NEWLINE_DOWN_HIST 119 0 /* DUMMY VALUE */ -#define F_NUM_FNS 122 +#define F_NUM_FNS 120 }; @@ -1752,18 +1744,6 @@ editinit(void) f->func = F_YANK_POP; f->desc = CSAVS(3, 115, "Replace just-yanked text with yank from earlier kill"); - - f++; - f->name = "e_copy_to_clipboard"; - f->func = F_COPY_CLIP; - f->desc = CSAVS(3, 116, - "(WIN32 only) Copy cut buffer to system clipboard"); - - f++; - f->name = "e_paste_from_clipboard"; - f->func = F_PASTE_CLIP; - f->desc = CSAVS(3, 117, - "(WIN32 only) Paste clipboard buffer at cursor position"); f++; f->name = "e_dosify_next"; Modified: stable/12/contrib/tcsh/ed.h ============================================================================== --- stable/12/contrib/tcsh/ed.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.50 2007/07/05 14:13:06 christos Exp $ */ /* * ed.h: Editor declarations and globals */ Modified: stable/12/contrib/tcsh/ed.init.c ============================================================================== --- stable/12/contrib/tcsh/ed.init.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.init.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $ */ /* * ed.init.c: Editor initializations */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/ed.inputl.c ============================================================================== --- stable/12/contrib/tcsh/ed.inputl.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.inputl.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $ */ /* * ed.inputl.c: Input line handling. */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $") - #include "ed.h" #include "ed.defns.h" /* for the function names */ #include "tw.h" /* for twenex stuff */ @@ -668,6 +664,17 @@ RunCommand(Char *str) Refresh(); } +int +GetCmdChar(Char ch) +{ +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys + wint_t c = ch & CHAR; +#else + wint_t c = ch; +#endif + return c < NT_NUM_KEYS ? CurrentKeyMap[c] : F_INSERT; +} + static int GetNextCommand(KEYCMD *cmdnum, Char *ch) { @@ -696,17 +703,8 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) MetaNext = 0; *ch |= META; } - /* XXX: This needs to be fixed so that we don't just truncate - * the character, we unquote it. - */ - if (*ch < NT_NUM_KEYS) - cmd = CurrentKeyMap[*ch]; - else -#ifdef WINNT_NATIVE - cmd = CurrentKeyMap[(unsigned char) *ch]; -#else - cmd = F_INSERT; -#endif + + cmd = GetCmdChar(*ch); if (cmd == F_XKEY) { XmapVal val; CStr cstr; @@ -800,13 +798,18 @@ GetNextChar(Char *cp) return -1; } } - cbp++; - if (normal_mbtowc(cp, cbuf, cbp) == -1) { - reset_mbtowc(); - if (cbp < MB_CUR_MAX) - continue; /* Maybe a partial character */ - /* And drop the following bytes, if any */ - *cp = (unsigned char)*cbuf | INVALID_BYTE; + if (cbp == 0 /* && *cbuf < NT_NUM_KEYS */ + && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) { + *cp = (unsigned char)*cbuf; + } else { + cbp++; + if (normal_mbtowc(cp, cbuf, cbp) == -1) { + reset_mbtowc(); + if (cbp < MB_CUR_MAX) + continue; /* Maybe a partial character */ + /* And drop the following bytes, if any */ + *cp = (unsigned char)*cbuf | INVALID_BYTE; + } } break; } Modified: stable/12/contrib/tcsh/ed.refresh.c ============================================================================== --- stable/12/contrib/tcsh/ed.refresh.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.refresh.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $ */ /* * ed.refresh.c: Lower level screen refreshing functions */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" /* #define DEBUG_UPDATE */ /* #define DEBUG_REFRESH */ Modified: stable/12/contrib/tcsh/ed.screen.c ============================================================================== --- stable/12/contrib/tcsh/ed.screen.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.screen.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $ */ /* * ed.screen.c: Editor/termcap-curses interface */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/ed.term.c ============================================================================== --- stable/12/contrib/tcsh/ed.term.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.term.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $ */ /* * ed.term.c: Low level terminal interface */ @@ -32,8 +31,6 @@ */ #include "sh.h" #ifndef WINNT_NATIVE - -RCSID("$tcsh: ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $") #include #include "ed.h" Modified: stable/12/contrib/tcsh/ed.term.h ============================================================================== --- stable/12/contrib/tcsh/ed.term.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.term.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 christos Exp $ */ /* * ed.term.h: Local terminal header */ Modified: stable/12/contrib/tcsh/ed.xmap.c ============================================================================== --- stable/12/contrib/tcsh/ed.xmap.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ed.xmap.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $ */ /* * ed.xmap.c: This module contains the procedures for maintaining * the extended-key map. @@ -87,9 +86,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" #include "ed.defns.h" Modified: stable/12/contrib/tcsh/eight-bit.me ============================================================================== --- stable/12/contrib/tcsh/eight-bit.me Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/eight-bit.me Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -.\" $tcsh: eight-bit.me,v 3.2 2006/03/02 18:46:44 christos Exp $ How to use 8 bit characters by Johan Widen Modified: stable/12/contrib/tcsh/gethost.c ============================================================================== --- stable/12/contrib/tcsh/gethost.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/gethost.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $ */ /* * gethost.c: Create version file from prototype */ @@ -31,8 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $") #ifdef SCO # define perror __perror Modified: stable/12/contrib/tcsh/glob.3 ============================================================================== --- stable/12/contrib/tcsh/glob.3 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.3 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -.\" $NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp $ +.\" NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. Modified: stable/12/contrib/tcsh/glob.c ============================================================================== --- stable/12/contrib/tcsh/glob.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.c Wed Oct 30 17:06:02 2019 (r354191) @@ -100,7 +100,7 @@ static int Lstat (const char *, struct stat *); static int Stat (const char *, struct stat *sb); static Char *Strchr (Char *, int); #ifdef DEBUG -static void qprintf (const Char *); +static void qprintf (const char *, const Char *); #endif #define DOLLAR '$' @@ -256,19 +256,20 @@ Strchr(Char *str, int ch) #ifdef DEBUG static void -qprintf(const Char *s) +qprintf(const char *pre, const Char *s) { const Char *p; - + + xprintf("%s", pre); for (p = s; *p; p++) - printf("%c", *p & 0xff); - printf("\n"); + xprintf("%c", *p & 0xff); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_PROTECT ? '"' : ' '); - printf("\n"); + xprintf("%c", *p & M_PROTECT ? '"' : ' '); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_META ? '_' : ' '); - printf("\n"); + xprintf("%c", *p & M_META ? '_' : ' '); + xprintf("\n"); } #endif /* DEBUG */ @@ -412,7 +413,7 @@ glob(const char *pattern, int flags, int (*errfunc) (c } *bufnext = EOS; #ifdef DEBUG - qprintf(patbuf); + qprintf("patbuf=", patbuf); #endif if ((err = glob1(patbuf, pglob, no_match)) != 0) { @@ -693,72 +694,94 @@ globextend(const char *path, glob_t *pglob) } /* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. + * pattern matching function for filenames. */ static int match(const char *name, const Char *pat, const Char *patend, int m_not) { int ok, negate_range; + const Char *patNext; + const char *nameNext, *nameStart, *nameEnd; Char c; - while (pat < patend) { - size_t lwk; - __Char wc, wk; + patNext = pat; + nameStart = nameNext = name; + nameEnd = NULL; + while (pat < patend || *name) { + size_t lwk, pwk; + __Char wc, wk, wc1; + c = *pat; /* Only for M_MASK bits */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + if (*name == EOS) + nameEnd = name; + + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX); switch (c & M_MASK) { case M_ALL: - while (pat < patend && (*pat & M_MASK) == M_ALL) /* eat consecutive '*' */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); - if (pat == patend) - return (1); - while (!match(name, pat, patend, m_not)) { - if (*name == EOS) - return (0); - name += lwk; - lwk = one_mbtowc(&wk, name, MB_LEN_MAX); + while ((*(pat + pwk) & M_MASK) == M_ALL) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - return (1); + patNext = pat; + nameNext = name + lwk; + pat += pwk; + continue; case M_ONE: if (*name == EOS) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; case M_SET: ok = 0; if (*name == EOS) - return (0); + break; + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); name += lwk; - if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) - ++pat; + if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + } + wc1 = wc; while ((*pat & M_MASK) != M_END) { - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if ((*pat & M_MASK) == M_RNG) { __Char wc2; - pat++; - pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); - if (globcharcoll(wc, wk, 0) <= 0 && + pat += pwk; + pwk = One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); + if (globcharcoll(wc1, wk, 0) <= 0 && globcharcoll(wk, wc2, 0) <= 0) ok = 1; } else if (wc == wk) ok = 1; + pat += pwk; + wc1 = wc; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if (ok == negate_range) - return (0); - break; + break; + continue; default: if (*name == EOS || samecase(wk) != samecase(wc)) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; } + if (nameNext != nameStart + && (nameEnd == NULL || nameNext <= nameEnd)) { + pat = patNext; + name = nameNext; + continue; + } + return 0; } - return (*name == EOS); + return 1; } /* free allocated data belonging to a glob_t structure */ Modified: stable/12/contrib/tcsh/glob.h ============================================================================== --- stable/12/contrib/tcsh/glob.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/glob.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,4 @@ -/* $NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp $ */ +/* NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp */ /* * Copyright (c) 1989, 1993 Modified: stable/12/contrib/tcsh/host.defs ============================================================================== --- stable/12/contrib/tcsh/host.defs Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/host.defs Wed Oct 30 17:06:02 2019 (r354191) @@ -1,5 +1,4 @@ newcode : -/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $ */ /* * host.defs: Hosttype/Machtype etc. */ @@ -33,8 +32,6 @@ newcode : */ #include "sh.h" -RCSID("$tcsh: host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $") - endcode : macro : M_mips64el : (defined(mips64) && defined(MIPSEL)) @@ -857,9 +854,9 @@ enddef : newdef : defined(APPLE) && defined(MACH) comment : OS X vendor : : "apple" -hosttype: defined(i386) : "intel-pc" +hosttype: defined(i386) : "intel-mac" hosttype: defined(ppc) : "powermac" -hosttype: defined(M_amd64) : "amd" +hosttype: defined(M_amd64) : "intel-mac" ostype : : "darwin" machtype: defined(i386) : "i386" machtype: defined(M_amd64) : "x86_64" Modified: stable/12/contrib/tcsh/imake.config ============================================================================== --- stable/12/contrib/tcsh/imake.config Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/imake.config Wed Oct 30 17:06:02 2019 (r354191) @@ -1,6 +1,4 @@ /* - * $tcsh: imake.config,v 1.5 2006/03/02 18:46:44 christos Exp $ - * * config.Imakefile for for tcsh 6.00 * Marc Horowitz, MIT SIPB */ Modified: stable/12/contrib/tcsh/ma.setp.c ============================================================================== --- stable/12/contrib/tcsh/ma.setp.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/ma.setp.c Wed Oct 30 17:06:02 2019 (r354191) @@ -82,7 +82,6 @@ ********************************************************************** */ #include "sh.h" -RCSID("$tcsh: ma.setp.c,v 1.19 2007/11/20 20:03:51 christos Exp $") #ifdef MACH Modified: stable/12/contrib/tcsh/mi.termios.c ============================================================================== --- stable/12/contrib/tcsh/mi.termios.c Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/mi.termios.c Wed Oct 30 17:06:02 2019 (r354191) @@ -1,10 +1,8 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $ */ /* termios.c - fake termios interface using sgtty interface * by Magnus Doell and Bruce Evans. * */ #include "sh.h" -RCSID("$tcsh: mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $") #if defined(_MINIX) && !defined(_MINIX_VMD) Modified: stable/12/contrib/tcsh/mi.varargs.h ============================================================================== --- stable/12/contrib/tcsh/mi.varargs.h Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/mi.varargs.h Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */ /* * mi.varargs.h: Correct varargs for minix */ Modified: stable/12/contrib/tcsh/nls/C/set1 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set1 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set1 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $ $ Error messages $set 1 1 Syntax Error Modified: stable/12/contrib/tcsh/nls/C/set10 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set10 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set10 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set10,v 1.3 2006/03/02 18:46:45 christos Exp $ $ ma.setp.c $set 10 1 setpath: invalid command '%s'.\n Modified: stable/12/contrib/tcsh/nls/C/set11 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set11 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set11 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set11,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.c $set 11 1 Warning: no access to tty (%s).\n Modified: stable/12/contrib/tcsh/nls/C/set12 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set12 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set12 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set12,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.dir.c $set 12 1 %s: Trying to start from "%s"\n Modified: stable/12/contrib/tcsh/nls/C/set13 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set13 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set13 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set13,v 1.3 2006/03/02 18:46:45 christos Exp $ $ sh.exec.c $set 13 1 hash=%-4d dir=%-2d prog=%s\n Modified: stable/12/contrib/tcsh/nls/C/set14 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set14 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set14 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set14,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.file.c $set 14 1 \nYikes!! Too many %s!!\n Modified: stable/12/contrib/tcsh/nls/C/set15 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set15 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set15 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set15,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.func.c $set 15 1 %s: %s: Can't %s%s limit\n Modified: stable/12/contrib/tcsh/nls/C/set16 ============================================================================== --- stable/12/contrib/tcsh/nls/C/set16 Wed Oct 30 17:02:31 2019 (r354190) +++ stable/12/contrib/tcsh/nls/C/set16 Wed Oct 30 17:06:02 2019 (r354191) @@ -1,4 +1,3 @@ -$ $tcsh: set16,v 1.4 2006/03/02 18:46:45 christos Exp $ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Oct 30 18:22:07 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2F4D15CFC7; Wed, 30 Oct 2019 18:22:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473Gy76R4Dz4MJ2; Wed, 30 Oct 2019 18:22:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFFBDE5C1; Wed, 30 Oct 2019 18:22:07 +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 x9UIM7Hk099862; Wed, 30 Oct 2019 18:22:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UILwXj099790; Wed, 30 Oct 2019 18:21:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201910301821.x9UILwXj099790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Oct 2019 18:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354195 - in stable/11/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/contrib/tcsh: . nls nls/C nls/et nls/finnish nls/french nls/german nls/greek nls/italian nls/ja nls/russian nls/spanish nls/ukrainian X-SVN-Commit-Revision: 354195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 18:22:08 -0000 Author: brooks Date: Wed Oct 30 18:21:58 2019 New Revision: 354195 URL: https://svnweb.freebsd.org/changeset/base/354195 Log: MFC r353325, r353875 r353325: Update tcsh to 6.21.00. This is a bugfix release with no new features. A number of these fixes were previously merged into our tree. Sponsored by: DARPA, AFRL r353875: Update tcsh to git revision 83c5be0 bringing in a number of bug fixes. Reported by: sobomax Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22099 Record prior MFC of r315948, r315952 Added: stable/11/contrib/tcsh/README.md Deleted: stable/11/contrib/tcsh/README stable/11/contrib/tcsh/README.imake Modified: stable/11/contrib/tcsh/Fixes stable/11/contrib/tcsh/Imakefile stable/11/contrib/tcsh/MAKEDIFFS stable/11/contrib/tcsh/MAKESHAR stable/11/contrib/tcsh/Makefile.in stable/11/contrib/tcsh/Makefile.std stable/11/contrib/tcsh/Makefile.vms stable/11/contrib/tcsh/Ported stable/11/contrib/tcsh/complete.tcsh stable/11/contrib/tcsh/config_f.h stable/11/contrib/tcsh/configure stable/11/contrib/tcsh/dotlock.c stable/11/contrib/tcsh/ed.chared.c stable/11/contrib/tcsh/ed.decls.h stable/11/contrib/tcsh/ed.defns.c stable/11/contrib/tcsh/ed.h stable/11/contrib/tcsh/ed.init.c stable/11/contrib/tcsh/ed.inputl.c stable/11/contrib/tcsh/ed.refresh.c stable/11/contrib/tcsh/ed.screen.c stable/11/contrib/tcsh/ed.term.c stable/11/contrib/tcsh/ed.term.h stable/11/contrib/tcsh/ed.xmap.c stable/11/contrib/tcsh/eight-bit.me stable/11/contrib/tcsh/gethost.c stable/11/contrib/tcsh/glob.3 stable/11/contrib/tcsh/glob.c stable/11/contrib/tcsh/glob.h stable/11/contrib/tcsh/host.defs stable/11/contrib/tcsh/imake.config stable/11/contrib/tcsh/ma.setp.c stable/11/contrib/tcsh/mi.termios.c stable/11/contrib/tcsh/mi.varargs.h stable/11/contrib/tcsh/nls/C/set1 stable/11/contrib/tcsh/nls/C/set10 stable/11/contrib/tcsh/nls/C/set11 stable/11/contrib/tcsh/nls/C/set12 stable/11/contrib/tcsh/nls/C/set13 stable/11/contrib/tcsh/nls/C/set14 stable/11/contrib/tcsh/nls/C/set15 stable/11/contrib/tcsh/nls/C/set16 stable/11/contrib/tcsh/nls/C/set17 stable/11/contrib/tcsh/nls/C/set18 stable/11/contrib/tcsh/nls/C/set19 stable/11/contrib/tcsh/nls/C/set2 stable/11/contrib/tcsh/nls/C/set20 stable/11/contrib/tcsh/nls/C/set21 stable/11/contrib/tcsh/nls/C/set22 stable/11/contrib/tcsh/nls/C/set23 stable/11/contrib/tcsh/nls/C/set24 stable/11/contrib/tcsh/nls/C/set25 stable/11/contrib/tcsh/nls/C/set26 stable/11/contrib/tcsh/nls/C/set27 stable/11/contrib/tcsh/nls/C/set29 stable/11/contrib/tcsh/nls/C/set3 stable/11/contrib/tcsh/nls/C/set30 stable/11/contrib/tcsh/nls/C/set31 stable/11/contrib/tcsh/nls/C/set4 stable/11/contrib/tcsh/nls/C/set5 stable/11/contrib/tcsh/nls/C/set6 stable/11/contrib/tcsh/nls/C/set7 stable/11/contrib/tcsh/nls/C/set8 stable/11/contrib/tcsh/nls/C/set9 stable/11/contrib/tcsh/nls/Makefile.in stable/11/contrib/tcsh/nls/catgen stable/11/contrib/tcsh/nls/et/set1 stable/11/contrib/tcsh/nls/et/set10 stable/11/contrib/tcsh/nls/et/set11 stable/11/contrib/tcsh/nls/et/set12 stable/11/contrib/tcsh/nls/et/set13 stable/11/contrib/tcsh/nls/et/set14 stable/11/contrib/tcsh/nls/et/set15 stable/11/contrib/tcsh/nls/et/set16 stable/11/contrib/tcsh/nls/et/set17 stable/11/contrib/tcsh/nls/et/set18 stable/11/contrib/tcsh/nls/et/set19 stable/11/contrib/tcsh/nls/et/set2 stable/11/contrib/tcsh/nls/et/set20 stable/11/contrib/tcsh/nls/et/set21 stable/11/contrib/tcsh/nls/et/set22 stable/11/contrib/tcsh/nls/et/set23 stable/11/contrib/tcsh/nls/et/set24 stable/11/contrib/tcsh/nls/et/set25 stable/11/contrib/tcsh/nls/et/set26 stable/11/contrib/tcsh/nls/et/set27 stable/11/contrib/tcsh/nls/et/set29 stable/11/contrib/tcsh/nls/et/set3 stable/11/contrib/tcsh/nls/et/set30 stable/11/contrib/tcsh/nls/et/set31 stable/11/contrib/tcsh/nls/et/set4 stable/11/contrib/tcsh/nls/et/set5 stable/11/contrib/tcsh/nls/et/set6 stable/11/contrib/tcsh/nls/et/set7 stable/11/contrib/tcsh/nls/et/set8 stable/11/contrib/tcsh/nls/et/set9 stable/11/contrib/tcsh/nls/finnish/set1 stable/11/contrib/tcsh/nls/finnish/set10 stable/11/contrib/tcsh/nls/finnish/set11 stable/11/contrib/tcsh/nls/finnish/set12 stable/11/contrib/tcsh/nls/finnish/set13 stable/11/contrib/tcsh/nls/finnish/set14 stable/11/contrib/tcsh/nls/finnish/set15 stable/11/contrib/tcsh/nls/finnish/set16 stable/11/contrib/tcsh/nls/finnish/set17 stable/11/contrib/tcsh/nls/finnish/set18 stable/11/contrib/tcsh/nls/finnish/set19 stable/11/contrib/tcsh/nls/finnish/set2 stable/11/contrib/tcsh/nls/finnish/set20 stable/11/contrib/tcsh/nls/finnish/set21 stable/11/contrib/tcsh/nls/finnish/set22 stable/11/contrib/tcsh/nls/finnish/set23 stable/11/contrib/tcsh/nls/finnish/set24 stable/11/contrib/tcsh/nls/finnish/set25 stable/11/contrib/tcsh/nls/finnish/set26 stable/11/contrib/tcsh/nls/finnish/set27 stable/11/contrib/tcsh/nls/finnish/set29 stable/11/contrib/tcsh/nls/finnish/set3 stable/11/contrib/tcsh/nls/finnish/set30 stable/11/contrib/tcsh/nls/finnish/set31 stable/11/contrib/tcsh/nls/finnish/set4 stable/11/contrib/tcsh/nls/finnish/set5 stable/11/contrib/tcsh/nls/finnish/set6 stable/11/contrib/tcsh/nls/finnish/set7 stable/11/contrib/tcsh/nls/finnish/set8 stable/11/contrib/tcsh/nls/finnish/set9 stable/11/contrib/tcsh/nls/french/set1 stable/11/contrib/tcsh/nls/french/set10 stable/11/contrib/tcsh/nls/french/set11 stable/11/contrib/tcsh/nls/french/set12 stable/11/contrib/tcsh/nls/french/set13 stable/11/contrib/tcsh/nls/french/set14 stable/11/contrib/tcsh/nls/french/set15 stable/11/contrib/tcsh/nls/french/set16 stable/11/contrib/tcsh/nls/french/set17 stable/11/contrib/tcsh/nls/french/set18 stable/11/contrib/tcsh/nls/french/set19 stable/11/contrib/tcsh/nls/french/set2 stable/11/contrib/tcsh/nls/french/set20 stable/11/contrib/tcsh/nls/french/set21 stable/11/contrib/tcsh/nls/french/set22 stable/11/contrib/tcsh/nls/french/set23 stable/11/contrib/tcsh/nls/french/set24 stable/11/contrib/tcsh/nls/french/set25 stable/11/contrib/tcsh/nls/french/set26 stable/11/contrib/tcsh/nls/french/set27 stable/11/contrib/tcsh/nls/french/set29 stable/11/contrib/tcsh/nls/french/set3 stable/11/contrib/tcsh/nls/french/set30 stable/11/contrib/tcsh/nls/french/set31 stable/11/contrib/tcsh/nls/french/set4 stable/11/contrib/tcsh/nls/french/set5 stable/11/contrib/tcsh/nls/french/set6 stable/11/contrib/tcsh/nls/french/set7 stable/11/contrib/tcsh/nls/french/set8 stable/11/contrib/tcsh/nls/french/set9 stable/11/contrib/tcsh/nls/german/set1 stable/11/contrib/tcsh/nls/german/set10 stable/11/contrib/tcsh/nls/german/set11 stable/11/contrib/tcsh/nls/german/set12 stable/11/contrib/tcsh/nls/german/set13 stable/11/contrib/tcsh/nls/german/set14 stable/11/contrib/tcsh/nls/german/set15 stable/11/contrib/tcsh/nls/german/set16 stable/11/contrib/tcsh/nls/german/set17 stable/11/contrib/tcsh/nls/german/set18 stable/11/contrib/tcsh/nls/german/set19 stable/11/contrib/tcsh/nls/german/set2 stable/11/contrib/tcsh/nls/german/set20 stable/11/contrib/tcsh/nls/german/set21 stable/11/contrib/tcsh/nls/german/set22 stable/11/contrib/tcsh/nls/german/set23 stable/11/contrib/tcsh/nls/german/set24 stable/11/contrib/tcsh/nls/german/set25 stable/11/contrib/tcsh/nls/german/set26 stable/11/contrib/tcsh/nls/german/set27 stable/11/contrib/tcsh/nls/german/set29 stable/11/contrib/tcsh/nls/german/set3 stable/11/contrib/tcsh/nls/german/set30 stable/11/contrib/tcsh/nls/german/set31 stable/11/contrib/tcsh/nls/german/set4 stable/11/contrib/tcsh/nls/german/set5 stable/11/contrib/tcsh/nls/german/set6 stable/11/contrib/tcsh/nls/german/set7 stable/11/contrib/tcsh/nls/german/set8 stable/11/contrib/tcsh/nls/german/set9 stable/11/contrib/tcsh/nls/greek/set1 stable/11/contrib/tcsh/nls/greek/set10 stable/11/contrib/tcsh/nls/greek/set11 stable/11/contrib/tcsh/nls/greek/set12 stable/11/contrib/tcsh/nls/greek/set13 stable/11/contrib/tcsh/nls/greek/set14 stable/11/contrib/tcsh/nls/greek/set15 stable/11/contrib/tcsh/nls/greek/set16 stable/11/contrib/tcsh/nls/greek/set17 stable/11/contrib/tcsh/nls/greek/set18 stable/11/contrib/tcsh/nls/greek/set19 stable/11/contrib/tcsh/nls/greek/set2 stable/11/contrib/tcsh/nls/greek/set20 stable/11/contrib/tcsh/nls/greek/set21 stable/11/contrib/tcsh/nls/greek/set22 stable/11/contrib/tcsh/nls/greek/set23 stable/11/contrib/tcsh/nls/greek/set24 stable/11/contrib/tcsh/nls/greek/set25 stable/11/contrib/tcsh/nls/greek/set26 stable/11/contrib/tcsh/nls/greek/set27 stable/11/contrib/tcsh/nls/greek/set29 stable/11/contrib/tcsh/nls/greek/set3 stable/11/contrib/tcsh/nls/greek/set30 stable/11/contrib/tcsh/nls/greek/set31 stable/11/contrib/tcsh/nls/greek/set4 stable/11/contrib/tcsh/nls/greek/set5 stable/11/contrib/tcsh/nls/greek/set6 stable/11/contrib/tcsh/nls/greek/set7 stable/11/contrib/tcsh/nls/greek/set8 stable/11/contrib/tcsh/nls/greek/set9 stable/11/contrib/tcsh/nls/italian/set1 stable/11/contrib/tcsh/nls/italian/set10 stable/11/contrib/tcsh/nls/italian/set11 stable/11/contrib/tcsh/nls/italian/set12 stable/11/contrib/tcsh/nls/italian/set13 stable/11/contrib/tcsh/nls/italian/set14 stable/11/contrib/tcsh/nls/italian/set15 stable/11/contrib/tcsh/nls/italian/set16 stable/11/contrib/tcsh/nls/italian/set17 stable/11/contrib/tcsh/nls/italian/set18 stable/11/contrib/tcsh/nls/italian/set19 stable/11/contrib/tcsh/nls/italian/set2 stable/11/contrib/tcsh/nls/italian/set20 stable/11/contrib/tcsh/nls/italian/set21 stable/11/contrib/tcsh/nls/italian/set22 stable/11/contrib/tcsh/nls/italian/set23 stable/11/contrib/tcsh/nls/italian/set24 stable/11/contrib/tcsh/nls/italian/set25 stable/11/contrib/tcsh/nls/italian/set26 stable/11/contrib/tcsh/nls/italian/set27 stable/11/contrib/tcsh/nls/italian/set29 stable/11/contrib/tcsh/nls/italian/set3 stable/11/contrib/tcsh/nls/italian/set30 stable/11/contrib/tcsh/nls/italian/set31 stable/11/contrib/tcsh/nls/italian/set4 stable/11/contrib/tcsh/nls/italian/set5 stable/11/contrib/tcsh/nls/italian/set6 stable/11/contrib/tcsh/nls/italian/set7 stable/11/contrib/tcsh/nls/italian/set8 stable/11/contrib/tcsh/nls/italian/set9 stable/11/contrib/tcsh/nls/ja/set1 stable/11/contrib/tcsh/nls/ja/set10 stable/11/contrib/tcsh/nls/ja/set11 stable/11/contrib/tcsh/nls/ja/set12 stable/11/contrib/tcsh/nls/ja/set13 stable/11/contrib/tcsh/nls/ja/set15 stable/11/contrib/tcsh/nls/ja/set16 stable/11/contrib/tcsh/nls/ja/set17 stable/11/contrib/tcsh/nls/ja/set18 stable/11/contrib/tcsh/nls/ja/set2 stable/11/contrib/tcsh/nls/ja/set21 stable/11/contrib/tcsh/nls/ja/set24 stable/11/contrib/tcsh/nls/ja/set29 stable/11/contrib/tcsh/nls/ja/set3 stable/11/contrib/tcsh/nls/ja/set30 stable/11/contrib/tcsh/nls/ja/set4 stable/11/contrib/tcsh/nls/ja/set5 stable/11/contrib/tcsh/nls/ja/set6 stable/11/contrib/tcsh/nls/ja/set7 stable/11/contrib/tcsh/nls/ja/set8 stable/11/contrib/tcsh/nls/russian/set1 stable/11/contrib/tcsh/nls/russian/set10 stable/11/contrib/tcsh/nls/russian/set11 stable/11/contrib/tcsh/nls/russian/set12 stable/11/contrib/tcsh/nls/russian/set13 stable/11/contrib/tcsh/nls/russian/set14 stable/11/contrib/tcsh/nls/russian/set15 stable/11/contrib/tcsh/nls/russian/set16 stable/11/contrib/tcsh/nls/russian/set17 stable/11/contrib/tcsh/nls/russian/set18 stable/11/contrib/tcsh/nls/russian/set19 stable/11/contrib/tcsh/nls/russian/set2 stable/11/contrib/tcsh/nls/russian/set20 stable/11/contrib/tcsh/nls/russian/set21 stable/11/contrib/tcsh/nls/russian/set22 stable/11/contrib/tcsh/nls/russian/set23 stable/11/contrib/tcsh/nls/russian/set24 stable/11/contrib/tcsh/nls/russian/set25 stable/11/contrib/tcsh/nls/russian/set26 stable/11/contrib/tcsh/nls/russian/set27 stable/11/contrib/tcsh/nls/russian/set29 stable/11/contrib/tcsh/nls/russian/set3 stable/11/contrib/tcsh/nls/russian/set30 stable/11/contrib/tcsh/nls/russian/set31 stable/11/contrib/tcsh/nls/russian/set4 stable/11/contrib/tcsh/nls/russian/set5 stable/11/contrib/tcsh/nls/russian/set6 stable/11/contrib/tcsh/nls/russian/set7 stable/11/contrib/tcsh/nls/russian/set8 stable/11/contrib/tcsh/nls/russian/set9 stable/11/contrib/tcsh/nls/spanish/set1 stable/11/contrib/tcsh/nls/spanish/set10 stable/11/contrib/tcsh/nls/spanish/set11 stable/11/contrib/tcsh/nls/spanish/set12 stable/11/contrib/tcsh/nls/spanish/set13 stable/11/contrib/tcsh/nls/spanish/set14 stable/11/contrib/tcsh/nls/spanish/set15 stable/11/contrib/tcsh/nls/spanish/set16 stable/11/contrib/tcsh/nls/spanish/set17 stable/11/contrib/tcsh/nls/spanish/set18 stable/11/contrib/tcsh/nls/spanish/set19 stable/11/contrib/tcsh/nls/spanish/set2 stable/11/contrib/tcsh/nls/spanish/set20 stable/11/contrib/tcsh/nls/spanish/set21 stable/11/contrib/tcsh/nls/spanish/set22 stable/11/contrib/tcsh/nls/spanish/set23 stable/11/contrib/tcsh/nls/spanish/set24 stable/11/contrib/tcsh/nls/spanish/set25 stable/11/contrib/tcsh/nls/spanish/set26 stable/11/contrib/tcsh/nls/spanish/set27 stable/11/contrib/tcsh/nls/spanish/set29 stable/11/contrib/tcsh/nls/spanish/set3 stable/11/contrib/tcsh/nls/spanish/set30 stable/11/contrib/tcsh/nls/spanish/set31 stable/11/contrib/tcsh/nls/spanish/set4 stable/11/contrib/tcsh/nls/spanish/set5 stable/11/contrib/tcsh/nls/spanish/set6 stable/11/contrib/tcsh/nls/spanish/set7 stable/11/contrib/tcsh/nls/spanish/set8 stable/11/contrib/tcsh/nls/spanish/set9 stable/11/contrib/tcsh/nls/ukrainian/set1 stable/11/contrib/tcsh/nls/ukrainian/set10 stable/11/contrib/tcsh/nls/ukrainian/set11 stable/11/contrib/tcsh/nls/ukrainian/set12 stable/11/contrib/tcsh/nls/ukrainian/set13 stable/11/contrib/tcsh/nls/ukrainian/set14 stable/11/contrib/tcsh/nls/ukrainian/set15 stable/11/contrib/tcsh/nls/ukrainian/set16 stable/11/contrib/tcsh/nls/ukrainian/set17 stable/11/contrib/tcsh/nls/ukrainian/set18 stable/11/contrib/tcsh/nls/ukrainian/set19 stable/11/contrib/tcsh/nls/ukrainian/set2 stable/11/contrib/tcsh/nls/ukrainian/set20 stable/11/contrib/tcsh/nls/ukrainian/set21 stable/11/contrib/tcsh/nls/ukrainian/set22 stable/11/contrib/tcsh/nls/ukrainian/set23 stable/11/contrib/tcsh/nls/ukrainian/set24 stable/11/contrib/tcsh/nls/ukrainian/set25 stable/11/contrib/tcsh/nls/ukrainian/set26 stable/11/contrib/tcsh/nls/ukrainian/set27 stable/11/contrib/tcsh/nls/ukrainian/set29 stable/11/contrib/tcsh/nls/ukrainian/set3 stable/11/contrib/tcsh/nls/ukrainian/set30 stable/11/contrib/tcsh/nls/ukrainian/set31 stable/11/contrib/tcsh/nls/ukrainian/set4 stable/11/contrib/tcsh/nls/ukrainian/set5 stable/11/contrib/tcsh/nls/ukrainian/set6 stable/11/contrib/tcsh/nls/ukrainian/set7 stable/11/contrib/tcsh/nls/ukrainian/set8 stable/11/contrib/tcsh/nls/ukrainian/set9 stable/11/contrib/tcsh/patchlevel.h stable/11/contrib/tcsh/pathnames.h stable/11/contrib/tcsh/sh.c stable/11/contrib/tcsh/sh.char.c stable/11/contrib/tcsh/sh.char.h stable/11/contrib/tcsh/sh.decls.h stable/11/contrib/tcsh/sh.dir.c stable/11/contrib/tcsh/sh.dir.h stable/11/contrib/tcsh/sh.dol.c stable/11/contrib/tcsh/sh.err.c stable/11/contrib/tcsh/sh.exec.c stable/11/contrib/tcsh/sh.exp.c stable/11/contrib/tcsh/sh.file.c stable/11/contrib/tcsh/sh.func.c stable/11/contrib/tcsh/sh.glob.c stable/11/contrib/tcsh/sh.h stable/11/contrib/tcsh/sh.hist.c stable/11/contrib/tcsh/sh.init.c stable/11/contrib/tcsh/sh.lex.c stable/11/contrib/tcsh/sh.misc.c stable/11/contrib/tcsh/sh.parse.c stable/11/contrib/tcsh/sh.print.c stable/11/contrib/tcsh/sh.proc.c stable/11/contrib/tcsh/sh.proc.h stable/11/contrib/tcsh/sh.sem.c stable/11/contrib/tcsh/sh.set.c stable/11/contrib/tcsh/sh.time.c stable/11/contrib/tcsh/sh.types.h stable/11/contrib/tcsh/snames.h stable/11/contrib/tcsh/tc.alloc.c stable/11/contrib/tcsh/tc.bind.c stable/11/contrib/tcsh/tc.const.c stable/11/contrib/tcsh/tc.decls.h stable/11/contrib/tcsh/tc.disc.c stable/11/contrib/tcsh/tc.func.c stable/11/contrib/tcsh/tc.h stable/11/contrib/tcsh/tc.nls.c stable/11/contrib/tcsh/tc.nls.h stable/11/contrib/tcsh/tc.os.c stable/11/contrib/tcsh/tc.os.h stable/11/contrib/tcsh/tc.printf.c stable/11/contrib/tcsh/tc.prompt.c stable/11/contrib/tcsh/tc.sched.c stable/11/contrib/tcsh/tc.sig.c stable/11/contrib/tcsh/tc.sig.h stable/11/contrib/tcsh/tc.str.c stable/11/contrib/tcsh/tc.vers.c stable/11/contrib/tcsh/tc.wait.h stable/11/contrib/tcsh/tc.who.c stable/11/contrib/tcsh/tcsh.man stable/11/contrib/tcsh/tcsh.man.new stable/11/contrib/tcsh/tcsh.man2html stable/11/contrib/tcsh/termcap.vms stable/11/contrib/tcsh/tw.color.c stable/11/contrib/tcsh/tw.comp.c stable/11/contrib/tcsh/tw.decls.h stable/11/contrib/tcsh/tw.h stable/11/contrib/tcsh/tw.help.c stable/11/contrib/tcsh/tw.init.c stable/11/contrib/tcsh/tw.parse.c stable/11/contrib/tcsh/tw.spell.c stable/11/contrib/tcsh/vms.termcap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcsh/Fixes ============================================================================== --- stable/11/contrib/tcsh/Fixes Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Fixes Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,26 @@ - 22. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is + not a tty. + 4. Avoid infinite loops during history loads when merging, print a better + error for errors during history load. + 3. PR/88: Preserve empty arguments in :q + 2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE) + 1. PR/81: Fix range matching issue where we were comparing with the + range character instead of the start of range. [l-z]* would match foo + 12. V6.21.00 - 20190508 + 11. Abort history loading on words and lines too long + https://bugzilla.redhat.com/show_bug.cgi?id=1598502 + 10. PR/37: Introduce GetCmdChar() to avoid open coding array access. + 9. make closem() not close sockets so as not to affect nss_ldap. + tcsh never creates sockets so that's ok (Miloslav Trmac) + 8. PR/597: Make rmstar work with aliased rm + 7. convert match() from recursive to backtracking. + 6. Handle 8 bit characters in bindkey (Werner Fink) + 5. Look for tgetent in libtinfo as well (Werner Fink) + 4. Don't play pointer tricks that are undefined in modern c (Brooks Davis) + 3. Fix out of bounds read (Brooks Davis) + 2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar) + 1. PR/471: Delay arginp parsing + 20. V6.20.00 - 20161124 19. Don't resize the screen if it did not change size. 18. V6.19.01 - 20161025 Modified: stable/11/contrib/tcsh/Imakefile ============================================================================== --- stable/11/contrib/tcsh/Imakefile Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Imakefile Wed Oct 30 18:21:58 2019 (r354195) @@ -1,6 +1,4 @@ XCOMM -XCOMM $tcsh: Imakefile,v 1.88 2014/07/07 20:34:58 christos Exp $ -XCOMM XCOMM Imakefile for tcsh 6.12 XCOMM Marc Horowitz, MIT SIPB XCOMM @@ -522,12 +520,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \ tc.vers.${SUF} tc.who.${SUF} -MISCF = Makefile.std Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ - WishList config_f.h eight-bit.me glob.3 patchlevel.h \ - pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt Makefile.vms termcap.vms \ - snames.h host.defs gethost.c tcsh.man2html Makefile.in configure.ac \ - Makefile.win32 aclocal.m4 +MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \ + FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \ + tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \ + Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \ + Makefile.in configure.ac Makefile.win32 aclocal.m4 CONFSRCS=config/[a-z]* Modified: stable/11/contrib/tcsh/MAKEDIFFS ============================================================================== --- stable/11/contrib/tcsh/MAKEDIFFS Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/MAKEDIFFS Wed Oct 30 18:21:58 2019 (r354195) @@ -2,7 +2,6 @@ # # MAKEDIFFS.sh: Make context diffs for the csh sources # -# $tcsh: MAKEDIFFS,v 3.1 2006/03/02 18:46:44 christos Exp $ XINUDIR=/usr/share/src/mtXinu/bin/csh BSDDIR=/usr/share/src/mtXinu/BSD/bin/csh TAHOEDIR=/usr/share/src/mtXinu/TAHOE/bin/csh Modified: stable/11/contrib/tcsh/MAKESHAR ============================================================================== --- stable/11/contrib/tcsh/MAKESHAR Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/MAKESHAR Wed Oct 30 18:21:58 2019 (r354195) @@ -2,7 +2,6 @@ # # MAKESHAR.sh: Make a shar file for the sources # -# $tcsh: MAKESHAR,v 3.2 2006/03/02 18:46:44 christos Exp $ AWK=/usr/bin/nawk # Must be nawk or gawk cause of 2D arrays WC=/usr/ucb/wc Modified: stable/11/contrib/tcsh/Makefile.in ============================================================================== --- stable/11/contrib/tcsh/Makefile.in Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.in Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.in,v 3.59 2015/08/24 20:09:04 kim Exp $ -# Makefile.in 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -407,11 +405,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ tests/testsuite.at aclocal.m4 TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \ tests/expr.at tests/lexical.at tests/mb-eucjp.at \ @@ -449,7 +447,7 @@ pure:$(P) ${OBJS} gethost: gethost.c sh.err.h tc.const.h sh.h rm -f gethost - ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c + ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $(srcdir)/gethost.c tc.defs.c: gethost host.defs @rm -f $@.tmp Modified: stable/11/contrib/tcsh/Makefile.std ============================================================================== --- stable/11/contrib/tcsh/Makefile.std Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.std Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.std,v 1.100 2015/08/24 20:09:04 kim Exp $ -# Makefile.std 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -317,11 +315,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac configure config.h.in \ + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac configure config.h.in \ aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/11/contrib/tcsh/Makefile.vms ============================================================================== --- stable/11/contrib/tcsh/Makefile.vms Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Makefile.vms Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,3 @@ -# $tcsh: Makefile.vms,v 1.40 2014/07/07 20:34:58 christos Exp $ -# Makefile.vms 4.3 6/11/83 # # C Shell with process control; VM/UNIX VAX Makefile # Bill Joy UC Berkeley; Jim Kulp IIASA, Austria @@ -295,11 +293,11 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.vers.${SUF} tc.who.${SUF} PVSRCS= Makefile.std Makefile.vms Makefile.in Makefile.win32 -AVSRCS= Fixes MAKEDIFFS MAKESHAR NewThings README FAQ \ +AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \ WishList config_f.h eight-bit.me glob.3 patchlevel.h \ pathnames.h tcsh.man Ported src.desc Imakefile imake.config \ - README.imake complete.tcsh vmsreadme.txt termcap.vms snames.h \ - host.defs gethost.c tcsh.man2html configure.ac aclocal.m4 + complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \ + gethost.c tcsh.man2html configure.ac aclocal.m4 VHSRCS=${PVSRCS} ${AVSRCS} Modified: stable/11/contrib/tcsh/Ported ============================================================================== --- stable/11/contrib/tcsh/Ported Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/Ported Wed Oct 30 18:21:58 2019 (r354195) @@ -338,7 +338,7 @@ CFLAGS : normal LIBES : -ltermcap OS : bsd 4.3reno CONFIG : bsdreno -NOTES : ttyname() is buggy. calls closedir() twice. See README +NOTES : ttyname() is buggy. calls closedir() twice. See BUILDING ENVIRON : n/a VERSION : 6.00.04 Added: stable/11/contrib/tcsh/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/tcsh/README.md Wed Oct 30 18:21:58 2019 (r354195) @@ -0,0 +1,26 @@ +# TCSH + +*C shell with file name completion and command line editing* + +The Tcsh source code is available on GitHub as a read-only repo +mirror at: + +> http://github.com/tcsh-org/tcsh + +Instructions for compiling Tcsh can be found in [BUILDING]. + +PLEASE file any bug reports, fixes, and code for new features at: + +> https://bugs.astron.com/ + +Comments, questions, etc. (even flames) are welcome via email to +the tcsh mailing list: + +> tcsh@astron.com +> https://mailman.astron.com/mailman/listinfo/tcsh + +[![Build Status][status]][travis] + +[BUILDING]: BUILDING +[status]: https://travis-ci.org/tcsh-org/tcsh.svg?branch=master +[travis]: https://travis-ci.org/tcsh-org/tcsh Modified: stable/11/contrib/tcsh/complete.tcsh ============================================================================== --- stable/11/contrib/tcsh/complete.tcsh Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/complete.tcsh Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,4 @@ # -# $tcsh: complete.tcsh,v 1.56 2015/07/03 16:52:47 christos Exp $ # example file using the new completion code # # Debian GNU/Linux Modified: stable/11/contrib/tcsh/config_f.h ============================================================================== --- stable/11/contrib/tcsh/config_f.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/config_f.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/config_f.h,v 3.52 2016/04/16 15:44:18 christos Exp $ */ /* * config_f.h -- configure various defines for tcsh * @@ -176,20 +175,6 @@ * FILEC support for old style file completion */ #define FILEC - -/* - * RCSID This defines if we want rcs strings in the binary or not - * - */ -#if !defined(lint) && !defined(SABER) && !defined(__CLCC__) -# ifndef __GNUC__ -# define RCSID(id) static char *rcsid = (id); -# else -# define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id); -# endif /* !__GNUC__ */ -#else -# define RCSID(id) /* Nothing */ -#endif /* !lint && !SABER */ /* Consistency checks */ #ifdef WIDE_STRINGS Modified: stable/11/contrib/tcsh/configure ============================================================================== --- stable/11/contrib/tcsh/configure Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/configure Wed Oct 30 18:21:58 2019 (r354195) @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tcsh 6.20.00. +# Generated by GNU Autoconf 2.69 for tcsh 6.21.00. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,10 +267,10 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: http://bugs.gw.com/ about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." +$0: https://bugs.astron.com/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." fi exit 1 fi @@ -580,9 +580,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcsh' PACKAGE_TARNAME='tcsh' -PACKAGE_VERSION='6.20.00' -PACKAGE_STRING='tcsh 6.20.00' -PACKAGE_BUGREPORT='http://bugs.gw.com/' +PACKAGE_VERSION='6.21.00' +PACKAGE_STRING='tcsh 6.21.00' +PACKAGE_BUGREPORT='https://bugs.astron.com/' PACKAGE_URL='' ac_unique_file="tc.vers.c" @@ -1250,7 +1250,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcsh 6.20.00 to adapt to many kinds of systems. +\`configure' configures tcsh 6.21.00 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcsh 6.20.00:";; + short | recursive ) echo "Configuration of tcsh 6.21.00:";; esac cat <<\_ACEOF @@ -1348,7 +1348,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1411,7 +1411,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcsh configure 6.20.00 +tcsh configure 6.21.00 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1658,9 +1658,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf docume $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------- ## -## Report this to http://bugs.gw.com/ ## -## ---------------------------------- ##" +( $as_echo "## --------------------------------------- ## +## Report this to https://bugs.astron.com/ ## +## --------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcsh $as_me 6.20.00, which was +It was created by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4284,7 +4284,7 @@ return tgetent (); return 0; } _ACEOF -for ac_lib in '' termlib termcap curses ncurses; do +for ac_lib in '' termlib tinfo termcap curses ncurses; do if test -z "$ac_lib"; then ac_res="none required" else @@ -7350,7 +7350,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tcsh $as_me 6.20.00, which was +This file was extended by tcsh $as_me 6.21.00, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7410,13 +7410,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tcsh config.status 6.20.00 +tcsh config.status 6.21.00 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/tcsh/dotlock.c ============================================================================== --- stable/11/contrib/tcsh/dotlock.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/dotlock.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -/* $NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp $ */ +/* NetBSD: dotlock.c,v 1.11 2009/10/21 01:07:46 snj Exp */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -24,7 +24,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "sh.h" -RCSID("$tcsh: dotlock.c,v 3.4 2015/11/03 21:04:13 christos Exp $") #include #ifndef O_SYNC Modified: stable/11/contrib/tcsh/ed.chared.c ============================================================================== --- stable/11/contrib/tcsh/ed.chared.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.chared.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $ */ /* * ed.chared.c: Character editing functions. */ @@ -71,9 +70,6 @@ */ #include "sh.h" - -RCSID("$tcsh: ed.chared.c,v 3.103 2015/08/19 14:29:55 christos Exp $") - #include "ed.h" #include "tw.h" #include "ed.defns.h" @@ -1105,8 +1101,7 @@ e_inc_search(int dir) if (GetNextChar(&ch) != 1) return(e_send_eof(0)); - switch (ch > NT_NUM_KEYS - ? F_INSERT : CurrentKeyMap[(unsigned char) ch]) { + switch (GetCmdChar(ch)) { case F_INSERT: case F_DIGIT: case F_MAGIC_SPACE: Modified: stable/11/contrib/tcsh/ed.decls.h ============================================================================== --- stable/11/contrib/tcsh/ed.decls.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.decls.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.decls.h,v 3.46 2015/08/19 14:29:55 christos Exp $ */ /* * ed.decls.h: Editor external definitions */ @@ -250,6 +249,7 @@ extern CCRETVAL e_newline_down_hist (Char); * ed.inputl.c */ extern int Inputl (void); +extern int GetCmdChar (Char); extern int GetNextChar (Char *); extern void UngetNextChar (Char); extern void PushMacro (Char *); Modified: stable/11/contrib/tcsh/ed.defns.c ============================================================================== --- stable/11/contrib/tcsh/ed.defns.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.defns.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $ */ /* * ed.defns.c: Editor function definitions and initialization */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.defns.c,v 3.51 2016/02/14 15:44:18 christos Exp $") - #include "ed.h" static void ed_InitMetaBindings (void); @@ -265,26 +261,22 @@ PFCmd CcFuncTbl[] = { /* table of available command #define F_COMMAND_NORM 111 e_dabbrev_expand, #define F_DABBREV_EXPAND 112 - e_copy_to_clipboard, -#define F_COPY_CLIP 113 - e_paste_from_clipboard, -#define F_PASTE_CLIP 114 e_dosify_next, -#define F_DOSIFY_NEXT 115 +#define F_DOSIFY_NEXT 113 e_dosify_prev, -#define F_DOSIFY_PREV 116 +#define F_DOSIFY_PREV 114 e_page_up, -#define F_PAGE_UP 117 +#define F_PAGE_UP 115 e_page_down, -#define F_PAGE_DOWN 118 +#define F_PAGE_DOWN 116 e_yank_pop, -#define F_YANK_POP 119 +#define F_YANK_POP 117 e_newline_hold, -#define F_NEWLINE_HOLD 120 +#define F_NEWLINE_HOLD 118 e_newline_down_hist, -#define F_NEWLINE_DOWN_HIST 121 +#define F_NEWLINE_DOWN_HIST 119 0 /* DUMMY VALUE */ -#define F_NUM_FNS 122 +#define F_NUM_FNS 120 }; @@ -1752,18 +1744,6 @@ editinit(void) f->func = F_YANK_POP; f->desc = CSAVS(3, 115, "Replace just-yanked text with yank from earlier kill"); - - f++; - f->name = "e_copy_to_clipboard"; - f->func = F_COPY_CLIP; - f->desc = CSAVS(3, 116, - "(WIN32 only) Copy cut buffer to system clipboard"); - - f++; - f->name = "e_paste_from_clipboard"; - f->func = F_PASTE_CLIP; - f->desc = CSAVS(3, 117, - "(WIN32 only) Paste clipboard buffer at cursor position"); f++; f->name = "e_dosify_next"; Modified: stable/11/contrib/tcsh/ed.h ============================================================================== --- stable/11/contrib/tcsh/ed.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.h,v 3.50 2007/07/05 14:13:06 christos Exp $ */ /* * ed.h: Editor declarations and globals */ Modified: stable/11/contrib/tcsh/ed.init.c ============================================================================== --- stable/11/contrib/tcsh/ed.init.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.init.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $ */ /* * ed.init.c: Editor initializations */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.init.c,v 3.60 2006/08/24 20:56:31 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/ed.inputl.c ============================================================================== --- stable/11/contrib/tcsh/ed.inputl.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.inputl.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $ */ /* * ed.inputl.c: Input line handling. */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.inputl.c,v 3.73 2012/10/19 15:23:32 christos Exp $") - #include "ed.h" #include "ed.defns.h" /* for the function names */ #include "tw.h" /* for twenex stuff */ @@ -668,6 +664,17 @@ RunCommand(Char *str) Refresh(); } +int +GetCmdChar(Char ch) +{ +#ifndef WINNT_NATIVE // We use more than 256 for various extended keys + wint_t c = ch & CHAR; +#else + wint_t c = ch; +#endif + return c < NT_NUM_KEYS ? CurrentKeyMap[c] : F_INSERT; +} + static int GetNextCommand(KEYCMD *cmdnum, Char *ch) { @@ -696,17 +703,8 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch) MetaNext = 0; *ch |= META; } - /* XXX: This needs to be fixed so that we don't just truncate - * the character, we unquote it. - */ - if (*ch < NT_NUM_KEYS) - cmd = CurrentKeyMap[*ch]; - else -#ifdef WINNT_NATIVE - cmd = CurrentKeyMap[(unsigned char) *ch]; -#else - cmd = F_INSERT; -#endif + + cmd = GetCmdChar(*ch); if (cmd == F_XKEY) { XmapVal val; CStr cstr; @@ -800,13 +798,18 @@ GetNextChar(Char *cp) return -1; } } - cbp++; - if (normal_mbtowc(cp, cbuf, cbp) == -1) { - reset_mbtowc(); - if (cbp < MB_CUR_MAX) - continue; /* Maybe a partial character */ - /* And drop the following bytes, if any */ - *cp = (unsigned char)*cbuf | INVALID_BYTE; + if (cbp == 0 /* && *cbuf < NT_NUM_KEYS */ + && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) { + *cp = (unsigned char)*cbuf; + } else { + cbp++; + if (normal_mbtowc(cp, cbuf, cbp) == -1) { + reset_mbtowc(); + if (cbp < MB_CUR_MAX) + continue; /* Maybe a partial character */ + /* And drop the following bytes, if any */ + *cp = (unsigned char)*cbuf | INVALID_BYTE; + } } break; } Modified: stable/11/contrib/tcsh/ed.refresh.c ============================================================================== --- stable/11/contrib/tcsh/ed.refresh.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.refresh.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $ */ /* * ed.refresh.c: Lower level screen refreshing functions */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.refresh.c,v 3.51 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" /* #define DEBUG_UPDATE */ /* #define DEBUG_REFRESH */ Modified: stable/11/contrib/tcsh/ed.screen.c ============================================================================== --- stable/11/contrib/tcsh/ed.screen.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.screen.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $ */ /* * ed.screen.c: Editor/termcap-curses interface */ @@ -31,9 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.screen.c,v 3.82 2016/11/24 15:04:14 christos Exp $") - #include "ed.h" #include "tc.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/ed.term.c ============================================================================== --- stable/11/contrib/tcsh/ed.term.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.term.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $ */ /* * ed.term.c: Low level terminal interface */ @@ -32,8 +31,6 @@ */ #include "sh.h" #ifndef WINNT_NATIVE - -RCSID("$tcsh: ed.term.c,v 1.38 2011/02/25 23:58:34 christos Exp $") #include #include "ed.h" Modified: stable/11/contrib/tcsh/ed.term.h ============================================================================== --- stable/11/contrib/tcsh/ed.term.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.term.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.term.h,v 1.19 2015/03/25 19:53:16 christos Exp $ */ /* * ed.term.h: Local terminal header */ Modified: stable/11/contrib/tcsh/ed.xmap.c ============================================================================== --- stable/11/contrib/tcsh/ed.xmap.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ed.xmap.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $ */ /* * ed.xmap.c: This module contains the procedures for maintaining * the extended-key map. @@ -87,9 +86,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: ed.xmap.c,v 3.38 2015/06/06 21:19:07 christos Exp $") - #include "ed.h" #include "ed.defns.h" Modified: stable/11/contrib/tcsh/eight-bit.me ============================================================================== --- stable/11/contrib/tcsh/eight-bit.me Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/eight-bit.me Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -.\" $tcsh: eight-bit.me,v 3.2 2006/03/02 18:46:44 christos Exp $ How to use 8 bit characters by Johan Widen Modified: stable/11/contrib/tcsh/gethost.c ============================================================================== --- stable/11/contrib/tcsh/gethost.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/gethost.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $ */ /* * gethost.c: Create version file from prototype */ @@ -31,8 +30,6 @@ * SUCH DAMAGE. */ #include "sh.h" - -RCSID("$tcsh: gethost.c,v 1.19 2014/03/09 00:11:54 christos Exp $") #ifdef SCO # define perror __perror Modified: stable/11/contrib/tcsh/glob.3 ============================================================================== --- stable/11/contrib/tcsh/glob.3 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.3 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -.\" $NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp $ +.\" NetBSD: glob.3,v 1.17 2001/03/16 21:09:05 christos Exp .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. Modified: stable/11/contrib/tcsh/glob.c ============================================================================== --- stable/11/contrib/tcsh/glob.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.c Wed Oct 30 18:21:58 2019 (r354195) @@ -100,7 +100,7 @@ static int Lstat (const char *, struct stat *); static int Stat (const char *, struct stat *sb); static Char *Strchr (Char *, int); #ifdef DEBUG -static void qprintf (const Char *); +static void qprintf (const char *, const Char *); #endif #define DOLLAR '$' @@ -256,19 +256,20 @@ Strchr(Char *str, int ch) #ifdef DEBUG static void -qprintf(const Char *s) +qprintf(const char *pre, const Char *s) { const Char *p; - + + xprintf("%s", pre); for (p = s; *p; p++) - printf("%c", *p & 0xff); - printf("\n"); + xprintf("%c", *p & 0xff); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_PROTECT ? '"' : ' '); - printf("\n"); + xprintf("%c", *p & M_PROTECT ? '"' : ' '); + xprintf("\n%s", pre); for (p = s; *p; p++) - printf("%c", *p & M_META ? '_' : ' '); - printf("\n"); + xprintf("%c", *p & M_META ? '_' : ' '); + xprintf("\n"); } #endif /* DEBUG */ @@ -412,7 +413,7 @@ glob(const char *pattern, int flags, int (*errfunc) (c } *bufnext = EOS; #ifdef DEBUG - qprintf(patbuf); + qprintf("patbuf=", patbuf); #endif if ((err = glob1(patbuf, pglob, no_match)) != 0) { @@ -693,72 +694,94 @@ globextend(const char *path, glob_t *pglob) } /* - * pattern matching function for filenames. Each occurrence of the * - * pattern causes a recursion level. + * pattern matching function for filenames. */ static int match(const char *name, const Char *pat, const Char *patend, int m_not) { int ok, negate_range; + const Char *patNext; + const char *nameNext, *nameStart, *nameEnd; Char c; - while (pat < patend) { - size_t lwk; - __Char wc, wk; + patNext = pat; + nameStart = nameNext = name; + nameEnd = NULL; + while (pat < patend || *name) { + size_t lwk, pwk; + __Char wc, wk, wc1; + c = *pat; /* Only for M_MASK bits */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + if (*name == EOS) + nameEnd = name; + + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); lwk = one_mbtowc(&wk, name, MB_LEN_MAX); switch (c & M_MASK) { case M_ALL: - while (pat < patend && (*pat & M_MASK) == M_ALL) /* eat consecutive '*' */ - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); - if (pat == patend) - return (1); - while (!match(name, pat, patend, m_not)) { - if (*name == EOS) - return (0); - name += lwk; - lwk = one_mbtowc(&wk, name, MB_LEN_MAX); + while ((*(pat + pwk) & M_MASK) == M_ALL) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - return (1); + patNext = pat; + nameNext = name + lwk; + pat += pwk; + continue; case M_ONE: if (*name == EOS) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; case M_SET: ok = 0; if (*name == EOS) - return (0); + break; + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); name += lwk; - if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) - ++pat; + if ((negate_range = ((*pat & M_MASK) == m_not)) != 0) { + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + } + wc1 = wc; while ((*pat & M_MASK) != M_END) { - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if ((*pat & M_MASK) == M_RNG) { __Char wc2; - pat++; - pat += One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); - if (globcharcoll(wc, wk, 0) <= 0 && + pat += pwk; + pwk = One_Char_mbtowc(&wc2, pat, MB_LEN_MAX); + if (globcharcoll(wc1, wk, 0) <= 0 && globcharcoll(wk, wc2, 0) <= 0) ok = 1; } else if (wc == wk) ok = 1; + pat += pwk; + wc1 = wc; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); } - pat += One_Char_mbtowc(&wc, pat, MB_LEN_MAX); + pat += pwk; + pwk = One_Char_mbtowc(&wc, pat, MB_LEN_MAX); if (ok == negate_range) - return (0); - break; + break; + continue; default: if (*name == EOS || samecase(wk) != samecase(wc)) - return (0); + break; name += lwk; - break; + pat += pwk; + continue; } + if (nameNext != nameStart + && (nameEnd == NULL || nameNext <= nameEnd)) { + pat = patNext; + name = nameNext; + continue; + } + return 0; } - return (*name == EOS); + return 1; } /* free allocated data belonging to a glob_t structure */ Modified: stable/11/contrib/tcsh/glob.h ============================================================================== --- stable/11/contrib/tcsh/glob.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/glob.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,4 @@ -/* $NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp $ */ +/* NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp */ /* * Copyright (c) 1989, 1993 Modified: stable/11/contrib/tcsh/host.defs ============================================================================== --- stable/11/contrib/tcsh/host.defs Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/host.defs Wed Oct 30 18:21:58 2019 (r354195) @@ -1,5 +1,4 @@ newcode : -/* $Header: /p/tcsh/cvsroot/tcsh/host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $ */ /* * host.defs: Hosttype/Machtype etc. */ @@ -33,8 +32,6 @@ newcode : */ #include "sh.h" -RCSID("$tcsh: host.defs,v 1.61 2015/05/26 18:56:19 christos Exp $") - endcode : macro : M_mips64el : (defined(mips64) && defined(MIPSEL)) @@ -857,9 +854,9 @@ enddef : newdef : defined(APPLE) && defined(MACH) comment : OS X vendor : : "apple" -hosttype: defined(i386) : "intel-pc" +hosttype: defined(i386) : "intel-mac" hosttype: defined(ppc) : "powermac" -hosttype: defined(M_amd64) : "amd" +hosttype: defined(M_amd64) : "intel-mac" ostype : : "darwin" machtype: defined(i386) : "i386" machtype: defined(M_amd64) : "x86_64" Modified: stable/11/contrib/tcsh/imake.config ============================================================================== --- stable/11/contrib/tcsh/imake.config Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/imake.config Wed Oct 30 18:21:58 2019 (r354195) @@ -1,6 +1,4 @@ /* - * $tcsh: imake.config,v 1.5 2006/03/02 18:46:44 christos Exp $ - * * config.Imakefile for for tcsh 6.00 * Marc Horowitz, MIT SIPB */ Modified: stable/11/contrib/tcsh/ma.setp.c ============================================================================== --- stable/11/contrib/tcsh/ma.setp.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/ma.setp.c Wed Oct 30 18:21:58 2019 (r354195) @@ -82,7 +82,6 @@ ********************************************************************** */ #include "sh.h" -RCSID("$tcsh: ma.setp.c,v 1.19 2007/11/20 20:03:51 christos Exp $") #ifdef MACH Modified: stable/11/contrib/tcsh/mi.termios.c ============================================================================== --- stable/11/contrib/tcsh/mi.termios.c Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/mi.termios.c Wed Oct 30 18:21:58 2019 (r354195) @@ -1,10 +1,8 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $ */ /* termios.c - fake termios interface using sgtty interface * by Magnus Doell and Bruce Evans. * */ #include "sh.h" -RCSID("$tcsh: mi.termios.c,v 1.5 2006/03/02 18:46:44 christos Exp $") #if defined(_MINIX) && !defined(_MINIX_VMD) Modified: stable/11/contrib/tcsh/mi.varargs.h ============================================================================== --- stable/11/contrib/tcsh/mi.varargs.h Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/mi.varargs.h Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -/* $Header: /p/tcsh/cvsroot/tcsh/mi.varargs.h,v 1.2 1996/04/26 19:18:39 christos Exp $ */ /* * mi.varargs.h: Correct varargs for minix */ Modified: stable/11/contrib/tcsh/nls/C/set1 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set1 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set1 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set1,v 1.7 2015/05/26 17:38:25 christos Exp $ $ Error messages $set 1 1 Syntax Error Modified: stable/11/contrib/tcsh/nls/C/set10 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set10 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set10 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set10,v 1.3 2006/03/02 18:46:45 christos Exp $ $ ma.setp.c $set 10 1 setpath: invalid command '%s'.\n Modified: stable/11/contrib/tcsh/nls/C/set11 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set11 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set11 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set11,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.c $set 11 1 Warning: no access to tty (%s).\n Modified: stable/11/contrib/tcsh/nls/C/set12 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set12 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set12 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set12,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.dir.c $set 12 1 %s: Trying to start from "%s"\n Modified: stable/11/contrib/tcsh/nls/C/set13 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set13 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set13 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set13,v 1.3 2006/03/02 18:46:45 christos Exp $ $ sh.exec.c $set 13 1 hash=%-4d dir=%-2d prog=%s\n Modified: stable/11/contrib/tcsh/nls/C/set14 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set14 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set14 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set14,v 1.4 2006/03/02 18:46:45 christos Exp $ $ sh.file.c $set 14 1 \nYikes!! Too many %s!!\n Modified: stable/11/contrib/tcsh/nls/C/set15 ============================================================================== --- stable/11/contrib/tcsh/nls/C/set15 Wed Oct 30 17:33:17 2019 (r354194) +++ stable/11/contrib/tcsh/nls/C/set15 Wed Oct 30 18:21:58 2019 (r354195) @@ -1,4 +1,3 @@ -$ $tcsh: set15,v 1.4 2006/03/02 18:46:45 christos Exp $ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Wed Oct 30 18:36:50 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9F715D4EE; Wed, 30 Oct 2019 18:36:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HH56rbfz4NTp; Wed, 30 Oct 2019 18:36:49 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE9A1E7C8; Wed, 30 Oct 2019 18:36:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UIans9006684; Wed, 30 Oct 2019 18:36:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIan0b006682; Wed, 30 Oct 2019 18:36:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301836.x9UIan0b006682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354196 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 18:36:50 -0000 Author: markj Date: Wed Oct 30 18:36:49 2019 New Revision: 354196 URL: https://svnweb.freebsd.org/changeset/base/354196 Log: MFC r353893: Fix thread0 kernel stack initialization on riscv. Modified: stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Wed Oct 30 18:21:58 2019 (r354195) +++ stable/12/sys/riscv/riscv/locore.S Wed Oct 30 18:36:49 2019 (r354196) @@ -209,7 +209,7 @@ va: sd t0, 0(sp) /* kern_l1pt */ sd s9, 8(sp) /* kern_phys */ - la t0, initstack_end + la t0, initstack sd t0, 16(sp) /* kern_stack */ li t0, (VM_MAX_KERNEL_ADDRESS - 2 * L2_SIZE) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Wed Oct 30 18:21:58 2019 (r354195) +++ stable/12/sys/riscv/riscv/machdep.c Wed Oct 30 18:36:49 2019 (r354196) @@ -123,7 +123,6 @@ uint32_t boot_hart; /* The hart we booted on. */ cpuset_t all_harts; extern int *end; -extern int *initstack_end; static void cpu_startup(void *dummy) @@ -656,7 +655,9 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_fpflags = 0; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; From owner-svn-src-stable@freebsd.org Wed Oct 30 18:38:45 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3693115D5F1; Wed, 30 Oct 2019 18:38:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HKK0jnTz4Nkr; Wed, 30 Oct 2019 18:38:45 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFD4EE7CE; Wed, 30 Oct 2019 18:38:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UIcicN006957; Wed, 30 Oct 2019 18:38:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIcicf006956; Wed, 30 Oct 2019 18:38:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301838.x9UIcicf006956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354197 - stable/12/sys/arm/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm/arm X-SVN-Commit-Revision: 354197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 18:38:45 -0000 Author: markj Date: Wed Oct 30 18:38:44 2019 New Revision: 354197 URL: https://svnweb.freebsd.org/changeset/base/354197 Log: MFC r353894: Initialize thread0.td_kstack_pages on arm. Modified: stable/12/sys/arm/arm/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/machdep.c ============================================================================== --- stable/12/sys/arm/arm/machdep.c Wed Oct 30 18:36:49 2019 (r354196) +++ stable/12/sys/arm/arm/machdep.c Wed Oct 30 18:38:44 2019 (r354197) @@ -770,8 +770,9 @@ init_proc0(vm_offset_t kstack) { proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + kstack_pages * PAGE_SIZE) - 1; + thread0.td_kstack_pages = kstack_pages; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN; From owner-svn-src-stable@freebsd.org Wed Oct 30 18:39:08 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B508715D680; Wed, 30 Oct 2019 18:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HKm4H5Pz4Nry; Wed, 30 Oct 2019 18:39:08 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76FF0E7CF; Wed, 30 Oct 2019 18:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UId8ha007060; Wed, 30 Oct 2019 18:39:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UId8m7007059; Wed, 30 Oct 2019 18:39:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301839.x9UId8m7007059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354198 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 354198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 18:39:08 -0000 Author: markj Date: Wed Oct 30 18:39:07 2019 New Revision: 354198 URL: https://svnweb.freebsd.org/changeset/base/354198 Log: MFC r353895: Apply r353893 to arm64. Modified: stable/12/sys/arm64/arm64/locore.S stable/12/sys/arm64/arm64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/locore.S ============================================================================== --- stable/12/sys/arm64/arm64/locore.S Wed Oct 30 18:38:44 2019 (r354197) +++ stable/12/sys/arm64/arm64/locore.S Wed Oct 30 18:39:07 2019 (r354198) @@ -132,6 +132,7 @@ virtdone: str x1, [x0] /* modulep */ str x26, [x0, 8] /* kern_l1pt */ str x29, [x0, 16] /* kern_delta */ + adr x25, initstack str x25, [x0, 24] /* kern_stack */ str x24, [x0, 32] /* kern_l0pt */ Modified: stable/12/sys/arm64/arm64/machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/machdep.c Wed Oct 30 18:38:44 2019 (r354197) +++ stable/12/sys/arm64/arm64/machdep.c Wed Oct 30 18:39:07 2019 (r354198) @@ -702,7 +702,9 @@ init_proc0(vm_offset_t kstack) proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * KSTACK_PAGES) - 1; thread0.td_pcb->pcb_fpflags = 0; thread0.td_pcb->pcb_fpusaved = &thread0.td_pcb->pcb_fpustate; thread0.td_pcb->pcb_vfpcpu = UINT_MAX; From owner-svn-src-stable@freebsd.org Wed Oct 30 18:39:38 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11ACD15D717; Wed, 30 Oct 2019 18:39:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473HLK6kbVz4P0L; Wed, 30 Oct 2019 18:39:37 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAB63E7D1; Wed, 30 Oct 2019 18:39:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UIdbZ2007251; Wed, 30 Oct 2019 18:39:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UIdb7D007250; Wed, 30 Oct 2019 18:39:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910301839.x9UIdb7D007250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 30 Oct 2019 18:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354199 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 354199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 18:39:38 -0000 Author: markj Date: Wed Oct 30 18:39:37 2019 New Revision: 354199 URL: https://svnweb.freebsd.org/changeset/base/354199 Log: MFC r353957: Check for bogus_page in vnode_pager_generic_getpages_done(). Modified: stable/12/sys/vm/vnode_pager.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vnode_pager.c ============================================================================== --- stable/12/sys/vm/vnode_pager.c Wed Oct 30 18:39:07 2019 (r354198) +++ stable/12/sys/vm/vnode_pager.c Wed Oct 30 18:39:37 2019 (r354199) @@ -1130,6 +1130,8 @@ vnode_pager_generic_getpages_done(struct buf *bp) nextoff = tfoff + PAGE_SIZE; mt = bp->b_pages[i]; + if (mt == bogus_page) + continue; if (nextoff <= object->un_pager.vnp.vnp_size) { /* From owner-svn-src-stable@freebsd.org Wed Oct 30 21:48:44 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01CC1162654; Wed, 30 Oct 2019 21:48:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473MXW6Bgyz4d89; Wed, 30 Oct 2019 21:48:43 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7F6818A3D; Wed, 30 Oct 2019 21:48:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9ULmh3w019395; Wed, 30 Oct 2019 21:48:43 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9ULmhFP019394; Wed, 30 Oct 2019 21:48:43 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201910302148.x9ULmhFP019394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 30 Oct 2019 21:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r354208 - stable/11/sys/dev/e1000 X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/e1000 X-SVN-Commit-Revision: 354208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 21:48:44 -0000 Author: marius Date: Wed Oct 30 21:48:43 2019 New Revision: 354208 URL: https://svnweb.freebsd.org/changeset/base/354208 Log: MFC: r353778 (partial) In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. Modified: stable/11/sys/dev/e1000/if_em.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/if_em.c ============================================================================== --- stable/11/sys/dev/e1000/if_em.c Wed Oct 30 20:45:12 2019 (r354207) +++ stable/11/sys/dev/e1000/if_em.c Wed Oct 30 21:48:43 2019 (r354208) @@ -1760,6 +1760,7 @@ static void em_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct e1000_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; if_t ifp = adapter->ifp; @@ -1770,8 +1771,8 @@ em_handle_link(void *context, int pending) callout_stop(&adapter->timer); em_update_link_status(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); + if (hw->mac.type == e1000_82574 && adapter->msix_mem != NULL) + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); From owner-svn-src-stable@freebsd.org Wed Oct 30 21:49:35 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D73E1626D5; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473MYW3h89z4dGV; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C0218A3E; Wed, 30 Oct 2019 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9ULnZ1O019474; Wed, 30 Oct 2019 21:49:35 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9ULnZGN019473; Wed, 30 Oct 2019 21:49:35 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201910302149.x9ULnZGN019473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 30 Oct 2019 21:49: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: r354209 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/dev/e1000 X-SVN-Commit-Revision: 354209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 21:49:35 -0000 Author: marius Date: Wed Oct 30 21:49:34 2019 New Revision: 354209 URL: https://svnweb.freebsd.org/changeset/base/354209 Log: MFC: r353778 (partial) In em_handle_link(), only re-arm the link state change interrupt for 82574 and also only if such a device uses MSI-X, i. e. takes advantage of autoclearing. In case of INTx and MSI re-arming isn't appropriate here and setting EM_MSIX_LINK isn't either. Modified: stable/10/sys/dev/e1000/if_em.c Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Wed Oct 30 21:48:43 2019 (r354208) +++ stable/10/sys/dev/e1000/if_em.c Wed Oct 30 21:49:34 2019 (r354209) @@ -1774,6 +1774,7 @@ static void em_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct e1000_hw *hw = &adapter->hw; struct tx_ring *txr = adapter->tx_rings; struct ifnet *ifp = adapter->ifp; @@ -1784,8 +1785,8 @@ em_handle_link(void *context, int pending) callout_stop(&adapter->timer); em_update_link_status(adapter); callout_reset(&adapter->timer, hz, em_local_timer, adapter); - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); + if (hw->mac.type == e1000_82574 && adapter->msix_mem != NULL) + E1000_WRITE_REG(hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); if (adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); From owner-svn-src-stable@freebsd.org Thu Oct 31 09:14:53 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F06D61A1AAF; Thu, 31 Oct 2019 09:14:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473fmF6ZJcz42sZ; Thu, 31 Oct 2019 09:14:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A808C2077B; Thu, 31 Oct 2019 09:14:53 +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 x9V9ErE2027740; Thu, 31 Oct 2019 09:14:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9V9Epv6027728; Thu, 31 Oct 2019 09:14:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201910310914.x9V9Epv6027728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 31 Oct 2019 09:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354211 - in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/con... X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/comm... X-SVN-Commit-Revision: 354211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 09:14:54 -0000 Author: avg Date: Thu Oct 31 09:14:50 2019 New Revision: 354211 URL: https://svnweb.freebsd.org/changeset/base/354211 Log: MFC r353176,r353304,r353556,r353559: large_dnode improvements and fixes r353176: MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature This updates FreeBSD large_dnode code (that was imported from ZoL) to a version that was committed to illumos. It has some cleanups, improvements and fixes comparing to what we have in FreeBSD now. I think that the most significant update is 8199 multi-threaded dmu_object_alloc(). r353304: zfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl r353556: MFV r353551: 10452 ZoL: merge in large dnode feature fixes r353559: MFV r353558: 10572 10579 Fix race in dnode_check_slots_free() Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Oct 31 09:14:50 2019 (r354211) @@ -2131,7 +2131,8 @@ static object_viewer_t *object_viewer[DMU_OT_NUMTYPES }; static void -dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header) +dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header, + uint64_t *dnode_slots_used) { dmu_buf_t *db = NULL; dmu_object_info_t doi; @@ -2151,7 +2152,7 @@ dump_object(objset_t *os, uint64_t object, int verbosi CTASSERT(sizeof (bonus_size) >= NN_NUMBUF_SZ); if (*print_header) { - (void) printf("\n%10s %3s %5s %5s %5s %6s %5s %6s %s\n", + (void) printf("\n%10s %3s %5s %5s %5s %6s %5s %6s %s\n", "Object", "lvl", "iblk", "dblk", "dsize", "dnsize", "lsize", "%full", "type"); *print_header = 0; @@ -2170,6 +2171,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi } dmu_object_info_from_dnode(dn, &doi); + if (dnode_slots_used != NULL) + *dnode_slots_used = doi.doi_dnodesize / DNODE_MIN_SIZE; + zdb_nicenum(doi.doi_metadata_block_size, iblk, sizeof (iblk)); zdb_nicenum(doi.doi_data_block_size, dblk, sizeof (dblk)); zdb_nicenum(doi.doi_max_offset, lsize, sizeof (lsize)); @@ -2192,8 +2196,9 @@ dump_object(objset_t *os, uint64_t object, int verbosi ZDB_COMPRESS_NAME(doi.doi_compress)); } - (void) printf("%10lld %3u %5s %5s %5s %6s %5s %6s %s%s\n", - (u_longlong_t)object, doi.doi_indirection, iblk, dblk, + (void) printf("%10" PRIu64 + " %3u %5s %5s %5s %5s %5s %6s %s%s\n", + object, doi.doi_indirection, iblk, dblk, asize, dnsize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux); if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) { @@ -2302,6 +2307,9 @@ dump_dir(objset_t *os) int print_header = 1; unsigned i; int error; + uint64_t total_slots_used = 0; + uint64_t max_slot_used = 0; + uint64_t dnode_slots; /* make sure nicenum has enough space */ CTASSERT(sizeof (numbuf) >= NN_NUMBUF_SZ); @@ -2346,7 +2354,7 @@ dump_dir(objset_t *os) if (zopt_objects != 0) { for (i = 0; i < zopt_objects; i++) dump_object(os, zopt_object[i], verbosity, - &print_header); + &print_header, NULL); (void) printf("\n"); return; } @@ -2371,22 +2379,37 @@ dump_dir(objset_t *os) if (BP_IS_HOLE(os->os_rootbp)) return; - dump_object(os, 0, verbosity, &print_header); + dump_object(os, 0, verbosity, &print_header, NULL); object_count = 0; if (DMU_USERUSED_DNODE(os) != NULL && DMU_USERUSED_DNODE(os)->dn_type != 0) { - dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header); - dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header); + dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header, + NULL); + dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header, + NULL); } object = 0; while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { - dump_object(os, object, verbosity, &print_header); + dump_object(os, object, verbosity, &print_header, &dnode_slots); object_count++; + total_slots_used += dnode_slots; + max_slot_used = object + dnode_slots - 1; } (void) printf("\n"); + (void) printf(" Dnode slots:\n"); + (void) printf("\tTotal used: %10llu\n", + (u_longlong_t)total_slots_used); + (void) printf("\tMax used: %10llu\n", + (u_longlong_t)max_slot_used); + (void) printf("\tPercent empty: %10lf\n", + (double)(max_slot_used - total_slots_used)*100 / + (double)max_slot_used); + + (void) printf("\n"); + if (error != ESRCH) { (void) fprintf(stderr, "dmu_object_next() = %d\n", error); abort(); @@ -2578,7 +2601,7 @@ dump_path_impl(objset_t *os, uint64_t obj, char *name) return (dump_path_impl(os, child_obj, s + 1)); /*FALLTHROUGH*/ case DMU_OT_PLAIN_FILE_CONTENTS: - dump_object(os, child_obj, dump_opt['v'], &header); + dump_object(os, child_obj, dump_opt['v'], &header, NULL); return (0); default: (void) fprintf(stderr, "object %llu has non-file/directory " Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Thu Oct 31 09:14:50 2019 (r354211) @@ -84,15 +84,15 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *a } (void) printf("%s%s", tab_prefix, ctime(&crtime)); - (void) printf("%sdoid %llu, foid %llu, slots %llu, mode %llo\n", tab_prefix, - (u_longlong_t)lr->lr_doid, - (u_longlong_t)LR_FOID_GET_OBJ(lr->lr_foid), - (u_longlong_t)LR_FOID_GET_SLOTS(lr->lr_foid), - (longlong_t)lr->lr_mode); - (void) printf("%suid %llu, gid %llu, gen %llu, rdev 0x%llx\n", - tab_prefix, - (u_longlong_t)lr->lr_uid, (u_longlong_t)lr->lr_gid, - (u_longlong_t)lr->lr_gen, (u_longlong_t)lr->lr_rdev); + (void) printf("%sdoid %" PRIu64 ", foid %" PRIu64 ", slots %" PRIu64 + ", mode %" PRIo64 "\n", + tab_prefix, lr->lr_doid, + (uint64_t)LR_FOID_GET_OBJ(lr->lr_foid), + (uint64_t)LR_FOID_GET_SLOTS(lr->lr_foid), + lr->lr_mode); + (void) printf("%suid %" PRIu64 ", gid %" PRIu64 ", gen %" PRIu64 + ", rdev %#" PRIx64 "\n", + tab_prefix, lr->lr_uid, lr->lr_gid, lr->lr_gen, lr->lr_rdev); } /* ARGSUSED */ Modified: stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c Thu Oct 31 09:14:50 2019 (r354211) @@ -416,13 +416,15 @@ main(int argc, char *argv[]) drro->drr_toguid = BSWAP_64(drro->drr_toguid); } if (verbose) { - (void) printf("OBJECT object = %llu type = %u " - "bonustype = %u blksz = %u bonuslen = %u\n", - (u_longlong_t)drro->drr_object, + (void) printf("OBJECT object = %" PRIu64 + " type = %u bonustype = %u blksz = %u" + " bonuslen = %u dn_slots = %u\n", + drro->drr_object, drro->drr_type, drro->drr_bonustype, drro->drr_blksz, - drro->drr_bonuslen); + drro->drr_bonuslen, + drro->drr_dn_slots); } if (drro->drr_bonuslen > 0) { (void) ssread(buf, Modified: stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Oct 31 09:14:50 2019 (r354211) @@ -196,6 +196,7 @@ extern uint64_t zfs_deadman_synctime_ms; extern int metaslab_preload_limit; extern boolean_t zfs_compressed_arc_enabled; extern boolean_t zfs_abd_scatter_enabled; +extern int dmu_object_alloc_chunk_shift; extern boolean_t zfs_force_some_double_word_sm_entries; static ztest_shared_opts_t *ztest_shared_opts; @@ -322,6 +323,7 @@ static ztest_shared_callstate_t *ztest_shared_callstat ztest_func_t ztest_dmu_read_write; ztest_func_t ztest_dmu_write_parallel; ztest_func_t ztest_dmu_object_alloc_free; +ztest_func_t ztest_dmu_object_next_chunk; ztest_func_t ztest_dmu_commit_callbacks; ztest_func_t ztest_zap; ztest_func_t ztest_zap_parallel; @@ -363,6 +365,7 @@ ztest_info_t ztest_info[] = { { ztest_dmu_read_write, 1, &zopt_always }, { ztest_dmu_write_parallel, 10, &zopt_always }, { ztest_dmu_object_alloc_free, 1, &zopt_always }, + { ztest_dmu_object_next_chunk, 1, &zopt_sometimes }, { ztest_dmu_commit_callbacks, 1, &zopt_always }, { ztest_zap, 30, &zopt_always }, { ztest_zap_parallel, 100, &zopt_always }, @@ -1366,7 +1369,7 @@ ztest_bt_bonus(dmu_buf_t *db) * it unique to the object, generation, and offset to verify that data * is not getting overwritten by data from other dnodes. */ -#define ZTEST_BONUS_FILL_TOKEN(obj, ds, gen, offset) \ +#define ZTEST_BONUS_FILL_TOKEN(obj, ds, gen, offset) \ (((ds) << 48) | ((gen) << 32) | ((obj) << 8) | (offset)) /* @@ -1895,6 +1898,7 @@ ztest_replay_setattr(void *arg1, void *arg2, boolean_t ztest_bt_generate(bbt, os, lr->lr_foid, dnodesize, -1ULL, lr->lr_mode, txg, crtxg); ztest_fill_unused_bonus(db, bbt, lr->lr_foid, os, bbt->bt_gen); + dmu_buf_rele(db, FTAG); (void) ztest_log_setattr(zd, tx, lr); @@ -3815,8 +3819,10 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t i ztest_od_t od[4]; int batchsize = sizeof (od) / sizeof (od[0]); - for (int b = 0; b < batchsize; b++) - ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, 0, 0, 0); + for (int b = 0; b < batchsize; b++) { + ztest_od_init(&od[b], id, FTAG, b, DMU_OT_UINT64_OTHER, + 0, 0, 0); + } /* * Destroy the previous batch of objects, create a new batch, @@ -3831,6 +3837,26 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t i } /* + * Rewind the global allocator to verify object allocation backfilling. + */ +void +ztest_dmu_object_next_chunk(ztest_ds_t *zd, uint64_t id) +{ + objset_t *os = zd->zd_os; + int dnodes_per_chunk = 1 << dmu_object_alloc_chunk_shift; + uint64_t object; + + /* + * Rewind the global allocator randomly back to a lower object number + * to force backfilling and reclamation of recently freed dnodes. + */ + mutex_enter(&os->os_obj_lock); + object = ztest_random(os->os_obj_next_chunk); + os->os_obj_next_chunk = P2ALIGN(object, dnodes_per_chunk); + mutex_exit(&os->os_obj_lock); +} + +/* * Verify that dmu_{read,write} work as expected. */ void @@ -3876,8 +3902,10 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id) /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, chunksize); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4146,8 +4174,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id /* * Read the directory info. If it's the first time, set things up. */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); - ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, chunksize); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); + ztest_od_init(&od[1], id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, 0, + chunksize); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4347,7 +4377,8 @@ ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id) * to verify that parallel writes to an object -- even to the * same blocks within the object -- doesn't cause any trouble. */ - ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, + 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -4366,7 +4397,8 @@ ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id) uint64_t blocksize = ztest_random_blocksize(); void *data; - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); if (ztest_object_init(zd, od, sizeof (od), !ztest_random(2)) != 0) return; @@ -4590,7 +4622,8 @@ ztest_zap_parallel(ztest_ds_t *zd, uint64_t id) char name[20], string_value[20]; void *data; - ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0, 0); + ztest_od_init(&od[0], ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, + 0, 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; @@ -5411,7 +5444,8 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id) blocksize = ztest_random_blocksize(); blocksize = MIN(blocksize, 2048); /* because we write so many */ - ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0, 0); + ztest_od_init(&od[0], id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, + 0, 0); if (ztest_object_init(zd, od, sizeof (od), B_FALSE) != 0) return; Modified: stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Thu Oct 31 09:14:50 2019 (r354211) @@ -292,10 +292,11 @@ zfs_prop_init(void) ZFS_VOLMODE_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, "default | geom | dev | none", "VOLMODE", volmode_table); + zprop_register_index(ZFS_PROP_DNODESIZE, "dnodesize", ZFS_DNSIZE_LEGACY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "legacy | auto | 1k | 2k | 4k | 8k | 16k", "DNSIZE", dnsize_table); - + /* inherit index (boolean) properties */ zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1812,6 +1812,9 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) FTAG); } } + + if (tx->tx_txg > dn->dn_dirty_txg) + dn->dn_dirty_txg = tx->tx_txg; mutex_exit(&dn->dn_mtx); if (db->db_blkid == DMU_SPILL_BLKID) @@ -3757,7 +3760,8 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb if (dn->dn_type == DMU_OT_DNODE) { i = 0; while (i < db->db.db_size) { - dnode_phys_t *dnp = db->db.db_data + i; + dnode_phys_t *dnp = + (void *)(((char *)db->db.db_data) + i); i += DNODE_MIN_SIZE; if (dnp->dn_type != DMU_OT_NONE) { Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Oct 31 09:14:50 2019 (r354211) @@ -32,6 +32,14 @@ #include #include +/* + * Each of the concurrent object allocators will grab + * 2^dmu_object_alloc_chunk_shift dnode slots at a time. The default is to + * grab 128 slots, which is 4 blocks worth. This was experimentally + * determined to be the lowest value that eliminates the measurable effect + * of lock contention from this code path. + */ +int dmu_object_alloc_chunk_shift = 7; static uint64_t dmu_object_alloc_impl(objset_t *os, dmu_object_type_t ot, int blocksize, @@ -44,6 +52,10 @@ dmu_object_alloc_impl(objset_t *os, dmu_object_type_t dnode_t *dn = NULL; int dn_slots = dnodesize >> DNODE_SHIFT; boolean_t restarted = B_FALSE; + uint64_t *cpuobj = &os->os_obj_next_percpu[CPU_SEQID % + os->os_obj_next_percpu_len]; + int dnodes_per_chunk = 1 << dmu_object_alloc_chunk_shift; + int error; if (dn_slots == 0) { dn_slots = DNODE_MIN_SLOTS; @@ -51,93 +63,149 @@ dmu_object_alloc_impl(objset_t *os, dmu_object_type_t ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); } - - mutex_enter(&os->os_obj_lock); + + /* + * The "chunk" of dnodes that is assigned to a CPU-specific + * allocator needs to be at least one block's worth, to avoid + * lock contention on the dbuf. It can be at most one L1 block's + * worth, so that the "rescan after polishing off a L1's worth" + * logic below will be sure to kick in. + */ + if (dnodes_per_chunk < DNODES_PER_BLOCK) + dnodes_per_chunk = DNODES_PER_BLOCK; + if (dnodes_per_chunk > L1_dnode_count) + dnodes_per_chunk = L1_dnode_count; + +#ifdef __FreeBSD__ + object = atomic_load_64(cpuobj); +#else + object = *cpuobj; +#endif + for (;;) { - object = os->os_obj_next; /* - * Each time we polish off a L1 bp worth of dnodes (2^12 - * objects), move to another L1 bp that's still - * reasonably sparse (at most 1/4 full). Look from the - * beginning at most once per txg. If we still can't - * allocate from that L1 block, search for an empty L0 - * block, which will quickly skip to the end of the - * metadnode if the no nearby L0 blocks are empty. This - * fallback avoids a pathology where full dnode blocks - * containing large dnodes appear sparse because they - * have a low blk_fill, leading to many failed - * allocation attempts. In the long term a better - * mechanism to search for sparse metadnode regions, - * such as spacemaps, could be implemented. - * - * os_scan_dnodes is set during txg sync if enough objects - * have been freed since the previous rescan to justify - * backfilling again. - * - * Note that dmu_traverse depends on the behavior that we use - * multiple blocks of the dnode object before going back to - * reuse objects. Any change to this algorithm should preserve - * that property or find another solution to the issues - * described in traverse_visitbp. + * If we finished a chunk of dnodes, get a new one from + * the global allocator. */ - if (P2PHASE(object, L1_dnode_count) == 0) { - uint64_t offset; - uint64_t blkfill; - int minlvl; - int error; - if (os->os_rescan_dnodes) { - offset = 0; - os->os_rescan_dnodes = B_FALSE; - } else { - offset = object << DNODE_SHIFT; + if ((P2PHASE(object, dnodes_per_chunk) == 0) || + (P2PHASE(object + dn_slots - 1, dnodes_per_chunk) < + dn_slots)) { + DNODE_STAT_BUMP(dnode_alloc_next_chunk); + mutex_enter(&os->os_obj_lock); + ASSERT0(P2PHASE(os->os_obj_next_chunk, + dnodes_per_chunk)); + object = os->os_obj_next_chunk; + + /* + * Each time we polish off a L1 bp worth of dnodes + * (2^12 objects), move to another L1 bp that's + * still reasonably sparse (at most 1/4 full). Look + * from the beginning at most once per txg. If we + * still can't allocate from that L1 block, search + * for an empty L0 block, which will quickly skip + * to the end of the metadnode if the no nearby L0 + * blocks are empty. This fallback avoids a + * pathology where full dnode blocks containing + * large dnodes appear sparse because they have a + * low blk_fill, leading to many failed allocation + * attempts. In the long term a better mechanism to + * search for sparse metadnode regions, such as + * spacemaps, could be implemented. + * + * os_scan_dnodes is set during txg sync if enough + * objects have been freed since the previous + * rescan to justify backfilling again. + * + * Note that dmu_traverse depends on the behavior + * that we use multiple blocks of the dnode object + * before going back to reuse objects. Any change + * to this algorithm should preserve that property + * or find another solution to the issues described + * in traverse_visitbp. + */ + if (P2PHASE(object, L1_dnode_count) == 0) { + uint64_t offset; + uint64_t blkfill; + int minlvl; + if (os->os_rescan_dnodes) { + offset = 0; + os->os_rescan_dnodes = B_FALSE; + } else { + offset = object << DNODE_SHIFT; + } + blkfill = restarted ? 1 : DNODES_PER_BLOCK >> 2; + minlvl = restarted ? 1 : 2; + restarted = B_TRUE; + error = dnode_next_offset(DMU_META_DNODE(os), + DNODE_FIND_HOLE, &offset, minlvl, + blkfill, 0); + if (error == 0) { + object = offset >> DNODE_SHIFT; + } } - blkfill = restarted ? 1 : DNODES_PER_BLOCK >> 2; - minlvl = restarted ? 1 : 2; - restarted = B_TRUE; - error = dnode_next_offset(DMU_META_DNODE(os), - DNODE_FIND_HOLE, &offset, minlvl, blkfill, 0); - if (error == 0) - object = offset >> DNODE_SHIFT; + /* + * Note: if "restarted", we may find a L0 that + * is not suitably aligned. + */ + os->os_obj_next_chunk = + P2ALIGN(object, dnodes_per_chunk) + + dnodes_per_chunk; + (void) atomic_swap_64(cpuobj, object); + mutex_exit(&os->os_obj_lock); } - os->os_obj_next = object + dn_slots; /* + * The value of (*cpuobj) before adding dn_slots is the object + * ID assigned to us. The value afterwards is the object ID + * assigned to whoever wants to do an allocation next. + */ + object = atomic_add_64_nv(cpuobj, dn_slots) - dn_slots; + + /* * XXX We should check for an i/o error here and return * up to our caller. Actually we should pre-read it in * dmu_tx_assign(), but there is currently no mechanism * to do so. */ - (void) dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, dn_slots, - FTAG, &dn); - if (dn) - break; - - if (dmu_object_next(os, &object, B_TRUE, 0) == 0) - os->os_obj_next = object; - else + error = dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, + dn_slots, FTAG, &dn); + if (error == 0) { + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* - * Skip to next known valid starting point for a dnode. + * Another thread could have allocated it; check + * again now that we have the struct lock. */ - os->os_obj_next = P2ROUNDUP(object + 1, - DNODES_PER_BLOCK); - } + if (dn->dn_type == DMU_OT_NONE) { + dnode_allocate(dn, ot, blocksize, 0, + bonustype, bonuslen, dn_slots, tx); + rw_exit(&dn->dn_struct_rwlock); + dmu_tx_add_new_object(tx, dn); + dnode_rele(dn, FTAG); + return (object); + } + rw_exit(&dn->dn_struct_rwlock); + dnode_rele(dn, FTAG); + DNODE_STAT_BUMP(dnode_alloc_race); + } - dnode_allocate(dn, ot, blocksize, indirect_blockshift, - bonustype, bonuslen, dn_slots, tx); - mutex_exit(&os->os_obj_lock); - - dmu_tx_add_new_object(tx, dn); - dnode_rele(dn, FTAG); - - return (object); + /* + * Skip to next known valid starting point on error. This + * is the start of the next block of dnodes. + */ + if (dmu_object_next(os, &object, B_TRUE, 0) != 0) { + object = P2ROUNDUP(object + 1, DNODES_PER_BLOCK); + DNODE_STAT_BUMP(dnode_alloc_next_block); + } + (void) atomic_swap_64(cpuobj, object); + } } uint64_t dmu_object_alloc(objset_t *os, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - return dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, - bonuslen, 0, tx); + return (dmu_object_alloc_impl(os, ot, blocksize, 0, bonustype, + bonuslen, 0, tx)); } uint64_t @@ -145,8 +213,8 @@ dmu_object_alloc_ibs(objset_t *os, dmu_object_type_t o int indirect_blockshift, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - return dmu_object_alloc_impl(os, ot, blocksize, indirect_blockshift, - bonustype, bonuslen, 0, tx); + return (dmu_object_alloc_impl(os, ot, blocksize, indirect_blockshift, + bonustype, bonuslen, 0, tx)); } uint64_t @@ -178,7 +246,7 @@ dmu_object_claim_dnsize(objset_t *os, uint64_t object, dn_slots = DNODE_MIN_SLOTS; ASSERT3S(dn_slots, >=, DNODE_MIN_SLOTS); ASSERT3S(dn_slots, <=, DNODE_MAX_SLOTS); - + if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) return (SET_ERROR(EBADF)); @@ -199,7 +267,7 @@ dmu_object_reclaim(objset_t *os, uint64_t object, dmu_ int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { return (dmu_object_reclaim_dnsize(os, object, ot, blocksize, bonustype, - bonuslen, 0, tx)); + bonuslen, DNODE_MIN_SIZE, tx)); } int @@ -211,6 +279,9 @@ dmu_object_reclaim_dnsize(objset_t *os, uint64_t objec int dn_slots = dnodesize >> DNODE_SHIFT; int err; + if (dn_slots == 0) + dn_slots = DNODE_MIN_SLOTS; + if (object == DMU_META_DNODE_OBJECT) return (SET_ERROR(EBADF)); @@ -260,28 +331,52 @@ int dmu_object_next(objset_t *os, uint64_t *objectp, boolean_t hole, uint64_t txg) { uint64_t offset; - dmu_object_info_t doi; + uint64_t start_obj; struct dsl_dataset *ds = os->os_dsl_dataset; - int dnodesize; int error; - /* - * Avoid expensive dnode hold if this dataset doesn't use large dnodes. - */ - if (ds && ds->ds_feature_inuse[SPA_FEATURE_LARGE_DNODE]) { - error = dmu_object_info(os, *objectp, &doi); - if (error && !(error == EINVAL && *objectp == 0)) - return (SET_ERROR(error)); - else - dnodesize = doi.doi_dnodesize; + if (*objectp == 0) { + start_obj = 1; + } else if (ds && ds->ds_feature_inuse[SPA_FEATURE_LARGE_DNODE]) { + uint64_t i = *objectp + 1; + uint64_t last_obj = *objectp | (DNODES_PER_BLOCK - 1); + dmu_object_info_t doi; + + /* + * Scan through the remaining meta dnode block. The contents + * of each slot in the block are known so it can be quickly + * checked. If the block is exhausted without a match then + * hand off to dnode_next_offset() for further scanning. + */ + while (i <= last_obj) { + error = dmu_object_info(os, i, &doi); + if (error == ENOENT) { + if (hole) { + *objectp = i; + return (0); + } else { + i++; + } + } else if (error == EEXIST) { + i++; + } else if (error == 0) { + if (hole) { + i += doi.doi_dnodesize >> DNODE_SHIFT; + } else { + *objectp = i; + return (0); + } + } else { + return (error); + } + } + + start_obj = i; } else { - dnodesize = DNODE_MIN_SIZE; + start_obj = *objectp + 1; } - if (*objectp == 0) - offset = 1 << DNODE_SHIFT; - else - offset = (*objectp << DNODE_SHIFT) + dnodesize; + offset = start_obj << DNODE_SHIFT; error = dnode_next_offset(DMU_META_DNODE(os), (hole ? DNODE_FIND_HOLE : 0), &offset, 0, DNODES_PER_BLOCK, txg); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Oct 31 09:14:50 2019 (r354211) @@ -566,6 +566,9 @@ dmu_objset_open_impl(spa_t *spa, dsl_dataset_t *ds, bl mutex_init(&os->os_userused_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_obj_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&os->os_user_ptr_lock, NULL, MUTEX_DEFAULT, NULL); + os->os_obj_next_percpu_len = boot_ncpus; + os->os_obj_next_percpu = kmem_zalloc(os->os_obj_next_percpu_len * + sizeof (os->os_obj_next_percpu[0]), KM_SLEEP); dnode_special_open(os, &os->os_phys->os_meta_dnode, DMU_META_DNODE_OBJECT, &os->os_meta_dnode); @@ -844,6 +847,9 @@ dmu_objset_evict_done(objset_t *os) rw_enter(&os_lock, RW_READER); rw_exit(&os_lock); + kmem_free(os->os_obj_next_percpu, + os->os_obj_next_percpu_len * sizeof (os->os_obj_next_percpu[0])); + mutex_destroy(&os->os_lock); mutex_destroy(&os->os_userused_lock); mutex_destroy(&os->os_obj_lock); @@ -1243,10 +1249,23 @@ dmu_objset_sync_dnodes(multilist_sublist_t *list, dmu_ ASSERT3U(dn->dn_nlevels, <=, DN_MAX_LEVELS); multilist_sublist_remove(list, dn); + /* + * If we are not doing useraccounting (os_synced_dnodes == NULL) + * we are done with this dnode for this txg. Unset dn_dirty_txg + * if later txgs aren't dirtying it so that future holders do + * not get a stale value. Otherwise, we will do this in + * userquota_updates_task() when processing has completely + * finished for this txg. + */ multilist_t *newlist = dn->dn_objset->os_synced_dnodes; if (newlist != NULL) { (void) dnode_add_ref(dn, newlist); multilist_insert(newlist, dn); + } else { + mutex_enter(&dn->dn_mtx); + if (dn->dn_dirty_txg == tx->tx_txg) + dn->dn_dirty_txg = 0; + mutex_exit(&dn->dn_mtx); } dnode_sync(dn, tx); @@ -1606,6 +1625,8 @@ userquota_updates_task(void *arg) dn->dn_id_flags |= DN_ID_CHKED_BONUS; } dn->dn_id_flags &= ~(DN_ID_NEW_EXIST); + if (dn->dn_dirty_txg == spa_syncing_txg(os->os_spa)) + dn->dn_dirty_txg = 0; mutex_exit(&dn->dn_mtx); multilist_sublist_remove(list, dn); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1441,17 +1441,12 @@ dmu_recv_begin_check(void *arg, dmu_tx_t *tx) /* * The receiving code doesn't know how to translate large blocks * to smaller ones, so the pool must have the LARGE_BLOCKS - * feature enabled if the stream has LARGE_BLOCKS. + * feature enabled if the stream has LARGE_BLOCKS. Same with + * large dnodes. */ if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) return (SET_ERROR(ENOTSUP)); - - /* - * The receiving code doesn't know how to translate large dnodes - * to smaller ones, so the pool must have the LARGE_DNODE - * feature enabled if the stream has LARGE_DNODE. - */ if ((featureflags & DMU_BACKUP_FEATURE_LARGE_DNODE) && !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_DNODE)) return (SET_ERROR(ENOTSUP)); @@ -1659,6 +1654,9 @@ dmu_recv_resume_begin_check(void *arg, dmu_tx_t *tx) dsl_dataset_t *ds; const char *tofs = drba->drba_cookie->drc_tofs; + /* 6 extra bytes for /%recv */ + char recvname[ZFS_MAX_DATASET_NAME_LEN + 6]; + /* already checked */ ASSERT3U(drrb->drr_magic, ==, DMU_BACKUP_MAGIC); ASSERT(featureflags & DMU_BACKUP_FEATURE_RESUMING); @@ -1686,8 +1684,18 @@ dmu_recv_resume_begin_check(void *arg, dmu_tx_t *tx) !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LZ4_COMPRESS)) return (SET_ERROR(ENOTSUP)); - /* 6 extra bytes for /%recv */ - char recvname[ZFS_MAX_DATASET_NAME_LEN + 6]; + /* + * The receiving code doesn't know how to translate large blocks + * to smaller ones, so the pool must have the LARGE_BLOCKS + * feature enabled if the stream has LARGE_BLOCKS. Same with + * large dnodes. + */ + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SET_ERROR(ENOTSUP)); + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_DNODE) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_DNODE)) + return (SET_ERROR(ENOTSUP)); (void) snprintf(recvname, sizeof (recvname), "%s/%s", tofs, recv_clone_name); @@ -2149,6 +2157,8 @@ receive_object(struct receive_writer_arg *rwa, struct dmu_tx_t *tx; uint64_t object; int err; + uint8_t dn_slots = drro->drr_dn_slots != 0 ? + drro->drr_dn_slots : DNODE_MIN_SLOTS; if (drro->drr_type == DMU_OT_NONE || !DMU_OT_IS_VALID(drro->drr_type) || @@ -2159,15 +2169,16 @@ receive_object(struct receive_writer_arg *rwa, struct drro->drr_blksz < SPA_MINBLOCKSIZE || drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(rwa->os)) || drro->drr_bonuslen > - DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os)))) { + DN_BONUS_SIZE(spa_maxdnodesize(dmu_objset_spa(rwa->os))) || + dn_slots > + (spa_maxdnodesize(dmu_objset_spa(rwa->os)) >> DNODE_SHIFT)) { return (SET_ERROR(EINVAL)); } err = dmu_object_info(rwa->os, drro->drr_object, &doi); - if (err != 0 && err != ENOENT) + if (err != 0 && err != ENOENT && err != EEXIST) return (SET_ERROR(EINVAL)); - object = err == 0 ? drro->drr_object : DMU_NEW_OBJECT; if (drro->drr_object > rwa->max_object) rwa->max_object = drro->drr_object; @@ -2180,18 +2191,66 @@ receive_object(struct receive_writer_arg *rwa, struct if (err == 0) { int nblkptr; + object = drro->drr_object; + nblkptr = deduce_nblkptr(drro->drr_bonustype, drro->drr_bonuslen); if (drro->drr_blksz != doi.doi_data_block_size || - nblkptr < doi.doi_nblkptr) { + nblkptr < doi.doi_nblkptr || + dn_slots != doi.doi_dnodesize >> DNODE_SHIFT) { err = dmu_free_long_range(rwa->os, drro->drr_object, 0, DMU_OBJECT_END); if (err != 0) return (SET_ERROR(EINVAL)); } + } else if (err == EEXIST) { + /* + * The object requested is currently an interior slot of a + * multi-slot dnode. This will be resolved when the next txg + * is synced out, since the send stream will have told us + * to free this slot when we freed the associated dnode + * earlier in the stream. + */ + txg_wait_synced(dmu_objset_pool(rwa->os), 0); + object = drro->drr_object; + } else { + /* object is free and we are about to allocate a new one */ + object = DMU_NEW_OBJECT; } + /* + * If this is a multi-slot dnode there is a chance that this + * object will expand into a slot that is already used by + * another object from the previous snapshot. We must free + * these objects before we attempt to allocate the new dnode. + */ + if (dn_slots > 1) { + boolean_t need_sync = B_FALSE; + + for (uint64_t slot = drro->drr_object + 1; + slot < drro->drr_object + dn_slots; + slot++) { + dmu_object_info_t slot_doi; + + err = dmu_object_info(rwa->os, slot, &slot_doi); + if (err == ENOENT || err == EEXIST) + continue; + else if (err != 0) + return (err); + + err = dmu_free_long_object(rwa->os, slot); + + if (err != 0) + return (err); + + need_sync = B_TRUE; + } + + if (need_sync) + txg_wait_synced(dmu_objset_pool(rwa->os), 0); + } + tx = dmu_tx_create(rwa->os); dmu_tx_hold_bonus(tx, object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -2205,15 +2264,17 @@ receive_object(struct receive_writer_arg *rwa, struct err = dmu_object_claim_dnsize(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, - drro->drr_dn_slots << DNODE_SHIFT, tx); + dn_slots << DNODE_SHIFT, tx); } else if (drro->drr_type != doi.doi_type || drro->drr_blksz != doi.doi_data_block_size || drro->drr_bonustype != doi.doi_bonus_type || - drro->drr_bonuslen != doi.doi_bonus_size) { + drro->drr_bonuslen != doi.doi_bonus_size || + drro->drr_dn_slots != (doi.doi_dnodesize >> DNODE_SHIFT)) { /* currently allocated, but with different properties */ - err = dmu_object_reclaim(rwa->os, drro->drr_object, + err = dmu_object_reclaim_dnsize(rwa->os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen, + drro->drr_dn_slots << DNODE_SHIFT, tx); } if (err != 0) { dmu_tx_commit(tx); @@ -2263,13 +2324,11 @@ receive_freeobjects(struct receive_writer_arg *rwa, dmu_object_info_t doi; int err; - err = dmu_object_info(rwa->os, obj, &doi); - if (err == ENOENT) { - obj++; - continue; - } else if (err != 0) { + err = dmu_object_info(rwa->os, obj, NULL); + if (err == ENOENT) + continue; + else if (err != 0) return (err); - } err = dmu_free_long_object(rwa->os, obj); if (err != 0) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Oct 31 09:14:50 2019 (r354211) @@ -1252,11 +1252,13 @@ dmu_tx_sa_registration_hold(sa_os_t *sa, dmu_tx_t *tx) void dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t object) { - dmu_tx_hold_t *txh = dmu_tx_hold_object_impl(tx, - tx->tx_objset, object, THT_SPILL, 0, 0); + dmu_tx_hold_t *txh; - (void) refcount_add_many(&txh->txh_space_towrite, - SPA_OLD_MAXBLOCKSIZE, FTAG); + txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, object, + THT_SPILL, 0, 0); + if (txh != NULL) + (void) refcount_add_many(&txh->txh_space_towrite, + SPA_OLD_MAXBLOCKSIZE, FTAG); } void Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Oct 31 00:35:26 2019 (r354210) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Oct 31 09:14:50 2019 (r354211) @@ -40,21 +40,41 @@ #include #include +dnode_stats_t dnode_stats = { + { "dnode_hold_dbuf_hold", KSTAT_DATA_UINT64 }, + { "dnode_hold_dbuf_read", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_hits", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_interior", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_lock_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_alloc_type_none", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_hits", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_lock_misses", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_overflow", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_refcount", KSTAT_DATA_UINT64 }, + { "dnode_hold_free_txg", KSTAT_DATA_UINT64 }, + { "dnode_free_interior_lock_retry", KSTAT_DATA_UINT64 }, + { "dnode_allocate", KSTAT_DATA_UINT64 }, + { "dnode_reallocate", KSTAT_DATA_UINT64 }, + { "dnode_buf_evict", KSTAT_DATA_UINT64 }, + { "dnode_alloc_next_chunk", KSTAT_DATA_UINT64 }, + { "dnode_alloc_race", KSTAT_DATA_UINT64 }, + { "dnode_alloc_next_block", KSTAT_DATA_UINT64 }, + { "dnode_move_invalid", KSTAT_DATA_UINT64 }, + { "dnode_move_recheck1", KSTAT_DATA_UINT64 }, + { "dnode_move_recheck2", KSTAT_DATA_UINT64 }, + { "dnode_move_special", KSTAT_DATA_UINT64 }, + { "dnode_move_handle", KSTAT_DATA_UINT64 }, + { "dnode_move_rwlock", KSTAT_DATA_UINT64 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Thu Oct 31 14:49:30 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E096215B38C; Thu, 31 Oct 2019 14:49:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473pBL4C26z4N5C; Thu, 31 Oct 2019 14:49:30 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 728C124350; Thu, 31 Oct 2019 14:49:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VEnULC021200; Thu, 31 Oct 2019 14:49:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VEnUJ1021199; Thu, 31 Oct 2019 14:49:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910311449.x9VEnUJ1021199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 31 Oct 2019 14:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354216 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 354216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 14:49:31 -0000 Author: markj Date: Thu Oct 31 14:49:30 2019 New Revision: 354216 URL: https://svnweb.freebsd.org/changeset/base/354216 Log: MFC r353699: Clean up some nits in link_elf_(un)load_file(). Modified: stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/link_elf_obj.c ============================================================================== --- stable/12/sys/kern/link_elf_obj.c Thu Oct 31 14:22:54 2019 (r354215) +++ stable/12/sys/kern/link_elf_obj.c Thu Oct 31 14:49:30 2019 (r354216) @@ -779,7 +779,6 @@ link_elf_load_file(linker_class_t cls, const char *fil error = ENOMEM; goto out; } - ef->address = (caddr_t) vm_map_min(kernel_map); /* * In order to satisfy amd64's architectural requirements on the @@ -794,9 +793,10 @@ link_elf_load_file(linker_class_t cls, const char *fil error = vm_map_find(kernel_map, ef->object, 0, &mapbase, round_page(mapsize), 0, VMFS_OPTIMAL_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(ef->object); - ef->object = 0; + ef->object = NULL; + error = ENOMEM; goto out; } @@ -1084,11 +1084,9 @@ link_elf_unload_file(linker_file_t file) free(ef->relatab, M_LINKER); free(ef->progtab, M_LINKER); - if (ef->object) { - vm_map_remove(kernel_map, (vm_offset_t) ef->address, - (vm_offset_t) ef->address + - (ef->object->size << PAGE_SHIFT)); - } + if (ef->object != NULL) + vm_map_remove(kernel_map, (vm_offset_t)ef->address, + (vm_offset_t)ef->address + ptoa(ef->object->size)); free(ef->e_shdr, M_LINKER); free(ef->ddbsymtab, M_LINKER); free(ef->ddbstrtab, M_LINKER); From owner-svn-src-stable@freebsd.org Thu Oct 31 20:29:46 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC991655AC; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473xky4bQcz3JYD; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DB219C; Thu, 31 Oct 2019 20:29:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VKTkuR025464; Thu, 31 Oct 2019 20:29:46 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VKTkO7025461; Thu, 31 Oct 2019 20:29:46 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910312029.x9VKTkO7025461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 31 Oct 2019 20:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354226 - stable/12/lib/libsecureboot X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: stable/12/lib/libsecureboot X-SVN-Commit-Revision: 354226 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 20:29:47 -0000 Author: sjg Date: Thu Oct 31 20:29:45 2019 New Revision: 354226 URL: https://svnweb.freebsd.org/changeset/base/354226 Log: Initialize verbosity and debug level from env For EFI at least, we can seed the environment with VE_VERBOSE etc. MFC of r354038 Reviewed by: stevek imp Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22135 Modified: stable/12/lib/libsecureboot/verify_file.c stable/12/lib/libsecureboot/vets.c Modified: stable/12/lib/libsecureboot/verify_file.c ============================================================================== --- stable/12/lib/libsecureboot/verify_file.c Thu Oct 31 16:03:43 2019 (r354225) +++ stable/12/lib/libsecureboot/verify_file.c Thu Oct 31 20:29:45 2019 (r354226) @@ -292,6 +292,28 @@ verify_tweak(int fd, off_t off, struct stat *stp, } } +#ifndef VE_DEBUG_LEVEL +# define VE_DEBUG_LEVEL 0 +#endif + +static int +getenv_int(const char *var, int def) +{ + const char *cp; + char *ep; + long val; + + val = def; + cp = getenv(var); + if (cp && *cp) { + val = strtol(cp, &ep, 0); + if ((ep && *ep) || val != (int)val) { + val = def; + } + } + return (int)val; +} + /** * @brief verify an open file * @@ -331,9 +353,8 @@ verify_file(int fd, const char *filename, off_t off, i if (verifying < 0) { verifying = ve_trust_init(); -#ifdef VE_DEBUG_LEVEL - ve_debug_set(VE_DEBUG_LEVEL); -#endif + verbose = getenv_int("VE_VERBOSE", VE_VERBOSE_DEFAULT); + ve_debug_set(getenv_int("VE_DEBUG_LEVEL", VE_DEBUG_LEVEL)); /* initialize ve_status with default result */ rc = verifying ? VE_NOT_CHECKED : VE_NOT_VERIFYING; ve_status_set(0, rc); Modified: stable/12/lib/libsecureboot/vets.c ============================================================================== --- stable/12/lib/libsecureboot/vets.c Thu Oct 31 16:03:43 2019 (r354225) +++ stable/12/lib/libsecureboot/vets.c Thu Oct 31 20:29:45 2019 (r354226) @@ -240,7 +240,7 @@ ve_forbidden_digest_add(hash_data *digest, size_t num) static size_t ve_anchors_add(br_x509_certificate *xcs, size_t num, anchor_list *anchors, - char *anchors_name) + const char *anchors_name) { br_x509_trust_anchor ta; size_t u; From owner-svn-src-stable@freebsd.org Thu Oct 31 21:33:01 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6113C167892; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473z7x1xW5z3NsY; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2567CDB6; Thu, 31 Oct 2019 21:33:01 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VLX1Fp066376; Thu, 31 Oct 2019 21:33:01 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VLWxAO066341; Thu, 31 Oct 2019 21:32:59 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201910312132.x9VLWxAO066341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 31 Oct 2019 21:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354230 - in stable/12/stand: . efi/loader ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/stand: . efi/loader ficl ficl/amd64 ficl/i386 ficl/x86 i386/loader libsa libsa/x86 X-SVN-Commit-Revision: 354230 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 21:33:01 -0000 Author: sjg Date: Thu Oct 31 21:32:59 2019 New Revision: 354230 URL: https://svnweb.freebsd.org/changeset/base/354230 Log: Add support for hypervisor check on x86 Add ficl words for isvirtualized and move ficl inb and outb words to ficl/x86/sysdep.c so can be shared by i386 and amd64 MFC of r354043, r354055 Reviewed by: imp bdrewery Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22069 Added: stable/12/stand/ficl/x86/ - copied from r354043, head/stand/ficl/x86/ stable/12/stand/libsa/x86/ - copied from r354043, head/stand/libsa/x86/ Modified: stable/12/stand/defs.mk stable/12/stand/efi/loader/main.c stable/12/stand/ficl/amd64/sysdep.c stable/12/stand/ficl/i386/sysdep.c stable/12/stand/ficl/loader.c stable/12/stand/i386/loader/main.c stable/12/stand/libsa/Makefile stable/12/stand/libsa/stand.h Modified: stable/12/stand/defs.mk ============================================================================== --- stable/12/stand/defs.mk Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/defs.mk Thu Oct 31 21:32:59 2019 (r354230) @@ -182,14 +182,15 @@ CFLAGS+=-I. all: ${PROG} .if !defined(NO_OBJ) -_ILINKS=machine +_ILINKS=include/machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" -_ILINKS+=${MACHINE_CPUARCH} +_ILINKS+=include/${MACHINE_CPUARCH} .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_ILINKS+=x86 +_ILINKS+=include/x86 .endif -CLEANFILES+=${_ILINKS} +CFLAGS+= -Iinclude +CLEANDIRS+= include beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} @@ -204,8 +205,8 @@ ${OBJS}: ${_link} .NOPATH: ${_ILINKS} -${_ILINKS}: - @case ${.TARGET} in \ +${_ILINKS}: .NOMETA + @case ${.TARGET:T} in \ machine) \ if [ ${DO32:U0} -eq 0 ]; then \ path=${SYSDIR}/${MACHINE}/include ; \ @@ -215,8 +216,11 @@ ${_ILINKS}: *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ + case ${.TARGET} in \ + */*) mkdir -p ${.TARGET:H};; \ + esac ; \ path=`(cd $$path && /bin/pwd)` ; \ - ${ECHO} ${.TARGET:T} "->" $$path ; \ - ln -fhs $$path ${.TARGET:T} + ${ECHO} ${.TARGET} "->" $$path ; \ + ln -fhs $$path ${.TARGET} .endif # !NO_OBJ .endif # __BOOT_DEFS_MK__ Modified: stable/12/stand/efi/loader/main.c ============================================================================== --- stable/12/stand/efi/loader/main.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/efi/loader/main.c Thu Oct 31 21:32:59 2019 (r354230) @@ -863,6 +863,9 @@ main(int argc, CHAR16 *argv[]) archsw.arch_getdev = efi_getdev; archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; +#ifdef __amd64__ + archsw.arch_hypervisor = x86_hypervisor; +#endif archsw.arch_readin = efi_readin; archsw.arch_zfs_probe = efi_zfs_probe; Modified: stable/12/stand/ficl/amd64/sysdep.c ============================================================================== --- stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/amd64/sysdep.c Thu Oct 31 21:32:59 2019 (r354230) @@ -17,6 +17,8 @@ #endif #include "ficl.h" +#include "../x86/sysdep.c" + /* ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith */ Modified: stable/12/stand/ficl/i386/sysdep.c ============================================================================== --- stable/12/stand/ficl/i386/sysdep.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/i386/sysdep.c Thu Oct 31 21:32:59 2019 (r354230) @@ -14,12 +14,11 @@ #include #else #include -#ifdef __i386__ -#include #endif -#endif #include "ficl.h" +#include "../x86/sysdep.c" + /* ******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith */ @@ -80,53 +79,6 @@ void ficlFree (void *p) free(p); } -#ifndef TESTMAIN -/* - * outb ( port# c -- ) - * Store a byte to I/O port number port# - */ -void -ficlOutb(FICL_VM *pVM) -{ - u_char c; - uint32_t port; - - port=stackPopUNS(pVM->pStack); - c=(u_char)stackPopINT(pVM->pStack); - outb(port,c); -} - -/* - * inb ( port# -- c ) - * Fetch a byte from I/O port number port# - */ -void -ficlInb(FICL_VM *pVM) -{ - u_char c; - uint32_t port; - - port=stackPopUNS(pVM->pStack); - c=inb(port); - stackPushINT(pVM->pStack,c); -} - -/* - * Glue function to add the appropriate forth words to access x86 special cpu - * functionality. - */ -static void ficlCompileCpufunc(FICL_SYSTEM *pSys) -{ - FICL_DICT *dp = pSys->dp; - assert (dp); - - dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); - dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT); -} - -FICL_COMPILE_SET(ficlCompileCpufunc); - -#endif /* ** Stub function for dictionary access control - does nothing Modified: stable/12/stand/ficl/loader.c ============================================================================== --- stable/12/stand/ficl/loader.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/ficl/loader.c Thu Oct 31 21:32:59 2019 (r354230) @@ -287,6 +287,32 @@ ficlFindfile(FICL_VM *pVM) return; } +#ifndef TESTMAIN + +/* isvirtualized? - Return whether the loader runs under a + * hypervisor. + * + * isvirtualized? ( -- flag ) + */ +static void +ficlIsvirtualizedQ(FICL_VM *pVM) +{ + FICL_INT flag; + const char *hv; + +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + hv = (archsw.arch_hypervisor != NULL) + ? (*archsw.arch_hypervisor)() + : NULL; + flag = (hv != NULL) ? FICL_TRUE : FICL_FALSE; + stackPushINT(pVM->pStack, flag); +} + +#endif /* ndef TESTMAIN */ + void ficlCcall(FICL_VM *pVM) { @@ -840,7 +866,10 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys) dictAppendWord(dp, "ccall", ficlCcall, FW_DEFAULT); dictAppendWord(dp, "uuid-from-string", ficlUuidFromString, FW_DEFAULT); dictAppendWord(dp, "uuid-to-string", ficlUuidToString, FW_DEFAULT); - +#ifndef TESTMAIN + dictAppendWord(dp, "isvirtualized?",ficlIsvirtualizedQ, FW_DEFAULT); +#endif + SET_FOREACH(fnpp, Xficl_compile_set) (*fnpp)(pSys); Modified: stable/12/stand/i386/loader/main.c ============================================================================== --- stable/12/stand/i386/loader/main.c Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/i386/loader/main.c Thu Oct 31 21:32:59 2019 (r354230) @@ -167,6 +167,7 @@ main(void) archsw.arch_readin = i386_readin; archsw.arch_isainb = isa_inb; archsw.arch_isaoutb = isa_outb; + archsw.arch_hypervisor = x86_hypervisor; #ifdef LOADER_ZFS_SUPPORT archsw.arch_zfs_probe = i386_zfs_probe; Modified: stable/12/stand/libsa/Makefile ============================================================================== --- stable/12/stand/libsa/Makefile Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/libsa/Makefile Thu Oct 31 21:32:59 2019 (r354230) @@ -71,6 +71,11 @@ SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c m SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c SRCS+= ashldi3.c ashrdi3.c lshrdi3.c +.if ${MACHINE_CPUARCH:Namd64:Ni386} == "" +.PATH: ${SASRC}/x86 +SRCS+= hypervisor.c +.endif + .if ${MACHINE_CPUARCH} == "powerpc" SRCS+= syncicache.c .endif Modified: stable/12/stand/libsa/stand.h ============================================================================== --- stable/12/stand/libsa/stand.h Thu Oct 31 21:01:34 2019 (r354229) +++ stable/12/stand/libsa/stand.h Thu Oct 31 21:32:59 2019 (r354230) @@ -435,6 +435,8 @@ void *Reallocf(void *, size_t, const char *, int); void Free(void *, const char *, int); extern void mallocstats(void); +const char *x86_hypervisor(void); + #ifdef DEBUG_MALLOC #define malloc(x) Malloc(x, __FILE__, __LINE__) #define memalign(x, y) Memalign(x, y, __FILE__, __LINE__) From owner-svn-src-stable@freebsd.org Sat Nov 2 09:22:21 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EDD317C46B; Sat, 2 Nov 2019 09:22:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474tqx0VSCz4PTb; Sat, 2 Nov 2019 09:22:21 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8829214BE; Sat, 2 Nov 2019 09:22:20 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA29MKkv075006; Sat, 2 Nov 2019 09:22:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA29MKij075005; Sat, 2 Nov 2019 09:22:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911020922.xA29MKij075005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 2 Nov 2019 09:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354248 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 354248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 09:22:21 -0000 Author: tsoome Date: Sat Nov 2 09:22:20 2019 New Revision: 354248 URL: https://svnweb.freebsd.org/changeset/base/354248 Log: MFC r354119: loader: rs_alloc() may return NULL rs_alloc() in zfs reader code may return NULL, so we need to check the return value and error out if needed. Modified: stable/12/stand/libsa/zfs/zfsimpl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfsimpl.c ============================================================================== --- stable/12/stand/libsa/zfs/zfsimpl.c Sat Nov 2 04:01:39 2019 (r354247) +++ stable/12/stand/libsa/zfs/zfsimpl.c Sat Nov 2 09:22:20 2019 (r354248) @@ -840,12 +840,17 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 list_t stack; spa_t *spa = vd->spa; zio_t *zio = arg; + remap_segment_t *rs; list_create(&stack, sizeof (remap_segment_t), offsetof(remap_segment_t, rs_node)); - for (remap_segment_t *rs = rs_alloc(vd, offset, asize, 0); - rs != NULL; rs = list_remove_head(&stack)) { + rs = rs_alloc(vd, offset, asize, 0); + if (rs == NULL) { + printf("vdev_indirect_remap: out of memory.\n"); + zio->io_error = ENOMEM; + } + for ( ; rs != NULL; rs = list_remove_head(&stack)) { vdev_t *v = rs->rs_vd; uint64_t num_entries = 0; /* vdev_indirect_mapping_t *vim = v->v_mapping; */ @@ -853,6 +858,9 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 vdev_indirect_mapping_duplicate_adjacent_entries(v, rs->rs_offset, rs->rs_asize, &num_entries); + if (num_entries == 0) + zio->io_error = ENOMEM; + for (uint64_t i = 0; i < num_entries; i++) { vdev_indirect_mapping_entry_phys_t *m = &mapping[i]; uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); @@ -865,9 +873,18 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 vdev_t *dst_v = vdev_lookup_top(spa, dst_vdev); if (dst_v->v_read == vdev_indirect_read) { - list_insert_head(&stack, - rs_alloc(dst_v, dst_offset + inner_offset, - inner_size, rs->rs_split_offset)); + remap_segment_t *o; + + o = rs_alloc(dst_v, dst_offset + inner_offset, + inner_size, rs->rs_split_offset); + if (o == NULL) { + printf("vdev_indirect_remap: " + "out of memory.\n"); + zio->io_error = ENOMEM; + break; + } + + list_insert_head(&stack, o); } vdev_indirect_gather_splits(rs->rs_split_offset, dst_v, dst_offset + inner_offset, From owner-svn-src-stable@freebsd.org Sat Nov 2 19:46:40 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BCAC161A59; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758hJ1GCGz461J; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E65A4C8; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JkdSH050085; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JkdjX050083; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021946.xA2JkdjX050083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354260 - in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Commit-Revision: 354260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 19:46:40 -0000 Author: mhorne Date: Sat Nov 2 19:46:39 2019 New Revision: 354260 URL: https://svnweb.freebsd.org/changeset/base/354260 Log: MFC r340228-r340229, r340231 r340228 by jhb: Enable use of a global shared page for RISC-V. machine/vmparam.h already defines the SHAREDPAGE constant. This change just enables it for ELF executables. The only use of the shared page currently is to hold the signal trampoline. Reviewed by: markj, kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17875 r340229 by jhb: Drop the legacy ELF brandinfo for the old rtld from arm64 and riscv. These architectures never shipped binaries with an rtld path of /usr/libexec/ld-elf.so.1. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17876 r340231 by jhb: Enable non-executable stacks by default on RISC-V. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17878 Modified: stable/12/sys/arm64/arm64/elf_machdep.c stable/12/sys/kern/imgact_elf.c stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -107,21 +107,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_AARCH64, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); - void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:46:39 2019 (r354260) @@ -119,7 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), int __elfN(nxstack) = #if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \ - (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) + (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) || \ + defined(__riscv) 1; #else 0; Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -84,10 +84,12 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, @@ -110,22 +112,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); - -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_RISCV, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_oinfo); static int debug_kld; SYSCTL_INT(_kern, OID_AUTO, debug_kld, From owner-svn-src-stable@freebsd.org Sat Nov 2 19:48:43 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7881B161B85; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758kg2ZcJz46PK; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 367CC4D3; Sat, 2 Nov 2019 19:48:43 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JmhKw050228; Sat, 2 Nov 2019 19:48:43 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JmhxF050227; Sat, 2 Nov 2019 19:48:43 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021948.xA2JmhxF050227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354261 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 19:48:43 -0000 Author: mhorne Date: Sat Nov 2 19:48:42 2019 New Revision: 354261 URL: https://svnweb.freebsd.org/changeset/base/354261 Log: MFC r352729: Cleanup of elf_machdep.c Fix some style(9) violations. This also changes the name of the machine-dependent sysctl kern.debug_kld to debug.kld_reloc, and changes its type from int to bool. This is acceptable since we are not currently concerned with preserving the RISC-V ABI. Reviewed by: markj, kp Differential Revision: https://reviews.freebsd.org/D21772 Modified: stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:48:42 2019 (r354261) @@ -110,13 +110,11 @@ static Elf64_Brandinfo freebsd_brand_info = { }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_info); + (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static int debug_kld; -SYSCTL_INT(_kern, OID_AUTO, debug_kld, - CTLFLAG_RW, &debug_kld, 0, - "Activate debug prints in elf_reloc_internal()"); +static bool debug_kld; +SYSCTL_BOOL(_debug, OID_AUTO, kld_reloc, CTLFLAG_RW, &debug_kld, 0, + "Activate debug prints in elf_reloc_internal()"); struct type2str_ent { int type; @@ -275,7 +273,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas uint32_t before32_1; uint32_t before32; uint64_t before64; - uint32_t* insn32p; + uint32_t *insn32p; uint32_t imm20; int error; @@ -283,15 +281,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case ELF_RELOC_RELA: rela = (const Elf_Rela *)data; where = (Elf_Addr *)(relocbase + rela->r_offset); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); break; default: printf("%s:%d unknown reloc type %d\n", - __FUNCTION__, __LINE__, type); - return -1; + __FUNCTION__, __LINE__, type); + return (-1); } switch (rtype) { @@ -302,43 +300,36 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_RISCV_JUMP_SLOT: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; before64 = *where; if (*where != val) *where = val; - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_RELATIVE: before64 = *where; - *where = elf_relocaddr(lf, relocbase + addend); - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_JAL: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 20) || (1UL << 20) <= val)) { + if (val <= -(1UL << 20) || (1UL << 20) <= val) { printf("kldload: huge offset against R_RISCV_JAL\n"); - return -1; + return (-1); } before32 = *insn32p; @@ -346,13 +337,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *insn32p = insert_imm(*insn32p, val, 10, 1, 21); *insn32p = insert_imm(*insn32p, val, 11, 11, 20); *insn32p = insert_imm(*insn32p, val, 19, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_CALL: @@ -360,14 +348,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * R_RISCV_CALL relocates 8-byte region that consists * of the sequence of AUIPC and JALR. */ - /* calculate and check the pc relative offset. */ + /* Calculate and check the pc relative offset. */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); + val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 32) || (1UL << 32) <= val)) { + if (val <= -(1UL << 32) || (1UL << 32) <= val) { printf("kldload: huge offset against R_RISCV_CALL\n"); - return -1; + return (-1); } /* Relocate AUIPC. */ @@ -378,112 +367,91 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas /* Relocate JALR. */ before32_1 = insn32p[1]; insn32p[1] = insert_imm(insn32p[1], val, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x %08x -> %08x %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, insn32p[0], - before32_1, insn32p[1]); + printf("%p %c %-24s %08x %08x -> %08x %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, insn32p[0], before32_1, insn32p[1]); break; case R_RISCV_PCREL_HI20: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_I: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_S: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_HI20: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_I: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_S: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; default: From owner-svn-src-stable@freebsd.org Sat Nov 2 19:50:36 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF5AF161CF9; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758mr5dgSz46YQ; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A50DC4DD; Sat, 2 Nov 2019 19:50:36 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JoaFv051034; Sat, 2 Nov 2019 19:50:36 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2Joa6S051033; Sat, 2 Nov 2019 19:50:36 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021950.xA2Joa6S051033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354262 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 354262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 19:50:36 -0000 Author: mhorne Date: Sat Nov 2 19:50:36 2019 New Revision: 354262 URL: https://svnweb.freebsd.org/changeset/base/354262 Log: MFC r352730: Fix some broken relocation handling In a few cases, the symbol lookup is missing before attempting to perform the relocation. While the relocation types affected are currently unused, this results in an uninitialized variable warning, that is escalated to an error when building with clang. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21773 Modified: stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:48:42 2019 (r354261) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:50:36 2019 (r354262) @@ -374,6 +374,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_HI20: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -386,6 +390,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_I: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -397,6 +405,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_S: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -413,6 +425,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas if (error != 0) return (-1); + val = addr; insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); From owner-svn-src-stable@freebsd.org Sat Nov 2 19:52:23 2019 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA0F161E0D; Sat, 2 Nov 2019 19:52:23 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758pv0qxRz46ty; Sat, 2 Nov 2019 19:52:23 +0000 (UTC) (envelope-from mhorne@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 000B867C; Sat, 2 Nov 2019 19:52:22 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JqM0x056302; Sat, 2 Nov 2019 19:52:22 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JqMKE056301; Sat, 2 Nov 2019 19:52:22 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021952.xA2JqMKE056301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354263 - stable/12/lib/libthr/arch/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/lib/libthr/arch/riscv/include X-SVN-Commit-Revision: 354263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 19:52:23 -0000 Author: mhorne Date: Sat Nov 2 19:52:22 2019 New Revision: 354263 URL: https://svnweb.freebsd.org/changeset/base/354263 Log: MFC r353334: RISC-V: Fix an alignment warning in libthr Compiling with clang gives a loss-of-alignment error due the cast to uint8_t *. Since the TLS is always tcb aligned and TP_OFFSET is defined as sizeof(struct tcb) we can guarantee there is no misalignment. Silence the error by moving the offset into the inline assembly. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D21926 Modified: stable/12/lib/libthr/arch/riscv/include/pthread_md.h Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libthr/arch/riscv/include/pthread_md.h ============================================================================== --- stable/12/lib/libthr/arch/riscv/include/pthread_md.h Sat Nov 2 19:50:36 2019 (r354262) +++ stable/12/lib/libthr/arch/riscv/include/pthread_md.h Sat Nov 2 19:52:22 2019 (r354263) @@ -62,7 +62,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - __asm __volatile("mv tp, %0" :: "r"((uint8_t *)tcb + TP_OFFSET)); + __asm __volatile("addi tp, %0, %1" :: "r"(tcb), "I"(TP_OFFSET)); } /* @@ -71,11 +71,11 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - register uint8_t *_tp; + struct tcb *_tcb; - __asm __volatile("mv %0, tp" : "=r"(_tp)); + __asm __volatile("addi %0, tp, %1" : "=r"(_tcb) : "I"(-TP_OFFSET)); - return ((struct tcb *)(_tp - TP_OFFSET)); + return (_tcb); } static __inline struct pthread *