]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r358336: MFZoL: Fix txg_sync_thread hang in scan_exec_io()
authorAlexander Motin <mav@FreeBSD.org>
Wed, 4 Mar 2020 04:36:50 +0000 (04:36 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Wed, 4 Mar 2020 04:36:50 +0000 (04:36 +0000)
commit099665940e3b42549b5b31aa1e3bda95a7feacb0
tree7bf35c8b4a0b30c34610f9b49ce445b4bc303b56
parent5a4d9c879bd7f030de4452858c2662d2d6661f88
MFC r358336: MFZoL: Fix txg_sync_thread hang in scan_exec_io()

When scn->scn_maxinflight_bytes has not been initialized it's
possible to hang on the condition variable in scan_exec_io().
This issue was uncovered by ztest and is only possible when
deduplication is enabled through the following call path.

  txg_sync_thread()
    spa_sync()
      ddt_sync_table()
        ddt_sync_entry()
          dsl_scan_ddt_entry()
            dsl_scan_scrub_cb()
              dsl_scan_enqueuei()
                scan_exec_io()
                  cv_wait()

Resolve the issue by always initializing scn_maxinflight_bytes
to a reasonable minimum value.  This value will be recalculated
in dsl_scan_sync() to pick up changes to zfs_scan_vdev_limit
and the addition/removal of vdevs.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7098
zfsonlinux/zfs@f90a30ad1b32a971f62a540f8944e42f99b254ce
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c