Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-dm
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-dm
  • Repository
Switch branch/tag
  • linux-dm
  • drivers
  • nvdimm
  • bus.c
Find file BlameHistoryPermalink
  • Dan Williams's avatar
    libnvdimm/bus: Prevent duplicate device_unregister() calls · 8aac0e23
    Dan Williams authored Jul 17, 2019
    
    
    A multithreaded namespace creation/destruction stress test currently
    fails with signatures like the following:
    
        sysfs group 'power' not found for kobject 'dax1.1'
        RIP: 0010:sysfs_remove_group+0x76/0x80
        Call Trace:
         device_del+0x73/0x370
         device_unregister+0x16/0x50
         nd_async_device_unregister+0x1e/0x30 [libnvdimm]
         async_run_entry_fn+0x39/0x160
         process_one_work+0x23c/0x5e0
         worker_thread+0x3c/0x390
    
        BUG: kernel NULL pointer dereference, address: 0000000000000020
        RIP: 0010:klist_put+0x1b/0x6c
        Call Trace:
         klist_del+0xe/0x10
         device_del+0x8a/0x2c9
         ? __switch_to_asm+0x34/0x70
         ? __switch_to_asm+0x40/0x70
         device_unregister+0x44/0x4f
         nd_async_device_unregister+0x22/0x2d [libnvdimm]
         async_run_entry_fn+0x47/0x15a
         process_one_work+0x1a2/0x2eb
         worker_thread+0x1b8/0x26e
    
    Use the kill_device() helper to atomically resolve the race of multiple
    threads issuing kill, device_unregister(), requests.
    
    Reported-by: default avatarJane Chu <jane.chu@oracle.com>
    Reported-by: default avatarErwin Tsaur <erwin.tsaur@oracle.com>
    Fixes: 4d88a97a ("libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver...")
    Cc: <stable@vger.kernel.org>
    Link: https://github.com/pmem/ndctl/issues/96
    
    
    Tested-by: default avatarTested-by: Jane Chu <jane.chu@oracle.com>
    Link: https://lore.kernel.org/r/156341207846.292348.10435719262819764054.stgit@dwillia2-desk3.amr.corp.intel.com
    
    
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    8aac0e23