Skip to content

Commit 6bbf591

Browse files
committed
Merge tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "A few minor fixes: - Fix ldm kernel-doc warning (Bart) - Fix adding offset twice for DMA address in n64cart (Christoph) - Fix use-after-free in dasd path handling (Stefan) - Order kyber insert trace correctly (Vincent) - raid1 errored write handling fix (Wei) - Fix blk-iolatency queue get failure handling (Yu)" * tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block: kyber: make trace_block_rq call consistent with documentation block/partitions/ldm.c: Fix a kernel-doc warning blk-iolatency: error out if blk_get_queue() failed in iolatency_set_limit() n64cart: fix the dma address in n64cart_do_bvec s390/dasd: fix use after free in dasd path handling md/raid10: properly indicate failure when ending a failed write request
2 parents 0b6684b + fb7b9b0 commit 6bbf591

File tree

7 files changed

+21
-10
lines changed

7 files changed

+21
-10
lines changed

block/blk-iolatency.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,11 @@ static ssize_t iolatency_set_limit(struct kernfs_open_file *of, char *buf,
833833

834834
enable = iolatency_set_min_lat_nsec(blkg, lat_val);
835835
if (enable) {
836-
WARN_ON_ONCE(!blk_get_queue(blkg->q));
836+
if (!blk_get_queue(blkg->q)) {
837+
ret = -ENODEV;
838+
goto out;
839+
}
840+
837841
blkg_get(blkg);
838842
}
839843

block/kyber-iosched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,13 @@ static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx,
596596
struct list_head *head = &kcq->rq_list[sched_domain];
597597

598598
spin_lock(&kcq->lock);
599+
trace_block_rq_insert(rq);
599600
if (at_head)
600601
list_move(&rq->queuelist, head);
601602
else
602603
list_move_tail(&rq->queuelist, head);
603604
sbitmap_set_bit(&khd->kcq_map[sched_domain],
604605
rq->mq_ctx->index_hw[hctx->type]);
605-
trace_block_rq_insert(rq);
606606
spin_unlock(&kcq->lock);
607607
}
608608
}

block/partitions/ldm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
2-
/**
2+
/*
33
* ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
44
*
55
* Copyright (C) 2001,2002 Richard Russon <[email protected]>

drivers/block/n64cart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static bool n64cart_do_bvec(struct device *dev, struct bio_vec *bv, u32 pos)
7474

7575
n64cart_wait_dma();
7676

77-
n64cart_write_reg(PI_DRAM_REG, dma_addr + bv->bv_offset);
77+
n64cart_write_reg(PI_DRAM_REG, dma_addr);
7878
n64cart_write_reg(PI_CART_REG, (bstart | CART_DOMAIN) & CART_MAX);
7979
n64cart_write_reg(PI_WRITE_REG, bv->bv_len - 1);
8080

drivers/md/raid1.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,6 @@ static void raid1_end_write_request(struct bio *bio)
474474
/*
475475
* When the device is faulty, it is not necessary to
476476
* handle write error.
477-
* For failfast, this is the only remaining device,
478-
* We need to retry the write without FailFast.
479477
*/
480478
if (!test_bit(Faulty, &rdev->flags))
481479
set_bit(R1BIO_WriteError, &r1_bio->state);

drivers/md/raid10.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,12 @@ static void raid10_end_write_request(struct bio *bio)
471471
/*
472472
* When the device is faulty, it is not necessary to
473473
* handle write error.
474-
* For failfast, this is the only remaining device,
475-
* We need to retry the write without FailFast.
476474
*/
477475
if (!test_bit(Faulty, &rdev->flags))
478476
set_bit(R10BIO_WriteError, &r10_bio->state);
479477
else {
478+
/* Fail the request */
479+
set_bit(R10BIO_Degraded, &r10_bio->state);
480480
r10_bio->devs[slot].bio = NULL;
481481
to_put = bio;
482482
dec_rdev = 1;

drivers/s390/block/dasd_eckd.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,22 +1004,31 @@ static unsigned char dasd_eckd_path_access(void *conf_data, int conf_len)
10041004
static void dasd_eckd_store_conf_data(struct dasd_device *device,
10051005
struct dasd_conf_data *conf_data, int chp)
10061006
{
1007+
struct dasd_eckd_private *private = device->private;
10071008
struct channel_path_desc_fmt0 *chp_desc;
10081009
struct subchannel_id sch_id;
1010+
void *cdp;
10091011

1010-
ccw_device_get_schid(device->cdev, &sch_id);
10111012
/*
10121013
* path handling and read_conf allocate data
10131014
* free it before replacing the pointer
1015+
* also replace the old private->conf_data pointer
1016+
* with the new one if this points to the same data
10141017
*/
1015-
kfree(device->path[chp].conf_data);
1018+
cdp = device->path[chp].conf_data;
1019+
if (private->conf_data == cdp) {
1020+
private->conf_data = (void *)conf_data;
1021+
dasd_eckd_identify_conf_parts(private);
1022+
}
1023+
ccw_device_get_schid(device->cdev, &sch_id);
10161024
device->path[chp].conf_data = conf_data;
10171025
device->path[chp].cssid = sch_id.cssid;
10181026
device->path[chp].ssid = sch_id.ssid;
10191027
chp_desc = ccw_device_get_chp_desc(device->cdev, chp);
10201028
if (chp_desc)
10211029
device->path[chp].chpid = chp_desc->chpid;
10221030
kfree(chp_desc);
1031+
kfree(cdp);
10231032
}
10241033

10251034
static void dasd_eckd_clear_conf_data(struct dasd_device *device)

0 commit comments

Comments
 (0)