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.18-2022-04-15' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

- Moving of lower_48_bits() to the block layer and a fix for the
unaligned_be48 added with that originally (Alexander, Keith)

- Fix a bad WARN_ON() for trim size checking (Ming)

- A polled IO timeout fix for null_blk (Ming)

- Silence IO error printing for dead disks (Christoph)

- Compat mode range fix (Khazhismel)

- NVMe pull request via Christoph:
- Tone down the error logging added this merge window a bit
(Chaitanya Kulkarni)
- Quirk devices with non-unique unique identifiers (Christoph)

* tag 'block-5.18-2022-04-15' of git://git.kernel.dk/linux-block:
block: don't print I/O error warning for dead disks
block/compat_ioctl: fix range check in BLKGETSIZE
nvme-pci: disable namespace identifiers for Qemu controllers
nvme-pci: disable namespace identifiers for the MAXIO MAP1002/1202
nvme: add a quirk to disable namespace identifiers
nvme: don't print verbose errors for internal passthrough requests
block: null_blk: end timed out poll request
block: fix offset/size check in bio_trim()
asm-generic: fix __get_unaligned_be48() on 32 bit platforms
block: move lower_48_bits() to block

+48 -22
+1 -1
block/bio.c
··· 1598 1598 void bio_trim(struct bio *bio, sector_t offset, sector_t size) 1599 1599 { 1600 1600 if (WARN_ON_ONCE(offset > BIO_MAX_SECTORS || size > BIO_MAX_SECTORS || 1601 - offset + size > bio->bi_iter.bi_size)) 1601 + offset + size > bio_sectors(bio))) 1602 1602 return; 1603 1603 1604 1604 size <<= 9;
+2 -1
block/blk-mq.c
··· 794 794 #endif 795 795 796 796 if (unlikely(error && !blk_rq_is_passthrough(req) && 797 - !(req->rq_flags & RQF_QUIET))) { 797 + !(req->rq_flags & RQF_QUIET)) && 798 + !test_bit(GD_DEAD, &req->q->disk->state)) { 798 799 blk_print_req_error(req, error); 799 800 trace_block_rq_error(req, error, nr_bytes); 800 801 }
+1 -1
block/ioctl.c
··· 629 629 return compat_put_long(argp, 630 630 (bdev->bd_disk->bdi->ra_pages * PAGE_SIZE) / 512); 631 631 case BLKGETSIZE: 632 - if (bdev_nr_sectors(bdev) > ~0UL) 632 + if (bdev_nr_sectors(bdev) > ~(compat_ulong_t)0) 633 633 return -EFBIG; 634 634 return compat_put_ulong(argp, bdev_nr_sectors(bdev)); 635 635
+1 -1
drivers/block/null_blk/main.c
··· 1600 1600 * Only fake timeouts need to execute blk_mq_complete_request() here. 1601 1601 */ 1602 1602 cmd->error = BLK_STS_TIMEOUT; 1603 - if (cmd->fake_timeout) 1603 + if (cmd->fake_timeout || hctx->type == HCTX_TYPE_POLL) 1604 1604 blk_mq_complete_request(rq); 1605 1605 return BLK_EH_DONE; 1606 1606 }
+20 -7
drivers/nvme/host/core.c
··· 366 366 { 367 367 blk_status_t status = nvme_error_status(nvme_req(req)->status); 368 368 369 - if (unlikely(nvme_req(req)->status != NVME_SC_SUCCESS)) 369 + if (unlikely(nvme_req(req)->status && !(req->rq_flags & RQF_QUIET))) 370 370 nvme_log_error(req); 371 371 nvme_end_req_zoned(req); 372 372 nvme_trace_bio_complete(req); ··· 1015 1015 goto out; 1016 1016 } 1017 1017 1018 + req->rq_flags |= RQF_QUIET; 1018 1019 ret = nvme_execute_rq(req, at_head); 1019 1020 if (result && ret >= 0) 1020 1021 *result = nvme_req(req)->result; ··· 1288 1287 warn_str, cur->nidl); 1289 1288 return -1; 1290 1289 } 1290 + if (ctrl->quirks & NVME_QUIRK_BOGUS_NID) 1291 + return NVME_NIDT_EUI64_LEN; 1291 1292 memcpy(ids->eui64, data + sizeof(*cur), NVME_NIDT_EUI64_LEN); 1292 1293 return NVME_NIDT_EUI64_LEN; 1293 1294 case NVME_NIDT_NGUID: ··· 1298 1295 warn_str, cur->nidl); 1299 1296 return -1; 1300 1297 } 1298 + if (ctrl->quirks & NVME_QUIRK_BOGUS_NID) 1299 + return NVME_NIDT_NGUID_LEN; 1301 1300 memcpy(ids->nguid, data + sizeof(*cur), NVME_NIDT_NGUID_LEN); 1302 1301 return NVME_NIDT_NGUID_LEN; 1303 1302 case NVME_NIDT_UUID: ··· 1308 1303 warn_str, cur->nidl); 1309 1304 return -1; 1310 1305 } 1306 + if (ctrl->quirks & NVME_QUIRK_BOGUS_NID) 1307 + return NVME_NIDT_UUID_LEN; 1311 1308 uuid_copy(&ids->uuid, data + sizeof(*cur)); 1312 1309 return NVME_NIDT_UUID_LEN; 1313 1310 case NVME_NIDT_CSI: ··· 1406 1399 if ((*id)->ncap == 0) /* namespace not allocated or attached */ 1407 1400 goto out_free_id; 1408 1401 1409 - if (ctrl->vs >= NVME_VS(1, 1, 0) && 1410 - !memchr_inv(ids->eui64, 0, sizeof(ids->eui64))) 1411 - memcpy(ids->eui64, (*id)->eui64, sizeof(ids->eui64)); 1412 - if (ctrl->vs >= NVME_VS(1, 2, 0) && 1413 - !memchr_inv(ids->nguid, 0, sizeof(ids->nguid))) 1414 - memcpy(ids->nguid, (*id)->nguid, sizeof(ids->nguid)); 1402 + 1403 + if (ctrl->quirks & NVME_QUIRK_BOGUS_NID) { 1404 + dev_info(ctrl->device, 1405 + "Ignoring bogus Namespace Identifiers\n"); 1406 + } else { 1407 + if (ctrl->vs >= NVME_VS(1, 1, 0) && 1408 + !memchr_inv(ids->eui64, 0, sizeof(ids->eui64))) 1409 + memcpy(ids->eui64, (*id)->eui64, sizeof(ids->eui64)); 1410 + if (ctrl->vs >= NVME_VS(1, 2, 0) && 1411 + !memchr_inv(ids->nguid, 0, sizeof(ids->nguid))) 1412 + memcpy(ids->nguid, (*id)->nguid, sizeof(ids->nguid)); 1413 + } 1415 1414 1416 1415 return 0; 1417 1416
+5
drivers/nvme/host/nvme.h
··· 144 144 * encoding the generation sequence number. 145 145 */ 146 146 NVME_QUIRK_SKIP_CID_GEN = (1 << 17), 147 + 148 + /* 149 + * Reports garbage in the namespace identifiers (eui64, nguid, uuid). 150 + */ 151 + NVME_QUIRK_BOGUS_NID = (1 << 18), 147 152 }; 148 153 149 154 /*
+8 -1
drivers/nvme/host/pci.c
··· 3409 3409 .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3410 3410 { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ 3411 3411 .driver_data = NVME_QUIRK_IDENTIFY_CNS | 3412 - NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3412 + NVME_QUIRK_DISABLE_WRITE_ZEROES | 3413 + NVME_QUIRK_BOGUS_NID, }, 3414 + { PCI_VDEVICE(REDHAT, 0x0010), /* Qemu emulated controller */ 3415 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3413 3416 { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */ 3414 3417 .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, }, 3415 3418 { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ ··· 3450 3447 .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, 3451 3448 { PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */ 3452 3449 .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, 3450 + { PCI_DEVICE(0x1e4B, 0x1002), /* MAXIO MAP1002 */ 3451 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3452 + { PCI_DEVICE(0x1e4B, 0x1202), /* MAXIO MAP1202 */ 3453 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3453 3454 { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), 3454 3455 .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, }, 3455 3456 { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
+1 -1
include/asm-generic/unaligned.h
··· 143 143 144 144 static inline u64 __get_unaligned_be48(const u8 *p) 145 145 { 146 - return (u64)p[0] << 40 | (u64)p[1] << 32 | p[2] << 24 | 146 + return (u64)p[0] << 40 | (u64)p[1] << 32 | (u64)p[2] << 24 | 147 147 p[3] << 16 | p[4] << 8 | p[5]; 148 148 } 149 149
-9
include/linux/kernel.h
··· 64 64 ) 65 65 66 66 /** 67 - * lower_48_bits() - return bits 0-47 of a number 68 - * @n: the number we're accessing 69 - */ 70 - static inline u64 lower_48_bits(u64 n) 71 - { 72 - return n & ((1ull << 48) - 1); 73 - } 74 - 75 - /** 76 67 * upper_32_bits - return bits 32-63 of a number 77 68 * @n: the number we're accessing 78 69 *
+9
include/linux/t10-pi.h
··· 59 59 __u8 ref_tag[6]; 60 60 }; 61 61 62 + /** 63 + * lower_48_bits() - return bits 0-47 of a number 64 + * @n: the number we're accessing 65 + */ 66 + static inline u64 lower_48_bits(u64 n) 67 + { 68 + return n & ((1ull << 48) - 1); 69 + } 70 + 62 71 static inline u64 ext_pi_ref_tag(struct request *rq) 63 72 { 64 73 unsigned int shift = ilog2(queue_logical_block_size(rq->q));