CVS commit: src/doc

2021-07-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul 19 01:34:03 UTC 2021

Modified Files:
src/doc: 3RDPARTY

Log Message:
binutils 2.37 has been released.


To generate a diff of this commit:
cvs rdiff -u -r1.1807 -r1.1808 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1807 src/doc/3RDPARTY:1.1808
--- src/doc/3RDPARTY:1.1807	Sun Jul 11 21:28:17 2021
+++ src/doc/3RDPARTY	Mon Jul 19 01:34:03 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1807 2021/07/11 21:28:17 mrg Exp $
+#	$NetBSD: 3RDPARTY,v 1.1808 2021/07/19 01:34:03 rin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -498,11 +498,11 @@ When updating GDB, it is imperative to t
 
 Package:	binutils
 Version:	2.34
-Current Vers:	2.36.1
+Current Vers:	2.37
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/binutils/
 Home Page:	http://www.gnu.org/software/binutils/
-Date:		2021-03-15
+Date:		2021-07-19
 Mailing List:	bug-gnu-ut...@gnu.org
 Responsible:	thorpej, mrg
 License:	GPLv3, LGPLv3, GPLv2, LGPLv2, BSD



CVS commit: src/sys/miscfs/kernfs

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 19 01:33:53 UTC 2021

Modified Files:
src/sys/miscfs/kernfs: kernfs_vnops.c

Log Message:
Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.

Part 3; cvs randomly didn't commit all the files the first time, still
hunting down the files it skipped.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/miscfs/kernfs/kernfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/miscfs/kernfs/kernfs_vnops.c
diff -u src/sys/miscfs/kernfs/kernfs_vnops.c:1.171 src/sys/miscfs/kernfs/kernfs_vnops.c:1.172
--- src/sys/miscfs/kernfs/kernfs_vnops.c:1.171	Sun Jul 18 23:56:13 2021
+++ src/sys/miscfs/kernfs/kernfs_vnops.c	Mon Jul 19 01:33:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernfs_vnops.c,v 1.171 2021/07/18 23:56:13 dholland Exp $	*/
+/*	$NetBSD: kernfs_vnops.c,v 1.172 2021/07/19 01:33:53 dholland Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.171 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.172 2021/07/19 01:33:53 dholland Exp $");
 
 #include 
 #include 
@@ -137,8 +137,6 @@ const struct kernfs_fileop kernfs_defaul
 };
 
 int	kernfs_lookup(void *);
-#define	kernfs_create	genfs_eopnotsupp
-#define	kernfs_mknod	genfs_eopnotsupp
 int	kernfs_open(void *);
 int	kernfs_close(void *);
 int	kernfs_access(void *);
@@ -146,34 +144,15 @@ int	kernfs_getattr(void *);
 int	kernfs_setattr(void *);
 int	kernfs_read(void *);
 int	kernfs_write(void *);
-#define	kernfs_fcntl	genfs_fcntl
 int	kernfs_ioctl(void *);
-#define	kernfs_poll	genfs_poll
-#define kernfs_revoke	genfs_revoke
-#define	kernfs_fsync	genfs_nullop
-#define	kernfs_seek	genfs_nullop
-#define	kernfs_remove	genfs_eopnotsupp
 int	kernfs_link(void *);
-#define	kernfs_rename	genfs_eopnotsupp
-#define	kernfs_mkdir	genfs_eopnotsupp
-#define	kernfs_rmdir	genfs_eopnotsupp
 int	kernfs_symlink(void *);
 int	kernfs_readdir(void *);
-#define	kernfs_readlink	genfs_eopnotsupp
-#define	kernfs_abortop	genfs_abortop
 int	kernfs_inactive(void *);
 int	kernfs_reclaim(void *);
-#define	kernfs_lock	genfs_lock
-#define	kernfs_unlock	genfs_unlock
-#define	kernfs_bmap	genfs_badop
-#define	kernfs_strategy	genfs_eopnotsupp
 int	kernfs_print(void *);
-#define	kernfs_islocked	genfs_islocked
 int	kernfs_pathconf(void *);
-#define	kernfs_advlock	genfs_einval
-#define	kernfs_bwrite	genfs_eopnotsupp
 int	kernfs_getpages(void *);
-#define	kernfs_putpages	genfs_putpages
 
 static int	kernfs_xread(struct kernfs_node *, int, char **,
 size_t, size_t *);
@@ -184,8 +163,8 @@ const struct vnodeopv_entry_desc kernfs_
 	{ _default_desc, vn_default_error },
 	{ _parsepath_desc, genfs_parsepath },	/* parsepath */
 	{ _lookup_desc, kernfs_lookup },		/* lookup */
-	{ _create_desc, kernfs_create },		/* create */
-	{ _mknod_desc, kernfs_mknod },		/* mknod */
+	{ _create_desc, genfs_eopnotsupp },		/* create */
+	{ _mknod_desc, genfs_eopnotsupp },		/* mknod */
 	{ _open_desc, kernfs_open },		/* open */
 	{ _close_desc, kernfs_close },		/* close */
 	{ _access_desc, kernfs_access },		/* access */
@@ -196,35 +175,35 @@ const struct vnodeopv_entry_desc kernfs_
 	{ _write_desc, kernfs_write },		/* write */
 	{ _fallocate_desc, genfs_eopnotsupp },	/* fallocate */
 	{ _fdiscard_desc, genfs_eopnotsupp },	/* fdiscard */
-	{ _fcntl_desc, kernfs_fcntl },		/* fcntl */
+	{ _fcntl_desc, genfs_fcntl },		/* fcntl */
 	{ _ioctl_desc, kernfs_ioctl },		/* ioctl */
-	{ _poll_desc, kernfs_poll },		/* poll */
+	{ _poll_desc, genfs_poll },			/* poll */
 	{ _kqfilter_desc, genfs_kqfilter },		/* kqfilter */
-	{ _revoke_desc, kernfs_revoke },		/* revoke */
-	{ _fsync_desc, kernfs_fsync },		/* fsync */
-	{ _seek_desc, kernfs_seek },		/* seek */
-	{ _remove_desc, kernfs_remove },		/* remove */
+	{ _revoke_desc, genfs_revoke },		/* revoke */
+	{ _fsync_desc, genfs_nullop },		/* fsync */
+	{ _seek_desc, genfs_nullop },		/* seek */
+	{ _remove_desc, genfs_eopnotsupp },		/* remove */
 	{ _link_desc, kernfs_link },		/* link */
-	{ _rename_desc, kernfs_rename },		/* rename */
-	{ _mkdir_desc, kernfs_mkdir },		/* mkdir */
-	{ _rmdir_desc, kernfs_rmdir },		/* rmdir */
+	{ _rename_desc, genfs_eopnotsupp },		/* rename */
+	{ _mkdir_desc, genfs_eopnotsupp },		/* mkdir */
+	{ _rmdir_desc, genfs_eopnotsupp },		/* rmdir */
 	{ _symlink_desc, kernfs_symlink },		/* symlink */
 	{ _readdir_desc, kernfs_readdir },		/* readdir */
-	{ _readlink_desc, kernfs_readlink },	/* readlink */
-	{ _abortop_desc, kernfs_abortop },		/* abortop */
+	{ _readlink_desc, genfs_eopnotsupp },	/* readlink */
+	{ _abortop_desc, genfs_abortop },		/* abortop 

CVS commit: src/sys/fs

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 19 01:30:25 UTC 2021

Modified Files:
src/sys/fs/cd9660: cd9660_vnops.c
src/sys/fs/puffs: puffs_vnops.c
src/sys/fs/tmpfs: tmpfs_fifoops.c tmpfs_specops.c

Log Message:
Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.

Part 2; cvs randomly didn't commit these changes before, and then hid
them from me until I touched the files to force it to rethink. Dunno
what happened.

There's probably more of these, going to have to scan the tree the
hard way.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/fs/cd9660/cd9660_vnops.c
cvs rdiff -u -r1.220 -r1.221 src/sys/fs/puffs/puffs_vnops.c
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/tmpfs/tmpfs_fifoops.c
cvs rdiff -u -r1.15 -r1.16 src/sys/fs/tmpfs/tmpfs_specops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/cd9660/cd9660_vnops.c
diff -u src/sys/fs/cd9660/cd9660_vnops.c:1.60 src/sys/fs/cd9660/cd9660_vnops.c:1.61
--- src/sys/fs/cd9660/cd9660_vnops.c:1.60	Sun Jul 18 23:56:13 2021
+++ src/sys/fs/cd9660/cd9660_vnops.c	Mon Jul 19 01:30:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_vnops.c,v 1.60 2021/07/18 23:56:13 dholland Exp $	*/
+/*	$NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.60 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $");
 
 #include 
 #include 
@@ -829,21 +829,6 @@ cd9660_setattr(void *v)
 }
 
 /*
- * Global vfs data structures for isofs
- */
-#define	cd9660_create	genfs_eopnotsupp
-#define	cd9660_mknod	genfs_eopnotsupp
-#define	cd9660_write	genfs_eopnotsupp
-#define	cd9660_fsync	genfs_nullop
-#define	cd9660_remove	genfs_eopnotsupp
-#define	cd9660_rename	genfs_eopnotsupp
-#define	cd9660_mkdir	genfs_eopnotsupp
-#define	cd9660_rmdir	genfs_eopnotsupp
-#define	cd9660_advlock	genfs_einval
-#define	cd9660_bwrite	genfs_eopnotsupp
-#define cd9660_revoke	genfs_revoke
-
-/*
  * Global vfs data structures for cd9660
  */
 int (**cd9660_vnodeop_p)(void *);
@@ -851,34 +836,34 @@ const struct vnodeopv_entry_desc cd9660_
 	{ _default_desc, vn_default_error },
 	{ _parsepath_desc, genfs_parsepath },	/* parsepath */
 	{ _lookup_desc, cd9660_lookup },		/* lookup */
-	{ _create_desc, cd9660_create },		/* create */
-	{ _mknod_desc, cd9660_mknod },		/* mknod */
-	{ _open_desc, cd9660_open },		/* open */
-	{ _close_desc, cd9660_close },		/* close */
+	{ _create_desc, genfs_eopnotsupp },		/* create */
+	{ _mknod_desc, genfs_eopnotsupp },		/* mknod */
+	{ _open_desc, genfs_nullop },		/* open */
+	{ _close_desc, genfs_nullop },		/* close */
 	{ _access_desc, cd9660_access },		/* access */
 	{ _accessx_desc, genfs_accessx },		/* accessx */
 	{ _getattr_desc, cd9660_getattr },		/* getattr */
 	{ _setattr_desc, cd9660_setattr },		/* setattr */
 	{ _read_desc, cd9660_read },		/* read */
-	{ _write_desc, cd9660_write },		/* write */
+	{ _write_desc, genfs_eopnotsupp },		/* write */
 	{ _fallocate_desc, genfs_eopnotsupp },	/* fallocate */
 	{ _fdiscard_desc, genfs_eopnotsupp },	/* fdiscard */
 	{ _fcntl_desc, genfs_fcntl },		/* fcntl */
-	{ _ioctl_desc, cd9660_ioctl },		/* ioctl */
-	{ _poll_desc, cd9660_poll },		/* poll */
-	{ _revoke_desc, cd9660_revoke },		/* revoke */
-	{ _mmap_desc, cd9660_mmap },		/* mmap */
-	{ _fsync_desc, cd9660_fsync },		/* fsync */
-	{ _seek_desc, cd9660_seek },		/* seek */
-	{ _remove_desc, cd9660_remove },		/* remove */
+	{ _ioctl_desc, genfs_enoioctl },		/* ioctl */
+	{ _poll_desc, genfs_poll },			/* poll */
+	{ _revoke_desc, genfs_revoke },		/* revoke */
+	{ _mmap_desc, genfs_mmap },			/* mmap */
+	{ _fsync_desc, genfs_nullop },		/* fsync */
+	{ _seek_desc, genfs_seek },			/* seek */
+	{ _remove_desc, genfs_eopnotsupp },		/* remove */
 	{ _link_desc, cd9660_link },		/* link */
-	{ _rename_desc, cd9660_rename },		/* rename */
-	{ _mkdir_desc, cd9660_mkdir },		/* mkdir */
-	{ _rmdir_desc, cd9660_rmdir },		/* rmdir */
+	{ _rename_desc, genfs_eopnotsupp },		/* rename */
+	{ _mkdir_desc, genfs_eopnotsupp },		/* mkdir */
+	{ _rmdir_desc, genfs_eopnotsupp },		/* rmdir */
 	{ _symlink_desc, cd9660_symlink },		/* symlink */
 	{ _readdir_desc, cd9660_readdir },		/* readdir */
 	{ _readlink_desc, cd9660_readlink },	/* readlink */
-	{ _abortop_desc, cd9660_abortop },		/* abortop */
+	{ _abortop_desc, genfs_abortop },		/* abortop */
 	{ _inactive_desc, cd9660_inactive },	/* inactive */
 	{ _reclaim_desc, cd9660_reclaim },		/* reclaim */
 	{ _lock_desc, genfs_lock },			/* lock */
@@ -888,7 +873,7 @@ const struct vnodeopv_entry_desc 

CVS commit: src/sys/arch/alpha/pci

2021-07-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jul 19 01:06:14 UTC 2021

Modified Files:
src/sys/arch/alpha/pci: cia_dma.c ciavar.h tsp_dma.c tsvar.h

Log Message:
For CIA/Pyxis and Tsunami/Typhoon/Titan, save the firmware's idea of
the DMA window configuration, and restore it at shutdown time.  Make
sure that all assumptions we've made on the firmware's configuration
of DMA windows is correct.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/pci/cia_dma.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/alpha/pci/ciavar.h \
src/sys/arch/alpha/pci/tsp_dma.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/alpha/pci/tsvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/pci/cia_dma.c
diff -u src/sys/arch/alpha/pci/cia_dma.c:1.36 src/sys/arch/alpha/pci/cia_dma.c:1.37
--- src/sys/arch/alpha/pci/cia_dma.c:1.36	Sun Jul 18 05:09:47 2021
+++ src/sys/arch/alpha/pci/cia_dma.c	Mon Jul 19 01:06:14 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cia_dma.c,v 1.36 2021/07/18 05:09:47 thorpej Exp $ */
+/* $NetBSD: cia_dma.c,v 1.37 2021/07/19 01:06:14 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: cia_dma.c,v 1.36 2021/07/18 05:09:47 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cia_dma.c,v 1.37 2021/07/19 01:06:14 thorpej Exp $");
 
 #include 
 #include 
@@ -100,12 +100,49 @@ struct alpha_sgmap cia_pyxis_bug_sgmap;
 #define	CIA_PYXIS_BUG_BASE	(128UL*1024*1024)
 #define	CIA_PYXIS_BUG_SIZE	(2UL*1024*1024)
 
+static void
+cia_dma_shutdown(void *arg)
+{
+	struct cia_config *ccp = arg;
+	int i;
+
+	/*
+	 * Restore the original values, to make the firmware happy.
+	 */
+	for (i = 0; i < 4; i++) {
+		REGVAL(CIA_PCI_W0BASE + (i * 0x100)) =
+		ccp->cc_saved_windows.wbase[i];
+		alpha_mb();
+		REGVAL(CIA_PCI_W0MASK + (i * 0x100)) =
+		ccp->cc_saved_windows.wmask[i];
+		alpha_mb();
+		REGVAL(CIA_PCI_T0BASE + (i * 0x100)) =
+		ccp->cc_saved_windows.tbase[i];
+		alpha_mb();
+	}
+}
+
 void
 cia_dma_init(struct cia_config *ccp)
 {
 	bus_addr_t tbase;
 	bus_dma_tag_t t;
 	bus_dma_tag_t t_sg_hi = NULL;
+	int i;
+
+	/*
+	 * Save our configuration to restore at shutdown, just
+	 * in case the firmware would get cranky with us.
+	 */
+	for (i = 0; i < 4; i++) {
+		ccp->cc_saved_windows.wbase[i] =
+		REGVAL(CIA_PCI_W0BASE + (i * 0x100));
+		ccp->cc_saved_windows.wmask[i] =
+		REGVAL(CIA_PCI_W0MASK + (i * 0x100));
+		ccp->cc_saved_windows.tbase[i] =
+		REGVAL(CIA_PCI_T0BASE + (i * 0x100));
+	}
+	shutdownhook_establish(cia_dma_shutdown, ccp);
 
 	/*
 	 * If we have more than 1GB of RAM, then set up an sgmap-mapped
@@ -195,11 +232,17 @@ cia_dma_init(struct cia_config *ccp)
 	t->_dmamem_mmap = _bus_dmamem_mmap;
 
 	/*
-	 * The firmware has set up window 1 as a 1G direct-mapped DMA
-	 * window beginning at 1G.  We leave it alone.  Leave window
-	 * 0 alone until we reconfigure it for SGMAP-mapped DMA.
-	 * Windows 2 and 3 are already disabled.
+	 * The firmware will have set up window 1 as a 1G dirct-mapped
+	 * DMA window beginning at 1G.  While it's pretty safe to assume
+	 * this is the case, we'll go ahead and program the registers
+	 * as we expect as a belt-and-suspenders measure.
 	 */
+	REGVAL(CIA_PCI_W1BASE) = CIA_DIRECT_MAPPED_BASE | CIA_PCI_WnBASE_W_EN;
+	alpha_mb();
+	REGVAL(CIA_PCI_W1MASK) = CIA_PCI_WnMASK_1G;
+	alpha_mb();
+	REGVAL(CIA_PCI_T1BASE) = 0;
+	alpha_mb();
 
 	/*
 	 * Initialize the SGMAP(s).  Must align page table to at least 32k
@@ -248,6 +291,9 @@ cia_dma_init(struct cia_config *ccp)
 			panic("cia_dma_init: bad page table address");
 		REGVAL(CIA_PCI_T3BASE) = tbase;
 		alpha_mb();
+	} else {
+		REGVAL(CIA_PCI_W3BASE) = 0;
+		alpha_mb();
 	}
 
 	/*
@@ -261,7 +307,6 @@ cia_dma_init(struct cia_config *ccp)
 	 */
 	if ((ccp->cc_flags & CCF_ISPYXIS) != 0 && ccp->cc_rev <= 1) {
 		uint64_t *page_table;
-		int i;
 
 		cia_tlb_invalidate_fn =
 		cia_broken_pyxis_tlb_invalidate;
@@ -296,8 +341,12 @@ cia_dma_init(struct cia_config *ccp)
 			pci_sgmap_pte64_prefetch_spill_page_pte;
 		}
 		alpha_mb();
-	} else
+	} else {
+		REGVAL(CIA_PCI_W2BASE) = 0;
+		alpha_mb();
+
 		cia_tlb_invalidate_fn = cia_tlb_invalidate;
+	}
 
 	CIA_TLB_INVALIDATE();
 }

Index: src/sys/arch/alpha/pci/ciavar.h
diff -u src/sys/arch/alpha/pci/ciavar.h:1.21 src/sys/arch/alpha/pci/ciavar.h:1.22
--- src/sys/arch/alpha/pci/ciavar.h:1.21	Sat Jul 17 00:30:39 2021
+++ src/sys/arch/alpha/pci/ciavar.h	Mon Jul 19 01:06:14 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ciavar.h,v 1.21 2021/07/17 00:30:39 thorpej Exp $ */
+/* $NetBSD: ciavar.h,v 1.22 2021/07/19 01:06:14 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -65,6 +65,12 @@ struct cia_config {
 
 	struct extent *cc_io_ex, *cc_d_mem_ex, *cc_s_mem_ex;
 	int	cc_mallocsafe;
+
+	struct {
+	

CVS commit: src/sys/fs/ptyfs

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 18 23:57:34 UTC 2021

Modified Files:
src/sys/fs/ptyfs: ptyfs_vnops.c

Log Message:
Fix ptyfs link and symlink ops.

They were set (via macro obfuscation just eliminated) to
genfs_abortop, which is the wrong thing. These code paths are
currently inaccessible because of EROFS enforcement in namei, but if
either were reached odd behavior would likely ensue. Use
genfs_eopnotsupp like the rest of the ops that don't make sense here.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/fs/ptyfs/ptyfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/ptyfs/ptyfs_vnops.c
diff -u src/sys/fs/ptyfs/ptyfs_vnops.c:1.65 src/sys/fs/ptyfs/ptyfs_vnops.c:1.66
--- src/sys/fs/ptyfs/ptyfs_vnops.c:1.65	Sun Jul 18 23:57:14 2021
+++ src/sys/fs/ptyfs/ptyfs_vnops.c	Sun Jul 18 23:57:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptyfs_vnops.c,v 1.65 2021/07/18 23:57:14 dholland Exp $	*/
+/*	$NetBSD: ptyfs_vnops.c,v 1.66 2021/07/18 23:57:34 dholland Exp $	*/
 
 /*
  * Copyright (c) 1993, 1995
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.65 2021/07/18 23:57:14 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ptyfs_vnops.c,v 1.66 2021/07/18 23:57:34 dholland Exp $");
 
 #include 
 #include 
@@ -167,11 +167,11 @@ const struct vnodeopv_entry_desc ptyfs_v
 	{ _fsync_desc, genfs_nullop },		/* fsync */
 	{ _seek_desc, genfs_nullop },		/* seek */
 	{ _remove_desc, genfs_eopnotsupp },		/* remove */
-	{ _link_desc, genfs_abortop },		/* link */
+	{ _link_desc, genfs_eopnotsupp },		/* link */
 	{ _rename_desc, genfs_eopnotsupp },		/* rename */
 	{ _mkdir_desc, genfs_eopnotsupp },		/* mkdir */
 	{ _rmdir_desc, genfs_eopnotsupp },		/* rmdir */
-	{ _symlink_desc, genfs_abortop },		/* symlink */
+	{ _symlink_desc, genfs_eopnotsupp },	/* symlink */
 	{ _readdir_desc, ptyfs_readdir },		/* readdir */
 	{ _readlink_desc, genfs_eopnotsupp },	/* readlink */
 	{ _abortop_desc, genfs_abortop },		/* abortop */



CVS commit: src

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 18 23:57:16 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/sys/fs/adosfs: advnops.c
src/sys/fs/cd9660: cd9660_node.h
src/sys/fs/filecorefs: filecore_node.h filecore_vnops.c
src/sys/fs/msdosfs: denode.h msdosfs_vnops.c
src/sys/fs/ptyfs: ptyfs_vnops.c
src/sys/fs/tmpfs: tmpfs_fifoops.h tmpfs_specops.h tmpfs_vnops.c
tmpfs_vnops.h
src/sys/miscfs/deadfs: dead_vnops.c
src/sys/miscfs/procfs: procfs_vnops.c
src/sys/miscfs/specfs: spec_vnops.c specdev.h
src/sys/nfs: nfs_vnops.c nfsnode.h
src/sys/ufs/ext2fs: ext2fs_vnops.c
src/sys/ufs/ffs: ffs_vnops.c
src/sys/ufs/lfs: lfs_vnops.c ulfs_extern.h
src/sys/ufs/mfs: mfs_extern.h mfs_vnops.c mfsnode.h
src/sys/ufs/ufs: ufs_extern.h

Log Message:
Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.56 -r1.57 src/sys/fs/adosfs/advnops.c
cvs rdiff -u -r1.16 -r1.17 src/sys/fs/cd9660/cd9660_node.h
cvs rdiff -u -r1.6 -r1.7 src/sys/fs/filecorefs/filecore_node.h
cvs rdiff -u -r1.48 -r1.49 src/sys/fs/filecorefs/filecore_vnops.c
cvs rdiff -u -r1.25 -r1.26 src/sys/fs/msdosfs/denode.h
cvs rdiff -u -r1.105 -r1.106 src/sys/fs/msdosfs/msdosfs_vnops.c
cvs rdiff -u -r1.64 -r1.65 src/sys/fs/ptyfs/ptyfs_vnops.c
cvs rdiff -u -r1.8 -r1.9 src/sys/fs/tmpfs/tmpfs_fifoops.h \
src/sys/fs/tmpfs/tmpfs_specops.h
cvs rdiff -u -r1.146 -r1.147 src/sys/fs/tmpfs/tmpfs_vnops.c
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/tmpfs/tmpfs_vnops.h
cvs rdiff -u -r1.64 -r1.65 src/sys/miscfs/deadfs/dead_vnops.c
cvs rdiff -u -r1.217 -r1.218 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.182 -r1.183 src/sys/miscfs/specfs/spec_vnops.c
cvs rdiff -u -r1.45 -r1.46 src/sys/miscfs/specfs/specdev.h
cvs rdiff -u -r1.319 -r1.320 src/sys/nfs/nfs_vnops.c
cvs rdiff -u -r1.74 -r1.75 src/sys/nfs/nfsnode.h
cvs rdiff -u -r1.134 -r1.135 src/sys/ufs/ext2fs/ext2fs_vnops.c
cvs rdiff -u -r1.136 -r1.137 src/sys/ufs/ffs/ffs_vnops.c
cvs rdiff -u -r1.338 -r1.339 src/sys/ufs/lfs/lfs_vnops.c
cvs rdiff -u -r1.25 -r1.26 src/sys/ufs/lfs/ulfs_extern.h
cvs rdiff -u -r1.31 -r1.32 src/sys/ufs/mfs/mfs_extern.h
cvs rdiff -u -r1.62 -r1.63 src/sys/ufs/mfs/mfs_vnops.c
cvs rdiff -u -r1.21 -r1.22 src/sys/ufs/mfs/mfsnode.h
cvs rdiff -u -r1.86 -r1.87 src/sys/ufs/ufs/ufs_extern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.73 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.74
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.73	Sun Jul 18 23:56:12 2021
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Sun Jul 18 23:57:13 2021
@@ -6337,13 +6337,6 @@ const struct genfs_ops zfs_genfsops = {
 	.gop_putrange = zfs_netbsd_gop_putrange,
 };
 
-#define	zfs_netbsd_lock		genfs_lock
-#define	zfs_netbsd_unlock	genfs_unlock
-#define	zfs_netbsd_islocked	genfs_islocked
-#define zfs_netbsd_seek		genfs_seek
-#define zfs_netbsd_mmap		genfs_mmap
-#define zfs_netbsd_fcntl	genfs_fcntl
-
 int (**zfs_vnodeop_p)(void *);
 const struct vnodeopv_entry_desc zfs_vnodeop_entries[] = {
 	{ _default_desc,		vn_default_error },
@@ -6366,8 +6359,8 @@ const struct vnodeopv_entry_desc zfs_vno
 	{ _fsync_desc,		zfs_netbsd_fsync },
 	{ _remove_desc,		zfs_netbsd_remove },
 	{ _link_desc,		zfs_netbsd_link },
-	{ _lock_desc,		zfs_netbsd_lock },
-	{ _unlock_desc,		zfs_netbsd_unlock },
+	{ _lock_desc,		genfs_lock },
+	{ _unlock_desc,		genfs_unlock },
 	{ _rename_desc,		zfs_netbsd_rename },
 	{ _mkdir_desc,		zfs_netbsd_mkdir },
 	{ _rmdir_desc,		zfs_netbsd_rmdir },
@@ -6377,14 +6370,14 @@ const struct vnodeopv_entry_desc zfs_vno
 	{ _inactive_desc,		zfs_netbsd_inactive },
 	{ _reclaim_desc,		zfs_netbsd_reclaim },
 	{ _pathconf_desc,		zfs_netbsd_pathconf },
-	{ _seek_desc,		zfs_netbsd_seek },
+	{ _seek_desc,		genfs_seek },
 	{ _getpages_desc,		zfs_netbsd_getpages },
 	{ _putpages_desc,		zfs_netbsd_putpages },
-	{ _mmap_desc,		zfs_netbsd_mmap },
-	{ _islocked_desc,		zfs_netbsd_islocked },
+	{ _mmap_desc,		genfs_mmap },
+	{ _islocked_desc,		genfs_islocked },
 	{ _advlock_desc,		zfs_netbsd_advlock },
 	{ _print_desc,		zfs_netbsd_print },
-	{ _fcntl_desc,		zfs_netbsd_fcntl },
+	{ _fcntl_desc,		genfs_fcntl },
 	{ NULL, NULL }
 };
 
@@ -6403,14 +6396,14 @@ const struct vnodeopv_entry_desc zfs_spe
 	{ _read_desc,		/**/zfs_netbsd_read },
 	{ 

CVS commit: src

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 18 23:56:14 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/sys/fs/cd9660: cd9660_vnops.c
src/sys/fs/efs: efs_vnops.c
src/sys/fs/hfs: hfs_vnops.c
src/sys/fs/puffs: puffs_vnops.c
src/sys/fs/tmpfs: tmpfs_fifoops.c tmpfs_specops.c
src/sys/fs/v7fs: v7fs_extern.c
src/sys/miscfs/fifofs: fifo.h
src/sys/miscfs/kernfs: kernfs_vnops.c
src/sys/miscfs/specfs: specdev.h
src/sys/nfs: nfs_vnops.c
src/sys/rump/librump/rumpvfs: rumpfs.c
src/sys/ufs/chfs: chfs_vnops.c
src/sys/ufs/ext2fs: ext2fs_vnops.c
src/sys/ufs/ffs: ffs_vnops.c
src/sys/ufs/lfs: lfs_vnops.c

Log Message:
Use macros for the canned parts of device and fifo vnode op tables.

Add GENFS_SPECOP_ENTRIES and GENFS_FIFOOP_ENTRIES macros that contain
the portion of the vnode ops table declaration that is
(conservatively) the same in every fs. Use these in every fs that
supports devices and/or fifos with separate ops tables.

Note that ptyfs works differently (it has one type of vnode with
open-coded dispatch to the specfs code, which I haven't changed in
this commit) and rump/librump/rumpvfs/rumpfs.c has an indirect dynamic
dispatch that already does more or less the same thing, which I also
haven't changed.

Also note that this anticipates a few bits in the next changeset here
and there, and adds missing but unreachable calls in some cases (e.g.
most fses weren't defining whiteout on devices and fifos, but it isn't
reachable there), and it changes parsepath on devices and fifos to
genfs_badop from genfs_parsepath (but it's not reachable there
either).

It appears that devices in kernfs were missing kqfilter, so it's
possible that if you try to use kqueue on /kern/rootdev that it'll
explode.

And finally note that the ops declaration tables aren't
order-dependent. (Other than vop_default_desc has to come first.)
Otherwise this wouldn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.59 -r1.60 src/sys/fs/cd9660/cd9660_vnops.c
cvs rdiff -u -r1.42 -r1.43 src/sys/fs/efs/efs_vnops.c
cvs rdiff -u -r1.38 -r1.39 src/sys/fs/hfs/hfs_vnops.c
cvs rdiff -u -r1.219 -r1.220 src/sys/fs/puffs/puffs_vnops.c
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/tmpfs/tmpfs_fifoops.c
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/tmpfs/tmpfs_specops.c
cvs rdiff -u -r1.8 -r1.9 src/sys/fs/v7fs/v7fs_extern.c
cvs rdiff -u -r1.26 -r1.27 src/sys/miscfs/fifofs/fifo.h
cvs rdiff -u -r1.170 -r1.171 src/sys/miscfs/kernfs/kernfs_vnops.c
cvs rdiff -u -r1.44 -r1.45 src/sys/miscfs/specfs/specdev.h
cvs rdiff -u -r1.318 -r1.319 src/sys/nfs/nfs_vnops.c
cvs rdiff -u -r1.164 -r1.165 src/sys/rump/librump/rumpvfs/rumpfs.c
cvs rdiff -u -r1.44 -r1.45 src/sys/ufs/chfs/chfs_vnops.c
cvs rdiff -u -r1.133 -r1.134 src/sys/ufs/ext2fs/ext2fs_vnops.c
cvs rdiff -u -r1.135 -r1.136 src/sys/ufs/ffs/ffs_vnops.c
cvs rdiff -u -r1.337 -r1.338 src/sys/ufs/lfs/lfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.72 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.73
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.72	Fri Jul  2 17:14:36 2021
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Sun Jul 18 23:56:12 2021
@@ -6394,10 +6394,7 @@ const struct vnodeopv_desc zfs_vnodeop_o
 int (**zfs_specop_p)(void *);
 const struct vnodeopv_entry_desc zfs_specop_entries[] = {
 	{ _default_desc,		vn_default_error },
-	{ _lookup_desc,		spec_lookup },
-	{ _create_desc,		spec_create },
-	{ _mknod_desc,		spec_mknod },
-	{ _open_desc,		spec_open },
+	GENFS_SPECOP_ENTRIES,
 	{ _close_desc,		spec_close },
 	{ _access_desc,		zfs_netbsd_access },
 	{ _accessx_desc,		genfs_accessx },
@@ -6405,31 +6402,12 @@ const struct vnodeopv_entry_desc zfs_spe
 	{ _setattr_desc,		zfs_netbsd_setattr },
 	{ _read_desc,		/**/zfs_netbsd_read },
 	{ _write_desc,		/**/zfs_netbsd_write },
-	{ _ioctl_desc,		spec_ioctl },
-	{ _poll_desc,		spec_poll },
-	{ _kqfilter_desc,		spec_kqfilter },
-	{ _revoke_desc,		spec_revoke },
 	{ _fsync_desc,		zfs_spec_fsync },
-	{ _remove_desc,		spec_remove },
-	{ _link_desc,		spec_link },
 	{ _lock_desc,		zfs_netbsd_lock },
 	{ _unlock_desc,		zfs_netbsd_unlock },
-	{ _rename_desc,		spec_rename },
-	{ _mkdir_desc,		spec_mkdir },
-	{ _rmdir_desc,		spec_rmdir },
-	{ _symlink_desc,		spec_symlink },
-	{ _readdir_desc,		spec_readdir },
-	{ _readlink_desc,		spec_readlink },
 	{ _inactive_desc,		zfs_netbsd_inactive },
 	{ _reclaim_desc,		zfs_netbsd_reclaim },
-	{ _pathconf_desc,		spec_pathconf },
-	{ _seek_desc,		spec_seek },
-	{ _getpages_desc,		spec_getpages },
-	{ 

CVS commit: src/sys/arch/alpha/pci

2021-07-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Jul 18 19:58:34 UTC 2021

Modified Files:
src/sys/arch/alpha/pci: tsp_dma.c

Log Message:
According to section 8.1.2.2 of the Tsunami/Typhoon hardware reference
manual (DS-0025A-TE), the SGMAP TLB is arranged as 168 locations of 4
consecutive quadwords.  It seems that on some revisions of the Pchip,
SGMAP translation is not perfectly reliable unless we align the DMA
segments to the TLBs natural boundaries (observed on the API CS20).

N.B. the Titan (as observed on a Compaq DS25) does not seem to have this
problem, but we'll play it safe and run this way on both variants.

PR port-alpha/40604.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/alpha/pci/tsp_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/pci/tsp_dma.c
diff -u src/sys/arch/alpha/pci/tsp_dma.c:1.20 src/sys/arch/alpha/pci/tsp_dma.c:1.21
--- src/sys/arch/alpha/pci/tsp_dma.c:1.20	Sun Jul 18 05:09:47 2021
+++ src/sys/arch/alpha/pci/tsp_dma.c	Sun Jul 18 19:58:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tsp_dma.c,v 1.20 2021/07/18 05:09:47 thorpej Exp $ */
+/* $NetBSD: tsp_dma.c,v 1.21 2021/07/18 19:58:34 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2021 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tsp_dma.c,v 1.20 2021/07/18 05:09:47 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsp_dma.c,v 1.21 2021/07/18 19:58:34 thorpej Exp $");
 
 #include 
 #include 
@@ -187,6 +187,20 @@ tsp_dma_init(struct tsp_config *pcp)
 		t->_next_window = NULL;
 		t->_boundary = 0;
 		t->_sgmap = >pc_sgmap_hi;
+		/*
+		 * According to section 8.1.2.2 of the Tsunami/Typhoon
+		 * hardware reference manual (DS-0025A-TE), the SGMAP
+		 * TLB is arranged as 168 locations of 4 consecutive
+		 * quadwords.  It seems that on some revisions of the
+		 * Pchip, SGMAP translation is not perfectly reliable
+		 * unless we align the DMA segments to the TLBs natural
+		 * boundaries (observed on the API CS20).
+		 *
+		 * N.B. the Titan (as observed on a Compaq DS25) does not
+		 * seem to have this problem, but we'll play it safe and
+		 * run this way on both variants.
+		 */
+		t->_sgmap_minalign = PAGE_SIZE * 4;
 		t->_pfthresh = TSP_SGMAP_PFTHRESH;
 		t->_get_tag = tsp_dma_get_tag;
 		t->_dmamap_create = alpha_sgmap_dmamap_create;
@@ -267,6 +281,11 @@ tsp_dma_init(struct tsp_config *pcp)
 	t->_next_window = NULL;
 	t->_boundary = 0;
 	t->_sgmap = >pc_sgmap_lo;
+	/*
+	 * This appears to be needed to make DMA on the ALI southbridge
+	 * that's present in some systems happy.  ???
+	 */
+	t->_sgmap_minalign = (64UL * 1024);
 	t->_pfthresh = TSP_SGMAP_PFTHRESH;
 	t->_get_tag = tsp_dma_get_tag;
 	t->_dmamap_create = alpha_sgmap_dmamap_create;



CVS commit: src/usr.bin/aiomixer

2021-07-18 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Jul 18 11:45:31 UTC 2021

Modified Files:
src/usr.bin/aiomixer: main.c

Log Message:
aiomixer: Honor terminal colors. Looks better in cool-retro-term.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/aiomixer/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/aiomixer/main.c
diff -u src/usr.bin/aiomixer/main.c:1.3 src/usr.bin/aiomixer/main.c:1.4
--- src/usr.bin/aiomixer/main.c:1.3	Thu Jul 15 06:57:10 2021
+++ src/usr.bin/aiomixer/main.c	Sun Jul 18 11:45:31 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.3 2021/07/15 06:57:10 nia Exp $ */
+/* $NetBSD: main.c,v 1.4 2021/07/18 11:45:31 nia Exp $ */
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -537,6 +537,7 @@ main(int argc, char **argv)
 
 	if (has_colors()) {
 		start_color();
+		use_default_colors();
 		init_pair(COLOR_CONTROL_SELECTED, COLOR_BLUE, COLOR_BLACK);
 		init_pair(COLOR_LEVELS, COLOR_GREEN, COLOR_BLACK);
 		init_pair(COLOR_SET_SELECTED, COLOR_BLACK, COLOR_GREEN);



CVS commit: src/sys/kern

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 18 09:30:36 UTC 2021

Modified Files:
src/sys/kern: vfs_vnops.c

Log Message:
Fix confusion arising from whether FOLLOW or NOFOLLOW is 0.

In vn_open, don't set and then throw away FOLLOW, and clarify the
comment about requesting FOLLOW/NOFOLLOW behavior.

Related to PR 56316.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/kern/vfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.220 src/sys/kern/vfs_vnops.c:1.221
--- src/sys/kern/vfs_vnops.c:1.220	Thu Jul  1 15:53:20 2021
+++ src/sys/kern/vfs_vnops.c	Sun Jul 18 09:30:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.221 2021/07/18 09:30:36 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.221 2021/07/18 09:30:36 dholland Exp $");
 
 #include "veriexec.h"
 
@@ -155,8 +155,9 @@ const struct fileops vnops = {
  * EOPNOTSUPP will be produced in the cases that would otherwise return
  * a file descriptor.
  *
- * Note that callers that want NOFOLLOW should pass O_NOFOLLOW in fmode,
- * not NOFOLLOW in nmode.
+ * Note that callers that want no-follow behavior should pass
+ * O_NOFOLLOW in fmode. Neither FOLLOW nor NOFOLLOW in nmode is
+ * honored.
  */
 int
 vn_open(struct vnode *at_dvp, struct pathbuf *pb,
@@ -179,7 +180,7 @@ vn_open(struct vnode *at_dvp, struct pat
 	if ((fmode & (O_CREAT | O_DIRECTORY)) == (O_CREAT | O_DIRECTORY))
 		return EINVAL;
 
-	NDINIT(, LOOKUP, FOLLOW | nmode, pb);
+	NDINIT(, LOOKUP, nmode, pb);
 	if (at_dvp != NULL)
 		NDAT(, at_dvp);
 



CVS commit: src/external/cddl/osnet/sys/sys

2021-07-18 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jul 18 07:22:22 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: vnode.h

Log Message:
PR kern/56316: vn_open doesn't follow symlinks

remove setting of O_NOFOLLOW. restores ZFS being able
to open devices via symlinks again.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/cddl/osnet/sys/sys/vnode.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/sys/sys/vnode.h
diff -u src/external/cddl/osnet/sys/sys/vnode.h:1.19 src/external/cddl/osnet/sys/sys/vnode.h:1.20
--- src/external/cddl/osnet/sys/sys/vnode.h:1.19	Tue Jun 29 22:40:53 2021
+++ src/external/cddl/osnet/sys/sys/vnode.h	Sun Jul 18 07:22:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode.h,v 1.19 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: vnode.h,v 1.20 2021/07/18 07:22:22 kardel Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -246,8 +246,6 @@ zfs_vn_open(const char *pnamep, enum uio
 	ASSERT(crwhy == CRCREAT);
 	ASSERT(umask == 0);
 
-	filemode |= O_NOFOLLOW;
-
 	pb = pathbuf_create(pnamep);
 	error = vn_open(NULL, pb, 0, filemode, createmode, vpp, NULL, NULL);
 	if (error == 0) {



CVS commit: src/sys/kern

2021-07-18 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jul 18 06:57:28 UTC 2021

Modified Files:
src/sys/kern: kern_ksyms.c

Log Message:
skip symbol tables that were unloaded again to avoid EFAULT when reading
ksyms.

also restore TAILQ_FOREACH idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/kern/kern_ksyms.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.97 src/sys/kern/kern_ksyms.c:1.98
--- src/sys/kern/kern_ksyms.c:1.97	Thu Jun  3 09:22:47 2021
+++ src/sys/kern/kern_ksyms.c	Sun Jul 18 06:57:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.97 2021/06/03 09:22:47 riastradh Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.98 2021/07/18 06:57:28 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.97 2021/06/03 09:22:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.98 2021/07/18 06:57:28 mlelstv Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_copy_symtab.h"
@@ -1084,9 +1084,9 @@ ksymsread(dev_t dev, struct uio *uio, in
 	 * Copy out the symbol table.
 	 */
 	filepos = sizeof(struct ksyms_hdr);
-	for (st = TAILQ_FIRST(_symtabs);
-	 ;
-	 st = TAILQ_NEXT(st, sd_queue)) {
+	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_symsize + filepos) {



CVS commit: src/tests/usr.sbin/execsnoop

2021-07-18 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 18 06:24:58 UTC 2021

Modified Files:
src/tests/usr.sbin/execsnoop: t_execsnoop.sh

Log Message:
Mark t_execsnoop xfail (PR 53417)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.sbin/execsnoop/t_execsnoop.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/execsnoop/t_execsnoop.sh
diff -u src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.3 src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.4
--- src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.3	Sat Jul 11 09:55:26 2020
+++ src/tests/usr.sbin/execsnoop/t_execsnoop.sh	Sun Jul 18 06:24:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_execsnoop.sh,v 1.3 2020/07/11 09:55:26 jruoho Exp $
+# $NetBSD: t_execsnoop.sh,v 1.4 2021/07/18 06:24:58 dholland Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,6 +37,7 @@ basic_head() {
 }
 
 basic_body() {
+	atf_expect_fail "PR kern/53417"
 
 	n=10
 	atf_check -s exit:0 -o ignore -e empty -x "execsnoop > $tmp &"