]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
UBUNTU: SAUCE: blk/core: Gracefully handle unset make_request_fn
authorStefan Bader <stefan.bader@canonical.com>
Thu, 23 Jan 2020 08:33:03 +0000 (10:33 +0200)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:27:50 +0000 (16:27 +0100)
commit2093cc97247151e287b0bf7659c35775eadb4d54
treee878a2295d42ba7f3c7069f1503c8f5774314f0a
parent122190c7a84b48a9d191027431b8582addb4feb1
UBUNTU: SAUCE: blk/core: Gracefully handle unset make_request_fn

BugLink: https://bugs.launchpad.net/bugs/1860231
When device-mapper adapted for multi-queue functionality, they
also re-organized the way the make-request function was set.
Before, this happened when the device-mapper logical device was
created. Now it is done once the mapping table gets loaded the
first time (this also decides whether the block device is request
or bio based).

However in generic_make_request(), the request function gets used
without further checks and this happens if one tries to mount such
a partially set up device.

This can easily be reproduced with the following steps:
 - dmsetup create -n test
 - mount /dev/dm-<#> /mnt

This maybe is something which also should be fixed up in device-
mapper. But given there is already a check for an unset queue
pointer and potentially there could be other drivers which do or
might do the same, it sounds like a good move to add another check
to generic_make_request_checks() and to bail out if the request
function has not been set, yet.

Fixes: ff36ab34583a ("dm: remove request-based logic from make_request_fn wrapper")
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
block/blk-core.c