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-6.4-2023-05-20' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

- NVMe pull request via Keith:
- More device quirks (Sagi, Hristo, Adrian, Daniel)
- Controller delete race (Maurizo)
- Multipath cleanup fix (Christoph)

- Deny writeable mmap mapping on a readonly block device (Loic)

- Kill unused define that got introduced by accident (Christoph)

- Error handling fix for s390 dasd (Stefan)

- ublk locking fix (Ming)

* tag 'block-6.4-2023-05-20' of git://git.kernel.dk/linux:
block: remove NFL4_UFLG_MASK
block: Deny writable memory mapping if block is read-only
s390/dasd: fix command reject error on ESE devices
nvme-pci: Add quirk for Teamgroup MP33 SSD
ublk: fix AB-BA lockdep warning
nvme: do not let the user delete a ctrl before a complete initialization
nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk
nvme-pci: clamp max_hw_sectors based on DMA optimized limitation
nvme-pci: add quirk for missing secondary temperature thresholds
nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G

+69 -11
+11 -1
block/fops.c
··· 678 678 return error; 679 679 } 680 680 681 + static int blkdev_mmap(struct file *file, struct vm_area_struct *vma) 682 + { 683 + struct inode *bd_inode = bdev_file_inode(file); 684 + 685 + if (bdev_read_only(I_BDEV(bd_inode))) 686 + return generic_file_readonly_mmap(file, vma); 687 + 688 + return generic_file_mmap(file, vma); 689 + } 690 + 681 691 const struct file_operations def_blk_fops = { 682 692 .open = blkdev_open, 683 693 .release = blkdev_close, ··· 695 685 .read_iter = blkdev_read_iter, 696 686 .write_iter = blkdev_write_iter, 697 687 .iopoll = iocb_bio_iopoll, 698 - .mmap = generic_file_mmap, 688 + .mmap = blkdev_mmap, 699 689 .fsync = blkdev_fsync, 700 690 .unlocked_ioctl = blkdev_ioctl, 701 691 #ifdef CONFIG_COMPAT
+7 -2
drivers/block/ublk_drv.c
··· 1120 1120 return ubq->nr_io_ready == ubq->q_depth; 1121 1121 } 1122 1122 1123 + static void ublk_cmd_cancel_cb(struct io_uring_cmd *cmd, unsigned issue_flags) 1124 + { 1125 + io_uring_cmd_done(cmd, UBLK_IO_RES_ABORT, 0, issue_flags); 1126 + } 1127 + 1123 1128 static void ublk_cancel_queue(struct ublk_queue *ubq) 1124 1129 { 1125 1130 int i; ··· 1136 1131 struct ublk_io *io = &ubq->ios[i]; 1137 1132 1138 1133 if (io->flags & UBLK_IO_FLAG_ACTIVE) 1139 - io_uring_cmd_done(io->cmd, UBLK_IO_RES_ABORT, 0, 1140 - IO_URING_F_UNLOCKED); 1134 + io_uring_cmd_complete_in_task(io->cmd, 1135 + ublk_cmd_cancel_cb); 1141 1136 } 1142 1137 1143 1138 /* all io commands are canceled */
+5 -1
drivers/nvme/host/core.c
··· 3585 3585 { 3586 3586 struct nvme_ctrl *ctrl = dev_get_drvdata(dev); 3587 3587 3588 + if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags)) 3589 + return -EBUSY; 3590 + 3588 3591 if (device_remove_file_self(dev, attr)) 3589 3592 nvme_delete_ctrl_sync(ctrl); 3590 3593 return count; ··· 5048 5045 * that were missed. We identify persistent discovery controllers by 5049 5046 * checking that they started once before, hence are reconnecting back. 5050 5047 */ 5051 - if (test_and_set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) && 5048 + if (test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) && 5052 5049 nvme_discovery_ctrl(ctrl)) 5053 5050 nvme_change_uevent(ctrl, "NVME_EVENT=rediscover"); 5054 5051 ··· 5059 5056 } 5060 5057 5061 5058 nvme_change_uevent(ctrl, "NVME_EVENT=connected"); 5059 + set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags); 5062 5060 } 5063 5061 EXPORT_SYMBOL_GPL(nvme_start_ctrl); 5064 5062
+3 -1
drivers/nvme/host/hwmon.c
··· 163 163 case hwmon_temp_max: 164 164 case hwmon_temp_min: 165 165 if ((!channel && data->ctrl->wctemp) || 166 - (channel && data->log->temp_sensor[channel - 1])) { 166 + (channel && data->log->temp_sensor[channel - 1] && 167 + !(data->ctrl->quirks & 168 + NVME_QUIRK_NO_SECONDARY_TEMP_THRESH))) { 167 169 if (data->ctrl->quirks & 168 170 NVME_QUIRK_NO_TEMP_THRESH_CHANGE) 169 171 return 0444;
-1
drivers/nvme/host/multipath.c
··· 884 884 { 885 885 if (!head->disk) 886 886 return; 887 - blk_mark_disk_dead(head->disk); 888 887 /* make sure all pending bios are cleaned up */ 889 888 kblockd_schedule_work(&head->requeue_work); 890 889 flush_work(&head->requeue_work);
+5
drivers/nvme/host/nvme.h
··· 149 149 * Reports garbage in the namespace identifiers (eui64, nguid, uuid). 150 150 */ 151 151 NVME_QUIRK_BOGUS_NID = (1 << 18), 152 + 153 + /* 154 + * No temperature thresholds for channels other than 0 (Composite). 155 + */ 156 + NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19), 152 157 }; 153 158 154 159 /*
+7 -1
drivers/nvme/host/pci.c
··· 2956 2956 * over a single page. 2957 2957 */ 2958 2958 dev->ctrl.max_hw_sectors = min_t(u32, 2959 - NVME_MAX_KB_SZ << 1, dma_max_mapping_size(&pdev->dev) >> 9); 2959 + NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9); 2960 2960 dev->ctrl.max_segments = NVME_MAX_SEGS; 2961 2961 2962 2962 /* ··· 3402 3402 .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, 3403 3403 { PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */ 3404 3404 .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, 3405 + { PCI_DEVICE(0x2646, 0x5013), /* Kingston KC3000, Kingston FURY Renegade */ 3406 + .driver_data = NVME_QUIRK_NO_SECONDARY_TEMP_THRESH, }, 3405 3407 { PCI_DEVICE(0x2646, 0x5018), /* KINGSTON OM8SFP4xxxxP OS21012 NVMe SSD */ 3406 3408 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3407 3409 { PCI_DEVICE(0x2646, 0x5016), /* KINGSTON OM3PGP4xxxxP OS21011 NVMe SSD */ ··· 3442 3440 .driver_data = NVME_QUIRK_BOGUS_NID | 3443 3441 NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3444 3442 { PCI_DEVICE(0x10ec, 0x5763), /* TEAMGROUP T-FORCE CARDEA ZERO Z330 SSD */ 3443 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3444 + { PCI_DEVICE(0x1e4b, 0x1602), /* HS-SSD-FUTURE 2048G */ 3445 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3446 + { PCI_DEVICE(0x10ec, 0x5765), /* TEAMGROUP MP33 2TB SSD */ 3445 3447 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3446 3448 { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), 3447 3449 .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
+31 -2
drivers/s390/block/dasd_eckd.c
··· 127 127 struct dasd_device *, struct dasd_device *, 128 128 unsigned int, int, unsigned int, unsigned int, 129 129 unsigned int, unsigned int); 130 + static int dasd_eckd_query_pprc_status(struct dasd_device *, 131 + struct dasd_pprc_data_sc4 *); 130 132 131 133 /* initial attempt at a probe function. this can be simplified once 132 134 * the other detection code is gone */ ··· 3735 3733 return count; 3736 3734 } 3737 3735 3736 + static int dasd_in_copy_relation(struct dasd_device *device) 3737 + { 3738 + struct dasd_pprc_data_sc4 *temp; 3739 + int rc; 3740 + 3741 + if (!dasd_eckd_pprc_enabled(device)) 3742 + return 0; 3743 + 3744 + temp = kzalloc(sizeof(*temp), GFP_KERNEL); 3745 + if (!temp) 3746 + return -ENOMEM; 3747 + 3748 + rc = dasd_eckd_query_pprc_status(device, temp); 3749 + if (!rc) 3750 + rc = temp->dev_info[0].state; 3751 + 3752 + kfree(temp); 3753 + return rc; 3754 + } 3755 + 3738 3756 /* 3739 3757 * Release allocated space for a given range or an entire volume. 3740 3758 */ ··· 3771 3749 int cur_to_trk, cur_from_trk; 3772 3750 struct dasd_ccw_req *cqr; 3773 3751 u32 beg_cyl, end_cyl; 3752 + int copy_relation; 3774 3753 struct ccw1 *ccw; 3775 3754 int trks_per_ext; 3776 3755 size_t ras_size; ··· 3782 3759 3783 3760 if (dasd_eckd_ras_sanity_checks(device, first_trk, last_trk)) 3784 3761 return ERR_PTR(-EINVAL); 3762 + 3763 + copy_relation = dasd_in_copy_relation(device); 3764 + if (copy_relation < 0) 3765 + return ERR_PTR(copy_relation); 3785 3766 3786 3767 rq = req ? blk_mq_rq_to_pdu(req) : NULL; 3787 3768 ··· 3815 3788 /* 3816 3789 * This bit guarantees initialisation of tracks within an extent that is 3817 3790 * not fully specified, but is only supported with a certain feature 3818 - * subset. 3791 + * subset and for devices not in a copy relation. 3819 3792 */ 3820 - ras_data->op_flags.guarantee_init = !!(features->feature[56] & 0x01); 3793 + if (features->feature[56] & 0x01 && !copy_relation) 3794 + ras_data->op_flags.guarantee_init = 1; 3795 + 3821 3796 ras_data->lss = private->conf.ned->ID; 3822 3797 ras_data->dev_addr = private->conf.ned->unit_addr; 3823 3798 ras_data->nr_exts = nr_exts;
-2
include/linux/blkdev.h
··· 1376 1376 BLK_UID_NAA = 3, 1377 1377 }; 1378 1378 1379 - #define NFL4_UFLG_MASK 0x0000003F 1380 - 1381 1379 struct block_device_operations { 1382 1380 void (*submit_bio)(struct bio *bio); 1383 1381 int (*poll_bio)(struct bio *bio, struct io_comp_batch *iob,