• Jun'ichi Nomura's avatar
    dm: path selector use module refcount directly · aea90588
    Jun'ichi Nomura authored
    Fix refcount corruption in dm-path-selector
    
    Refcounting with non-atomic ops under shared lock will corrupt the counter
    in multi-processor system and may trigger BUG_ON().
    Use module refcount.
    # same approach as dm-target-use-module-refcount-directly.patch here
    # https://www.redhat.com/archives/dm-devel/2008-December/msg00075.html
    
    Typical oops:
      kernel BUG at linux-2.6.29-rc3/drivers/md/dm-path-selector.c:90!
      Pid: 11148, comm: dmsetup Not tainted 2.6.29-rc3-nm #1
      dm_put_path_selector+0x4d/0x61 [dm_multipath]
      Call Trace:
       [<ffffffffa031d3f9>] free_priority_group+0x33/0xb3 [dm_multipath]
       [<ffffffffa031d4aa>] free_multipath+0x31/0x67 [dm_multipath]
       [<ffffffffa031d50d>] multipath_dtr+0x2d/0x32 [dm_multipath]
       [<ffffffffa015d6c2>] dm_table_destroy+0x64/0xd8 [dm_mod]
       [<ffffffffa015b73a>] __unbind+0x46/0x4b [dm_mod]
       [<ffffffffa015b79f>] dm_swap_table+0x60/0x14d [dm_mod]
       [<ffffffffa015f963>] dev_suspend+0xfd/0x177 [dm_mod]
       [<ffffffffa016...
    aea90588
dm-path-selector.c 2.42 KB