Files
linux/drivers
Kiyoshi Ueda d1a2ec482c dm ioctl: release _hash_lock between devices in remove_all
commit 98f332855e upstream.

This patch changes dm_hash_remove_all() to release _hash_lock when
removing a device.  After removing the device, dm_hash_remove_all()
takes _hash_lock and searches the hash from scratch again.

This patch is a preparation for the next patch, which changes device
deletion code to wait for md reference to be 0.  Without this patch,
the wait in the next patch may cause AB-BA deadlock:
  CPU0                                CPU1
  -----------------------------------------------------------------------
  dm_hash_remove_all()
    down_write(_hash_lock)
                                      table_status()
                                        md = find_device()
                                               dm_get(md)
                                                 <increment md->holders>
                                        dm_get_live_or_inactive_table()
                                          dm_get_inactive_table()
                                            down_write(_hash_lock)
    <in the md deletion code>
      <wait for md->holders to be 0>

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-26 16:41:44 -07:00
..
2009-06-16 19:50:13 -07:00
2010-08-26 16:41:42 -07:00
2010-08-26 16:41:41 -07:00
2009-10-15 09:58:27 -06:00
2010-08-13 13:19:34 -07:00
2009-11-12 07:26:01 -08:00
2010-08-02 10:20:53 -07:00
2010-08-13 13:20:13 -07:00
2010-08-10 10:20:51 -07:00
2009-07-12 12:22:34 -07:00
2010-08-02 10:20:42 -07:00
2010-08-13 13:19:51 -07:00
2009-06-18 13:04:04 -07:00
2010-05-12 14:57:15 -07:00