freebsd-dev/cddl/contrib/opensolaris
Andriy Gapon b4e4140d13 MFV r322223: 8378 crash due to bp in-memory modification of nopwrite block
illumos/illumos-gate@b7edcb9408
b7edcb9408

https://www.illumos.org/issues/8378
  The problem is that zfs_get_data() supplies a stale zgd_bp to dmu_sync(), which
  we then nopwrite against.
  zfs_get_data() doesn't hold any DMU-related locks, so after it copies db_blkptr
  to zgd_bp, dbuf_write_ready()
  could change db_blkptr, and dbuf_write_done() could remove the dirty record.
  dmu_sync() then sees the stale
  BP and that the dbuf it not dirty, so it is eligible for nop-writing.
  The fix is for dmu_sync() to copy db_blkptr to zgd_bp after acquiring the
  db_mtx. We could still see a stale
  db_blkptr, but if it is stale then the dirty record will still exist and thus
  we won't attempt to nopwrite.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after:	2 weeks
2017-08-08 10:46:51 +00:00
..
cmd MFV r322223: 8378 crash due to bp in-memory modification of nopwrite block 2017-08-08 10:46:51 +00:00
common Recursively enumerate anonymous structs and unions in ctf_member_info(). 2016-08-30 05:50:42 +00:00
head MFV r270197: 2014-08-22 22:13:36 +00:00
lib MFV r322217: 8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op 2017-08-08 10:30:49 +00:00
tools/ctf Revert r253678, r253661: 2016-12-03 17:44:43 +00:00
OPENSOLARIS.LICENSE Now that we have CDDLed code in the tree, add CDDL license. 2007-09-23 07:04:50 +00:00