dm table: fix upgrade mode race
authorAlasdair G Kergon <agk@redhat.com>
Fri, 3 Apr 2009 17:45:08 +0000 (17:45 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:57 +0000 (10:36 -0700)
commit43a00bbcf5aeaac50d9e8271dbfa0d0fc1d4eb43
treedb8ee3938b6a9c9e4d495d916e7b6f48a9931086
parentd92281c9087f7f7d8c18cf95f18a8148167907e0
dm table: fix upgrade mode race

upstream commit: 570b9d968bf9b16974252ef7cbce73fa6dac34f3

upgrade_mode() sets bdev to NULL temporarily, and does not have any
locking to exclude anything from seeing that NULL.

In dm_table_any_congested() bdev_get_queue() can dereference that NULL and
cause a reported oops.

Fix this by not changing that field during the mode upgrade.

Cc: stable@kernel.org
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/md/dm-table.c