summaryrefslogtreecommitdiff
path: root/block/bdev.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-01-04 10:16:47 +0300
committerJens Axboe <axboe@kernel.dk>2022-02-02 17:49:58 +0300
commitfbdee71bb5d8d054e1bdb5af4c540f2cb86fe296 (patch)
tree46cfbed71aa40374f489df96373d2b96fcf1e0f5 /block/bdev.c
parent26291c54e111ff6ba87a164d85d4a4e134b7315c (diff)
downloadlinux-fbdee71bb5d8d054e1bdb5af4c540f2cb86fe296.tar.xz
block: deprecate autoloading based on dev_t
Make the legacy dev_t based autoloading optional and add a deprecation warning. This kind of autoloading has ceased to be useful about 20 years ago. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220104071647.164918-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bdev.c')
-rw-r--r--block/bdev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/bdev.c b/block/bdev.c
index 102837a37051..c68772644566 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -733,12 +733,15 @@ struct block_device *blkdev_get_no_open(dev_t dev)
struct inode *inode;
inode = ilookup(blockdev_superblock, dev);
- if (!inode) {
+ if (!inode && IS_ENABLED(CONFIG_BLOCK_LEGACY_AUTOLOAD)) {
blk_request_module(dev);
inode = ilookup(blockdev_superblock, dev);
- if (!inode)
- return NULL;
+ if (inode)
+ pr_warn_ratelimited(
+"block device autoloading is deprecated. It will be removed in Linux 5.19\n");
}
+ if (!inode)
+ return NULL;
/* switch from the inode reference to a device mode one: */
bdev = &BDEV_I(inode)->bdev;