Skip to content

Commit 24f0a48

Browse files
committed
Merge tag 'for-linus-20190215' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: - Ensure we insert into the hctx dispatch list, if a request is marked as DONTPREP (Jianchao) - NVMe pull request, single missing unlock on error fix (Keith) - MD pull request, single fix for a potentially data corrupting issue (Nate) - Floppy check_events regression fix (Yufen) * tag 'for-linus-20190215' of git://git.kernel.dk/linux-block: md/raid1: don't clear bitmap bits on interrupted recovery. floppy: check_events callback should not return a negative number nvme-pci: add missing unlock for reset error blk-mq: insert rq with DONTPREP to hctx dispatch list when requeue
2 parents ae3fa8b + ace74f7 commit 24f0a48

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

block/blk-mq.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,20 @@ static void blk_mq_requeue_work(struct work_struct *work)
737737
spin_unlock_irq(&q->requeue_lock);
738738

739739
list_for_each_entry_safe(rq, next, &rq_list, queuelist) {
740-
if (!(rq->rq_flags & RQF_SOFTBARRIER))
740+
if (!(rq->rq_flags & (RQF_SOFTBARRIER | RQF_DONTPREP)))
741741
continue;
742742

743743
rq->rq_flags &= ~RQF_SOFTBARRIER;
744744
list_del_init(&rq->queuelist);
745-
blk_mq_sched_insert_request(rq, true, false, false);
745+
/*
746+
* If RQF_DONTPREP, rq has contained some driver specific
747+
* data, so insert it to hctx dispatch list to avoid any
748+
* merge.
749+
*/
750+
if (rq->rq_flags & RQF_DONTPREP)
751+
blk_mq_request_bypass_insert(rq, false);
752+
else
753+
blk_mq_sched_insert_request(rq, true, false, false);
746754
}
747755

748756
while (!list_empty(&rq_list)) {

drivers/block/floppy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4075,7 +4075,7 @@ static unsigned int floppy_check_events(struct gendisk *disk,
40754075

40764076
if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
40774077
if (lock_fdc(drive))
4078-
return -EINTR;
4078+
return 0;
40794079
poll_drive(false, 0);
40804080
process_fd_request();
40814081
}

drivers/md/raid1.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,20 @@ static void end_sync_read(struct bio *bio)
18631863
reschedule_retry(r1_bio);
18641864
}
18651865

1866+
static void abort_sync_write(struct mddev *mddev, struct r1bio *r1_bio)
1867+
{
1868+
sector_t sync_blocks = 0;
1869+
sector_t s = r1_bio->sector;
1870+
long sectors_to_go = r1_bio->sectors;
1871+
1872+
/* make sure these bits don't get cleared. */
1873+
do {
1874+
md_bitmap_end_sync(mddev->bitmap, s, &sync_blocks, 1);
1875+
s += sync_blocks;
1876+
sectors_to_go -= sync_blocks;
1877+
} while (sectors_to_go > 0);
1878+
}
1879+
18661880
static void end_sync_write(struct bio *bio)
18671881
{
18681882
int uptodate = !bio->bi_status;
@@ -1874,15 +1888,7 @@ static void end_sync_write(struct bio *bio)
18741888
struct md_rdev *rdev = conf->mirrors[find_bio_disk(r1_bio, bio)].rdev;
18751889

18761890
if (!uptodate) {
1877-
sector_t sync_blocks = 0;
1878-
sector_t s = r1_bio->sector;
1879-
long sectors_to_go = r1_bio->sectors;
1880-
/* make sure these bits doesn't get cleared. */
1881-
do {
1882-
md_bitmap_end_sync(mddev->bitmap, s, &sync_blocks, 1);
1883-
s += sync_blocks;
1884-
sectors_to_go -= sync_blocks;
1885-
} while (sectors_to_go > 0);
1891+
abort_sync_write(mddev, r1_bio);
18861892
set_bit(WriteErrorSeen, &rdev->flags);
18871893
if (!test_and_set_bit(WantReplacement, &rdev->flags))
18881894
set_bit(MD_RECOVERY_NEEDED, &
@@ -2172,8 +2178,10 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio)
21722178
(i == r1_bio->read_disk ||
21732179
!test_bit(MD_RECOVERY_SYNC, &mddev->recovery))))
21742180
continue;
2175-
if (test_bit(Faulty, &conf->mirrors[i].rdev->flags))
2181+
if (test_bit(Faulty, &conf->mirrors[i].rdev->flags)) {
2182+
abort_sync_write(mddev, r1_bio);
21762183
continue;
2184+
}
21772185

21782186
bio_set_op_attrs(wbio, REQ_OP_WRITE, 0);
21792187
if (test_bit(FailFast, &conf->mirrors[i].rdev->flags))

drivers/nvme/host/pci.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,15 +2560,15 @@ static void nvme_reset_work(struct work_struct *work)
25602560
mutex_lock(&dev->shutdown_lock);
25612561
result = nvme_pci_enable(dev);
25622562
if (result)
2563-
goto out;
2563+
goto out_unlock;
25642564

25652565
result = nvme_pci_configure_admin_queue(dev);
25662566
if (result)
2567-
goto out;
2567+
goto out_unlock;
25682568

25692569
result = nvme_alloc_admin_tags(dev);
25702570
if (result)
2571-
goto out;
2571+
goto out_unlock;
25722572

25732573
/*
25742574
* Limit the max command size to prevent iod->sg allocations going
@@ -2651,6 +2651,8 @@ static void nvme_reset_work(struct work_struct *work)
26512651
nvme_start_ctrl(&dev->ctrl);
26522652
return;
26532653

2654+
out_unlock:
2655+
mutex_unlock(&dev->shutdown_lock);
26542656
out:
26552657
nvme_remove_dead_ctrl(dev, result);
26562658
}

0 commit comments

Comments
 (0)