freebsd-skq/sys
Andriy Gapon f94aa61c33 MFV r323917: 8648 Fix range locking in ZIL commit codepath
illumos/illumos-gate@42b1411172
42b1411172

https://www.illumos.org/issues/8648
  I'm opening this bug to track integration of the following ZFS on Linux
  commit into illumos:

  commit f763c3d1df569a8d6b60bcb5e95cf07aa7a189e6
  Author: LOLi <loli10K@users.noreply.github.com>
  Date:   Mon Aug 21 17:59:48 2017 +0200

      Fix range locking in ZIL commit codepath

      Since OpenZFS 7578 (1b7c1e5) if we have a ZVOL with logbias=throughput
      we will force WR_INDIRECT itxs in zvol_log_write() setting itx->itx_lr
      offset and length to the offset and length of the BIO from
      zvol_write()->zvol_log_write(): these offset and length are later used
      to take a range lock in zillog->zl_get_data function: zvol_get_data().

      Now suppose we have a ZVOL with blocksize=8K and push 4K writes to
      offset 0: we will only be range-locking 0-4096. This means the
      ASSERTion we make in dbuf_unoverride() is no longer valid because now
      dmu_sync() is called from zilog's get_data functions holding a partial
      lock on the dbuf.

      Fix this by taking a range lock on the whole block in zvol_get_data().

      Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
      Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: loli10K <ezomori.nozomu@gmail.com>

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Alexander Motin <mav@FreeBSD.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: LOLi <loli10K@users.noreply.github.com>

MFC after:	10 days
2017-09-22 08:27:27 +00:00
..
amd64 Do not do torn writes to active LDTs. 2017-09-19 17:57:04 +00:00
arm Define CPU_XSCALE_CORE3 when relevant. 2017-09-19 23:41:55 +00:00
arm64 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
boot libefi: define EISA PNP constants 2017-09-22 07:44:36 +00:00
bsm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
cam cam iosched: Bettar account IOPS for smoother performance 2017-09-22 02:36:36 +00:00
cddl MFV r323917: 8648 Fix range locking in ZIL commit codepath 2017-09-22 08:27:27 +00:00
compat Add support for 32-bit compatibility IOCTLs in the LinuxKPI. 2017-09-22 08:12:08 +00:00
conf Miscellaneous fixes and improvements to MMCCAM stack 2017-09-15 19:47:44 +00:00
contrib Plug memory leak in case when nvlist allocation succeeds, but nvpair 2017-09-21 10:28:22 +00:00
crypto aesni(4): Fix another trivial typo (aensi -> aesni) 2017-09-20 18:31:36 +00:00
ddb Rename mkdumpheader() and group EKCD functions in kern_shutdown.c. 2017-08-18 04:04:09 +00:00
dev Extend sysctl description for hw.usb.disable_enumeration . 2017-09-22 08:21:35 +00:00
fs Only handle _PC_MAX_CANON, _PC_MAX_INPUT, and _PC_VDISABLE for TTY devices. 2017-09-21 23:05:32 +00:00
gdb
geom gmirror: treat ENXIO as disk disconnect, not media error 2017-09-15 13:57:08 +00:00
gnu Update DTS files from Linux 4.12 2017-07-09 13:53:32 +00:00
i386 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
isa Use better hard-coded defaults for the cursor shape, and remove nearby 2017-08-19 19:33:16 +00:00
kern Fix undeclared identifier error introduced in r323879 2017-09-21 23:27:35 +00:00
kgssapi
libkern x86/crc32_sse42.c: quiet unused function warning 2017-08-11 17:05:31 +00:00
mips Add MIPS32/64 Rev2 CP0 intctl register definitions. 2017-09-15 19:56:21 +00:00
modules Give icee(4) a detach() method so it can be used as a module. Add a 2017-09-17 22:58:13 +00:00
net bridge: Set module version 2017-09-21 14:14:01 +00:00
net80211 net80211: fix a typo (premable -> preamble). 2017-08-27 22:13:03 +00:00
netgraph Unprotected modification of ng_iface(4) private data leads to kernel panic. 2017-09-21 20:16:10 +00:00
netinet Add missing locking. Found by Coverity while scanning the usrsctp 2017-09-22 06:33:01 +00:00
netinet6 Fix a locking issue found by Coverity scanning the usrsctp library. 2017-09-09 20:51:54 +00:00
netipsec Fix possible double releasing for SA reference. 2017-09-01 11:51:07 +00:00
netpfil Use in_localip() function instead of unlocked access to addresses hash 2017-09-20 22:35:28 +00:00
netsmb
nfs Improve FHA locality control for NFS read/write requests. 2017-07-31 15:23:19 +00:00
nfsclient
nfsserver
nlm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
ofed Remove unsafe access to the LinuxKPI file structure from ibcore. 2017-09-09 06:34:20 +00:00
opencrypto Support AEAD requests with non-GCM algorithms. 2017-09-22 00:34:46 +00:00
powerpc Fix indentation for r323068 2017-09-19 20:40:05 +00:00
riscv Sync with amd64/arm/arm64/i386/mips pmap change r288256: 2017-09-20 04:19:49 +00:00
rpc Listening sockets improvements. 2017-06-08 21:30:34 +00:00
security Sprinkle __read_frequently on few obvious places. 2017-09-06 20:33:33 +00:00
sparc64 Fix indentation for r323068 2017-09-19 20:40:05 +00:00
sys Add support for 32-bit compatibility IOCTLs in the LinuxKPI. 2017-09-22 08:12:08 +00:00
teken Fix syscons escape sequence for setting the local cursor type. This sequence 2017-08-18 15:40:40 +00:00
tests style(9): sort headers 2017-05-09 05:08:47 +00:00
tools make.conf: Add the possibility to use another DTC 2017-06-17 23:34:53 +00:00
ufs Add UFS_LINK_MAX for the UFS-specific limit on link counts. 2017-09-18 23:30:39 +00:00
vm For unlinked files, do not msync(2) or sync on the vnode deactivation. 2017-09-19 16:46:37 +00:00
x86 x86: Decode AMD "Extended Feature Extensions ID EBX" bits 2017-09-20 18:30:37 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
xen
Makefile Remove glimpse make target added in r181432 2017-05-22 15:53:30 +00:00