Commit 643a7234 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-5.16/drivers-2021-10-29' of git://git.kernel.dk/linux-block

Pull block driver updates from Jens Axboe:

 - paride driver cleanups (Christoph)

 - Remove cryptoloop support (Christoph)

 - null_blk poll support (me)

 - Now that add_disk() supports proper error handling, add it to various
   drivers (Luis)

 - Make ataflop actually work again (Michael)

 - s390 dasd fixes (Stefan, Heiko)

 - nbd fixes (Yu, Ye)

 - Remove redundant wq flush in mtip32xx (Christophe)

 - NVMe updates
      - fix a multipath partition scanning deadlock (Hannes Reinecke)
      - generate uevent once a multipath namespace is operational again
        (Hannes Reinecke)
      - support unique discovery controller NQNs (Hannes Reinecke)
      - fix use-after-free when a port is removed (Israel Rukshin)
      - clear shadow doorbell memory on resets (Keith Busch)
      - use struct_size (Len Baker)
      - add error handling support for add_disk (Luis Chamberlain)
      - limit the maximal queue size for RDMA controllers (Max Gurtovoy)
      - use a few more symbolic names (Max Gurtovoy)
      - fix error code in nvme_rdma_setup_ctrl (Max Gurtovoy)
      - add support for ->map_queues on FC (Saurav Kashyap)
      - support the current discovery subsystem entry (Hannes Reinecke)
      - use flex_array_size and struct_size (Len Baker)

 - bcache fixes (Christoph, Coly, Chao, Lin, Qing)

 - MD updates (Christoph, Guoqing, Xiao)

 - Misc fixes (Dan, Ding, Jiapeng, Shin'ichiro, Ye)

* tag 'for-5.16/drivers-2021-10-29' of git://git.kernel.dk/linux-block: (117 commits)
  null_blk: Fix handling of submit_queues and poll_queues attributes
  block: ataflop: Fix warning comparing pointer to 0
  bcache: replace snprintf in show functions with sysfs_emit
  bcache: move uapi header bcache.h to bcache code directory
  nvmet: use flex_array_size and struct_size
  nvmet: register discovery subsystem as 'current'
  nvmet: switch check for subsystem type
  nvme: add new discovery log page entry definitions
  block: ataflop: more blk-mq refactoring fixes
  block: remove support for cryptoloop and the xor transfer
  mtd: add add_disk() error handling
  rnbd: add error handling support for add_disk()
  um/drivers/ubd_kern: add error handling support for add_disk()
  m68k/emu/nfblock: add error handling support for add_disk()
  xen-blkfront: add error handling support for add_disk()
  bcache: add error handling support for add_disk()
  dm: add add_disk() error handling
  block: aoe: fixup coccinelle warnings
  nvmet: use struct_size over open coded arithmetic
  nvme: drop scan_lock and always kick requeue list when removing namespaces
  ...
parents 33c8846c 15dfc662
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
{
	struct nfhd_device *dev;
	int dev_id = id - NFHD_DEV_OFFSET;
	int err = -ENOMEM;

	pr_info("nfhd%u: found device with %u blocks (%u bytes)\n", dev_id,
		blocks, bsize);
@@ -129,16 +130,20 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
	sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
	set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
	blk_queue_logical_block_size(dev->disk->queue, bsize);
	add_disk(dev->disk);
	err = add_disk(dev->disk);
	if (err)
		goto out_cleanup_disk;

	list_add_tail(&dev->list, &nfhd_list);

	return 0;

out_cleanup_disk:
	blk_cleanup_disk(dev->disk);
free_dev:
	kfree(dev);
out:
	return -ENOMEM;
	return err;
}

static int __init nfhd_init(void)
+9 −4
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ static const struct attribute_group *ubd_attr_groups[] = {
	NULL,
};

static void ubd_disk_register(int major, u64 size, int unit,
static int ubd_disk_register(int major, u64 size, int unit,
			     struct gendisk *disk)
{
	disk->major = major;
@@ -873,7 +873,7 @@ static void ubd_disk_register(int major, u64 size, int unit,

	disk->private_data = &ubd_devs[unit];
	disk->queue = ubd_devs[unit].queue;
	device_add_disk(&ubd_devs[unit].pdev.dev, disk, ubd_attr_groups);
	return device_add_disk(&ubd_devs[unit].pdev.dev, disk, ubd_attr_groups);
}

#define ROUND_BLOCK(n) ((n + (SECTOR_SIZE - 1)) & (-SECTOR_SIZE))
@@ -920,10 +920,15 @@ static int ubd_add(int n, char **error_out)
	blk_queue_write_cache(ubd_dev->queue, true, false);
	blk_queue_max_segments(ubd_dev->queue, MAX_SG);
	blk_queue_segment_boundary(ubd_dev->queue, PAGE_SIZE - 1);
	ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, disk);
	err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, disk);
	if (err)
		goto out_cleanup_disk;

	ubd_gendisk[n] = disk;
	return 0;

out_cleanup_disk:
	blk_cleanup_disk(disk);
out_cleanup_tags:
	blk_mq_free_tag_set(&ubd_dev->tag_set);
out:
+11 −2
Original line number Diff line number Diff line
@@ -258,6 +258,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
		struct proc_dir_entry *procdir)
{
	char tmp[2] = { '0' + which, 0 };
	int err = -ENOMEM;

	dev->fd = -1;
	dev->filename = NULL;
@@ -266,7 +267,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,

	dev->gd = blk_alloc_disk(NUMA_NO_NODE);
	if (!dev->gd)
		return -ENOMEM;
		goto out;
	dev->gd->major = simdisk_major;
	dev->gd->first_minor = which;
	dev->gd->minors = SIMDISK_MINORS;
@@ -274,10 +275,18 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
	dev->gd->private_data = dev;
	snprintf(dev->gd->disk_name, 32, "simdisk%d", which);
	set_capacity(dev->gd, 0);
	add_disk(dev->gd);
	err = add_disk(dev->gd);
	if (err)
		goto out_cleanup_disk;

	dev->procfile = proc_create_data(tmp, 0644, procdir, &simdisk_proc_ops, dev);

	return 0;

out_cleanup_disk:
	blk_cleanup_disk(dev->gd);
out:
	return err;
}

static int __init simdisk_init(void)
+0 −23
Original line number Diff line number Diff line
@@ -180,14 +180,6 @@ config BLK_DEV_LOOP
	  bits of, say, a sound file). This is also safe if the file resides
	  on a remote file server.

	  There are several ways of encrypting disks. Some of these require
	  kernel patches. The vanilla kernel offers the cryptoloop option
	  and a Device Mapper target (which is superior, as it supports all
	  file systems). If you want to use the cryptoloop, say Y to both
	  LOOP and CRYPTOLOOP, and make sure you have a recent (version 2.12
	  or later) version of util-linux. Additionally, be aware that
	  the cryptoloop is not safe for storing journaled filesystems.

	  Note that this loop device has nothing to do with the loopback
	  device used for network connections from the machine to itself.

@@ -211,21 +203,6 @@ config BLK_DEV_LOOP_MIN_COUNT
	  is used, it can be set to 0, since needed loop devices can be
	  dynamically allocated with the /dev/loop-control interface.

config BLK_DEV_CRYPTOLOOP
	tristate "Cryptoloop Support (DEPRECATED)"
	select CRYPTO
	select CRYPTO_CBC
	depends on BLK_DEV_LOOP
	help
	  Say Y here if you want to be able to use the ciphers that are 
	  provided by the CryptoAPI as loop transformation. This might be
	  used as hard disk encryption.

	  WARNING: This device is not safe for journaled file systems like
	  ext3 or Reiserfs. Please use the Device Mapper crypto module
	  instead, which can be configured to be on-disk compatible with the
	  cryptoloop device.  cryptoloop support will be removed in Linux 5.16.

source "drivers/block/drbd/Kconfig"

config BLK_DEV_NBD
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
obj-$(CONFIG_SUNVDC)		+= sunvdc.o

obj-$(CONFIG_BLK_DEV_NBD)	+= nbd.o
obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
obj-$(CONFIG_VIRTIO_BLK)	+= virtio_blk.o

obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
Loading