Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • L lustre-release
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • debian-packagesdebian-packages
  • lustre-release
  • Repository
Switch branch/tag
  • lustre-release
  • lustre
  • llite
  • llite_lib.c
Find file BlameHistoryPermalink
  • Lai Siyao's avatar
    LU-13121 llite: fix deadlock in ll_update_lsm_md() · 37465502
    Lai Siyao authored Jan 07, 2020
    
    
    Deadlock may happen in in following senario: a lookup process called
    ll_update_lsm_md(), it found lli->lli_lsm_md is NULL, then
    down_write(&lli->lli_lsm_sem). but another lookup process initialized
    lli->lli_lsm_md after this check and before write lock, so the first
    lookup process called up_read(&lli->lli_lsm_sem) and return, so the
    write lock is never released, which cause subsequent lookups deadlock.
    
    Rearrange the code to simplify the locking:
    1. take read lock.
    2. if lsm was initialized and unchanged, release read lock and return.
    3. otherwise release read lock and take write lock.
    4. free current lsm and initialize with new lsm.
    5. release write lock.
    6. initialize stripes with read lock.
    
    Signed-off-by: default avatarLai Siyao <lai.siyao@whamcloud.com>
    Change-Id: Ifcc25a957983512db6f29105b5ca5b6ec914cb4b
    Reviewed-on: https://review.whamcloud.com/37182
    
    
    Tested-by: default avatarjenkins <devops@whamcloud.com>
    Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
    Tested-by: default avatarMaloo <maloo@whamcloud.com>
    Reviewed-by: default avatarHongchao Zhang <hongchao@whamcloud.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    37465502

https://git.gsi.de is provided by CIT→Linux&Web | GSI Helmholtzzentrum fuer Schwerionenforschung GmbH | Imprint (in German) | Privacy policy