From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f225.google.com (mail-pf1-f225.google.com [209.85.210.225]) (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 460FA2DAFAA for ; Fri, 17 Apr 2026 01:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776391067; cv=none; b=Lgd1o1zh/46T3EnvlItAPpCw3dCCE/IX0Qc0OZksuMwB/LaCyH1eUDZS9qSBWTZTpmwpYsQ7LL/5v1c4hI42bepI8VEhOxuvgHMD4eDKGVsqS6QaNoyS27JPIrFBIDIpqemEgD7pBRUZ2ARhqC89nMVz6UX1IsAqCdIW9lOfEPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776391067; c=relaxed/simple; bh=H7gpgcOZQqlOz3UfsDNLcCOef8f555rSPNFVL/tklSA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PmqtGp84QwJDVk2/l+evpVBHtWpj5DDa5iW5cBQfz0AJHIkjZpccD1f9kbfRhDFoKEx2FOhVn8EP5dQgCXHVqLiwIsZhMoySRWdJQm0Gb0j5ZqEyu/7u34lye/UDWUg7EjvrUqybgotC1nYsQsFU1ThU8DtAmRfOtn8uTWMumyI= 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=YTorg9Qi; arc=none smtp.client-ip=209.85.210.225 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="YTorg9Qi" Received: by mail-pf1-f225.google.com with SMTP id d2e1a72fcca58-82f1f03754bso29153b3a.3 for ; Thu, 16 Apr 2026 18:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1776391060; x=1776995860; 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=FUQOgbnR7fb9TvRKeaJrBXV8GjBjh4S9IAVC916d1UI=; b=YTorg9QigkhvWrGwYpyHFmDLxSx/S4R0Pzjprjlv7CD6ip11GOgi5S9Oj1icBdLbDp lR6OjeocUkpFTQ7A0SbnMKKOlW0YQdUb0UmMxtffNcTuwvC4UINYWePE7IHURHWaO9ur AjYE9/EXfuJZkMtQuPJ7BF/0ctNw0y3jCp4BgcIc3QUlEOY+QPD+zzZwcqZO2hEyif6G uURk6leOkEO3cUosW6Veogkvdpt0vLKcx+Z5BciDtCDZL9IwlKB0afS32VCKhN15wwwN 2jMVfw6n3FfyXzKavj0yshFRCfmhNzhh7W2kdTsgbB/HPYzNbEAZvOmjqy68lWYz/t6S eZZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776391060; x=1776995860; 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=FUQOgbnR7fb9TvRKeaJrBXV8GjBjh4S9IAVC916d1UI=; b=oPUBrLwM/ZYtUlf19z5adx/vW3MicyG1l8w5VmhYzDbd+06CVm/FnNk3dK2NWbNUsf c/15go2WLqlD+/ZOxKRd0/FO8qHYyfKQPGfGD0YsM1+JCMJpU/WwpCIkB2uJ8vKlI2wz RhMvxKsYWoD2HgdsqR1OmUoL1n8+ZmlJztCLtHK3rjxBBI99aWiryms41hJA3hJOzudN KnEtpVbpcgDhTFe2T1LtdkLikfoC2mupNSqlZinIUg58mHpe4l/xZhxB1yp5LH2mr23U lpUogfonS2VGOJ7IhYta6WYaUo1WZQCj6IMfk5rM2I2wzsiQnKwBVPHVqh4Uel21uuFF qzzA== X-Forwarded-Encrypted: i=1; AFNElJ8wa7KH+401InmqrDd8FguMkz4O3nET8W3toqflFe/CkwRhIDhxnQ9FwMdTTTmGHYRUyotVzrWtX5KZooo=@vger.kernel.org X-Gm-Message-State: AOJu0YxintcY+V+JA8YCB4Xngbel8wpDB1h9UGm7cXkFmzRZZmwsjiXt RmzS8k3Z43H1SQ3y2OtL3Oedvko3TEqQuncvEZUo2DQXa7b0iEmjJSc2lJHFBltlRUpnO7nqlIV GlKzHWw6uFdkKybszCaEFkui3g9PfFvIHr40iisLc4OozSMSk1xKs X-Gm-Gg: AeBDieublddBYs141dGbvK5aCWoXcOXFKltfY2v78LYAmz+f/LFYIz2LdiE5gNNY50n uNHv/owiDdUgjh5agINiB9FiyxWy31PzzRX3iNJwDTTaqrLjqJApRqamVrO8rVHgNXiX/ENRxSN NXq3hf3YY7B26OYU+nhu5i7JYV6fEqfTID3co2/NeL/XJ6WuuUVdSXfPbyyTGkx60lxSFxhHIhN 9S0ZvnqZydZDt1glHDcStDtquVIIRXbVt0B76lAGjXqfuNh1gRJj7FbVHdLVcdKLDQ7OxHaEKdQ Gj0d9cjwSRrAwlmn3oz6E0OR28sd2V26uRMkm5kqV+114FI5iELcbEdeCVHmEK6oVTHeSU+TQvQ 5oy3fEhroUV4mzcKySW2g8hCYa8L9GZb9PEvMB7qszXbKxrsLzg== X-Received: by 2002:a17:90b:1d52:b0:35f:b204:c62c with SMTP id 98e67ed59e1d1-3614022c036mr490528a91.0.1776391060538; Thu, 16 Apr 2026 18:57:40 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-36141943c35sm24518a91.3.2026.04.16.18.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 18:57:40 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id C637C3406AA; Thu, 16 Apr 2026 19:57:39 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id B6B12E406BE; Thu, 16 Apr 2026 19:57:39 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" Cc: Anuj Gupta , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v3 0/6] block: fix integrity offset/length conversions Date: Thu, 16 Apr 2026 19:57:26 -0600 Message-ID: <20260417015732.2692434-1-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The block layer's integrity code currently sets the seed (initial reference tag) in units of 512-byte sectors but increments it in units of integrity intervals. Not only do the T10 DIF formats require ref tags to be the lower bits of the logical block address, but mixing the two units means the ref tags used for a particular logical block vary based on its offset within a read/write request. This looks to be a longstanding bug affecting block devices that support integrity with block sizes > 512 bytes; I'm surprised it wasn't noticed before. Also fix the newly added fs_bio_integrity_verify() to pass bio_integrity_verify() a struct bdev_iter representing the data instead of the integrity. Most of the integrity data is currently being skipped. v3: - Drop bi and bip arguments to bip_set_seed() (Christoph) v2: - Reorder fixes before refactoring commits - Use u64, SECTOR_SHIFT (Christoph) - Don't take sector_t in bip_set_seed() (Christoph) Caleb Sander Mateos (6): block: use integrity interval instead of sector as seed bio-integrity-fs: pass data iter to bio_integrity_verify() blk-integrity: take u64 in bio_integrity_intervals() bio-integrity-fs: use integrity interval instead of sector as seed t10-pi: use bio_integrity_intervals() helper blk-integrity: avoid sector_t in bip_{get,set}_seed() block/bio-integrity-fs.c | 8 ++++++-- block/bio-integrity.c | 4 ++-- block/t10-pi.c | 7 ++++--- drivers/nvme/target/io-cmd-bdev.c | 3 +-- drivers/target/target_core_iblock.c | 3 +-- include/linux/bio-integrity.h | 11 ----------- include/linux/blk-integrity.h | 27 ++++++++++++++++++++------- include/linux/bvec.h | 1 + 8 files changed, 35 insertions(+), 29 deletions(-) -- 2.45.2