Pull block fixes from Jens Axboe: - Fix for batch getting of tags in sbitmap (wuchi) - NVMe pull request via Christoph: - More quirks (Lamarque Vieira Souza, Pablo Greco) - Fix a fabrics disconnect regression (Ruozhu Li) - Fix a nvmet-tcp data_digest calculation regression (Sagi Grimberg) - Fix nvme-tcp send failure handling (Sagi Grimberg) - Fix a regression with nvmet-loop and passthrough controllers (Alan Adamson) * tag 'block-5.19-2022-07-01' of git://git.kernel.dk/linux-block: nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA IM2P33F8ABR1 nvmet: add a clear_ids attribute for passthru targets nvme: fix regression when disconnect a recovering ctrl nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G) nvme-tcp: always fail a request when sending it failed nvmet-tcp: fix regression in data_digest calculation lib/sbitmap: Fix invalid loop in __sbitmap_queue_get_batch()
Showing the changes to lib (1 of 11 files). Show all
Unified · Split
| @@ -528,7 +528,7 @@ unsigned long __sbitmap_queue_get_batch(struct sbitmap_queue *sbq, int nr_tags, · 527 unmodified lines | |||
| 528 | 528 | ||
| 529 | sbitmap_deferred_clear(map); | 529 | sbitmap_deferred_clear(map); |
| 530 | if (map->word == (1UL << (map_depth - 1)) - 1) | 530 | if (map->word == (1UL << (map_depth - 1)) - 1) |
| 531 | continue; | 531 | goto next; |
| 532 | 532 | ||
| 533 | nr = find_first_zero_bit(&map->word, map_depth); | 533 | nr = find_first_zero_bit(&map->word, map_depth); |
| 534 | if (nr + nr_tags <= map_depth) { | 534 | if (nr + nr_tags <= map_depth) { |
| @@ -539,6 +539,8 @@ unsigned long __sbitmap_queue_get_batch(struct sbitmap_queue *sbq, int nr_tags, · 4 unmodified lines | |||
| 539 | get_mask = ((1UL << map_tags) - 1) << nr; | 539 | get_mask = ((1UL << map_tags) - 1) << nr; |
| 540 | do { | 540 | do { |
| 541 | val = READ_ONCE(map->word); | 541 | val = READ_ONCE(map->word); |
| 542 | if ((val & ~get_mask) != val) | ||
| 543 | goto next; | ||
| 542 | ret = atomic_long_cmpxchg(ptr, val, get_mask | val); | 544 | ret = atomic_long_cmpxchg(ptr, val, get_mask | val); |
| 543 | } while (ret != val); | 545 | } while (ret != val); |
| 544 | get_mask = (get_mask & ~ret) >> nr; | 546 | get_mask = (get_mask & ~ret) >> nr; |
| @@ -549,6 +551,7 @@ unsigned long __sbitmap_queue_get_batch(struct sbitmap_queue *sbq, int nr_tags, · 4 unmodified lines | |||
| 549 | return get_mask; | 551 | return get_mask; |
| 550 | } | 552 | } |
| 551 | } | 553 | } |
| 554 | next: | ||
| 552 | /* Jump to next index. */ | 555 | /* Jump to next index. */ |
| 553 | if (++index >= sb->map_nr) | 556 | if (++index >= sb->map_nr) |
| 554 | index = 0; | 557 | index = 0; |