]> git.baikalelectronics.ru Git - kernel.git/commit
dm ioctl: increase granularity of type_lock when loading table
authorMike Snitzer <snitzer@redhat.com>
Tue, 27 Aug 2013 22:57:03 +0000 (18:57 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 6 Sep 2013 00:46:06 +0000 (20:46 -0400)
commitf7aad37e88e1ff044eefb32560538936eb48daa3
treee185bc97fc6529d1299e5e13987fe5b86cf21868
parentf78abcb8c14c40466aa5d6743f99069dff6a8d80
dm ioctl: increase granularity of type_lock when loading table

Hold the mapped device's type_lock before calling populate_table() since
it is where the table's type is determined based on the specified
targets.  There is no need to allow concurrent table loads to race to
establish the table's targets or type.

This eliminates the need to grab the lock in dm_table_set_type().

Also verify that the type_lock is held in both dm_set_md_type() and
dm_get_md_type().

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-ioctl.c
drivers/md/dm-table.c
drivers/md/dm.c