From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f104.google.com (mail-ua1-f104.google.com [209.85.222.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E67AB3A8755 for ; Wed, 13 May 2026 18:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.104 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778696981; cv=none; b=L7QlukvJyGUPSaYXJ0ul5aAXgt+gv9LIvNrVU4SukyiA4xWztMHVl3FT3aOmpdsumZblgAYa6QN+4ZhSqNW0HPCsVLDcTSY0XDxS9RTvDybXgrLaZoZsUx9a1cfFaAu3JfJp1yreWkXzQYn+3+DpgvZOVfo0tdPCWJCuk8Su0ds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778696981; c=relaxed/simple; bh=ijqnHNRqzTPIoYtrjuvejJohxFAC5Z8oMtw30slZKCc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qsYBi69Mg25sDpGjIjVlXdQ1V2usNuPO3zqoiZxOX+K568IYk9h0mdugtIg9O/Y9kjXEdmRHMD8EcSaBL+cWfzx2DB2iTjcs6nnn2zKUFoDsFrQqSTsWxqWMvGBWmngYVV2TN8j36uf6tGn7T9Pk22+jLfh9JL1Vqa7S0grJv3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=e201+8pw; arc=none smtp.client-ip=209.85.222.104 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="e201+8pw" Received: by mail-ua1-f104.google.com with SMTP id a1e0cc1a2514c-95ce65b78a8so137876241.2 for ; Wed, 13 May 2026 11:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1778696979; x=1779301779; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FFyi/JhFD26c7uSrv4bNuKOmxou2ucg11KYi5FCIQ9E=; b=e201+8pwnOc5FSCaa32DvnKsMhuJU8ZlpwECUli3jO0nnqKoijgi4ZvmUEZcSaIleN /7ASteldGX2OXlSiRR83b1tv5qKiDN+Hqp7ofxcuj7bqZq2sxyxllzqHCaqRx55qXgY9 6OmPklLA5laQlnhloTjowqzBQg1BY5JT4PG46AX9GEx89zMiLc9RYd+0SU+fcFOfzfyK v/h63fLCYHhyu7XGvP7PTHO6PW4qbMUcDjg5BRZtmw+9dUpCqFw1M44ZfqNjVmwfUDsX oRCAWs26zV671V6qdjaJ+EaD9klYaUAmb01ec1KemMts9kXhNBrMudl9NuKNc4oW9aIM d9Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778696979; x=1779301779; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FFyi/JhFD26c7uSrv4bNuKOmxou2ucg11KYi5FCIQ9E=; b=BDniNIezKDYcRTEyeZNJt1SqKmR7TsPVPyXDlcP0aUHINa1qqZFw3FJ8fU+HB2NBbb uWQfiXwqJLJAcYr5KDfS2vy+0NwAdHgjPhYN+MP3WLQU8QSk6SpKzU0oKpKpxEPc67m1 SWZrUl2EJkcQCyG/g8plCWCK1LvY66OaZGqFa9I6vBHiFgKajyXIPbVqRQrikn8wLlBd jbAzZTxS8KS9FoJW0r7tL2Nd/wyjHOTQqBS3sOUQiHlOkjr4SntFdu6N4ynV3u1qAzTV hfrkfp7PtUqVDkVOwTd8Ekpc1EogBfdebXHz6fCQdJ1NaDyDO8uLks9QXq8T34WewRPo PVuA== X-Forwarded-Encrypted: i=1; AFNElJ9YT/1c3OkbzWBIIwBAMMssbEK1ux1cfCuHYom51EilJVcvzW4NMsw1cKKTT0wkBBjjvup7IzIyYQZuGu0=@vger.kernel.org X-Gm-Message-State: AOJu0YyTyrcYt7dgzzX6BTHW/GhyoKlFXCqL+K/sbfilobvBMORstkUX OwvfAqHAJ+QTetSDctKJ/IwRFeDNRqVeU+fCUzLUqEQnASLlXJRT5Fd2c6gNY7y9MWIj0+1qZTn vFrcH5KMzoko5dciJFYdTs5xt9A+0xNC9FrLx X-Gm-Gg: Acq92OFwJrwDDTWOXOSo0aXRFMkAPJiBP/gvHV5mjZbW2ri7aH8BpkiMzOF3KN9hvA/ StWvvS5G1qGsDjlxC+a8wjFkhF9w8TVyU2DLV2u4bINHzNj7xI+jO//3j71TlJGTqgNkNq2dCA3 e6es412cS+PflH6oiOzEa1x8EvpUDbSGTknG5j4hGgfI83NabSl27t0nQRURLODWDy3ENUkLfZH yvoBIMPmEHA6L1j42hENuEtyVlIx3o7SWZeVO24aZ82ZpjNj4c9wKV9mSZO8e68R7hBgI1fJgqC bQCh5c7gXLTmPl4LUzq3bzPdUi6LbgJv4wlH4OWLWtlH90HPJl3qKunecIglZXdkwY/e35IY9Jr kk8nEbngFtyYIZvln0MsfxcXUT/MIh9WEY5HCztTZ7hu6chR3xaF9yw== X-Received: by 2002:a05:6102:41a9:b0:633:13a:6e31 with SMTP id ada2fe7eead31-63774873756mr1082276137.8.1778696978816; Wed, 13 May 2026 11:29:38 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.128]) by smtp-relay.gmail.com with ESMTPS id ada2fe7eead31-63140170ea1sm1403342137.20.2026.05.13.11.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:29:38 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (bond0.slc5-n22m09-k8s.dev.purestorage.com [IPv6:2620:125:9025:20::a31:449]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 255F93402D8; Wed, 13 May 2026 12:29:38 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 097D4E40CD8; Wed, 13 May 2026 12:29:38 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe Cc: Caleb Sander Mateos , Anuj Gupta , Christoph Hellwig , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] bio-integrity-fs: pass data iter to bio_integrity_verify() Date: Wed, 13 May 2026 12:29:21 -0600 Message-ID: <20260513182924.1753582-1-csander@purestorage.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit bio_integrity_verify() expects the passed struct bvec_iter to be an iterator over bio data, not integrity. So construct a separate data bvec_iter without the bio_integrity_bytes() conversion and pass it to bio_integrity_verify() instead of bip_iter. Fixes: 0bde8a12b554 ("block: add fs_bio_integrity helpers") Signed-off-by: Caleb Sander Mateos Reviewed-by: Anuj Gupta Reviewed-by: Christoph Hellwig --- v4: split from series changing ref tag seed units v3: https://lore.kernel.org/linux-block/20260417015732.2692434-3-csander@purestorage.com/ block/bio-integrity-fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/bio-integrity-fs.c b/block/bio-integrity-fs.c index acb1e5f270d2..0daa42d9ead7 100644 --- a/block/bio-integrity-fs.c +++ b/block/bio-integrity-fs.c @@ -53,21 +53,25 @@ EXPORT_SYMBOL_GPL(fs_bio_integrity_generate); int fs_bio_integrity_verify(struct bio *bio, sector_t sector, unsigned int size) { struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk); struct bio_integrity_payload *bip = bio_integrity(bio); + struct bvec_iter data_iter = { + .bi_sector = sector, + .bi_size = size, + }; /* * Reinitialize bip->bip_iter. * * This is for use in the submitter after the driver is done with the * bio. Requires the submitter to remember the sector and the size. */ memset(&bip->bip_iter, 0, sizeof(bip->bip_iter)); bip->bip_iter.bi_sector = sector; bip->bip_iter.bi_size = bio_integrity_bytes(bi, size >> SECTOR_SHIFT); - return blk_status_to_errno(bio_integrity_verify(bio, &bip->bip_iter)); + return blk_status_to_errno(bio_integrity_verify(bio, &data_iter)); } static int __init fs_bio_integrity_init(void) { fs_bio_integrity_cache = kmem_cache_create("fs_bio_integrity", -- 2.54.0