Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zpl_mount() deadlock #7693

Merged
merged 1 commit into from
Jul 11, 2018
Merged

Fix zpl_mount() deadlock #7693

merged 1 commit into from
Jul 11, 2018

Commits on Jul 11, 2018

  1. Fix zpl_mount() deadlock

    Commit 93b43af inadvertently introduced the following scenario which
    can result in a deadlock.  This issue was most easily reproduced by
    LXD containers using a ZFS storage backend but should be reproducible
    under any workload which is frequently mounting and unmounting.
    
    -- THREAD A --
    spa_sync()
      spa_sync_upgrades()
        rrw_enter(&dp->dp_config_rwlock, RW_WRITER, FTAG); <- Waiting on B
    
    -- THREAD B --
    mount_fs()
      zpl_mount()
        zpl_mount_impl()
          dmu_objset_hold()
            dmu_objset_hold_flags()
              dsl_pool_hold()
                dsl_pool_config_enter()
                  rrw_enter(&dp->dp_config_rwlock, RW_READER, tag);
        sget()
          sget_userns()
            grab_super()
              down_write(&s->s_umount); <- Waiting on C
    
    -- THREAD C --
    cleanup_mnt()
      deactivate_super()
        down_write(&s->s_umount);
        deactivate_locked_super()
          zpl_kill_sb()
            kill_anon_super()
              generic_shutdown_super()
                sync_filesystem()
                  zpl_sync_fs()
                    zfs_sync()
                      zil_commit()
                        txg_wait_synced() <- Waiting on A
    
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Issue openzfs#7691
    behlendorf committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    bbee325 View commit details
    Browse the repository at this point in the history