Skip to content

Commit

Permalink
Need a long hold in zpl_mount_impl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Paul Zuchowski <[email protected]>
Signed-off-by: John Poduska <[email protected]>
Closes openzfs#10936
  • Loading branch information
jwpoduska authored and RageLtMan committed May 31, 2021
1 parent e1c29a9 commit 179a1a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/os/linux/zfs/zpl_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 179a1a5

Please sign in to comment.