Skip to content

Commit

Permalink
Merge tag 'for-5.13/drivers-2021-04-27' of git://git.kernel.dk/linux-…
Browse files Browse the repository at this point in the history
…block

Pull block driver updates from Jens Axboe:

 - MD changes via Song:
        - raid5 POWER fix
        - raid1 failure fix
        - UAF fix for md cluster
        - mddev_find_or_alloc() clean up
        - Fix NULL pointer deref with external bitmap
        - Performance improvement for raid10 discard requests
        - Fix missing information of /proc/mdstat

 - rsxx const qualifier removal (Arnd)

 - Expose allocated brd pages (Calvin)

 - rnbd via Gioh Kim:
        - Change maintainer
        - Change domain address of maintainers' email
        - Add polling IO mode and document update
        - Fix memory leak and some bug detected by static code analysis
          tools
        - Code refactoring

 - Series of floppy cleanups/fixes (Denis)

 - s390 dasd fixes (Julian)

 - kerneldoc fixes (Lee)

 - null_blk double free (Lv)

 - null_blk virtual boundary addition (Max)

 - Remove xsysace driver (Michal)

 - umem driver removal (Davidlohr)

 - ataflop fixes (Dan)

 - Revalidate disk removal (Christoph)

 - Bounce buffer cleanups (Christoph)

 - Mark lightnvm as deprecated (Christoph)

 - mtip32xx init cleanups (Shixin)

 - Various fixes (Tian, Gustavo, Coly, Yang, Zhang, Zhiqiang)

* tag 'for-5.13/drivers-2021-04-27' of git://git.kernel.dk/linux-block: (143 commits)
  async_xor: increase src_offs when dropping destination page
  drivers/block/null_blk/main: Fix a double free in null_init.
  md/raid1: properly indicate failure when ending a failed write request
  md-cluster: fix use-after-free issue when removing rdev
  nvme: introduce generic per-namespace chardev
  nvme: cleanup nvme_configure_apst
  nvme: do not try to reconfigure APST when the controller is not live
  nvme: add 'kato' sysfs attribute
  nvme: sanitize KATO setting
  nvmet: avoid queuing keep-alive timer if it is disabled
  brd: expose number of allocated pages in debugfs
  ataflop: fix off by one in ataflop_probe()
  ataflop: potential out of bounds in do_format()
  drbd: Fix fall-through warnings for Clang
  block/rnbd: Use strscpy instead of strlcpy
  block/rnbd-clt-sysfs: Remove copy buffer overlap in rnbd_clt_get_path_name
  block/rnbd-clt: Remove max_segment_size
  block/rnbd-clt: Generate kobject_uevent when the rnbd device state changes
  block/rnbd-srv: Remove unused arguments of rnbd_srv_rdma_ev
  Documentation/ABI/rnbd-clt: Add description for nr_poll_queues
  ...
  • Loading branch information
torvalds committed Apr 28, 2021
2 parents 6c00292 + 8324fba commit fc05860
Show file tree
Hide file tree
Showing 99 changed files with 2,303 additions and 4,055 deletions.
18 changes: 18 additions & 0 deletions Documentation/ABI/testing/sysfs-block-rnbd
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,21 @@ Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <[email protected]> Danil Kipnis <[email protected]>
Description: Contains the device access mode: ro, rw or migration.

What: /sys/block/rnbd<N>/rnbd/resize
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <[email protected]> Danil Kipnis <[email protected]>
Description: Write the number of sectors to change the size of the disk.

What: /sys/block/rnbd<N>/rnbd/remap_device
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <[email protected]> Danil Kipnis <[email protected]>
Description: Remap the disconnected device if the session is not destroyed yet.

What: /sys/block/rnbd<N>/rnbd/nr_poll_queues
Date: Feb 2020
KernelVersion: 5.7
Contact: Jack Wang <[email protected]> Danil Kipnis <[email protected]>
Description: Contains the number of poll-mode queues
13 changes: 13 additions & 0 deletions Documentation/ABI/testing/sysfs-class-rnbd-client
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ Description: Expected format is the following::

By default "rw" is used.

nr_poll_queues
specifies the number of poll-mode queues. If the IO has HIPRI flag,
the block-layer will send the IO via the poll-mode queue.
For fast network and device the polling is faster than interrupt-base
IO handling because it saves time for context switching, switching to
another process, handling the interrupt and switching back to the
issuing process.

Set -1 if you want to set it as the number of CPUs
By default rnbd client creates only irq-mode queues.

NOTICE: MUST make a unique session for a device using the poll-mode queues.

Exit Codes:

If the device is already mapped it will fail with EEXIST. If the input
Expand Down
2 changes: 0 additions & 2 deletions Documentation/filesystems/locking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ prototypes::
int (*direct_access) (struct block_device *, sector_t, void **,
unsigned long *);
void (*unlock_native_capacity) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
void (*swap_slot_free_notify) (struct block_device *, unsigned long);

Expand All @@ -489,7 +488,6 @@ ioctl: no
compat_ioctl: no
direct_access: no
unlock_native_capacity: no
revalidate_disk: no
getgeo: no
swap_slot_free_notify: no (see below)
======================= ===================
Expand Down
5 changes: 2 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,6 @@ F: Documentation/devicetree/bindings/i2c/cdns,i2c-r1p10.yaml
F: Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml
F: Documentation/devicetree/bindings/spi/xlnx,zynq-qspi.yaml
F: arch/arm/mach-zynq/
F: drivers/block/xsysace.c
F: drivers/clocksource/timer-cadence-ttc.c
F: drivers/cpuidle/cpuidle-zynq.c
F: drivers/edac/synopsys_edac.c
Expand Down Expand Up @@ -15540,8 +15539,8 @@ N: riscv
K: riscv

RNBD BLOCK DRIVERS
M: Danil Kipnis <danil.kipnis@cloud.ionos.com>
M: Jack Wang <jinpu.wang@cloud.ionos.com>
M: Md. Haris Iqbal <haris.iqbal@ionos.com>
M: Jack Wang <[email protected]>
L: [email protected]
S: Maintained
F: drivers/block/rnbd/
Expand Down
8 changes: 0 additions & 8 deletions arch/microblaze/boot/dts/system.dts
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,6 @@
xlnx,odd-parity = <0x0>;
xlnx,use-parity = <0x0>;
} ;
SysACE_CompactFlash: sysace@83600000 {
compatible = "xlnx,xps-sysace-1.00.a";
interrupt-parent = <&xps_intc_0>;
interrupts = < 4 2 >;
reg = < 0x83600000 0x10000 >;
xlnx,family = "virtex5";
xlnx,mem-width = <0x10>;
} ;
debug_module: debug@84400000 {
compatible = "xlnx,mdm-1.00.d";
reg = < 0x84400000 0x10000 >;
Expand Down
1 change: 0 additions & 1 deletion arch/mips/configs/malta_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_GLUEBI=m
CONFIG_BLK_DEV_FD=m
CONFIG_BLK_DEV_UMEM=m
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
Expand Down
1 change: 0 additions & 1 deletion arch/mips/configs/malta_kvm_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_GLUEBI=m
CONFIG_BLK_DEV_FD=m
CONFIG_BLK_DEV_UMEM=m
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
Expand Down
1 change: 0 additions & 1 deletion arch/mips/configs/maltaup_xpa_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_UBI=m
CONFIG_MTD_UBI_GLUEBI=m
CONFIG_BLK_DEV_FD=m
CONFIG_BLK_DEV_UMEM=m
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
CONFIG_BLK_DEV_NBD=m
Expand Down
7 changes: 0 additions & 7 deletions arch/powerpc/boot/dts/icon.dts
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,6 @@
reg = <0x00fa0000 0x00060000>;
};
};

SysACE_CompactFlash: sysace@1,0 {
compatible = "xlnx,sysace";
interrupt-parent = <&UIC2>;
interrupts = <24 0x4>;
reg = <0x00000001 0x00000000 0x10000>;
};
};

UART0: serial@f0000200 {
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/configs/44x/icon_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_PHYSMAP_OF=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=35000
CONFIG_XILINX_SYSACE=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_CONSTANTS=y
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
int lcount;
char *lptr;

st = 1;
for (lcount = virtual_dma_count, lptr = virtual_dma_addr;
lcount; lcount--, lptr++) {
st = inb(virtual_dma_port + FD_STATUS);
Expand Down
1 change: 1 addition & 0 deletions crypto/async_tx/async_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ async_xor_offs(struct page *dest, unsigned int offset,
if (submit->flags & ASYNC_TX_XOR_DROP_DST) {
src_cnt--;
src_list++;
src_offs++;
}

/* wait for any prerequisite operations */
Expand Down
25 changes: 1 addition & 24 deletions drivers/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ config MAC_FLOPPY

config BLK_DEV_SWIM
tristate "Support for SWIM Macintosh floppy"
depends on M68K && MAC
depends on M68K && MAC && !HIGHMEM
help
You should select this option if you want floppy support
and you don't have a II, IIfx, Q900, Q950 or AV series.
Expand Down Expand Up @@ -121,23 +121,6 @@ source "drivers/block/mtip32xx/Kconfig"

source "drivers/block/zram/Kconfig"

config BLK_DEV_UMEM
tristate "Micro Memory MM5415 Battery Backed RAM support"
depends on PCI
help
Saying Y here will include support for the MM5415 family of
battery backed (Non-volatile) RAM cards.
<http://www.umem.com/>

The cards appear as block devices that can be partitioned into
as many as 15 partitions.

To compile this driver as a module, choose M here: the
module will be called umem.

The umem driver has not yet been allocated a MAJOR number, so
one is chosen dynamically.

config BLK_DEV_UBD
bool "Virtual block device"
depends on UML
Expand Down Expand Up @@ -378,12 +361,6 @@ config SUNVDC

source "drivers/s390/block/Kconfig"

config XILINX_SYSACE
tristate "Xilinx SystemACE support"
depends on 4xx || MICROBLAZE
help
Include support for the Xilinx SystemACE CompactFlash interface

config XEN_BLKDEV_FRONTEND
tristate "Xen virtual block device support"
depends on XEN
Expand Down
2 changes: 0 additions & 2 deletions drivers/block/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
obj-$(CONFIG_N64CART) += n64cart.o
obj-$(CONFIG_BLK_DEV_RAM) += brd.o
obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
obj-$(CONFIG_XILINX_SYSACE) += xsysace.o
obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
obj-$(CONFIG_SUNVDC) += sunvdc.o

obj-$(CONFIG_BLK_DEV_UMEM) += umem.o
obj-$(CONFIG_BLK_DEV_NBD) += nbd.o
obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
Expand Down
16 changes: 9 additions & 7 deletions drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,12 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
unsigned long flags;
int ret;

if (type)
if (type) {
type--;
if (type >= NUM_DISK_MINORS ||
minor2disktype[type].drive_types > DriveType)
return -EINVAL;
}

q = unit[drive].disk[type]->queue;
blk_mq_freeze_queue(q);
Expand All @@ -742,11 +746,6 @@ static int do_format(int drive, int type, struct atari_format_descr *desc)
local_irq_restore(flags);

if (type) {
if (type >= NUM_DISK_MINORS ||
minor2disktype[type].drive_types > DriveType) {
ret = -EINVAL;
goto out;
}
type = minor2disktype[type].index;
UDT = &atari_disk_type[type];
}
Expand Down Expand Up @@ -2002,7 +2001,10 @@ static void ataflop_probe(dev_t dev)
int drive = MINOR(dev) & 3;
int type = MINOR(dev) >> 2;

if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
if (type)
type--;

if (drive >= FD_MAX_UNITS || type >= NUM_DISK_MINORS)
return;
mutex_lock(&ataflop_probe_lock);
if (!unit[drive].disk[type]) {
Expand Down
19 changes: 18 additions & 1 deletion drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/backing-dev.h>
#include <linux/debugfs.h>

#include <linux/uaccess.h>

Expand All @@ -48,6 +49,7 @@ struct brd_device {
*/
spinlock_t brd_lock;
struct radix_tree_root brd_pages;
u64 brd_nr_pages;
};

/*
Expand Down Expand Up @@ -116,6 +118,8 @@ static struct page *brd_insert_page(struct brd_device *brd, sector_t sector)
page = radix_tree_lookup(&brd->brd_pages, idx);
BUG_ON(!page);
BUG_ON(page->index != idx);
} else {
brd->brd_nr_pages++;
}
spin_unlock(&brd->brd_lock);

Expand Down Expand Up @@ -365,11 +369,13 @@ __setup("ramdisk_size=", ramdisk_size);
*/
static LIST_HEAD(brd_devices);
static DEFINE_MUTEX(brd_devices_mutex);
static struct dentry *brd_debugfs_dir;

static struct brd_device *brd_alloc(int i)
{
struct brd_device *brd;
struct gendisk *disk;
char buf[DISK_NAME_LEN];

brd = kzalloc(sizeof(*brd), GFP_KERNEL);
if (!brd)
Expand All @@ -382,6 +388,11 @@ static struct brd_device *brd_alloc(int i)
if (!brd->brd_queue)
goto out_free_dev;

snprintf(buf, DISK_NAME_LEN, "ram%d", i);
if (!IS_ERR_OR_NULL(brd_debugfs_dir))
debugfs_create_u64(buf, 0444, brd_debugfs_dir,
&brd->brd_nr_pages);

/* This is so fdisk will align partitions on 4k, because of
* direct_access API needing 4k alignment, returning a PFN
* (This is only a problem on very small devices <= 4M,
Expand All @@ -397,7 +408,7 @@ static struct brd_device *brd_alloc(int i)
disk->fops = &brd_fops;
disk->private_data = brd;
disk->flags = GENHD_FL_EXT_DEVT;
sprintf(disk->disk_name, "ram%d", i);
strlcpy(disk->disk_name, buf, DISK_NAME_LEN);
set_capacity(disk, rd_size * 2);

/* Tell the block layer that this is not a rotational device */
Expand Down Expand Up @@ -495,6 +506,8 @@ static int __init brd_init(void)

brd_check_and_reset_par();

brd_debugfs_dir = debugfs_create_dir("ramdisk_pages", NULL);

mutex_lock(&brd_devices_mutex);
for (i = 0; i < rd_nr; i++) {
brd = brd_alloc(i);
Expand All @@ -519,6 +532,8 @@ static int __init brd_init(void)
return 0;

out_free:
debugfs_remove_recursive(brd_debugfs_dir);

list_for_each_entry_safe(brd, next, &brd_devices, brd_list) {
list_del(&brd->brd_list);
brd_free(brd);
Expand All @@ -534,6 +549,8 @@ static void __exit brd_exit(void)
{
struct brd_device *brd, *next;

debugfs_remove_recursive(brd_debugfs_dir);

list_for_each_entry_safe(brd, next, &brd_devices, brd_list)
brd_del_one(brd);

Expand Down
8 changes: 5 additions & 3 deletions drivers/block/drbd/drbd_interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <linux/rbtree_augmented.h>
#include "drbd_interval.h"

/**
/*
* interval_end - return end of @node
*/
static inline
Expand All @@ -18,7 +18,7 @@ sector_t interval_end(struct rb_node *node)
RB_DECLARE_CALLBACKS_MAX(static, augment_callbacks,
struct drbd_interval, rb, sector_t, end, NODE_END);

/**
/*
* drbd_insert_interval - insert a new interval into a tree
*/
bool
Expand Down Expand Up @@ -56,6 +56,7 @@ drbd_insert_interval(struct rb_root *root, struct drbd_interval *this)

/**
* drbd_contains_interval - check if a tree contains a given interval
* @root: red black tree root
* @sector: start sector of @interval
* @interval: may not be a valid pointer
*
Expand Down Expand Up @@ -88,7 +89,7 @@ drbd_contains_interval(struct rb_root *root, sector_t sector,
return false;
}

/**
/*
* drbd_remove_interval - remove an interval from a tree
*/
void
Expand All @@ -99,6 +100,7 @@ drbd_remove_interval(struct rb_root *root, struct drbd_interval *this)

/**
* drbd_find_overlap - search for an interval overlapping with [sector, sector + size)
* @root: red black tree root
* @sector: start sector
* @size: size, aligned to 512 bytes
*
Expand Down
Loading

0 comments on commit fc05860

Please sign in to comment.