1. 25 Sep, 2024 2 commits
    • Hannes Reinecke's avatar
      nvme-multipath: avoid hang on inaccessible namespaces · 3b97f5a0
      Hannes Reinecke authored
      During repetitive namespace remapping operations on the target the
      namespace might have changed between the time the initial scan
      was performed, and partition scan was invoked by device_add_disk()
      in nvme_mpath_set_live(). We then end up with a stuck scanning process:
      
      [<0>] folio_wait_bit_common+0x12a/0x310
      [<0>] filemap_read_folio+0x97/0xd0
      [<0>] do_read_cache_folio+0x108/0x390
      [<0>] read_part_sector+0x31/0xa0
      [<0>] read_lba+0xc5/0x160
      [<0>] efi_partition+0xd9/0x8f0
      [<0>] bdev_disk_changed+0x23d/0x6d0
      [<0>] blkdev_get_whole+0x78/0xc0
      [<0>] bdev_open+0x2c6/0x3b0
      [<0>] bdev_file_open_by_dev+0xcb/0x120
      [<0>] disk_scan_partitions+0x5d/0x100
      [<0>] device_add_disk+0x402/0x420
      [<0>] nvme_mpath_set_live+0x4f/0x1f0 [nvme_core]
      [<0>] nvme_mpath_add_disk+0x107/0x120 [nvme_core]
      [<0>] nvme_alloc_ns+0xac6/0xe60 [nvme_core]
      [<0>] nvme_scan_ns+0x2dd/0x3e0 [nvme_core]
      [<0>] nvme_scan_work+0x1a3/0x490 [nvme_core]
      
      This happens when we have several paths, some of which are inaccessible,
      and the active paths are removed first. Then nvme_find_path() will requeue
      I/O in the ns_head (as paths are present), but the requeue list is never
      triggered as all remaining paths are inactive.
      
      This patch checks for NVME_NSHEAD_DISK_LIVE in nvme_available_path(),
      and requeue I/O after NVME_NSHEAD_DISK_LIVE has been cleared once
      the last path has been removed to properly terminate pending I/O.
      Signed-off-by: default avatarHannes Reinecke <hare@kernel.org>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      3b97f5a0
    • Hannes Reinecke's avatar
      nvme-multipath: system fails to create generic nvme device · 63bcf901
      Hannes Reinecke authored
      NVME_NSHEAD_DISK_LIVE is a flag for struct nvme_ns_head, not nvme_ns.
      The current code has a typo causing NVME_NSHEAD_DISK_LIVE never to
      be cleared once device_add_disk_fails, causing the system never to
      create the 'generic' character device. Even several rescan attempts
      will change the situation and the system has to be rebooted to fix
      the issue.
      
      Fixes: 11384580 ("nvme-multipath: add error handling support for add_disk()")
      Signed-off-by: default avatarHannes Reinecke <hare@kernel.org>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      63bcf901
  2. 20 Sep, 2024 2 commits
  3. 18 Sep, 2024 1 commit
    • Qiu-ji Chen's avatar
      drbd: Fix atomicity violation in drbd_uuid_set_bm() · 2f02b5af
      Qiu-ji Chen authored
      The violation of atomicity occurs when the drbd_uuid_set_bm function is
      executed simultaneously with modifying the value of
      device->ldev->md.uuid[UI_BITMAP]. Consider a scenario where, while
      device->ldev->md.uuid[UI_BITMAP] passes the validity check when its
      value is not zero, the value of device->ldev->md.uuid[UI_BITMAP] is
      written to zero. In this case, the check in drbd_uuid_set_bm might refer
      to the old value of device->ldev->md.uuid[UI_BITMAP] (before locking),
      which allows an invalid value to pass the validity check, resulting in
      inconsistency.
      
      To address this issue, it is recommended to include the data validity
      check within the locked section of the function. This modification
      ensures that the value of device->ldev->md.uuid[UI_BITMAP] does not
      change during the validation process, thereby maintaining its integrity.
      
      This possible bug is found by an experimental static analysis tool
      developed by our team. This tool analyzes the locking APIs to extract
      function pairs that can be concurrently executed, and then analyzes the
      instructions in the paired functions to identify possible concurrency
      bugs including data races and atomicity violations.
      
      Fixes: 9f2247bb ("drbd: Protect accesses to the uuid set with a spinlock")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarQiu-ji Chen <chenqiuji666@gmail.com>
      Reviewed-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
      Link: https://lore.kernel.org/r/20240913083504.10549-1-chenqiuji666@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      2f02b5af
  4. 17 Sep, 2024 4 commits
  5. 15 Sep, 2024 3 commits
    • Linus Torvalds's avatar
      Linux 6.11 · 98f7e32f
      Linus Torvalds authored
      98f7e32f
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.11' of git://git.kernel.org/pub/scm/virt/kvm/kvm · d42f7708
      Linus Torvalds authored
      Pull kvm fix from Paolo Bonzini:
       "Do not always honor guest PAT on CPUs that support self-snoop.
      
        This triggers an issue in the bochsdrm driver, which used ioremap()
        instead of ioremap_wc() to map the video RAM.
      
        The revert lets video RAM use the WB memory type instead of the slower
        UC memory type"
      
      * tag 'for-linus-6.11' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        Revert "KVM: VMX: Always honor guest PAT on CPUs that support self-snoop"
      d42f7708
    • Paolo Bonzini's avatar
      Revert "KVM: VMX: Always honor guest PAT on CPUs that support self-snoop" · 9d70f3fe
      Paolo Bonzini authored
      This reverts commit 377b2f35.
      
      This caused a regression with the bochsdrm driver, which used ioremap()
      instead of ioremap_wc() to map the video RAM.  After the commit, the
      WB memory type is used without the IGNORE_PAT, resulting in the slower
      UC memory type.  In fact, UC is slow enough to basically cause guests
      to not boot... but only on new processors such as Sapphire Rapids and
      Cascade Lake.  Coffee Lake for example works properly, though that might
      also be an effect of being on a larger, more NUMA system.
      
      The driver has been fixed but that does not help older guests.  Until we
      figure out whether Cascade Lake and newer processors are working as
      intended, revert the commit.  Long term we might add a quirk, but the
      details depend on whether the processors are working as intended: for
      example if they are, the quirk might reference bochs-compatible devices,
      e.g. in the name and documentation, so that userspace can disable the
      quirk by default and only leave it enabled if such a device is being
      exposed to the guest.
      
      If instead this is actually a bug in CLX+, then the actions we need to
      take are different and depend on the actual cause of the bug.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9d70f3fe
  6. 14 Sep, 2024 4 commits
  7. 13 Sep, 2024 22 commits
  8. 12 Sep, 2024 2 commits