mirror_zfs/module
Brian Behlendorf ccfa35c6f9 Correct missing zil_claim() DTL updates
Commit a1d477c2 accidentally disabled DTL updates for the zil_claim()
case described at the end of vdev_stat_update() by unconditionally
disabling all DTL updates when loading.  This was done to avoid
a deadlock on the vd_dtl_lock when loading the DTLs from disk.

    vdev_dtl_contains <--- Takes vd->vd_dtl_lock
    vdev_mirror_child_missing
    vdev_mirror_io_start
    zio_vdev_io_start
    __zio_execute
    arc_read
    dbuf_issue_final_prefetch
    dbuf_prefetch_impl
    dbuf_prefetch
    dmu_prefetch
    space_map_iterate
    space_map_load_length
    space_map_load
    vdev_dtl_load <--- Takes vd->vd_dtl_lock
    vdev_load
    spa_ld_load_vdev_metadata
    spa_tryimport

The missing DTL updates can be restored by moving the space_map_load()
call outside the vd_dtl_lock.  A private range tree is populated by
reading the space map and then merged in to the DTL_MISSING tree
under the lock.

Furthermore, the SPA_LOAD_NONE check in vdev_dtl_contains() leads to an
additional problem.  Any resilvering which occurs before SPA_LOAD_NONE
is set will incorrectly determine that there's nothing to repair.  This
can result in full redundancy not being restored for some blocks.

Reviewed-by: Matt Ahrens <matt@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11218
2020-11-22 10:01:43 -08:00
..
avl Links in Source Files 2020-09-03 16:17:18 -07:00
icp ICP: gcm: Allocate hash subkey table separately 2020-10-30 16:06:09 -07:00
lua Use known license string for zlua 2020-10-30 16:03:37 -07:00
nvpair Links in Source Files 2020-09-03 16:17:18 -07:00
os Fix problems in zvol_set_volmode_impl 2020-11-17 12:20:09 -08:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Throw const on some strings 2020-10-16 12:55:56 -07:00
zcommon Update references to nonexistent man pages in code 2020-10-30 16:04:41 -07:00
zfs Correct missing zil_claim() DTL updates 2020-11-22 10:01:43 -08:00
zstd Optimize locking checks in mempool allocator 2020-11-03 09:51:10 -08:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Makefile.bsd: remove directory that no longer exists 2020-10-30 15:57:46 -07:00
Makefile.in Fix Linux modules uninstall 2020-10-16 13:01:14 -07:00