Skip to contentSkip to conversation

block: default BLOCK_LEGACY_AUTOLOAD to y

PATCH Applied Christoph Hellwig 5 participants 5 messages Feb 25, 2022 – Dec 28, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: default BLOCK_LEGACY_AUTOLOAD to y

As Luis reported, losetup currently doesn't properly create the loop device without this if the device node already exists because old scripts created it manually. So default to y for now and remove the aggressive removal schedule.

---
 block/Kconfig | 8 +++-----
 block/bdev.c  | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
block/Kconfig +3 -5
index 168b873eb666d..7eb5d6d53b3fc 100644
@@ -28,15 +28,13 @@ if BLOCK
 
 config BLOCK_LEGACY_AUTOLOAD
 	bool "Legacy autoloading support"
+	default y
 	help
 	  Enable loading modules and creating block device instances based on
 	  accesses through their device special file.  This is a historic Linux
 	  feature and makes no sense in a udev world where device files are
-	  created on demand.
-
-	  Say N here unless booting or other functionality broke without it, in
-	  which case you should also send a report to your distribution and
-	  [email protected].
+	  created on demand, but scripts that manually create device nodes and
+	  then call losetup might rely on this behavior.
 
 config BLK_RQ_ALLOC_TIME
 	bool
block/bdev.c +1 -1
index c687726445660..a3632317c8aae 100644
@@ -738,7 +738,7 @@ struct block_device *blkdev_get_no_open(dev_t dev)
 		inode = ilookup(blockdev_superblock, dev);
 		if (inode)
 			pr_warn_ratelimited(
-"block device autoloading is deprecated. It will be removed in Linux 5.19\n");
+"block device autoloading is deprecated and will be removed.\n");
 	}
 	if (!inode)
 		return NULL;
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Christoph Hellwig

As Luis reported, losetup currently doesn't properly create the loop device without this if the device node already exists because old scripts created it manually. So default to y for now and remove the aggressive removal schedule.

Looks good.

-ck

maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 6 lines · Christoph Hellwig

As Luis reported, losetup currently doesn't properly create the loop device without this if the device node already exists because old scripts created it manually. So default to y for now and remove the aggressive removal schedule.

Applied, thanks!

[1/1] block: default BLOCK_LEGACY_AUTOLOAD to y

      commit: 23c8d32e573c97177eb51c1384b774cfa7fa3710

Best regards,

Signature · 1 line
Jens Axboe
#3 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig

As Luis reported, losetup currently doesn't properly create the loop device without this if the device node already exists because old scripts created it manually. So default to y for now and remove the aggressive removal schedule.

I'm saddened by the fact that we're not going to get an idea of how far and wide the stupid mknod prior to modprobe use is by making this as y default even though I know this is the right thing to do.

I think our ownly measure of success here is to really push Linux distributions to start disabling BLOCK_LEGACY_AUTOLOAD and getting their help to see what burts into flames.

Without that endevour we're positioning ourselves to keep the stupid BLOCK_LEGACY_AUTOLOAD forever.

I *thought* that for some odd uses cases, maybe early-init, or virt-io, mknod might be used to this day, because of some odd boot failures I saw with linux-next, but I'm no longer seeing those boot failures anymore and I cannot confirm.

Luis

#4 lore raw

Hi,

Quoted 9 lines · Luis Chamberlain
Quoted 7 lines · Christoph Hellwig

As Luis reported, losetup currently doesn't properly create the loop device without this if the device node already exists because old scripts created it manually. So default to y for now and remove the aggressive removal schedule.

Quoted 7 lines

I'm saddened by the fact that we're not going to get an idea of how far and wide the stupid mknod prior to modprobe use is by making this as y default even though I know this is the right thing to do.

I think our ownly measure of success here is to really push Linux distributions to start disabling BLOCK_LEGACY_AUTOLOAD and getting their help to see what burts into flames.

I just spent some time bisecting another thing that regresses without BLOCK_LEGACY_AUTOLOAD (which was disabled here): mdadm software raid auto-assemble on boot (with udev).

I think it's because it tries to open /dev/md127 and then fails since it's not created automatically.

Regards,

Anisse