Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • include
  • linux
  • writeback.h
Find file BlameHistoryPermalink
  • Jan Kara's avatar
    block: Fix oops in locked_inode_to_wb_and_lock_list() · 3b9d0678
    Jan Kara authored Mar 23, 2017
    BugLink: http://bugs.launchpad.net/bugs/1659111
    
    
    
    When block device is closed, we call inode_detach_wb() in __blkdev_put()
    which sets inode->i_wb to NULL. That is contrary to expectations that
    inode->i_wb stays valid once set during the whole inode's lifetime and
    leads to oops in wb_get() in locked_inode_to_wb_and_lock_list() because
    inode_to_wb() returned NULL.
    
    The reason why we called inode_detach_wb() is not valid anymore though.
    BDI is guaranteed to stay along until we call bdi_put() from
    bdev_evict_inode() so we can postpone calling inode_detach_wb() to that
    moment.
    
    Also add a warning to catch if someone uses inode_detach_wb() in a
    dangerous way.
    
    Reported-by: default avatarThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
    Acked-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    (cherry picked from commit f759741d
    
    )
    Signed-off-by: default avatarThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
    Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
    Acked-by: default avatarSeth Forshee <seth.forshee@canonical.com>
    Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
    Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
    3b9d0678
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7