Compare commits
34 Commits
zfs-0.6.5.
...
zfs-0.6.5-
Author | SHA1 | Date |
---|---|---|
Tony Hutter | 2bc71fa976 | |
Tony Hutter | 5a20d4283c | |
alaviss | bf04e4d442 | |
DHE | 5e6057b574 | |
loli10K | 94d353a0bf | |
Tony Hutter | e9fc1bd5e6 | |
Tony Hutter | b88f4d7ba7 | |
Brian Behlendorf | 3e297b90f5 | |
Justin Lecher | 709f25e248 | |
Olaf Faaland | cd2209b75e | |
Tony Hutter | a57fa2c532 | |
Brian Behlendorf | 590509b75e | |
Matthew Ahrens | d07a8deac8 | |
Chunwei Chen | 69494c6aff | |
Chunwei Chen | 412e3c26a9 | |
LOLi | ed9cb8390b | |
LOLi | cb8210d125 | |
Brian Behlendorf | 21fd04ec40 | |
Brian Behlendorf | e4cb6ee6a5 | |
Brian Behlendorf | a83a4f9d10 | |
Matthew Ahrens | 1e5f75ecbe | |
Ned Bass | 36ccb9db43 | |
jxiong | a2c9518711 | |
Tony Hutter | cc519c4027 | |
Chunwei Chen | dbb48937ce | |
Tim Chase | 34a3a7c660 | |
Brian Behlendorf | 4a4c57d5ff | |
Chunwei Chen | 2094a93e87 | |
loli10K | 03336d011c | |
Brian Behlendorf | f0a4bfbe4d | |
Brian Behlendorf | ebef1f2fb6 | |
Chunwei Chen | 00a1a11989 | |
Olaf Faaland | b4c181dc76 | |
Olaf Faaland | 626ba3142b |
2
META
2
META
|
@ -1,7 +1,7 @@
|
|||
Meta: 1
|
||||
Name: zfs
|
||||
Branch: 1.0
|
||||
Version: 0.6.5.9
|
||||
Version: 0.6.5.11
|
||||
Release: 1
|
||||
Release-Tags: relext
|
||||
License: CDDL
|
||||
|
|
|
@ -608,10 +608,23 @@ main(int argc, char **argv)
|
|||
"failed for unknown reason.\n"), dataset);
|
||||
}
|
||||
return (MOUNT_SYSERR);
|
||||
#ifdef MS_MANDLOCK
|
||||
case EPERM:
|
||||
if (mntflags & MS_MANDLOCK) {
|
||||
(void) fprintf(stderr, gettext("filesystem "
|
||||
"'%s' has the 'nbmand=on' property set, "
|
||||
"this mount\noption may be disabled in "
|
||||
"your kernel. Use 'zfs set nbmand=off'\n"
|
||||
"to disable this option and try to "
|
||||
"mount the filesystem again.\n"), dataset);
|
||||
return (MOUNT_SYSERR);
|
||||
}
|
||||
/* fallthru */
|
||||
#endif
|
||||
default:
|
||||
(void) fprintf(stderr, gettext("filesystem "
|
||||
"'%s' can not be mounted due to error "
|
||||
"%d\n"), dataset, errno);
|
||||
"'%s' can not be mounted: %s\n"), dataset,
|
||||
strerror(errno));
|
||||
return (MOUNT_USAGE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,9 +184,9 @@ sas_handler() {
|
|||
return
|
||||
fi
|
||||
|
||||
# Get the raw scsi device name from multipath -l. Strip off
|
||||
# Get the raw scsi device name from multipath -ll. Strip off
|
||||
# leading pipe symbols to make field numbering consistent.
|
||||
DEV=`multipath -l $DM_NAME |
|
||||
DEV=`multipath -ll $DM_NAME |
|
||||
awk '/running/{gsub("^[|]"," "); print $3 ; exit}'`
|
||||
if [ -z "$DEV" ] ; then
|
||||
return
|
||||
|
|
|
@ -478,7 +478,7 @@ static void
|
|||
dump_bpobj_subobjs(objset_t *os, uint64_t object, void *data, size_t size)
|
||||
{
|
||||
dmu_object_info_t doi;
|
||||
uint64_t i;
|
||||
int64_t i;
|
||||
|
||||
VERIFY0(dmu_object_info(os, object, &doi));
|
||||
uint64_t *subobjs = kmem_alloc(doi.doi_max_offset, KM_SLEEP);
|
||||
|
@ -497,7 +497,7 @@ dump_bpobj_subobjs(objset_t *os, uint64_t object, void *data, size_t size)
|
|||
}
|
||||
|
||||
for (i = 0; i <= last_nonzero; i++) {
|
||||
(void) printf("\t%llu\n", (longlong_t)subobjs[i]);
|
||||
(void) printf("\t%llu\n", (u_longlong_t)subobjs[i]);
|
||||
}
|
||||
kmem_free(subobjs, doi.doi_max_offset);
|
||||
}
|
||||
|
|
|
@ -444,13 +444,13 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types,
|
|||
|
||||
/*
|
||||
* If we're recursive, then we always allow filesystems as
|
||||
* arguments. If we also are interested in snapshots, then we
|
||||
* can take volumes as well.
|
||||
* arguments. If we also are interested in snapshots or
|
||||
* bookmarks, then we can take volumes as well.
|
||||
*/
|
||||
argtype = types;
|
||||
if (flags & ZFS_ITER_RECURSE) {
|
||||
argtype |= ZFS_TYPE_FILESYSTEM;
|
||||
if (types & ZFS_TYPE_SNAPSHOT)
|
||||
if (types & (ZFS_TYPE_SNAPSHOT | ZFS_TYPE_BOOKMARK))
|
||||
argtype |= ZFS_TYPE_VOLUME;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
include $(top_srcdir)/config/Rules.am
|
||||
|
||||
AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
|
||||
# -Wnoformat-truncation to get rid of compiler warning for unchecked
|
||||
# truncating snprintfs on gcc 7.1.1.
|
||||
AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN) $(NO_FORMAT_TRUNCATION)
|
||||
|
||||
DEFAULT_INCLUDES += \
|
||||
-I$(top_srcdir)/include \
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
dnl #
|
||||
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() is not exported.
|
||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
||||
dnl # 4.0 - x.y, bdi_setup_and_register() takes 2 arguments.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER], [
|
||||
AC_MSG_CHECKING([whether bdi_setup_and_register() wants 2 args])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name);
|
||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 2 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether bdi_setup_and_register() wants 3 args])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name, cap);
|
||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 3 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
|
@ -0,0 +1,56 @@
|
|||
dnl #
|
||||
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() is not exported.
|
||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
||||
dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
dnl # 4.12 - x.y, super_setup_bdi_name() new interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||
AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/fs.h>
|
||||
struct super_block sb;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
int error __attribute__((unused)) =
|
||||
super_setup_bdi_name(&sb, name);
|
||||
], [super_setup_bdi_name], [fs/super.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
|
||||
[super_setup_bdi_name() exits])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 2 args])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name);
|
||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 2 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 3 args])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name, cap);
|
||||
], [bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 3 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -69,7 +69,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
|||
AC_DEFUN([ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS], [
|
||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/blk_types.h>
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio *bio __attribute__ ((unused)) = NULL;
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
dnl #
|
||||
dnl # 4.9, current_time() added
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME],
|
||||
[AC_MSG_CHECKING([whether current_time() exists])
|
||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct inode ip;
|
||||
struct timespec now __attribute__ ((unused));
|
||||
|
||||
now = current_time(&ip);
|
||||
], [current_time], [fs/inode.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -0,0 +1,67 @@
|
|||
dnl #
|
||||
dnl # Linux 4.11 API
|
||||
dnl # See torvalds/linux@a528d35
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_PATH_KERNEL_IOPS_GETATTR], [
|
||||
AC_MSG_CHECKING([whether iops->getattr() takes a path])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
|
||||
int test_getattr(
|
||||
const struct path *p, struct kstat *k,
|
||||
u32 request_mask, unsigned int query_flags)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.getattr = test_getattr,
|
||||
};
|
||||
],[
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PATH_IOPS_GETATTR, 1,
|
||||
[iops->getattr() takes a path])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.9 - 4.10 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_VFSMOUNT_KERNEL_IOPS_GETATTR], [
|
||||
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
|
||||
int test_getattr(
|
||||
struct vfsmount *mnt, struct dentry *d,
|
||||
struct kstat *k)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.getattr = test_getattr,
|
||||
};
|
||||
],[
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
||||
[iops->getattr() takes a vfsmount])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl #
|
||||
dnl # The interface of the getattr callback from the inode_operations
|
||||
dnl # structure changed. Also, the interface of the simple_getattr()
|
||||
dnl # function provided by the kernel changed.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GETATTR], [
|
||||
ZFS_AC_PATH_KERNEL_IOPS_GETATTR
|
||||
ZFS_AC_VFSMOUNT_KERNEL_IOPS_GETATTR
|
||||
])
|
|
@ -1,5 +1,5 @@
|
|||
dnl #
|
||||
dnl # Linux 4.1.x API
|
||||
dnl # Linux 3.16 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_RW_ITERATE],
|
||||
[AC_MSG_CHECKING([whether fops->read/write_iter() are available])
|
||||
|
@ -21,6 +21,26 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_RW_ITERATE],
|
|||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_RW_ITERATE, 1,
|
||||
[fops->read/write_iter() are available])
|
||||
|
||||
ZFS_AC_KERNEL_NEW_SYNC_READ
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.1 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_NEW_SYNC_READ],
|
||||
[AC_MSG_CHECKING([whether new_sync_read() is available])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
new_sync_read(NULL, NULL, 0, NULL);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_NEW_SYNC_READ, 1,
|
||||
[new_sync_read() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
|
|
@ -58,6 +58,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_GETATTR
|
||||
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
|
||||
ZFS_AC_KERNEL_SHOW_OPTIONS
|
||||
ZFS_AC_KERNEL_FILE_INODE
|
||||
|
@ -95,7 +96,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||
ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID
|
||||
ZFS_AC_KERNEL_S_INSTANCES_LIST_HEAD
|
||||
ZFS_AC_KERNEL_S_D_OP
|
||||
ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
|
||||
ZFS_AC_KERNEL_BDI
|
||||
ZFS_AC_KERNEL_SET_NLINK
|
||||
ZFS_AC_KERNEL_ELEVATOR_CHANGE
|
||||
ZFS_AC_KERNEL_5ARG_SGET
|
||||
|
@ -109,6 +110,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||
ZFS_AC_KERNEL_GENERIC_IO_ACCT
|
||||
ZFS_AC_KERNEL_RENAME_WANTS_FLAGS
|
||||
ZFS_AC_KERNEL_HAVE_GENERIC_SETXATTR
|
||||
ZFS_AC_KERNEL_CURRENT_TIME
|
||||
|
||||
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
|
||||
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
dnl #
|
||||
dnl # glibc 2.25
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
|
||||
AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <sys/sysmacros.h>
|
||||
],[
|
||||
int k;
|
||||
k = makedev(0,0);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
|
||||
[makedev() is declared in sys/sysmacros.h])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # glibc X < Y < 2.25
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
|
||||
AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <sys/mkdev.h>
|
||||
],[
|
||||
int k;
|
||||
k = makedev(0,0);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
|
||||
[makedev() is declared in sys/mkdev.h])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -0,0 +1,22 @@
|
|||
dnl #
|
||||
dnl # Check if gcc supports -Wno-format-truncation option.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER_NO_FORMAT_TRUNCATION], [
|
||||
AC_MSG_CHECKING([for -Wno-format-truncation support])
|
||||
|
||||
saved_flags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Wno-format-truncation"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
|
||||
[
|
||||
NO_FORMAT_TRUNCATION=-Wno-format-truncation
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
NO_FORMAT_TRUNCATION=
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
CFLAGS="$saved_flags"
|
||||
AC_SUBST([NO_FORMAT_TRUNCATION])
|
||||
])
|
|
@ -13,6 +13,9 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
|
|||
ZFS_AC_CONFIG_USER_LIBBLKID
|
||||
ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN
|
||||
ZFS_AC_CONFIG_USER_RUNSTATEDIR
|
||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
|
||||
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
|
||||
ZFS_AC_CONFIG_USER_NO_FORMAT_TRUNCATION
|
||||
dnl #
|
||||
dnl # Checks for library functions
|
||||
AC_CHECK_FUNCS([mlockall])
|
||||
|
|
|
@ -11,6 +11,7 @@ Before=local-fs.target
|
|||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=@sbindir@/zfs mount -a
|
||||
WorkingDirectory=-/sbin/
|
||||
|
||||
[Install]
|
||||
WantedBy=zfs-share.service
|
||||
|
|
|
@ -46,11 +46,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef VERIFY
|
||||
#undef VERIFY
|
||||
#endif
|
||||
#define VERIFY verify
|
||||
|
||||
typedef struct libzfs_fru {
|
||||
char *zf_device;
|
||||
char *zf_fru;
|
||||
|
|
|
@ -341,12 +341,12 @@ bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
|||
static inline void
|
||||
bio_set_flush(struct bio *bio)
|
||||
{
|
||||
#if defined(WRITE_BARRIER) /* < 2.6.37 */
|
||||
bio_set_op_attrs(bio, 0, WRITE_BARRIER);
|
||||
#if defined(REQ_PREFLUSH) /* >= 4.10 */
|
||||
bio_set_op_attrs(bio, 0, REQ_PREFLUSH);
|
||||
#elif defined(WRITE_FLUSH_FUA) /* >= 2.6.37 and <= 4.9 */
|
||||
bio_set_op_attrs(bio, 0, WRITE_FLUSH_FUA);
|
||||
#elif defined(REQ_PREFLUSH) /* >= 4.10 */
|
||||
bio_set_op_attrs(bio, 0, REQ_PREFLUSH);
|
||||
#elif defined(WRITE_BARRIER) /* < 2.6.37 */
|
||||
bio_set_op_attrs(bio, 0, WRITE_BARRIER);
|
||||
#else
|
||||
#error "Allowing the build will cause bio_set_flush requests to be ignored."
|
||||
"Please file an issue report at: "
|
||||
|
@ -373,9 +373,6 @@ bio_set_flush(struct bio *bio)
|
|||
* in all cases but may have a performance impact for some kernels. It
|
||||
* has the advantage of minimizing kernel specific changes in the zvol code.
|
||||
*
|
||||
* Note that 2.6.32 era kernels provide both BIO_RW_BARRIER and REQ_FLUSH,
|
||||
* where BIO_RW_BARRIER is the correct interface. Therefore, it is important
|
||||
* that the HAVE_BIO_RW_BARRIER check occur before the REQ_FLUSH check.
|
||||
*/
|
||||
static inline boolean_t
|
||||
bio_is_flush(struct bio *bio)
|
||||
|
@ -386,10 +383,10 @@ bio_is_flush(struct bio *bio)
|
|||
return (bio->bi_opf & REQ_PREFLUSH);
|
||||
#elif defined(REQ_PREFLUSH) && !defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_rw & REQ_PREFLUSH);
|
||||
#elif defined(HAVE_BIO_RW_BARRIER)
|
||||
return (bio->bi_rw & (1 << BIO_RW_BARRIER));
|
||||
#elif defined(REQ_FLUSH)
|
||||
return (bio->bi_rw & REQ_FLUSH);
|
||||
#elif defined(HAVE_BIO_RW_BARRIER)
|
||||
return (bio->bi_rw & (1 << BIO_RW_BARRIER));
|
||||
#else
|
||||
#error "Allowing the build will cause flush requests to be ignored. Please "
|
||||
"file an issue report at: https://github.com/zfsonlinux/zfs/issues/new"
|
||||
|
|
|
@ -69,45 +69,115 @@ truncate_setsize(struct inode *ip, loff_t new)
|
|||
/*
|
||||
* 2.6.32 - 2.6.33, bdi_setup_and_register() is not available.
|
||||
* 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
||||
* 4.0 - x.y, bdi_setup_and_register() takes 2 arguments.
|
||||
* 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
* 4.12 - x.y, super_setup_bdi_name() new interface.
|
||||
*/
|
||||
#if defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER)
|
||||
#if defined(HAVE_SUPER_SETUP_BDI_NAME)
|
||||
extern atomic_long_t zfs_bdi_seq;
|
||||
|
||||
static inline int
|
||||
zpl_bdi_setup_and_register(struct backing_dev_info *bdi, char *name)
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
return (bdi_setup_and_register(bdi, name));
|
||||
return super_setup_bdi_name(sb, "%.28s-%ld", name,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
}
|
||||
#elif defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER)
|
||||
static inline int
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
error = bdi_setup_and_register(bdi, name);
|
||||
if (error) {
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#elif defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
|
||||
static inline int
|
||||
zpl_bdi_setup_and_register(struct backing_dev_info *bdi, char *name)
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
return (bdi_setup_and_register(bdi, name, BDI_CAP_MAP_COPY));
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
error = bdi_setup_and_register(bdi, name, BDI_CAP_MAP_COPY);
|
||||
if (error) {
|
||||
kmem_free(sb->s_bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#else
|
||||
extern atomic_long_t zfs_bdi_seq;
|
||||
|
||||
static inline int
|
||||
zpl_bdi_setup_and_register(struct backing_dev_info *bdi, char *name)
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
char tmp[32];
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
bdi->name = name;
|
||||
bdi->capabilities = BDI_CAP_MAP_COPY;
|
||||
|
||||
error = bdi_init(bdi);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
sprintf(tmp, "%.28s%s", name, "-%d");
|
||||
error = bdi_register(bdi, NULL, tmp,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
if (error) {
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
error = bdi_register(bdi, NULL, "%.28s-%ld", name,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
if (error) {
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -368,4 +438,58 @@ setattr_prepare(struct dentry *dentry, struct iattr *ia)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.11 API change
|
||||
* These macros are defined by kernel 4.11. We define them so that the same
|
||||
* code builds under kernels < 4.11 and >= 4.11. The macros are set to 0 so
|
||||
* that it will create obvious failures if they are accidentally used when built
|
||||
* against a kernel >= 4.11.
|
||||
*/
|
||||
|
||||
#ifndef STATX_BASIC_STATS
|
||||
#define STATX_BASIC_STATS 0
|
||||
#endif
|
||||
|
||||
#ifndef AT_STATX_SYNC_AS_STAT
|
||||
#define AT_STATX_SYNC_AS_STAT 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.11 API change
|
||||
* 4.11 takes struct path *, < 4.11 takes vfsmount *
|
||||
*/
|
||||
|
||||
#ifdef HAVE_VFSMOUNT_IOPS_GETATTR
|
||||
#define ZPL_GETATTR_WRAPPER(func) \
|
||||
static int \
|
||||
func(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) \
|
||||
{ \
|
||||
struct path path = { .mnt = mnt, .dentry = dentry }; \
|
||||
return func##_impl(&path, stat, STATX_BASIC_STATS, \
|
||||
AT_STATX_SYNC_AS_STAT); \
|
||||
}
|
||||
#elif defined(HAVE_PATH_IOPS_GETATTR)
|
||||
#define ZPL_GETATTR_WRAPPER(func) \
|
||||
static int \
|
||||
func(const struct path *path, struct kstat *stat, u32 request_mask, \
|
||||
unsigned int query_flags) \
|
||||
{ \
|
||||
return (func##_impl(path, stat, request_mask, query_flags)); \
|
||||
}
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.9 API change
|
||||
* Preferred interface to get the current FS time.
|
||||
*/
|
||||
#if !defined(HAVE_CURRENT_TIME)
|
||||
static inline struct timespec
|
||||
current_time(struct inode *ip)
|
||||
{
|
||||
return (timespec_trunc(current_kernel_time(), ip->i_sb->s_time_gran));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ZFS_VFS_H */
|
||||
|
|
|
@ -40,6 +40,17 @@ extern "C" {
|
|||
*/
|
||||
#define FTAG ((char *)__func__)
|
||||
|
||||
/*
|
||||
* Starting with 4.11, torvalds/linux@f405df5, the linux kernel defines a
|
||||
* refcount_t type of its own. The macro below effectively changes references
|
||||
* in the ZFS code from refcount_t to zfs_refcount_t at compile time, so that
|
||||
* existing code need not be altered, reducing conflicts when landing openZFS
|
||||
* patches.
|
||||
*/
|
||||
|
||||
#define refcount_t zfs_refcount_t
|
||||
#define refcount_add zfs_refcount_add
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
typedef struct reference {
|
||||
list_node_t ref_link;
|
||||
|
@ -55,7 +66,7 @@ typedef struct refcount {
|
|||
list_t rc_removed;
|
||||
int64_t rc_count;
|
||||
int64_t rc_removed_count;
|
||||
} refcount_t;
|
||||
} zfs_refcount_t;
|
||||
|
||||
/* Note: refcount_t must be initialized with refcount_create[_untracked]() */
|
||||
|
||||
|
@ -65,7 +76,7 @@ void refcount_destroy(refcount_t *rc);
|
|||
void refcount_destroy_many(refcount_t *rc, uint64_t number);
|
||||
int refcount_is_zero(refcount_t *rc);
|
||||
int64_t refcount_count(refcount_t *rc);
|
||||
int64_t refcount_add(refcount_t *rc, void *holder_tag);
|
||||
int64_t zfs_refcount_add(refcount_t *rc, void *holder_tag);
|
||||
int64_t refcount_remove(refcount_t *rc, void *holder_tag);
|
||||
int64_t refcount_add_many(refcount_t *rc, uint64_t number, void *holder_tag);
|
||||
int64_t refcount_remove_many(refcount_t *rc, uint64_t number, void *holder_tag);
|
||||
|
@ -86,7 +97,7 @@ typedef struct refcount {
|
|||
#define refcount_destroy_many(rc, number) ((rc)->rc_count = 0)
|
||||
#define refcount_is_zero(rc) ((rc)->rc_count == 0)
|
||||
#define refcount_count(rc) ((rc)->rc_count)
|
||||
#define refcount_add(rc, holder) atomic_add_64_nv(&(rc)->rc_count, 1)
|
||||
#define zfs_refcount_add(rc, holder) atomic_add_64_nv(&(rc)->rc_count, 1)
|
||||
#define refcount_remove(rc, holder) atomic_add_64_nv(&(rc)->rc_count, -1)
|
||||
#define refcount_add_many(rc, number, holder) \
|
||||
atomic_add_64_nv(&(rc)->rc_count, number)
|
||||
|
|
|
@ -64,7 +64,6 @@ typedef struct zfs_mntopts {
|
|||
|
||||
typedef struct zfs_sb {
|
||||
struct super_block *z_sb; /* generic super_block */
|
||||
struct backing_dev_info z_bdi; /* generic backing dev info */
|
||||
struct zfs_sb *z_parent; /* parent fs */
|
||||
objset_t *z_os; /* objset reference */
|
||||
zfs_mntopts_t *z_mntopts; /* passed mount options */
|
||||
|
|
|
@ -507,7 +507,7 @@
|
|||
movl 16(%esp), %ebx
|
||||
movl 20(%esp), %ecx
|
||||
subl %eax, %ebx
|
||||
adcl %edx, %ecx
|
||||
sbbl %edx, %ecx
|
||||
lock
|
||||
cmpxchg8b (%edi)
|
||||
jne 1b
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <sys/mnttab.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
|
@ -31,69 +31,66 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef __assert_c99
|
||||
static inline void
|
||||
__assert_c99(const char *expr, const char *file, int line, const char *func)
|
||||
{
|
||||
fprintf(stderr, "%s:%i: %s: Assertion `%s` failed.\n",
|
||||
file, line, func, expr);
|
||||
abort();
|
||||
}
|
||||
#endif /* __assert_c99 */
|
||||
|
||||
#ifndef verify
|
||||
#if defined(__STDC__)
|
||||
#if __STDC_VERSION__ - 0 >= 199901L
|
||||
#define verify(EX) (void)((EX) || \
|
||||
(__assert_c99(#EX, __FILE__, __LINE__, __func__), 0))
|
||||
#else
|
||||
#define verify(EX) (void)((EX) || (__assert(#EX, __FILE__, __LINE__), 0))
|
||||
#endif /* __STDC_VERSION__ - 0 >= 199901L */
|
||||
#else
|
||||
#define verify(EX) (void)((EX) || (_assert("EX", __FILE__, __LINE__), 0))
|
||||
#endif /* __STDC__ */
|
||||
#endif /* verify */
|
||||
|
||||
#undef VERIFY
|
||||
#undef ASSERT
|
||||
|
||||
#define VERIFY verify
|
||||
#define ASSERT assert
|
||||
|
||||
extern void __assert(const char *, const char *, int);
|
||||
#include <stdarg.h>
|
||||
|
||||
static inline int
|
||||
assfail(const char *buf, const char *file, int line)
|
||||
libspl_assert(const char *buf, const char *file, const char *func, int line)
|
||||
{
|
||||
__assert(buf, file, line);
|
||||
return (0);
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
|
||||
abort();
|
||||
}
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
|
||||
/* printf version of libspl_assert */
|
||||
static inline void
|
||||
libspl_assertf(const char *file, const char *func, int line, char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "ASSERT at %s:%d:%s()", file, line, func);
|
||||
va_end(args);
|
||||
abort();
|
||||
}
|
||||
|
||||
#ifdef verify
|
||||
#undef verify
|
||||
#endif
|
||||
|
||||
#define VERIFY(cond) \
|
||||
(void) ((!(cond)) && \
|
||||
libspl_assert(#cond, __FILE__, __FUNCTION__, __LINE__))
|
||||
#define verify(cond) \
|
||||
(void) ((!(cond)) && \
|
||||
libspl_assert(#cond, __FILE__, __FUNCTION__, __LINE__))
|
||||
|
||||
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) \
|
||||
do { \
|
||||
const TYPE __left = (TYPE)(LEFT); \
|
||||
const TYPE __right = (TYPE)(RIGHT); \
|
||||
if (!(__left OP __right)) { \
|
||||
char *__buf = alloca(256); \
|
||||
(void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
|
||||
#LEFT, #OP, #RIGHT, \
|
||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
||||
assfail(__buf, __FILE__, __LINE__); \
|
||||
} \
|
||||
if (!(__left OP __right)) \
|
||||
libspl_assertf(__FILE__, __FUNCTION__, __LINE__, \
|
||||
"%s %s %s (0x%llx %s 0x%llx)", #LEFT, #OP, #RIGHT); \
|
||||
} while (0)
|
||||
/* END CSTYLED */
|
||||
|
||||
#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
||||
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
||||
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
||||
#define VERIFY0(x) VERIFY3_IMPL(x, ==, 0, uint64_t)
|
||||
|
||||
#ifdef assert
|
||||
#undef assert
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define ASSERT3S(x, y, z) ((void)0)
|
||||
#define ASSERT3U(x, y, z) ((void)0)
|
||||
#define ASSERT3P(x, y, z) ((void)0)
|
||||
#define ASSERT0(x) ((void)0)
|
||||
#define ASSERT(x) ((void)0)
|
||||
#define assert(x) ((void)0)
|
||||
#define ASSERTV(x)
|
||||
#define IMPLY(A, B) ((void)0)
|
||||
#define EQUIV(A, B) ((void)0)
|
||||
|
@ -102,13 +99,17 @@ assfail(const char *buf, const char *file, int line)
|
|||
#define ASSERT3U(x, y, z) VERIFY3U(x, y, z)
|
||||
#define ASSERT3P(x, y, z) VERIFY3P(x, y, z)
|
||||
#define ASSERT0(x) VERIFY0(x)
|
||||
#define ASSERT(x) VERIFY(x)
|
||||
#define assert(x) VERIFY(x)
|
||||
#define ASSERTV(x) x
|
||||
#define IMPLY(A, B) \
|
||||
((void)(((!(A)) || (B)) || \
|
||||
assfail("(" #A ") implies (" #B ")", __FILE__, __LINE__)))
|
||||
libspl_assert("(" #A ") implies (" #B ")", \
|
||||
__FILE__, __FUNCTION__, __LINE__)))
|
||||
#define EQUIV(A, B) \
|
||||
((void)((!!(A) == !!(B)) || \
|
||||
assfail("(" #A ") is equivalent to (" #B ")", __FILE__, __LINE__)))
|
||||
libspl_assert("(" #A ") is equivalent to (" #B ")", \
|
||||
__FILE__, __FUNCTION__, __LINE__)))
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#define makedevice(maj, min) makedev(maj, min)
|
||||
#define _sysconf(a) sysconf(a)
|
||||
#define __NORETURN __attribute__((noreturn))
|
||||
|
||||
/*
|
||||
* Compatibility macros/typedefs needed for Solaris -> Linux port
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
#ifndef _LIBSPL_SYS_TYPES_H
|
||||
#define _LIBSPL_SYS_TYPES_H
|
||||
|
||||
#if defined(HAVE_MAKEDEV_IN_SYSMACROS)
|
||||
#include <sys/sysmacros.h>
|
||||
#elif defined(HAVE_MAKEDEV_IN_MKDEV)
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
|
||||
#include <sys/isa_defs.h>
|
||||
#include <sys/feature_tests.h>
|
||||
#include_next <sys/types.h>
|
||||
|
|
|
@ -3315,8 +3315,9 @@ zfs_check_snap_cb(zfs_handle_t *zhp, void *arg)
|
|||
char name[ZFS_MAXNAMELEN];
|
||||
int rv = 0;
|
||||
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zhp->zfs_name, dd->snapname);
|
||||
if (snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name,
|
||||
dd->snapname) >= sizeof (name))
|
||||
return (EINVAL);
|
||||
|
||||
if (lzc_exists(name))
|
||||
verify(nvlist_add_boolean(dd->nvl, name) == 0);
|
||||
|
@ -3534,8 +3535,9 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
|
|||
int rv = 0;
|
||||
|
||||
if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) {
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zfs_get_name(zhp), sd->sd_snapname);
|
||||
if (snprintf(name, sizeof (name), "%s@%s", zfs_get_name(zhp),
|
||||
sd->sd_snapname) >= sizeof (name))
|
||||
return (EINVAL);
|
||||
|
||||
fnvlist_add_boolean(sd->sd_nvl, name);
|
||||
|
||||
|
@ -4257,8 +4259,9 @@ zfs_hold_one(zfs_handle_t *zhp, void *arg)
|
|||
char name[ZFS_MAXNAMELEN];
|
||||
int rv = 0;
|
||||
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zhp->zfs_name, ha->snapname);
|
||||
if (snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name,
|
||||
ha->snapname) >= sizeof (name))
|
||||
return (EINVAL);
|
||||
|
||||
if (lzc_exists(name))
|
||||
fnvlist_add_string(ha->nvl, name, ha->tag);
|
||||
|
@ -4377,8 +4380,11 @@ zfs_release_one(zfs_handle_t *zhp, void *arg)
|
|||
int rv = 0;
|
||||
nvlist_t *existing_holds;
|
||||
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zhp->zfs_name, ha->snapname);
|
||||
if (snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name,
|
||||
ha->snapname) >= sizeof (name)) {
|
||||
ha->error = EINVAL;
|
||||
rv = EINVAL;
|
||||
}
|
||||
|
||||
if (lzc_get_holds(name, &existing_holds) != 0) {
|
||||
ha->error = ENOENT;
|
||||
|
|
|
@ -1337,16 +1337,33 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
|||
|
||||
if (config != NULL) {
|
||||
boolean_t matched = B_TRUE;
|
||||
boolean_t aux = B_FALSE;
|
||||
char *pname;
|
||||
|
||||
if ((iarg->poolname != NULL) &&
|
||||
/*
|
||||
* Check if it's a spare or l2cache device. If
|
||||
* it is, we need to skip the name and guid
|
||||
* check since they don't exist on aux device
|
||||
* label.
|
||||
*/
|
||||
if (iarg->poolname != NULL ||
|
||||
iarg->guid != 0) {
|
||||
uint64_t state;
|
||||
aux = nvlist_lookup_uint64(config,
|
||||
ZPOOL_CONFIG_POOL_STATE,
|
||||
&state) == 0 &&
|
||||
(state == POOL_STATE_SPARE ||
|
||||
state == POOL_STATE_L2CACHE);
|
||||
}
|
||||
|
||||
if ((iarg->poolname != NULL) && !aux &&
|
||||
(nvlist_lookup_string(config,
|
||||
ZPOOL_CONFIG_POOL_NAME, &pname) == 0)) {
|
||||
|
||||
if (strcmp(iarg->poolname, pname))
|
||||
matched = B_FALSE;
|
||||
|
||||
} else if (iarg->guid != 0) {
|
||||
} else if (iarg->guid != 0 && !aux) {
|
||||
uint64_t this_guid;
|
||||
|
||||
matched = nvlist_lookup_uint64(config,
|
||||
|
|
|
@ -204,8 +204,11 @@ zfs_iter_bookmarks(zfs_handle_t *zhp, zfs_iter_f func, void *data)
|
|||
bmark_name = nvpair_name(pair);
|
||||
bmark_props = fnvpair_value_nvlist(pair);
|
||||
|
||||
(void) snprintf(name, sizeof (name), "%s#%s", zhp->zfs_name,
|
||||
bmark_name);
|
||||
if (snprintf(name, sizeof (name), "%s#%s", zhp->zfs_name,
|
||||
bmark_name) >= sizeof (name)) {
|
||||
err = EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
nzhp = make_bookmark_handle(zhp, name, bmark_props);
|
||||
if (nzhp == NULL)
|
||||
|
|
|
@ -1487,9 +1487,13 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
|||
drr_versioninfo, DMU_COMPOUNDSTREAM);
|
||||
DMU_SET_FEATUREFLAGS(drr.drr_u.drr_begin.
|
||||
drr_versioninfo, featureflags);
|
||||
(void) snprintf(drr.drr_u.drr_begin.drr_toname,
|
||||
if (snprintf(drr.drr_u.drr_begin.drr_toname,
|
||||
sizeof (drr.drr_u.drr_begin.drr_toname),
|
||||
"%s@%s", zhp->zfs_name, tosnap);
|
||||
"%s@%s", zhp->zfs_name, tosnap) >=
|
||||
sizeof (drr.drr_u.drr_begin.drr_toname)) {
|
||||
err = EINVAL;
|
||||
goto stderr_out;
|
||||
}
|
||||
drr.drr_payloadlen = buflen;
|
||||
err = cksum_and_write(&drr, sizeof (drr), &zc, outfd);
|
||||
|
||||
|
|
|
@ -883,7 +883,12 @@ Default value: \fB10\fR.
|
|||
Minimum asynchronous write I/Os active to each device.
|
||||
See the section "ZFS I/O SCHEDULER".
|
||||
.sp
|
||||
Default value: \fB1\fR.
|
||||
Lower values are associated with better latency on rotational media but poorer
|
||||
resilver performance. The default value of 2 was chosen as a compromise. A
|
||||
value of 3 has been shown to improve resilver performance further at a cost of
|
||||
further increasing latency.
|
||||
.sp
|
||||
Default value: \fB2\fR.
|
||||
.RE
|
||||
|
||||
.sp
|
||||
|
|
|
@ -5475,11 +5475,12 @@ arc_init(void)
|
|||
* If it has been set by a module parameter, take that.
|
||||
* Otherwise, use a percentage of physical memory defined by
|
||||
* zfs_dirty_data_max_percent (default 10%) with a cap at
|
||||
* zfs_dirty_data_max_max (default 25% of physical memory).
|
||||
* zfs_dirty_data_max_max (default 4G or 25% of physical memory).
|
||||
*/
|
||||
if (zfs_dirty_data_max_max == 0)
|
||||
zfs_dirty_data_max_max = (uint64_t)physmem * PAGESIZE *
|
||||
zfs_dirty_data_max_max_percent / 100;
|
||||
zfs_dirty_data_max_max = MIN(4ULL * 1024 * 1024 * 1024,
|
||||
(uint64_t)physmem * PAGESIZE *
|
||||
zfs_dirty_data_max_max_percent / 100);
|
||||
|
||||
if (zfs_dirty_data_max == 0) {
|
||||
zfs_dirty_data_max = (uint64_t)physmem * PAGESIZE *
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#ifdef _KERNEL
|
||||
#include <sys/vmsystm.h>
|
||||
#include <sys/zfs_znode.h>
|
||||
#include <linux/kmap_compat.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -1056,6 +1057,7 @@ dmu_bio_copy(void *arg_buf, int size, struct bio *bio, size_t bio_offset)
|
|||
char *bv_buf;
|
||||
int tocpy, bv_len, bv_offset;
|
||||
int offset = 0;
|
||||
void *paddr;
|
||||
|
||||
bio_for_each_segment4(bv, bvp, bio, iter) {
|
||||
|
||||
|
@ -1080,14 +1082,15 @@ dmu_bio_copy(void *arg_buf, int size, struct bio *bio, size_t bio_offset)
|
|||
tocpy = MIN(bv_len, size - offset);
|
||||
ASSERT3S(tocpy, >=, 0);
|
||||
|
||||
bv_buf = page_address(bvp->bv_page) + bv_offset;
|
||||
ASSERT3P(bv_buf, !=, NULL);
|
||||
paddr = zfs_kmap_atomic(bvp->bv_page, KM_USER0);
|
||||
bv_buf = paddr + bv_offset;
|
||||
ASSERT3P(paddr, !=, NULL);
|
||||
|
||||
if (bio_data_dir(bio) == WRITE)
|
||||
memcpy(arg_buf + offset, bv_buf, tocpy);
|
||||
else
|
||||
memcpy(bv_buf, arg_buf + offset, tocpy);
|
||||
|
||||
zfs_kunmap_atomic(paddr, KM_USER0);
|
||||
offset += tocpy;
|
||||
}
|
||||
out:
|
||||
|
|
|
@ -137,7 +137,7 @@ refcount_add_many(refcount_t *rc, uint64_t number, void *holder)
|
|||
}
|
||||
|
||||
int64_t
|
||||
refcount_add(refcount_t *rc, void *holder)
|
||||
zfs_refcount_add(refcount_t *rc, void *holder)
|
||||
{
|
||||
return (refcount_add_many(rc, 1, holder));
|
||||
}
|
||||
|
|
|
@ -3962,12 +3962,6 @@ spa_import(char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
|
|||
|
||||
VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
||||
&nvroot) == 0);
|
||||
if (error == 0)
|
||||
error = spa_validate_aux(spa, nvroot, -1ULL,
|
||||
VDEV_ALLOC_SPARE);
|
||||
if (error == 0)
|
||||
error = spa_validate_aux(spa, nvroot, -1ULL,
|
||||
VDEV_ALLOC_L2CACHE);
|
||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||
|
||||
if (props != NULL)
|
||||
|
|
|
@ -1799,6 +1799,9 @@ vdev_dtl_should_excise(vdev_t *vd)
|
|||
ASSERT0(scn->scn_phys.scn_errors);
|
||||
ASSERT0(vd->vdev_children);
|
||||
|
||||
if (vd->vdev_state < VDEV_STATE_DEGRADED)
|
||||
return (B_FALSE);
|
||||
|
||||
if (vd->vdev_resilver_txg == 0 ||
|
||||
range_tree_space(vd->vdev_dtl[DTL_MISSING]) == 0)
|
||||
return (B_TRUE);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012, 2017 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
|
@ -146,7 +146,7 @@ uint32_t zfs_vdev_sync_write_min_active = 10;
|
|||
uint32_t zfs_vdev_sync_write_max_active = 10;
|
||||
uint32_t zfs_vdev_async_read_min_active = 1;
|
||||
uint32_t zfs_vdev_async_read_max_active = 3;
|
||||
uint32_t zfs_vdev_async_write_min_active = 1;
|
||||
uint32_t zfs_vdev_async_write_min_active = 2;
|
||||
uint32_t zfs_vdev_async_write_max_active = 10;
|
||||
uint32_t zfs_vdev_scrub_min_active = 1;
|
||||
uint32_t zfs_vdev_scrub_max_active = 2;
|
||||
|
@ -545,7 +545,7 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
|
|||
|
||||
/*
|
||||
* Walk backwards through sufficiently contiguous I/Os
|
||||
* recording the last non-option I/O.
|
||||
* recording the last non-optional I/O.
|
||||
*/
|
||||
while ((dio = AVL_PREV(t, first)) != NULL &&
|
||||
(dio->io_flags & ZIO_FLAG_AGG_INHERIT) == flags &&
|
||||
|
@ -567,10 +567,14 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
|
|||
|
||||
/*
|
||||
* Walk forward through sufficiently contiguous I/Os.
|
||||
* The aggregation limit does not apply to optional i/os, so that
|
||||
* we can issue contiguous writes even if they are larger than the
|
||||
* aggregation limit.
|
||||
*/
|
||||
while ((dio = AVL_NEXT(t, last)) != NULL &&
|
||||
(dio->io_flags & ZIO_FLAG_AGG_INHERIT) == flags &&
|
||||
IO_SPAN(first, dio) <= zfs_vdev_aggregation_limit &&
|
||||
(IO_SPAN(first, dio) <= zfs_vdev_aggregation_limit ||
|
||||
(dio->io_flags & ZIO_FLAG_OPTIONAL)) &&
|
||||
IO_GAP(last, dio) <= maxgap) {
|
||||
last = dio;
|
||||
if (!(last->io_flags & ZIO_FLAG_OPTIONAL))
|
||||
|
@ -605,6 +609,7 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
|
|||
dio = AVL_NEXT(t, last);
|
||||
dio->io_flags &= ~ZIO_FLAG_OPTIONAL;
|
||||
} else {
|
||||
/* do not include the optional i/o */
|
||||
while (last != mandatory && last != first) {
|
||||
ASSERT(last->io_flags & ZIO_FLAG_OPTIONAL);
|
||||
last = AVL_PREV(t, last);
|
||||
|
@ -616,7 +621,6 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
|
|||
return (NULL);
|
||||
|
||||
size = IO_SPAN(first, last);
|
||||
ASSERT3U(size, <=, zfs_vdev_aggregation_limit);
|
||||
|
||||
buf = zio_buf_alloc_flags(size, KM_NOSLEEP);
|
||||
if (buf == NULL)
|
||||
|
|
|
@ -455,7 +455,7 @@ static struct inode *
|
|||
zfsctl_inode_alloc(zfs_sb_t *zsb, uint64_t id,
|
||||
const struct file_operations *fops, const struct inode_operations *ops)
|
||||
{
|
||||
struct timespec now = current_fs_time(zsb->z_sb);
|
||||
struct timespec now;
|
||||
struct inode *ip;
|
||||
znode_t *zp;
|
||||
|
||||
|
@ -463,6 +463,7 @@ zfsctl_inode_alloc(zfs_sb_t *zsb, uint64_t id,
|
|||
if (ip == NULL)
|
||||
return (NULL);
|
||||
|
||||
now = current_time(ip);
|
||||
zp = ITOZ(ip);
|
||||
ASSERT3P(zp->z_dirlocks, ==, NULL);
|
||||
ASSERT3P(zp->z_acl_cached, ==, NULL);
|
||||
|
@ -498,6 +499,9 @@ zfsctl_inode_alloc(zfs_sb_t *zsb, uint64_t id,
|
|||
ip->i_ctime = now;
|
||||
ip->i_fop = fops;
|
||||
ip->i_op = ops;
|
||||
#if defined(IOP_XATTR)
|
||||
ip->i_opflags &= ~IOP_XATTR;
|
||||
#endif
|
||||
|
||||
if (insert_inode_locked(ip)) {
|
||||
unlock_new_inode(ip);
|
||||
|
|
|
@ -1403,13 +1403,13 @@ zfs_domount(struct super_block *sb, zfs_mntopts_t *zmo, int silent)
|
|||
sb->s_time_gran = 1;
|
||||
sb->s_blocksize = recordsize;
|
||||
sb->s_blocksize_bits = ilog2(recordsize);
|
||||
zsb->z_bdi.ra_pages = 0;
|
||||
sb->s_bdi = &zsb->z_bdi;
|
||||
|
||||
error = -zpl_bdi_setup_and_register(&zsb->z_bdi, "zfs");
|
||||
error = -zpl_bdi_setup(sb, "zfs");
|
||||
if (error)
|
||||
goto out;
|
||||
|
||||
sb->s_bdi->ra_pages = 0;
|
||||
|
||||
/* Set callback operations for the file system. */
|
||||
sb->s_op = &zpl_super_operations;
|
||||
sb->s_xattr = zpl_xattr_handlers;
|
||||
|
@ -1505,7 +1505,7 @@ zfs_umount(struct super_block *sb)
|
|||
arc_remove_prune_callback(zsb->z_arc_prune);
|
||||
VERIFY(zfs_sb_teardown(zsb, B_TRUE) == 0);
|
||||
os = zsb->z_os;
|
||||
bdi_destroy(sb->s_bdi);
|
||||
zpl_bdi_destroy(sb);
|
||||
|
||||
/*
|
||||
* z_os will be NULL if there was an error in
|
||||
|
|
|
@ -1602,13 +1602,13 @@ top:
|
|||
error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
|
||||
if (error) {
|
||||
zfs_dirent_unlock(dl);
|
||||
iput(ip);
|
||||
if (xzp)
|
||||
iput(ZTOI(xzp));
|
||||
if (error == ERESTART) {
|
||||
waited = B_TRUE;
|
||||
dmu_tx_wait(tx);
|
||||
dmu_tx_abort(tx);
|
||||
iput(ip);
|
||||
if (xzp)
|
||||
iput(ZTOI(xzp));
|
||||
goto top;
|
||||
}
|
||||
#ifdef HAVE_PN_UTILS
|
||||
|
@ -1616,6 +1616,9 @@ top:
|
|||
pn_free(realnmp);
|
||||
#endif /* HAVE_PN_UTILS */
|
||||
dmu_tx_abort(tx);
|
||||
iput(ip);
|
||||
if (xzp)
|
||||
iput(ZTOI(xzp));
|
||||
ZFS_EXIT(zsb);
|
||||
return (error);
|
||||
}
|
||||
|
@ -1944,14 +1947,15 @@ top:
|
|||
rw_exit(&zp->z_parent_lock);
|
||||
rw_exit(&zp->z_name_lock);
|
||||
zfs_dirent_unlock(dl);
|
||||
iput(ip);
|
||||
if (error == ERESTART) {
|
||||
waited = B_TRUE;
|
||||
dmu_tx_wait(tx);
|
||||
dmu_tx_abort(tx);
|
||||
iput(ip);
|
||||
goto top;
|
||||
}
|
||||
dmu_tx_abort(tx);
|
||||
iput(ip);
|
||||
ZFS_EXIT(zsb);
|
||||
return (error);
|
||||
}
|
||||
|
@ -3025,8 +3029,6 @@ out:
|
|||
ASSERT(err2 == 0);
|
||||
}
|
||||
|
||||
if (attrzp)
|
||||
iput(ZTOI(attrzp));
|
||||
if (aclp)
|
||||
zfs_acl_free(aclp);
|
||||
|
||||
|
@ -3037,11 +3039,15 @@ out:
|
|||
|
||||
if (err) {
|
||||
dmu_tx_abort(tx);
|
||||
if (attrzp)
|
||||
iput(ZTOI(attrzp));
|
||||
if (err == ERESTART)
|
||||
goto top;
|
||||
} else {
|
||||
err2 = sa_bulk_update(zp->z_sa_hdl, bulk, count, tx);
|
||||
dmu_tx_commit(tx);
|
||||
if (attrzp)
|
||||
iput(ZTOI(attrzp));
|
||||
zfs_inode_update(zp);
|
||||
}
|
||||
|
||||
|
@ -3074,7 +3080,7 @@ zfs_rename_unlock(zfs_zlock_t **zlpp)
|
|||
|
||||
while ((zl = *zlpp) != NULL) {
|
||||
if (zl->zl_znode != NULL)
|
||||
iput(ZTOI(zl->zl_znode));
|
||||
zfs_iput_async(ZTOI(zl->zl_znode));
|
||||
rw_exit(zl->zl_rwlock);
|
||||
*zlpp = zl->zl_next;
|
||||
kmem_free(zl, sizeof (*zl));
|
||||
|
@ -3411,16 +3417,19 @@ top:
|
|||
if (sdzp == tdzp)
|
||||
rw_exit(&sdzp->z_name_lock);
|
||||
|
||||
iput(ZTOI(szp));
|
||||
if (tzp)
|
||||
iput(ZTOI(tzp));
|
||||
if (error == ERESTART) {
|
||||
waited = B_TRUE;
|
||||
dmu_tx_wait(tx);
|
||||
dmu_tx_abort(tx);
|
||||
iput(ZTOI(szp));
|
||||
if (tzp)
|
||||
iput(ZTOI(tzp));
|
||||
goto top;
|
||||
}
|
||||
dmu_tx_abort(tx);
|
||||
iput(ZTOI(szp));
|
||||
if (tzp)
|
||||
iput(ZTOI(tzp));
|
||||
ZFS_EXIT(zsb);
|
||||
return (error);
|
||||
}
|
||||
|
|
|
@ -139,10 +139,10 @@ zio_init(void)
|
|||
if (arc_watch && !IS_P2ALIGNED(size, PAGESIZE))
|
||||
continue;
|
||||
#endif
|
||||
if (size <= 4 * SPA_MINBLOCKSIZE) {
|
||||
if (size < PAGESIZE) {
|
||||
align = SPA_MINBLOCKSIZE;
|
||||
} else if (IS_P2ALIGNED(size, p2 >> 2)) {
|
||||
align = MIN(p2 >> 2, PAGESIZE);
|
||||
align = PAGESIZE;
|
||||
}
|
||||
|
||||
if (align != 0) {
|
||||
|
@ -3472,7 +3472,7 @@ zbookmark_is_before(const dnode_phys_t *dnp, const zbookmark_phys_t *zb1,
|
|||
|
||||
if (zb1->zb_object == DMU_META_DNODE_OBJECT) {
|
||||
uint64_t nextobj = zb1nextL0 *
|
||||
(dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT) >> DNODE_SHIFT;
|
||||
(dnp->dn_datablkszsec << (SPA_MINBLOCKSHIFT - DNODE_SHIFT));
|
||||
return (nextobj <= zb2thisobj);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,16 +100,17 @@ zpl_root_readdir(struct file *filp, void *dirent, filldir_t filldir)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zpl_root_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
struct kstat *stat)
|
||||
zpl_root_getattr_impl(const struct path *path, struct kstat *stat,
|
||||
u32 request_mask, unsigned int query_flags)
|
||||
{
|
||||
int error;
|
||||
struct inode *ip = path->dentry->d_inode;
|
||||
|
||||
error = simple_getattr(mnt, dentry, stat);
|
||||
stat->atime = CURRENT_TIME;
|
||||
generic_fillattr(ip, stat);
|
||||
stat->atime = current_time(ip);
|
||||
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
ZPL_GETATTR_WRAPPER(zpl_root_getattr);
|
||||
|
||||
static struct dentry *
|
||||
#ifdef HAVE_LOOKUP_NAMEIDATA
|
||||
|
@ -375,21 +376,22 @@ zpl_snapdir_mkdir(struct inode *dip, struct dentry *dentry, zpl_umode_t mode)
|
|||
*/
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zpl_snapdir_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
struct kstat *stat)
|
||||
zpl_snapdir_getattr_impl(const struct path *path, struct kstat *stat,
|
||||
u32 request_mask, unsigned int query_flags)
|
||||
{
|
||||
zfs_sb_t *zsb = ITOZSB(dentry->d_inode);
|
||||
int error;
|
||||
struct inode *ip = path->dentry->d_inode;
|
||||
zfs_sb_t *zsb = ITOZSB(path->dentry->d_inode);
|
||||
|
||||
ZFS_ENTER(zsb);
|
||||
error = simple_getattr(mnt, dentry, stat);
|
||||
generic_fillattr(path->dentry->d_inode, stat);
|
||||
stat->nlink = stat->size = 2;
|
||||
stat->ctime = stat->mtime = dmu_objset_snap_cmtime(zsb->z_os);
|
||||
stat->atime = CURRENT_TIME;
|
||||
stat->atime = current_time(ip);
|
||||
ZFS_EXIT(zsb);
|
||||
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
ZPL_GETATTR_WRAPPER(zpl_snapdir_getattr);
|
||||
|
||||
/*
|
||||
* The '.zfs/snapshot' directory file operations. These mainly control
|
||||
|
@ -509,10 +511,10 @@ zpl_shares_readdir(struct file *filp, void *dirent, filldir_t filldir)
|
|||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
zpl_shares_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
struct kstat *stat)
|
||||
zpl_shares_getattr_impl(const struct path *path, struct kstat *stat,
|
||||
u32 request_mask, unsigned int query_flags)
|
||||
{
|
||||
struct inode *ip = dentry->d_inode;
|
||||
struct inode *ip = path->dentry->d_inode;
|
||||
zfs_sb_t *zsb = ITOZSB(ip);
|
||||
znode_t *dzp;
|
||||
int error;
|
||||
|
@ -520,11 +522,11 @@ zpl_shares_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
|||
ZFS_ENTER(zsb);
|
||||
|
||||
if (zsb->z_shares_dir == 0) {
|
||||
error = simple_getattr(mnt, dentry, stat);
|
||||
generic_fillattr(path->dentry->d_inode, stat);
|
||||
stat->nlink = stat->size = 2;
|
||||
stat->atime = CURRENT_TIME;
|
||||
stat->atime = current_time(ip);
|
||||
ZFS_EXIT(zsb);
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
|
||||
error = -zfs_zget(zsb, zsb->z_shares_dir, &dzp);
|
||||
|
@ -538,6 +540,7 @@ zpl_shares_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
|||
|
||||
return (error);
|
||||
}
|
||||
ZPL_GETATTR_WRAPPER(zpl_shares_getattr);
|
||||
|
||||
/*
|
||||
* The '.zfs/shares' directory file operations.
|
||||
|
|
|
@ -857,9 +857,15 @@ const struct file_operations zpl_file_operations = {
|
|||
.release = zpl_release,
|
||||
.llseek = zpl_llseek,
|
||||
#ifdef HAVE_VFS_RW_ITERATE
|
||||
#ifdef HAVE_NEW_SYNC_READ
|
||||
.read = new_sync_read,
|
||||
.write = new_sync_write,
|
||||
#endif
|
||||
.read_iter = zpl_iter_read,
|
||||
.write_iter = zpl_iter_write,
|
||||
#else
|
||||
.read = do_sync_read,
|
||||
.write = do_sync_write,
|
||||
.aio_read = zpl_aio_read,
|
||||
.aio_write = zpl_aio_write,
|
||||
#endif
|
||||
|
|
|
@ -50,7 +50,7 @@ zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
|
|||
int zfs_flags = 0;
|
||||
zfs_sb_t *zsb = dentry->d_sb->s_fs_info;
|
||||
|
||||
if (dlen(dentry) > ZFS_MAXNAMELEN)
|
||||
if (dlen(dentry) >= ZAP_MAXNAMELEN)
|
||||
return (ERR_PTR(-ENAMETOOLONG));
|
||||
|
||||
crhold(cr);
|
||||
|
@ -302,18 +302,25 @@ zpl_rmdir(struct inode * dir, struct dentry *dentry)
|
|||
}
|
||||
|
||||
static int
|
||||
zpl_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
|
||||
zpl_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask,
|
||||
unsigned int query_flags)
|
||||
{
|
||||
int error;
|
||||
fstrans_cookie_t cookie;
|
||||
|
||||
cookie = spl_fstrans_mark();
|
||||
error = -zfs_getattr_fast(dentry->d_inode, stat);
|
||||
|
||||
/*
|
||||
* XXX request_mask and query_flags currently ignored.
|
||||
*/
|
||||
|
||||
error = -zfs_getattr_fast(path->dentry->d_inode, stat);
|
||||
spl_fstrans_unmark(cookie);
|
||||
ASSERT3S(error, <=, 0);
|
||||
|
||||
return (error);
|
||||
}
|
||||
ZPL_GETATTR_WRAPPER(zpl_getattr);
|
||||
|
||||
static int
|
||||
zpl_setattr(struct dentry *dentry, struct iattr *ia)
|
||||
|
@ -550,7 +557,7 @@ zpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
|
|||
return (-EMLINK);
|
||||
|
||||
crhold(cr);
|
||||
ip->i_ctime = CURRENT_TIME_SEC;
|
||||
ip->i_ctime = current_time(ip);
|
||||
igrab(ip); /* Use ihold() if available */
|
||||
|
||||
cookie = spl_fstrans_mark();
|
||||
|
|
|
@ -938,7 +938,6 @@ xattr_handler_t zpl_xattr_security_handler = {
|
|||
int
|
||||
zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
|
||||
{
|
||||
struct super_block *sb = ITOZSB(ip)->z_sb;
|
||||
char *name, *value = NULL;
|
||||
int error = 0;
|
||||
size_t size = 0;
|
||||
|
@ -964,7 +963,7 @@ zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
|
|||
*/
|
||||
if (ip->i_mode != mode) {
|
||||
ip->i_mode = mode;
|
||||
ip->i_ctime = current_fs_time(sb);
|
||||
ip->i_ctime = current_time(ip);
|
||||
zfs_mark_inode_dirty(ip);
|
||||
}
|
||||
|
||||
|
@ -1130,7 +1129,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
|
|||
|
||||
if (!acl) {
|
||||
ip->i_mode &= ~current_umask();
|
||||
ip->i_ctime = current_fs_time(ITOZSB(ip)->z_sb);
|
||||
ip->i_ctime = current_time(ip);
|
||||
zfs_mark_inode_dirty(ip);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -1615,14 +1615,12 @@ zvol_rename_minors_impl(const char *oldname, const char *newname)
|
|||
{
|
||||
zvol_state_t *zv, *zv_next;
|
||||
int oldnamelen, newnamelen;
|
||||
char *name;
|
||||
|
||||
if (zvol_inhibit_dev)
|
||||
return;
|
||||
|
||||
oldnamelen = strlen(oldname);
|
||||
newnamelen = strlen(newname);
|
||||
name = kmem_alloc(MAXNAMELEN, KM_SLEEP);
|
||||
|
||||
mutex_enter(&zvol_state_lock);
|
||||
|
||||
|
@ -1638,16 +1636,15 @@ zvol_rename_minors_impl(const char *oldname, const char *newname)
|
|||
} else if (strncmp(zv->zv_name, oldname, oldnamelen) == 0 &&
|
||||
(zv->zv_name[oldnamelen] == '/' ||
|
||||
zv->zv_name[oldnamelen] == '@')) {
|
||||
snprintf(name, MAXNAMELEN, "%s%c%s", newname,
|
||||
char *name = kmem_asprintf("%s%c%s", newname,
|
||||
zv->zv_name[oldnamelen],
|
||||
zv->zv_name + oldnamelen + 1);
|
||||
zvol_rename_minor(zv, name);
|
||||
kmem_free(name, strlen(name + 1));
|
||||
}
|
||||
}
|
||||
|
||||
mutex_exit(&zvol_state_lock);
|
||||
|
||||
kmem_free(name, MAXNAMELEN);
|
||||
}
|
||||
|
||||
typedef struct zvol_snapdev_cb_arg {
|
||||
|
|
|
@ -186,6 +186,39 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
|
|||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
* Mon Jul 10 2017 Tony Hutter <hutter2@llnl.gov> - 0.6.5.11-1
|
||||
- Linux 4.12 compat: super_setup_bdi_name() - add missing code zfsonlinux/zfs#6089 zfsonlinux/zfs#6324
|
||||
- Musl libc fixes zfsonlinux/zfs#6310
|
||||
- Increase zfs_vdev_async_write_min_active to 2 zfsonlinux/zfs#5926
|
||||
- Fix int overflow in zbookmark_is_before()- Fix RHEL 7.4 bio_set_op_attrs build error zfsonlinux/zfs#6234 zfsonlinux/zfs#6271
|
||||
- Fix RHEL 7.4 bio_set_op_attrs build error zfsonlinux/zfs#6253 zfsonlinux/zfs#6271
|
||||
- GCC 7.1 fixes zfsonlinux/zfs#6253
|
||||
- Remove complicated libspl assert wrappers zfsonlinux/zfs#4449
|
||||
- Compatibilty with glibc-2.23 zfsonlinux/zfs#6132
|
||||
- glibc 2.5 compat: use correct header for makedev() et al. zfsonlinux/zfs#5945
|
||||
* Mon Jun 12 2017 Tony Hutter <hutter2@llnl.gov> - 0.6.5.10-1
|
||||
- OpenZFS 8005 - poor performance of 1MB writes on certain RAID-Z configurations zfsonlinux/zfs#5931
|
||||
- Add MS_MANDLOCK mount failure message zfsonlinux/zfs#4729 zfsonlinux/zfs#6199
|
||||
- Fix import wrong spare/l2 device when path change zfsonlinux/zfs#6158
|
||||
- Fix import finding spare/l2cache when path changes zfsonlinux/zfs#6158
|
||||
- Linux 4.9 compat: fix zfs_ctldir xattr handling zfsonlinux/zfs#6189
|
||||
- Linux 4.12 compat: fix super_setup_bdi_name() call zfsonlinux/zfs#6147
|
||||
- Linux 4.12 compat: CURRENT_TIME removed zfsonlinux/zfs#6114
|
||||
- Linux 4.12 compat: super_setup_bdi_name() zfsonlinux/zfs#6089
|
||||
- Limit zfs_dirty_data_max_max to 4G zfsonlinux/zfs#6072 zfsonlinux/zfs#6081
|
||||
- OpenZFS 8166 - zpool scrub thinks it repaired offline device zfsonlinux/zfs#5806 zfsonlinux/zfs#6103
|
||||
- vdev_id: fix failure due to multipath -l bug zfsonlinux/zfs#6039
|
||||
- Guarantee PAGESIZE alignment for large zio buffers zfsonlinux/zfs#6084
|
||||
- Fix harmless "BARRIER is deprecated" kernel warning on Centos 6.8 zfsonlinux/zfs#5739 zfsonlinux/zfs#5828
|
||||
- Add kmap_atomic in dmu_bio_copy- zdb: segfault in dump_bpobj_subobjs() zfsonlinux/zfs#3905
|
||||
- Fix atomic_sub_64() i386 assembly implementation zfsonlinux/zfs#5671 zfsonlinux/zfs#5717
|
||||
- Fix loop device becomes read-only zfsonlinux/zfs#5776 zfsonlinux/zfs#5855
|
||||
- Allow ZVOL bookmarks to be listed recursively zfsonlinux/zfs#4503 zfsonlinux/zfs#5072
|
||||
- Fix zfs-mount.service failure on boot zfsonlinux/zfs#5719
|
||||
- Fix iput() calls within a tx zfsonlinux/zfs#5758
|
||||
- Fix off by one in zpl_lookup zfsonlinux/zfs#5768
|
||||
- Linux 4.11 compat: iops.getattr and friends zfsonlinux/zfs#5875
|
||||
- Linux 4.11 compat: avoid refcount_t name conflict zfsonlinux/zfs#5823 zfsonlinux/zfs#5842
|
||||
* Fri Feb 3 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5.9-1
|
||||
- Use large stacks when available zfsonlinux/zfs#4059
|
||||
- Use set_cached_acl() and forget_cached_acl() when possible zfsonlinux/zfs#5378
|
||||
|
|
|
@ -328,6 +328,39 @@ exit 0
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jul 10 2017 Tony Hutter <hutter2@llnl.gov> - 0.6.5.11-1
|
||||
- Linux 4.12 compat: super_setup_bdi_name() - add missing code zfsonlinux/zfs#6089 zfsonlinux/zfs#6324
|
||||
- Musl libc fixes zfsonlinux/zfs#6310
|
||||
- Increase zfs_vdev_async_write_min_active to 2 zfsonlinux/zfs#5926
|
||||
- Fix int overflow in zbookmark_is_before()- Fix RHEL 7.4 bio_set_op_attrs build error zfsonlinux/zfs#6234 zfsonlinux/zfs#6271
|
||||
- Fix RHEL 7.4 bio_set_op_attrs build error zfsonlinux/zfs#6253 zfsonlinux/zfs#6271
|
||||
- GCC 7.1 fixes zfsonlinux/zfs#6253
|
||||
- Remove complicated libspl assert wrappers zfsonlinux/zfs#4449
|
||||
- Compatibilty with glibc-2.23 zfsonlinux/zfs#6132
|
||||
- glibc 2.5 compat: use correct header for makedev() et al. zfsonlinux/zfs#5945
|
||||
* Mon Jun 12 2017 Tony Hutter <hutter2@llnl.gov> - 0.6.5.10-1
|
||||
- OpenZFS 8005 - poor performance of 1MB writes on certain RAID-Z configurations zfsonlinux/zfs#5931
|
||||
- Add MS_MANDLOCK mount failure message zfsonlinux/zfs#4729 zfsonlinux/zfs#6199
|
||||
- Fix import wrong spare/l2 device when path change zfsonlinux/zfs#6158
|
||||
- Fix import finding spare/l2cache when path changes zfsonlinux/zfs#6158
|
||||
- Linux 4.9 compat: fix zfs_ctldir xattr handling zfsonlinux/zfs#6189
|
||||
- Linux 4.12 compat: fix super_setup_bdi_name() call zfsonlinux/zfs#6147
|
||||
- Linux 4.12 compat: CURRENT_TIME removed zfsonlinux/zfs#6114
|
||||
- Linux 4.12 compat: super_setup_bdi_name() zfsonlinux/zfs#6089
|
||||
- Limit zfs_dirty_data_max_max to 4G zfsonlinux/zfs#6072 zfsonlinux/zfs#6081
|
||||
- OpenZFS 8166 - zpool scrub thinks it repaired offline device zfsonlinux/zfs#5806 zfsonlinux/zfs#6103
|
||||
- vdev_id: fix failure due to multipath -l bug zfsonlinux/zfs#6039
|
||||
- Guarantee PAGESIZE alignment for large zio buffers zfsonlinux/zfs#6084
|
||||
- Fix harmless "BARRIER is deprecated" kernel warning on Centos 6.8 zfsonlinux/zfs#5739 zfsonlinux/zfs#5828
|
||||
- Add kmap_atomic in dmu_bio_copy- zdb: segfault in dump_bpobj_subobjs() zfsonlinux/zfs#3905
|
||||
- Fix atomic_sub_64() i386 assembly implementation zfsonlinux/zfs#5671 zfsonlinux/zfs#5717
|
||||
- Fix loop device becomes read-only zfsonlinux/zfs#5776 zfsonlinux/zfs#5855
|
||||
- Allow ZVOL bookmarks to be listed recursively zfsonlinux/zfs#4503 zfsonlinux/zfs#5072
|
||||
- Fix zfs-mount.service failure on boot zfsonlinux/zfs#5719
|
||||
- Fix iput() calls within a tx zfsonlinux/zfs#5758
|
||||
- Fix off by one in zpl_lookup zfsonlinux/zfs#5768
|
||||
- Linux 4.11 compat: iops.getattr and friends zfsonlinux/zfs#5875
|
||||
- Linux 4.11 compat: avoid refcount_t name conflict zfsonlinux/zfs#5823 zfsonlinux/zfs#5842
|
||||
* Fri Feb 3 2017 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5.9-1
|
||||
- Use large stacks when available zfsonlinux/zfs#4059
|
||||
- Use set_cached_acl() and forget_cached_acl() when possible zfsonlinux/zfs#5378
|
||||
|
|
Loading…
Reference in New Issue