aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
committerMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
commit0be360124f8f108f73365e31448e7550f877f3ac (patch)
tree78557e980720fdcfd76497e6630c29ce1688559c /lib
parente2228bd99047bb6a0cef0da931147b1f28f155c2 (diff)
downloadsrc-vendor/openzfs.tar.gz
src-vendor/openzfs.zip
Update OpenZFS to 2.0.0-rc3-gbd565fvendor/openzfs/2.0.0-rc3-gfc5966vendor/openzfs
Notes
Notes: svn path=/vendor-sys/openzfs/dist/; revision=366774 svn path=/vendor-sys/openzfs/2.0.0-rc3-gfc5966/; revision=366775; tag=vendor/openzfs/2.0.0-rc3-gfc5966
Diffstat (limited to 'lib')
-rw-r--r--lib/libspl/include/os/freebsd/sys/param.h4
-rw-r--r--lib/libspl/include/sys/acl.h66
-rw-r--r--lib/libspl/os/freebsd/getmntany.c4
-rw-r--r--lib/libzfs/libzfs_sendrecv.c25
-rw-r--r--lib/libzfs/libzfs_util.c3
-rw-r--r--lib/libzfs/os/freebsd/libzfs_compat.c21
-rw-r--r--lib/libzfsbootenv/libzfsbootenv.pc.in2
-rw-r--r--lib/libzutil/os/linux/zutil_import_os.c6
8 files changed, 67 insertions, 64 deletions
diff --git a/lib/libspl/include/os/freebsd/sys/param.h b/lib/libspl/include/os/freebsd/sys/param.h
index 7c23b670591a..cb5260ea3d7e 100644
--- a/lib/libspl/include/os/freebsd/sys/param.h
+++ b/lib/libspl/include/os/freebsd/sys/param.h
@@ -45,10 +45,6 @@
*/
#define MAXNAMELEN 256
-#ifndef IN_BASE
-#define UID_NOBODY 60001 /* user ID no body */
-#define GID_NOBODY UID_NOBODY
-#endif
#define UID_NOACCESS 60002 /* user ID no access */
#define MAXUID UINT32_MAX /* max user id */
diff --git a/lib/libspl/include/sys/acl.h b/lib/libspl/include/sys/acl.h
index e6df864f850f..31168421b088 100644
--- a/lib/libspl/include/sys/acl.h
+++ b/lib/libspl/include/sys/acl.h
@@ -19,8 +19,12 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2017 RackTop Systems.
*/
#ifndef _SYS_ACL_H
@@ -75,23 +79,24 @@ typedef struct acl_info acl_t;
/*
* The following are defined for ace_t.
*/
-#define ACE_READ_DATA 0x00000001
-#define ACE_LIST_DIRECTORY 0x00000001
-#define ACE_WRITE_DATA 0x00000002
-#define ACE_ADD_FILE 0x00000002
-#define ACE_APPEND_DATA 0x00000004
-#define ACE_ADD_SUBDIRECTORY 0x00000004
-#define ACE_READ_NAMED_ATTRS 0x00000008
-#define ACE_WRITE_NAMED_ATTRS 0x00000010
-#define ACE_EXECUTE 0x00000020
-#define ACE_DELETE_CHILD 0x00000040
-#define ACE_READ_ATTRIBUTES 0x00000080
-#define ACE_WRITE_ATTRIBUTES 0x00000100
-#define ACE_DELETE 0x00010000
-#define ACE_READ_ACL 0x00020000
-#define ACE_WRITE_ACL 0x00040000
-#define ACE_WRITE_OWNER 0x00080000
-#define ACE_SYNCHRONIZE 0x00100000
+#define ACE_READ_DATA 0x00000001 /* file: read data */
+#define ACE_LIST_DIRECTORY 0x00000001 /* dir: list files */
+#define ACE_WRITE_DATA 0x00000002 /* file: write data */
+#define ACE_ADD_FILE 0x00000002 /* dir: create file */
+#define ACE_APPEND_DATA 0x00000004 /* file: append data */
+#define ACE_ADD_SUBDIRECTORY 0x00000004 /* dir: create subdir */
+#define ACE_READ_NAMED_ATTRS 0x00000008 /* FILE_READ_EA */
+#define ACE_WRITE_NAMED_ATTRS 0x00000010 /* FILE_WRITE_EA */
+#define ACE_EXECUTE 0x00000020 /* file: execute */
+#define ACE_TRAVERSE 0x00000020 /* dir: lookup name */
+#define ACE_DELETE_CHILD 0x00000040 /* dir: unlink child */
+#define ACE_READ_ATTRIBUTES 0x00000080 /* (all) stat, etc. */
+#define ACE_WRITE_ATTRIBUTES 0x00000100 /* (all) utimes, etc. */
+#define ACE_DELETE 0x00010000 /* (all) unlink self */
+#define ACE_READ_ACL 0x00020000 /* (all) getsecattr */
+#define ACE_WRITE_ACL 0x00040000 /* (all) setsecattr */
+#define ACE_WRITE_OWNER 0x00080000 /* (all) chown */
+#define ACE_SYNCHRONIZE 0x00100000 /* (all) */
#define ACE_FILE_INHERIT_ACE 0x0001
#define ACE_DIRECTORY_INHERIT_ACE 0x0002
@@ -116,8 +121,6 @@ typedef struct acl_info acl_t;
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
ACL_DEFAULTED)
-#ifdef _KERNEL
-
/*
* These are only applicable in a CIFS context.
*/
@@ -137,6 +140,8 @@ typedef struct acl_info acl_t;
#define ACE_ALL_TYPES 0x001F
+#if defined(_KERNEL)
+
typedef struct ace_object {
uid_t a_who; /* uid or gid */
uint32_t a_access_mask; /* read,write,... */
@@ -154,6 +159,21 @@ typedef struct ace_object {
ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
+#define ACE_ALL_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA| \
+ ACE_WRITE_ATTRIBUTES|ACE_WRITE_NAMED_ATTRS|ACE_WRITE_ACL| \
+ ACE_WRITE_OWNER|ACE_DELETE|ACE_DELETE_CHILD)
+
+#define ACE_READ_PERMS (ACE_READ_DATA|ACE_READ_ACL|ACE_READ_ATTRIBUTES| \
+ ACE_READ_NAMED_ATTRS)
+
+#define ACE_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA|ACE_WRITE_ATTRIBUTES| \
+ ACE_WRITE_NAMED_ATTRS)
+
+#define ACE_MODIFY_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
+ ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
+ ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
+ ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_SYNCHRONIZE)
+
/*
* The following flags are supported by both NFSv4 ACLs and ace_t.
*/
@@ -217,6 +237,7 @@ typedef struct ace_object {
#define ACL_APPEND_ID 0x1 /* append uid/gid to user/group entries */
#define ACL_COMPACT_FMT 0x2 /* build ACL in ls -V format */
#define ACL_NORESOLVE 0x4 /* don't do name service lookups */
+#define ACL_SID_FMT 0x8 /* use usersid/groupsid when appropriate */
/*
* Legacy aclcheck errors for aclent_t ACLs
@@ -272,13 +293,8 @@ extern int cmp2acls(void *, void *);
#endif /* !defined(_KERNEL) */
-#if defined(__STDC__)
extern int acl(const char *path, int cmd, int cnt, void *buf);
extern int facl(int fd, int cmd, int cnt, void *buf);
-#else /* !__STDC__ */
-extern int acl();
-extern int facl();
-#endif /* defined(__STDC__) */
#ifdef __cplusplus
}
diff --git a/lib/libspl/os/freebsd/getmntany.c b/lib/libspl/os/freebsd/getmntany.c
index b41e763cee43..0ef24059e84f 100644
--- a/lib/libspl/os/freebsd/getmntany.c
+++ b/lib/libspl/os/freebsd/getmntany.c
@@ -37,10 +37,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#define BUFSIZE (MNT_LINE_MAX + 2)
-
-__thread char buf[BUFSIZE];
-
int
getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
{
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index b46a4f122c47..3de7d7d9cc26 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -2119,8 +2119,6 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
avl_tree_t *fsavl = NULL;
static uint64_t holdseq;
int spa_version;
- pthread_t tid = 0;
- int pipefd[2];
int featureflags = 0;
FILE *fout;
@@ -2172,10 +2170,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
/* dump each stream */
sdd.fromsnap = fromsnap;
sdd.tosnap = tosnap;
- if (tid != 0)
- sdd.outfd = pipefd[0];
- else
- sdd.outfd = outfd;
+ sdd.outfd = outfd;
sdd.replicate = flags->replicate;
sdd.doall = flags->doall;
sdd.fromorigin = flags->fromorigin;
@@ -2278,13 +2273,6 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
if (err == 0 && !sdd.seento)
err = ENOENT;
- if (tid != 0) {
- if (err != 0)
- (void) pthread_cancel(tid);
- (void) close(pipefd[0]);
- (void) pthread_join(tid, NULL);
- }
-
if (sdd.cleanup_fd != -1) {
VERIFY(0 == close(sdd.cleanup_fd));
sdd.cleanup_fd = -1;
@@ -2313,11 +2301,6 @@ err_out:
if (sdd.cleanup_fd != -1)
VERIFY(0 == close(sdd.cleanup_fd));
- if (tid != 0) {
- (void) pthread_cancel(tid);
- (void) close(pipefd[0]);
- (void) pthread_join(tid, NULL);
- }
return (err);
}
@@ -4108,7 +4091,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
char errbuf[1024];
const char *chopprefix;
boolean_t newfs = B_FALSE;
- boolean_t stream_wantsnewfs;
+ boolean_t stream_wantsnewfs, stream_resumingnewfs;
boolean_t newprops = B_FALSE;
uint64_t read_bytes = 0;
uint64_t errflags = 0;
@@ -4329,6 +4312,8 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
DMU_BACKUP_FEATURE_EMBED_DATA;
stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
(drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming;
+ stream_resumingnewfs = (drrb->drr_fromguid == 0 ||
+ (drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && resuming;
if (stream_wantsnewfs) {
/*
@@ -4496,7 +4481,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
}
if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
- stream_wantsnewfs) {
+ (stream_wantsnewfs || stream_resumingnewfs)) {
/* We can't do online recv in this case */
clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
flags->forceunmount ? MS_FORCE : 0);
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index 651bca2978ce..a457fbfd0639 100644
--- a/lib/libzfs/libzfs_util.c
+++ b/lib/libzfs/libzfs_util.c
@@ -1010,8 +1010,7 @@ libzfs_init(void)
int error;
char *env;
- error = libzfs_load_module();
- if (error) {
+ if ((error = libzfs_load_module()) != 0) {
errno = error;
return (NULL);
}
diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c
index 037ba56efe1c..2de90c7ceea5 100644
--- a/lib/libzfs/os/freebsd/libzfs_compat.c
+++ b/lib/libzfs/os/freebsd/libzfs_compat.c
@@ -176,11 +176,26 @@ execvpe(const char *name, char * const argv[], char * const envp[])
return (execvPe(name, path, argv, envp));
}
+#define ERRBUFLEN 256
+
+__thread static char errbuf[ERRBUFLEN];
+
const char *
libzfs_error_init(int error)
{
+ char *msg = errbuf;
+ size_t len, msglen = ERRBUFLEN;
- return (strerror(error));
+ if (modfind("zfs") < 0) {
+ len = snprintf(msg, msglen, dgettext(TEXT_DOMAIN,
+ "Failed to load %s module: "), ZFS_KMOD);
+ msg += len;
+ msglen -= len;
+ }
+
+ (void) snprintf(msg, msglen, "%s", strerror(error));
+
+ return (errbuf);
}
int
@@ -193,10 +208,6 @@ zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
* Verify the required ZFS_DEV device is available and optionally attempt
* to load the ZFS modules. Under normal circumstances the modules
* should already have been loaded by some external mechanism.
- *
- * Environment variables:
- * - ZFS_MODULE_LOADING="YES|yes|ON|on" - Attempt to load modules.
- * - ZFS_MODULE_TIMEOUT="<seconds>" - Seconds to wait for ZFS_DEV
*/
int
libzfs_load_module(void)
diff --git a/lib/libzfsbootenv/libzfsbootenv.pc.in b/lib/libzfsbootenv/libzfsbootenv.pc.in
index 61bafa66e3fd..50865050bbfb 100644
--- a/lib/libzfsbootenv/libzfsbootenv.pc.in
+++ b/lib/libzfsbootenv/libzfsbootenv.pc.in
@@ -6,7 +6,7 @@ includedir=@includedir@
Name: libzfsbootenv
Description: LibZFSBootENV library
Version: @VERSION@
-URL: https://zfsonlinux.org
+URL: https://github.com/openzfs/zfs
Requires: libzfs libnvpair
Cflags: -I${includedir}
Libs: -L${libdir} -lzfsbootenv
diff --git a/lib/libzutil/os/linux/zutil_import_os.c b/lib/libzutil/os/linux/zutil_import_os.c
index a4bf01749da8..519ab3a078e3 100644
--- a/lib/libzutil/os/linux/zutil_import_os.c
+++ b/lib/libzutil/os/linux/zutil_import_os.c
@@ -813,9 +813,9 @@ update_vdev_config_dev_strs(nvlist_t *nv)
* env ZFS_VDEV_DEVID_OPT_OUT=YES zpool import dozer
*
* explanation:
- * Older ZFS on Linux implementations had issues when attempting to
- * display pool config VDEV names if a "devid" NVP value is present
- * in the pool's config.
+ * Older OpenZFS implementations had issues when attempting to
+ * display pool config VDEV names if a "devid" NVP value is
+ * present in the pool's config.
*
* For example, a pool that originated on illumos platform would
* have a devid value in the config and "zpool status" would fail