Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'block-5.12-2021-04-02' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- Remove comment that never came to fruition in 22 years of development
(Christoph)

- Remove unused request flag (Christoph)

- Fix for null_blk fake timeout handling (Damien)

- Fix for IOCB_NOWAIT being ignored for O_DIRECT on raw bdevs (Pavel)

- Error propagation fix for multiple split bios (Yufen)

* tag 'block-5.12-2021-04-02' of git://git.kernel.dk/linux-block:
block: remove the unused RQF_ALLOCED flag
block: update a few comments in uapi/linux/blkpg.h
block: don't ignore REQ_NOWAIT for direct IO
null_blk: fix command timeout completion handling
block: only update parent bi_status when bio fail

+29 -35
+1 -1
block/bio.c
··· 277 277 { 278 278 struct bio *parent = bio->bi_private; 279 279 280 - if (!parent->bi_status) 280 + if (bio->bi_status && !parent->bi_status) 281 281 parent->bi_status = bio->bi_status; 282 282 bio_put(bio); 283 283 return parent;
-1
block/blk-mq-debugfs.c
··· 302 302 RQF_NAME(QUIET), 303 303 RQF_NAME(ELVPRIV), 304 304 RQF_NAME(IO_STAT), 305 - RQF_NAME(ALLOCED), 306 305 RQF_NAME(PM), 307 306 RQF_NAME(HASHED), 308 307 RQF_NAME(STATS),
+21 -5
drivers/block/null_blk/main.c
··· 1369 1369 } 1370 1370 1371 1371 if (dev->zoned) 1372 - cmd->error = null_process_zoned_cmd(cmd, op, 1373 - sector, nr_sectors); 1372 + sts = null_process_zoned_cmd(cmd, op, sector, nr_sectors); 1374 1373 else 1375 - cmd->error = null_process_cmd(cmd, op, sector, nr_sectors); 1374 + sts = null_process_cmd(cmd, op, sector, nr_sectors); 1375 + 1376 + /* Do not overwrite errors (e.g. timeout errors) */ 1377 + if (cmd->error == BLK_STS_OK) 1378 + cmd->error = sts; 1376 1379 1377 1380 out: 1378 1381 nullb_complete_cmd(cmd); ··· 1454 1451 1455 1452 static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res) 1456 1453 { 1454 + struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq); 1455 + 1457 1456 pr_info("rq %p timed out\n", rq); 1458 - blk_mq_complete_request(rq); 1457 + 1458 + /* 1459 + * If the device is marked as blocking (i.e. memory backed or zoned 1460 + * device), the submission path may be blocked waiting for resources 1461 + * and cause real timeouts. For these real timeouts, the submission 1462 + * path will complete the request using blk_mq_complete_request(). 1463 + * Only fake timeouts need to execute blk_mq_complete_request() here. 1464 + */ 1465 + cmd->error = BLK_STS_TIMEOUT; 1466 + if (cmd->fake_timeout) 1467 + blk_mq_complete_request(rq); 1459 1468 return BLK_EH_DONE; 1460 1469 } 1461 1470 ··· 1488 1473 cmd->rq = bd->rq; 1489 1474 cmd->error = BLK_STS_OK; 1490 1475 cmd->nq = nq; 1476 + cmd->fake_timeout = should_timeout_request(bd->rq); 1491 1477 1492 1478 blk_mq_start_request(bd->rq); 1493 1479 ··· 1505 1489 return BLK_STS_OK; 1506 1490 } 1507 1491 } 1508 - if (should_timeout_request(bd->rq)) 1492 + if (cmd->fake_timeout) 1509 1493 return BLK_STS_OK; 1510 1494 1511 1495 return null_handle_cmd(cmd, sector, nr_sectors, req_op(bd->rq));
+1
drivers/block/null_blk/null_blk.h
··· 22 22 blk_status_t error; 23 23 struct nullb_queue *nq; 24 24 struct hrtimer timer; 25 + bool fake_timeout; 25 26 }; 26 27 27 28 struct nullb_queue {
+4
fs/block_dev.c
··· 275 275 bio.bi_opf = dio_bio_write_op(iocb); 276 276 task_io_account_write(ret); 277 277 } 278 + if (iocb->ki_flags & IOCB_NOWAIT) 279 + bio.bi_opf |= REQ_NOWAIT; 278 280 if (iocb->ki_flags & IOCB_HIPRI) 279 281 bio_set_polled(&bio, iocb); 280 282 ··· 430 428 bio->bi_opf = dio_bio_write_op(iocb); 431 429 task_io_account_write(bio->bi_iter.bi_size); 432 430 } 431 + if (iocb->ki_flags & IOCB_NOWAIT) 432 + bio->bi_opf |= REQ_NOWAIT; 433 433 434 434 dio->size += bio->bi_iter.bi_size; 435 435 pos += bio->bi_iter.bi_size;
-2
include/linux/blkdev.h
··· 85 85 #define RQF_ELVPRIV ((__force req_flags_t)(1 << 12)) 86 86 /* account into disk and partition IO statistics */ 87 87 #define RQF_IO_STAT ((__force req_flags_t)(1 << 13)) 88 - /* request came from our alloc pool */ 89 - #define RQF_ALLOCED ((__force req_flags_t)(1 << 14)) 90 88 /* runtime pm request */ 91 89 #define RQF_PM ((__force req_flags_t)(1 << 15)) 92 90 /* on IO scheduler merge hash */
+2 -26
include/uapi/linux/blkpg.h
··· 2 2 #ifndef _UAPI__LINUX_BLKPG_H 3 3 #define _UAPI__LINUX_BLKPG_H 4 4 5 - /* 6 - * Partition table and disk geometry handling 7 - * 8 - * A single ioctl with lots of subfunctions: 9 - * 10 - * Device number stuff: 11 - * get_whole_disk() (given the device number of a partition, 12 - * find the device number of the encompassing disk) 13 - * get_all_partitions() (given the device number of a disk, return the 14 - * device numbers of all its known partitions) 15 - * 16 - * Partition stuff: 17 - * add_partition() 18 - * delete_partition() 19 - * test_partition_in_use() (also for test_disk_in_use) 20 - * 21 - * Geometry stuff: 22 - * get_geometry() 23 - * set_geometry() 24 - * get_bios_drivedata() 25 - * 26 - * For today, only the partition stuff - aeb, 990515 27 - */ 28 5 #include <linux/compiler.h> 29 6 #include <linux/ioctl.h> 30 7 ··· 29 52 long long start; /* starting offset in bytes */ 30 53 long long length; /* length in bytes */ 31 54 int pno; /* partition number */ 32 - char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2, 33 - to be used in kernel messages */ 34 - char volname[BLKPG_VOLNAMELTH]; /* volume label */ 55 + char devname[BLKPG_DEVNAMELTH]; /* unused / ignored */ 56 + char volname[BLKPG_VOLNAMELTH]; /* unused / ignore */ 35 57 }; 36 58 37 59 #endif /* _UAPI__LINUX_BLKPG_H */