Skip to content

Instantly share code, notes, and snippets.

@tuxoko
tuxoko / a.patch
Last active April 17, 2018 00:15
diff --git a/configure.ac b/configure.ac
index 0893af4..4433cde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,6 +252,7 @@ AC_CONFIG_FILES([
tests/zfs-tests/tests/functional/cli_user/zpool_iostat/Makefile
tests/zfs-tests/tests/functional/cli_user/zpool_list/Makefile
tests/zfs-tests/tests/functional/compression/Makefile
+ tests/zfs-tests/tests/functional/cp_files/Makefile
tests/zfs-tests/tests/functional/ctime/Makefile
diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c
index 5e2a1db..9baeb01 100644
--- a/module/zfs/dmu.c
+++ b/module/zfs/dmu.c
@@ -49,6 +49,7 @@
#ifdef _KERNEL
#include <sys/vmsystm.h>
#include <sys/zfs_znode.h>
+#include <linux/kmap_compat.h>
#endif
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index 75a3b55..54b93e7 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -387,6 +387,8 @@ zpl_iter_write(struct kiocb *kiocb, struct iov_iter *from)
count = iov_iter_count(from);
ret = generic_write_checks(file, &kiocb->ki_pos, &count, isblk);
+ if (ret < 0)
+ return (ret);
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index 3192352..bccc61b 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -47,8 +47,24 @@ typedef struct {
#ifdef CONFIG_LOCKDEP
kmutex_type_t m_type;
#endif /* CONFIG_LOCKDEP */
+#ifdef CONFIG_DEBUG_KMEMLEAK
+ void *leak;
diff --git a/module/zfs/abd.c b/module/zfs/abd.c
index e641a48..3aadec7 100644
--- a/module/zfs/abd.c
+++ b/module/zfs/abd.c
@@ -191,11 +191,11 @@ abd_alloc_chunk(void)
return (c);
}
-static void
-abd_free_chunk(struct page *c)
26 20:30:33 ibmp11pqttle19 kernel: [7626514.003792] ------------[ cut here ]------------
Sep 26 20:30:33 ibmp11pqttle19 kernel: [7626514.003794] kernel BUG at /root/kbuilder/scst/iscsi-scst/kernel/iscsi.c:582!
Sep 26 20:30:33 ibmp11pqttle19 kernel: [7626514.003796] invalid opcode: 0000 [#17] SMP
Sep 26 20:30:33 ibmp11pqttle19 kernel: [7626514.003834] Modules linked in: zfs(POE) zavl(POE) zcommon(POE) znvpair(POE) spl(OE) zunicode(POE) xt_multiport xt_addrtype xt_state xt_REDIRECT nf_nat_redirect iptable_nat nf_conntrack_ipv4 nf_d
efrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables drbd lru_cache qla2x00tgt(O) qla2xxx scsi_transport_fc iscsi_scst(O) scst_vdisk(OE) scst(OE) dlm configfs sctp ipmi_devintf iscsi_tcp libiscsi_tcp libi
scsi scsi_transport_iscsi dm_crypt intel_rapl iosf_mbi x86_pkg_temp_thermal intel_powerclamp bnep coretemp dm_multipath scsi_dh kvm rfcomm sb_edac ipmi_ssif nfsd joydev ioatdma edac_core bluetooth lpc_ich nfs_acl shpchp auth_rpcgss 8250_f
intek nf
commit ca788d058d342dafdcf93a4bd67da61bdd020f61
Author: Chunwei Chen <david.chen@osnexus.com>
Date: Tue Sep 20 11:26:32 2016 -0700
Linux 4.7: fix deadlock during lookup on case-insensitive
We must not use d_add_ci if the dentry already has the real name. Otherwise,
d_add_ci()->d_alloc_parallel() will find itself on the lookup hash and wait
on itself causing deadlock.
diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c
index 22ca84d..d372ea2 100644
--- a/module/zfs/dmu_objset.c
+++ b/module/zfs/dmu_objset.c
@@ -854,6 +854,9 @@ dmu_objset_create_impl(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp,
DN_MAX_OBJECT * sizeof (dnode_phys_t))
levels++;
+ if (type == DMU_OST_ZVOL)
+ levels = 2;
@tuxoko
tuxoko / zglb.patch
Last active December 18, 2015 01:17
diff --git a/module/zfs/zap.c b/module/zfs/zap.c
index 44de234..7d72d01 100644
--- a/module/zfs/zap.c
+++ b/module/zfs/zap.c
@@ -506,7 +506,10 @@ zap_get_leaf_byblk(zap_t *zap, uint64_t blkid, dmu_tx_t *tx, krw_t lt,
int err;
ASSERT(RW_LOCK_HELD(&zap->zap_rwlock));
-
+#ifndef _KERNEL
From f3ac39e16ff20b635e7d8773a4a32a357893aa7f Mon Sep 17 00:00:00 2001
From: Chunwei Chen <david.chen@osnexus.com>
Date: Fri, 11 Dec 2015 15:24:34 -0800
Subject: [PATCH] Fix snapshot automount race cause EREMOTE
When a concorrent mount finishes just before calling to
zfsctl_snapshot_ismounted, if we return EISDIR, the VFS will return with
EREMOTE. We should instead just return 0, so VFS may retry and would likely
notice the dentry is alreadly mounted. This will be inline with when usermode
helper return EBUSY.