]> git.baikalelectronics.ru Git - kernel.git/commit
dm: avoid filesystem lookup in dm_get_dev_t()
authorHannes Reinecke <hare@suse.de>
Thu, 21 Jan 2021 17:50:56 +0000 (18:50 +0100)
committerMike Snitzer <snitzer@redhat.com>
Thu, 21 Jan 2021 20:06:45 +0000 (15:06 -0500)
commit6f2b9c9566f397ac258385478879ba5a54454c49
treee9e40751ce0ac4c796cd8c5a1d61ffead9e69c93
parent7c5ad31697b5d4bb996790a0fdd1933b22cc7922
dm: avoid filesystem lookup in dm_get_dev_t()

This reverts commit
3edfb731553e ("dm table: fall back to getting device using name_to_dev_t()")

dm_get_dev_t() is just used to convert an arbitrary 'path' string
into a dev_t. It doesn't presume that the device is present; that
check will be done later, as the only caller is dm_get_device(),
which does a dm_get_table_device() later on, which will properly
open the device.

So if the path string already _is_ in major:minor representation
we can convert it directly, avoiding a recursion into the filesystem
to lookup the block device.

This avoids a hang in multipath_message() when the filesystem is
inaccessible.

Fixes: 3edfb731553e ("dm table: fall back to getting device using name_to_dev_t()")
Cc: stable@vger.kernel.org
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-table.c