Skip to content

Commit c616920

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Make the block layer great again. Basically three amazing fixes in this pull request, split into 4 patches. Believe me, they should go into 4.4. Two of them fix a regression, the third and last fixes an easy-to-trigger bug. - Fix a bad irq enable through null_blk, for queue_mode=1 and using timer completions. Add a block helper to restart a queue asynchronously, and use that from null_blk. From me. - Fix a performance issue in NVMe. Some devices (Intel Pxxxx) expose a stripe boundary, and performance suffers if we cross it. We took that into account for merging, but not for the newer splitting code. Fix from Keith. - Fix a kernel oops in lightnvm with multiple channels. From Matias" * 'for-linus' of git://git.kernel.dk/linux-block: lightnvm: wrong offset in bad blk lun calculation null_blk: use async queue restart helper block: add blk_start_queue_async() block: Split bios on chunk boundaries
2 parents 866be88 + c3293a9 commit c616920

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

block/blk-core.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,22 @@ void blk_delay_queue(struct request_queue *q, unsigned long msecs)
206206
}
207207
EXPORT_SYMBOL(blk_delay_queue);
208208

209+
/**
210+
* blk_start_queue_async - asynchronously restart a previously stopped queue
211+
* @q: The &struct request_queue in question
212+
*
213+
* Description:
214+
* blk_start_queue_async() will clear the stop flag on the queue, and
215+
* ensure that the request_fn for the queue is run from an async
216+
* context.
217+
**/
218+
void blk_start_queue_async(struct request_queue *q)
219+
{
220+
queue_flag_clear(QUEUE_FLAG_STOPPED, q);
221+
blk_run_queue_async(q);
222+
}
223+
EXPORT_SYMBOL(blk_start_queue_async);
224+
209225
/**
210226
* blk_start_queue - restart a previously stopped queue
211227
* @q: The &struct request_queue in question

block/blk-merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
8181
struct bio *new = NULL;
8282

8383
bio_for_each_segment(bv, bio, iter) {
84-
if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q))
84+
if (sectors + (bv.bv_len >> 9) > blk_max_size_offset(q, bio->bi_iter.bi_sector))
8585
goto split;
8686

8787
/*

drivers/block/null_blk.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,19 @@ static void end_cmd(struct nullb_cmd *cmd)
232232
break;
233233
case NULL_Q_BIO:
234234
bio_endio(cmd->bio);
235-
goto free_cmd;
235+
break;
236236
}
237237

238+
free_cmd(cmd);
239+
238240
/* Restart queue if needed, as we are freeing a tag */
239-
if (q && !q->mq_ops && blk_queue_stopped(q)) {
241+
if (queue_mode == NULL_Q_RQ && blk_queue_stopped(q)) {
240242
unsigned long flags;
241243

242244
spin_lock_irqsave(q->queue_lock, flags);
243-
if (blk_queue_stopped(q))
244-
blk_start_queue(q);
245+
blk_start_queue_async(q);
245246
spin_unlock_irqrestore(q->queue_lock, flags);
246247
}
247-
free_cmd:
248-
free_cmd(cmd);
249248
}
250249

251250
static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer)

drivers/lightnvm/gennvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int gennvm_block_bb(struct ppa_addr ppa, int nr_blocks, u8 *blks,
7575
struct nvm_block *blk;
7676
int i;
7777

78-
lun = &gn->luns[(dev->nr_luns * ppa.g.ch) + ppa.g.lun];
78+
lun = &gn->luns[(dev->luns_per_chnl * ppa.g.ch) + ppa.g.lun];
7979

8080
for (i = 0; i < nr_blocks; i++) {
8181
if (blks[i] == 0)

include/linux/blkdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
797797
extern int blk_queue_enter(struct request_queue *q, gfp_t gfp);
798798
extern void blk_queue_exit(struct request_queue *q);
799799
extern void blk_start_queue(struct request_queue *q);
800+
extern void blk_start_queue_async(struct request_queue *q);
800801
extern void blk_stop_queue(struct request_queue *q);
801802
extern void blk_sync_queue(struct request_queue *q);
802803
extern void __blk_stop_queue(struct request_queue *q);

0 commit comments

Comments
 (0)