nvme fixes for Linux 6.12

- Multipath fixes (Hannes)
  - Sysfs attribute list NULL terminate fix (Shin'ichiro)
  - Remove problematic read-back (Keith)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE3Fbyvv+648XNRdHTPe3zGtjzRgkFAmbzr78ACgkQPe3zGtjz
 Rgl12xAA6Gy854fs6YeiolYD8qrZIN+TQeRc+aK+X7IP83tzDHN+VqqIFSdIi4Uq
 GhzksHYBHs/xSNA7aFeNebu+7p84mHh/73yRcvxrliac2JBq42NJ8/n02npmjozO
 IUn693VV5UR/twURAgdH2XbMRymIoC5CkPo2d36pF3zvBQYq75ZypcfVHQZm4vT6
 sU7Hb+t4VlWsEkwDT2gAVFzRzS9gOghtEThsNq0vzKOUoC/GXQO/w697rQ3HqKD9
 Ab1Q2WQEhy/yRJnqwBh/gumMtJvwx2uxdpw6G9hjR3U7CSQWFjneHBDd3CwssErJ
 JbhN0Nof1cMuAwwCNSCg398JofcwUdK7BXtZVgBEMKOJ8hMYUnmHiA4N8DMwoo7I
 VeKQ9wy4otYX42wHP1ieuWQKYaGI/EwPOxExdLJPYvtv8JQlsFKc+miM/lTi95HR
 /JKZk1Icn4RqSqXr9tpEBCRVAcUXjmKCxxup1kde5x/HMkxt+HelLvb/G0c4SL3U
 yMJrKMk34eBCFAXbdCuUXHeeiXvK40DKM70ocj0dyMeZ53oaTvCPiLcilRqrsx4y
 zGzSZ49YczSUueup0sAEmdzl6dZOKUeUD+s0LCSe4xX8M7CSZeBGhT+MhwzdWBwg
 O8SYk2iqkEhapDh0tldGF35VZr3hLSDmhp/b4kpVgBN8m9ZYxGg=
 =bLzT
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.12-2024-09-25' of git://git.infradead.org/nvme into for-6.12/block

Pull NVMe fixes from Keith:

"nvme fixes for Linux 6.12

 - Multipath fixes (Hannes)
 - Sysfs attribute list NULL terminate fix (Shin'ichiro)
 - Remove problematic read-back (Keith)"

* tag 'nvme-6.12-2024-09-25' of git://git.infradead.org/nvme:
  nvme: remove CC register read-back during enabling
  nvme: null terminate nvme_tls_attrs
  nvme-multipath: avoid hang on inaccessible namespaces
  nvme-multipath: system fails to create generic nvme device
This commit is contained in:
Jens Axboe 2024-09-25 03:29:17 -06:00
commit a045553362
3 changed files with 12 additions and 8 deletions

View File

@ -2468,11 +2468,6 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
if (ret)
return ret;
/* Flush write to device (required if transport is PCI) */
ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CC, &ctrl->ctrl_config);
if (ret)
return ret;
/* CAP value may change after initial CC write */
ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &ctrl->cap);
if (ret)

View File

@ -421,6 +421,9 @@ static bool nvme_available_path(struct nvme_ns_head *head)
{
struct nvme_ns *ns;
if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags))
return NULL;
list_for_each_entry_rcu(ns, &head->list, siblings) {
if (test_bit(NVME_CTRL_FAILFAST_EXPIRED, &ns->ctrl->flags))
continue;
@ -648,7 +651,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
rc = device_add_disk(&head->subsys->dev, head->disk,
nvme_ns_attr_groups);
if (rc) {
clear_bit(NVME_NSHEAD_DISK_LIVE, &ns->flags);
clear_bit(NVME_NSHEAD_DISK_LIVE, &head->flags);
return;
}
nvme_add_ns_head_cdev(head);
@ -969,11 +972,16 @@ void nvme_mpath_shutdown_disk(struct nvme_ns_head *head)
{
if (!head->disk)
return;
kblockd_schedule_work(&head->requeue_work);
if (test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
if (test_and_clear_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
nvme_cdev_del(&head->cdev, &head->cdev_device);
del_gendisk(head->disk);
}
/*
* requeue I/O after NVME_NSHEAD_DISK_LIVE has been cleared
* to allow multipath to fail all I/O.
*/
synchronize_srcu(&head->srcu);
kblockd_schedule_work(&head->requeue_work);
}
void nvme_mpath_remove_disk(struct nvme_ns_head *head)

View File

@ -767,6 +767,7 @@ static struct attribute *nvme_tls_attrs[] = {
&dev_attr_tls_key.attr,
&dev_attr_tls_configured_key.attr,
&dev_attr_tls_keyring.attr,
NULL,
};
static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,