nvme: don't WARN on I/O to a namespace revalidated to unusable metadata#842
Open
blktests-ci[bot] wants to merge 1 commit into
Open
nvme: don't WARN on I/O to a namespace revalidated to unusable metadata#842blktests-ci[bot] wants to merge 1 commit into
blktests-ci[bot] wants to merge 1 commit into
Conversation
nvme_setup_rw() fires WARN_ON_ONCE(!nvme_ns_has_pi(ns->head)) for a namespace with head->ms != 0 but no PI and no REQ_INTEGRITY. This occurs when Identify Namespace reports flbas META_EXT, lbaf[].ms != 0 and dps == 0: on PCIe nvme_configure_metadata() sets EXT_LBAS without METADATA_SUPPORTED, nvme_init_integrity() registers no profile, and capacity is forced to 0. It is the host-unaware geometry change Keith described -- an out-of-band format on a shared namespace, or a non-compliant device seen on rescan -- not the host's own Format NVM, which freezes first. The freeze in nvme_update_ns_info_block() is not defeated; the WARN just does not depend on q->limits. It depends on ns->head->ms (read live at dispatch, set inside the freeze window) and on REQ_INTEGRITY, never set for this geometry. capacity == 0 only gates submission (bio_check_eod()), not dispatch: a writeback bio that passed bio_check_eod() under the old capacity sits on the task plug holding no q_usage_counter reference and is flushed by blk_finish_plug() after the update committed head->ms != 0 (dmesg confirms: the capacity-change line prints before the WARN). The I/O is already rejected correctly (BLK_STS_NOTSUPP, capacity 0). The assertion fires on a device-reachable, already-handled condition -- a panic under panic_on_warn -- and its premise does not hold: metadata without PI or a registrable profile is a legitimate, unusable state. Add that explicit case and emit one dev_warn_once() instead. Fully fencing already-submitted bios over a revalidation is larger, TP-level work and is out of scope here. Tested: built on linux-kcov-debug (6.19.0+, KASAN); boot-tested under FEMU, 4x dd + 500 rescans, no splat; reject path verified by code inspection. Found by FuzzNvme (Syzkaller with FEMU fuzzing framework). Link: https://lore.kernel.org/linux-nvme/20260427003457.1264511-1-coshi036@gmail.com/ Acked-by: Sungwoo Kim <iam@sung-woo.kim> Acked-by: Dave Tian <daveti@purdue.edu> Acked-by: Weidong Zhu <weizhu@fiu.edu> Signed-off-by: Chao Shi <coshi036@gmail.com>
Author
|
Upstream branch: 70eda68 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: nvme: don't WARN on I/O to a namespace revalidated to unusable metadata
version: 2
url: https://patchwork.kernel.org/project/linux-block/list/?series=1095973