]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Illumos 4390 - I/O errors can corrupt space map when deleting fs/vol
authorMatthew Ahrens <mahrens@delphix.com>
Thu, 5 Jun 2014 21:20:08 +0000 (13:20 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 4 Aug 2014 18:50:52 +0000 (11:50 -0700)
commitfbeddd60b79690b6a6ececc9b00b6014d21405aa
tree67d3e5730537bc17cc5032d84864b3a9a10d3028
parent9b67f605601c77c814037613d8129562db642a29
Illumos 4390 - I/O errors can corrupt space map when deleting fs/vol

4390 i/o errors when deleting filesystem/zvol can lead to space map corruption
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>

References:
  https://www.illumos.org/issues/4390
  https://github.com/illumos/illumos-gate/commit/7fd05ac

Porting notes:

Previous stack-reduction efforts in traverse_visitb() caused a fair
number of un-mergable pieces of code.  This patch should reduce its
stack footprint a bit more.

The new local bptree_entry_phys_t in bptree_add() is dynamically-allocated
using kmem_zalloc() for the purpose of stack reduction.

The new global zfs_free_leak_on_eio has been defined as an integer
rather than a boolean_t as was the case with the related zfs_recover
global.  Also, zfs_free_leak_on_eio's definition has been inserted into
zfs_debug.c for consistency with the existing definition of zfs_recover.
Illumos placed it in spa_misc.c.

Ported by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2545
17 files changed:
include/sys/bptree.h
include/sys/dmu.h
include/sys/dsl_dir.h
include/sys/dsl_pool.h
include/sys/dsl_scan.h
include/sys/fs/zfs.h
include/sys/zfs_debug.h
lib/libzfs/libzfs_pool.c
man/man5/zfs-module-parameters.5
module/zcommon/zpool_prop.c
module/zfs/bptree.c
module/zfs/dmu_traverse.c
module/zfs/dsl_pool.c
module/zfs/dsl_scan.c
module/zfs/spa.c
module/zfs/zfs_debug.c
module/zfs/zio.c