zfsonlinux/zfs — pull request #2545 by dweeezil (2014-07-26 17:30:09+00:00)
Title: Illumos 4390

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
Reviewed by: Christopher Siden
Reviewed by: Adam Leventhal
Reviewed by: Dan McDonald
Reviewed by: Saso Kiselkov
Approved by: Dan McDonald
Ported by: Tim Chase

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.