]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Need a long hold in zpl_mount_impl
authorJohn Poduska <jpoduska@datto.com>
Thu, 17 Sep 2020 17:53:02 +0000 (13:53 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 18 Sep 2020 19:38:09 +0000 (12:38 -0700)
In zpl_mount_impl, there is:
    dmu_objset_hold ; returns with pool & ds held
    dsl_pool_rele

    sget

    dsl_dataset_rele

As spelled out in the "DSL Pool Configuration Lock" in dsl_pool.c,
this requires a long hold.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
Signed-off-by: John Poduska <jpoduska@datto.com>
Closes #10936

module/os/linux/zfs/zpl_super.c

index 5aaf82793f0e08a14596c4b3bec7fd52421d7d74..9db8bda4cc66366b9b3e69160dd908c355678370 100644 (file)
@@ -274,8 +274,12 @@ zpl_mount_impl(struct file_system_type *fs_type, int flags, zfs_mnt_t *zm)
         * a txg sync.  If the dsl_pool lock is held over sget()
         * this can prevent the pool sync and cause a deadlock.
         */
+       dsl_dataset_long_hold(dmu_objset_ds(os), FTAG);
        dsl_pool_rele(dmu_objset_pool(os), FTAG);
+
        s = sget(fs_type, zpl_test_super, set_anon_super, flags, os);
+
+       dsl_dataset_long_rele(dmu_objset_ds(os), FTAG);
        dsl_dataset_rele(dmu_objset_ds(os), FTAG);
 
        if (IS_ERR(s))