CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys
Module Name:src Committed By: riastradh Date: Tue Dec 28 17:51:23 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_context.h Log Message: zfs: Expose hostid to zfs, as in gethostid/sethostid(3). If set to nonzero, the hostid is recorded in the metadata of a zpool, and checked by `zpool import' when the pool has not been explicitly exported. After reboot, zpool import will not need `-f' to reimport the pool. Setting the hostid must be done explicitly through sysctl (or the sethostid(3) library call) on all ports except acorn32, amiga, mvme68k, newsmips, sparc, sparc64, sun2, and sun3. So for most users this change will have no immediate effect. But you can obviate the need for `zpool import -f' by adding `kern.hostid=123456789' to /etc/sysctl.conf and importing the pool one last time with `-f'. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.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/sys/zfs_context.h diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.4 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.3 Tue Feb 16 09:54:17 2021 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h Tue Dec 28 17:51:23 2021 @@ -130,6 +130,7 @@ extern "C" { #include #else /* !__NetBSD__ */ #include +#include #include #include @@ -165,7 +166,7 @@ extern "C" { #define td_rul_ru #define UID_NOBODY (32767) #define vnode_pager_setsize(vp, size) zfs_netbsd_setsize(vp, size) -#define zone_get_hostid(a) 0 +#define zone_get_hostid(a) ((unsigned)hostid) extern struct utsname utsname;
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys
Module Name:src Committed By: riastradh Date: Tue Dec 28 17:51:23 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_context.h Log Message: zfs: Expose hostid to zfs, as in gethostid/sethostid(3). If set to nonzero, the hostid is recorded in the metadata of a zpool, and checked by `zpool import' when the pool has not been explicitly exported. After reboot, zpool import will not need `-f' to reimport the pool. Setting the hostid must be done explicitly through sysctl (or the sethostid(3) library call) on all ports except acorn32, amiga, mvme68k, newsmips, sparc, sparc64, sun2, and sun3. So for most users this change will have no immediate effect. But you can obviate the need for `zpool import -f' by adding `kern.hostid=123456789' to /etc/sysctl.conf and importing the pool one last time with `-f'. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys
Module Name:src Committed By: hannken Date: Tue Feb 16 09:54:17 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_context.h Log Message: Use the right uid / gid for nobody:nobody like FreeBSD does. Prevents null pointer dereferences when ZFS replaces this illegal (according to IS_EPHEMERAL()) id with another illegal id in operation zfs_fuid_create_cred() and finally zfs_log_create() dereferences fuidp being NULL. Adresses PR misc/55042 (Panic when creating a directory on a NFS served ZFS) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.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/sys/zfs_context.h diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.3 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h:1.2 Sat Jun 22 09:48:39 2019 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h Tue Feb 16 09:54:17 2021 @@ -157,13 +157,13 @@ extern "C" { #define fm_panic panic #define getffd_getfile #define getminor(a) minor(a) -#define GID_NOBODY (-2) +#define GID_NOBODY (39) #define issig(x) (sigispending(curlwp, 0)) #define kmem_debugging() 0 #define releasef fd_putfile #define strfree(str) kmem_free((str), strlen(str)+1) #define td_rul_ru -#define UID_NOBODY (-2) +#define UID_NOBODY (32767) #define vnode_pager_setsize(vp, size) zfs_netbsd_setsize(vp, size) #define zone_get_hostid(a) 0
CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys
Module Name:src Committed By: hannken Date: Tue Feb 16 09:54:17 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: zfs_context.h Log Message: Use the right uid / gid for nobody:nobody like FreeBSD does. Prevents null pointer dereferences when ZFS replaces this illegal (according to IS_EPHEMERAL()) id with another illegal id in operation zfs_fuid_create_cred() and finally zfs_log_create() dereferences fuidp being NULL. Adresses PR misc/55042 (Panic when creating a directory on a NFS served ZFS) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.