Merge tag 'for-5.3/block-20190708' of git://git.kernel.dk/linux-block
Pull block updates from Jens Axboe: "This is the main block updates for 5.3. Nothing earth shattering or major in here, just fixes, additions, and improvements all over the map. This contains: - Series of documentation fixes (Bart) - Optimization of the blk-mq ctx get/put (Bart) - null_blk removal race condition fix (Bob) - req/bio_op() cleanups (Chaitanya) - Series cleaning up the segment accounting, and request/bio mapping (Christoph) - Series cleaning up the page getting/putting for bios (Christoph) - block cgroup cleanups and moving it to where it is used (Christoph) - block cgroup fixes (Tejun) - Series of fixes and improvements to bcache, most notably a write deadlock fix (Coly) - blk-iolatency STS_AGAIN and accounting fixes (Dennis) - Series of improvements and fixes to BFQ (Douglas, Paolo) - debugfs_create() return value check removal for drbd (Greg) - Use struct_size(), where appropriate (Gustavo) - Two lighnvm fixes (Heiner, Geert) - MD fixes, including a read balance and corruption fix (Guoqing, Marcos, Xiao, Yufen) - block opal shadow mbr additions (Jonas, Revanth) - sbitmap compare-and-exhange improvemnts (Pavel) - Fix for potential bio->bi_size overflow (Ming) - NVMe pull requests: - improved PCIe suspent support (Keith Busch) - error injection support for the admin queue (Akinobu Mita) - Fibre Channel discovery improvements (James Smart) - tracing improvements including nvmetc tracing support (Minwoo Im) - misc fixes and cleanups (Anton Eidelman, Minwoo Im, Chaitanya Kulkarni)" - Various little fixes and improvements to drivers and core" * tag 'for-5.3/block-20190708' of git://git.kernel.dk/linux-block: (153 commits) blk-iolatency: fix STS_AGAIN handling block: nr_phys_segments needs to be zero for REQ_OP_WRITE_ZEROES blk-mq: simplify blk_mq_make_request() blk-mq: remove blk_mq_put_ctx() sbitmap: Replace cmpxchg with xchg block: fix .bi_size overflow block: sed-opal: check size of shadow mbr block: sed-opal: ioctl for writing to shadow mbr block: sed-opal: add ioctl for done-mark of shadow mbr block: never take page references for ITER_BVEC direct-io: use bio_release_pages in dio_bio_complete block_dev: use bio_release_pages in bio_unmap_user block_dev: use bio_release_pages in blkdev_bio_end_io iomap: use bio_release_pages in iomap_dio_bio_end_io block: use bio_release_pages in bio_map_user_iov block: use bio_release_pages in bio_unmap_user block: optionally mark pages dirty in bio_release_pages block: move the BIO_NO_PAGE_REF check into bio_release_pages block: skd_main.c: Remove call to memset after dma_alloc_coherent block: mtip32xx: Remove call to memset after dma_alloc_coherent ...
This commit is contained in:
@@ -465,35 +465,20 @@ static const struct file_operations in_flight_summary_fops = {
|
||||
void drbd_debugfs_resource_add(struct drbd_resource *resource)
|
||||
{
|
||||
struct dentry *dentry;
|
||||
if (!drbd_debugfs_resources)
|
||||
return;
|
||||
|
||||
dentry = debugfs_create_dir(resource->name, drbd_debugfs_resources);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
resource->debugfs_res = dentry;
|
||||
|
||||
dentry = debugfs_create_dir("volumes", resource->debugfs_res);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
resource->debugfs_res_volumes = dentry;
|
||||
|
||||
dentry = debugfs_create_dir("connections", resource->debugfs_res);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
resource->debugfs_res_connections = dentry;
|
||||
|
||||
dentry = debugfs_create_file("in_flight_summary", 0440,
|
||||
resource->debugfs_res, resource,
|
||||
&in_flight_summary_fops);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
resource->debugfs_res_in_flight_summary = dentry;
|
||||
return;
|
||||
|
||||
fail:
|
||||
drbd_debugfs_resource_cleanup(resource);
|
||||
drbd_err(resource, "failed to create debugfs dentry\n");
|
||||
}
|
||||
|
||||
static void drbd_debugfs_remove(struct dentry **dp)
|
||||
@@ -636,35 +621,22 @@ void drbd_debugfs_connection_add(struct drbd_connection *connection)
|
||||
{
|
||||
struct dentry *conns_dir = connection->resource->debugfs_res_connections;
|
||||
struct dentry *dentry;
|
||||
if (!conns_dir)
|
||||
return;
|
||||
|
||||
/* Once we enable mutliple peers,
|
||||
* these connections will have descriptive names.
|
||||
* For now, it is just the one connection to the (only) "peer". */
|
||||
dentry = debugfs_create_dir("peer", conns_dir);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
connection->debugfs_conn = dentry;
|
||||
|
||||
dentry = debugfs_create_file("callback_history", 0440,
|
||||
connection->debugfs_conn, connection,
|
||||
&connection_callback_history_fops);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
connection->debugfs_conn_callback_history = dentry;
|
||||
|
||||
dentry = debugfs_create_file("oldest_requests", 0440,
|
||||
connection->debugfs_conn, connection,
|
||||
&connection_oldest_requests_fops);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
connection->debugfs_conn_oldest_requests = dentry;
|
||||
return;
|
||||
|
||||
fail:
|
||||
drbd_debugfs_connection_cleanup(connection);
|
||||
drbd_err(connection, "failed to create debugfs dentry\n");
|
||||
}
|
||||
|
||||
void drbd_debugfs_connection_cleanup(struct drbd_connection *connection)
|
||||
@@ -809,8 +781,6 @@ void drbd_debugfs_device_add(struct drbd_device *device)
|
||||
|
||||
snprintf(vnr_buf, sizeof(vnr_buf), "%u", device->vnr);
|
||||
dentry = debugfs_create_dir(vnr_buf, vols_dir);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
device->debugfs_vol = dentry;
|
||||
|
||||
snprintf(minor_buf, sizeof(minor_buf), "%u", device->minor);
|
||||
@@ -819,18 +789,14 @@ void drbd_debugfs_device_add(struct drbd_device *device)
|
||||
if (!slink_name)
|
||||
goto fail;
|
||||
dentry = debugfs_create_symlink(minor_buf, drbd_debugfs_minors, slink_name);
|
||||
device->debugfs_minor = dentry;
|
||||
kfree(slink_name);
|
||||
slink_name = NULL;
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
device->debugfs_minor = dentry;
|
||||
|
||||
#define DCF(name) do { \
|
||||
dentry = debugfs_create_file(#name, 0440, \
|
||||
device->debugfs_vol, device, \
|
||||
&device_ ## name ## _fops); \
|
||||
if (IS_ERR_OR_NULL(dentry)) \
|
||||
goto fail; \
|
||||
device->debugfs_vol_ ## name = dentry; \
|
||||
} while (0)
|
||||
|
||||
@@ -864,19 +830,9 @@ void drbd_debugfs_peer_device_add(struct drbd_peer_device *peer_device)
|
||||
struct dentry *dentry;
|
||||
char vnr_buf[8];
|
||||
|
||||
if (!conn_dir)
|
||||
return;
|
||||
|
||||
snprintf(vnr_buf, sizeof(vnr_buf), "%u", peer_device->device->vnr);
|
||||
dentry = debugfs_create_dir(vnr_buf, conn_dir);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
peer_device->debugfs_peer_dev = dentry;
|
||||
return;
|
||||
|
||||
fail:
|
||||
drbd_debugfs_peer_device_cleanup(peer_device);
|
||||
drbd_err(peer_device, "failed to create debugfs entries\n");
|
||||
}
|
||||
|
||||
void drbd_debugfs_peer_device_cleanup(struct drbd_peer_device *peer_device)
|
||||
@@ -917,35 +873,19 @@ void drbd_debugfs_cleanup(void)
|
||||
drbd_debugfs_remove(&drbd_debugfs_root);
|
||||
}
|
||||
|
||||
int __init drbd_debugfs_init(void)
|
||||
void __init drbd_debugfs_init(void)
|
||||
{
|
||||
struct dentry *dentry;
|
||||
|
||||
dentry = debugfs_create_dir("drbd", NULL);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
drbd_debugfs_root = dentry;
|
||||
|
||||
dentry = debugfs_create_file("version", 0444, drbd_debugfs_root, NULL, &drbd_version_fops);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
drbd_debugfs_version = dentry;
|
||||
|
||||
dentry = debugfs_create_dir("resources", drbd_debugfs_root);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
drbd_debugfs_resources = dentry;
|
||||
|
||||
dentry = debugfs_create_dir("minors", drbd_debugfs_root);
|
||||
if (IS_ERR_OR_NULL(dentry))
|
||||
goto fail;
|
||||
drbd_debugfs_minors = dentry;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
drbd_debugfs_cleanup();
|
||||
if (dentry)
|
||||
return PTR_ERR(dentry);
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "drbd_int.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
int __init drbd_debugfs_init(void);
|
||||
void __init drbd_debugfs_init(void);
|
||||
void drbd_debugfs_cleanup(void);
|
||||
|
||||
void drbd_debugfs_resource_add(struct drbd_resource *resource);
|
||||
@@ -22,7 +22,7 @@ void drbd_debugfs_peer_device_add(struct drbd_peer_device *peer_device);
|
||||
void drbd_debugfs_peer_device_cleanup(struct drbd_peer_device *peer_device);
|
||||
#else
|
||||
|
||||
static inline int __init drbd_debugfs_init(void) { return -ENODEV; }
|
||||
static inline void __init drbd_debugfs_init(void) { }
|
||||
static inline void drbd_debugfs_cleanup(void) { }
|
||||
|
||||
static inline void drbd_debugfs_resource_add(struct drbd_resource *resource) { }
|
||||
|
@@ -3009,8 +3009,7 @@ static int __init drbd_init(void)
|
||||
spin_lock_init(&retry.lock);
|
||||
INIT_LIST_HEAD(&retry.writes);
|
||||
|
||||
if (drbd_debugfs_init())
|
||||
pr_notice("failed to initialize debugfs -- will not be available\n");
|
||||
drbd_debugfs_init();
|
||||
|
||||
pr_info("initialized. "
|
||||
"Version: " REL_VERSION " (api:%d/proto:%d-%d)\n",
|
||||
|
@@ -3900,7 +3900,7 @@ static void __init config_types(void)
|
||||
if (!UDP->cmos)
|
||||
UDP->cmos = FLOPPY0_TYPE;
|
||||
drive = 1;
|
||||
if (!UDP->cmos && FLOPPY1_TYPE)
|
||||
if (!UDP->cmos)
|
||||
UDP->cmos = FLOPPY1_TYPE;
|
||||
|
||||
/* FIXME: additional physical CMOS drive detection should go here */
|
||||
|
@@ -264,20 +264,12 @@ lo_do_transfer(struct loop_device *lo, int cmd,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void loop_iov_iter_bvec(struct iov_iter *i,
|
||||
unsigned int direction, const struct bio_vec *bvec,
|
||||
unsigned long nr_segs, size_t count)
|
||||
{
|
||||
iov_iter_bvec(i, direction, bvec, nr_segs, count);
|
||||
i->type |= ITER_BVEC_FLAG_NO_REF;
|
||||
}
|
||||
|
||||
static int lo_write_bvec(struct file *file, struct bio_vec *bvec, loff_t *ppos)
|
||||
{
|
||||
struct iov_iter i;
|
||||
ssize_t bw;
|
||||
|
||||
loop_iov_iter_bvec(&i, WRITE, bvec, 1, bvec->bv_len);
|
||||
iov_iter_bvec(&i, WRITE, bvec, 1, bvec->bv_len);
|
||||
|
||||
file_start_write(file);
|
||||
bw = vfs_iter_write(file, &i, ppos, 0);
|
||||
@@ -355,7 +347,7 @@ static int lo_read_simple(struct loop_device *lo, struct request *rq,
|
||||
ssize_t len;
|
||||
|
||||
rq_for_each_segment(bvec, rq, iter) {
|
||||
loop_iov_iter_bvec(&i, READ, &bvec, 1, bvec.bv_len);
|
||||
iov_iter_bvec(&i, READ, &bvec, 1, bvec.bv_len);
|
||||
len = vfs_iter_read(lo->lo_backing_file, &i, &pos, 0);
|
||||
if (len < 0)
|
||||
return len;
|
||||
@@ -396,7 +388,7 @@ static int lo_read_transfer(struct loop_device *lo, struct request *rq,
|
||||
b.bv_offset = 0;
|
||||
b.bv_len = bvec.bv_len;
|
||||
|
||||
loop_iov_iter_bvec(&i, READ, &b, 1, b.bv_len);
|
||||
iov_iter_bvec(&i, READ, &b, 1, b.bv_len);
|
||||
len = vfs_iter_read(lo->lo_backing_file, &i, &pos, 0);
|
||||
if (len < 0) {
|
||||
ret = len;
|
||||
@@ -563,7 +555,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
|
||||
}
|
||||
atomic_set(&cmd->ref, 2);
|
||||
|
||||
loop_iov_iter_bvec(&iter, rw, bvec, nr_bvec, blk_rq_bytes(rq));
|
||||
iov_iter_bvec(&iter, rw, bvec, nr_bvec, blk_rq_bytes(rq));
|
||||
iter.iov_offset = offset;
|
||||
|
||||
cmd->iocb.ki_pos = pos;
|
||||
|
@@ -1577,7 +1577,6 @@ static int exec_drive_command(struct mtip_port *port, u8 *command,
|
||||
ATA_SECT_SIZE * xfer_sz);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buf, 0, ATA_SECT_SIZE * xfer_sz);
|
||||
}
|
||||
|
||||
/* Build the FIS. */
|
||||
@@ -2776,7 +2775,6 @@ static int mtip_dma_alloc(struct driver_data *dd)
|
||||
&port->block1_dma, GFP_KERNEL);
|
||||
if (!port->block1)
|
||||
return -ENOMEM;
|
||||
memset(port->block1, 0, BLOCK_DMA_ALLOC_SZ);
|
||||
|
||||
/* Allocate dma memory for command list */
|
||||
port->command_list =
|
||||
@@ -2789,7 +2787,6 @@ static int mtip_dma_alloc(struct driver_data *dd)
|
||||
port->block1_dma = 0;
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(port->command_list, 0, AHCI_CMD_TBL_SZ);
|
||||
|
||||
/* Setup all pointers into first DMA region */
|
||||
port->rxfis = port->block1 + AHCI_RX_FIS_OFFSET;
|
||||
@@ -3529,8 +3526,6 @@ static int mtip_init_cmd(struct blk_mq_tag_set *set, struct request *rq,
|
||||
if (!cmd->command)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(cmd->command, 0, CMD_DMA_ALLOC_SZ);
|
||||
|
||||
sg_init_table(cmd->sg, MTIP_MAX_SG);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -327,11 +327,12 @@ static ssize_t nullb_device_power_store(struct config_item *item,
|
||||
set_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags);
|
||||
dev->power = newp;
|
||||
} else if (dev->power && !newp) {
|
||||
mutex_lock(&lock);
|
||||
dev->power = newp;
|
||||
null_del_dev(dev->nullb);
|
||||
mutex_unlock(&lock);
|
||||
clear_bit(NULLB_DEV_FL_UP, &dev->flags);
|
||||
if (test_and_clear_bit(NULLB_DEV_FL_UP, &dev->flags)) {
|
||||
mutex_lock(&lock);
|
||||
dev->power = newp;
|
||||
null_del_dev(dev->nullb);
|
||||
mutex_unlock(&lock);
|
||||
}
|
||||
clear_bit(NULLB_DEV_FL_CONFIGURED, &dev->flags);
|
||||
}
|
||||
|
||||
@@ -1197,7 +1198,7 @@ static blk_status_t null_handle_cmd(struct nullb_cmd *cmd)
|
||||
if (!cmd->error && dev->zoned) {
|
||||
sector_t sector;
|
||||
unsigned int nr_sectors;
|
||||
int op;
|
||||
enum req_opf op;
|
||||
|
||||
if (dev->queue_mode == NULL_Q_BIO) {
|
||||
op = bio_op(cmd->bio);
|
||||
@@ -1488,7 +1489,6 @@ static int setup_queues(struct nullb *nullb)
|
||||
if (!nullb->queues)
|
||||
return -ENOMEM;
|
||||
|
||||
nullb->nr_queues = 0;
|
||||
nullb->queue_depth = nullb->dev->hw_queue_depth;
|
||||
|
||||
return 0;
|
||||
|
@@ -2694,7 +2694,6 @@ static int skd_cons_skmsg(struct skd_device *skdev)
|
||||
(FIT_QCMD_ALIGN - 1),
|
||||
"not aligned: msg_buf %p mb_dma_address %pad\n",
|
||||
skmsg->msg_buf, &skmsg->mb_dma_address);
|
||||
memset(skmsg->msg_buf, 0, SKD_N_FITMSG_BYTES);
|
||||
}
|
||||
|
||||
err_out:
|
||||
|
Reference in New Issue
Block a user