From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f228.google.com (mail-pf1-f228.google.com [209.85.210.228]) (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 C8DBB194C95 for ; Thu, 16 Apr 2026 00:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776298969; cv=none; b=gBRLgKfDkDKXC3JoTXWZEJ9CsV+ZTimnjq7MJKh3Yy9+iSjFPwfm11i+w15kACO38GqH+z7i0e5E0qhFPXcpl5Oeqt42qUe4XT/P0lGEasjdin0Owzfn49HnpI86OjfvYiO00Jb9WPKvktrVXMfRyMeFsxwMjjErORHKLlmH06Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776298969; c=relaxed/simple; bh=ZsNzzGBZWRqGf2uq6G6j10Q+trCcIWrDEn8dRrN0A+w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XmKANynNRLgVWRu5Ehg58uHEHgrHcqRkZsxu3kuC5zgSFDaKvzOlyDUjL1RI2YYGMlsKp4TveMC2GwIxuoCURc7bS/8/Sx8kUB+cRPbvWMUEmOruOzB1Yr4MaxyVe2cnWPA5KQkj5RSEKQXDeymJkb+9uiXDwFt0unzSky7EYtw= 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=QdBkYjZg; arc=none smtp.client-ip=209.85.210.228 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="QdBkYjZg" Received: by mail-pf1-f228.google.com with SMTP id d2e1a72fcca58-826dab01bbdso133942b3a.0 for ; Wed, 15 Apr 2026 17:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1776298967; x=1776903767; 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=32BeK9NcDM0TTacs4Hgu5YnQIjPRb6EDjdK365GBPos=; b=QdBkYjZg4GcvOsulgVGLN6Yty+QsEbBvYWqsK9h3dF7jbJWgX4mCT4/D1D0j/8Tv+J 5Yp8rJivwDJkNZhw5M104fimxjMCPZnnsmI8u1dgc+bt+NVrD5r2WfXs64QLqtEvN6Kf eOEZhVK0EguESYlUsx1HhkNgzXn2izp+Sp8TViUDzcdF9lLNVKyJqQqdv0XXtnGRM9SC QbYOzhhluh6zuQT6kbEs89FUCKn8CMAVSbgP5gEmYEl/JTWaG3fDweNWeQUicDi1mdOT PuoNMiwN5YHh6s7cdPf6rjkMU4Wm62fG3ASI2FKa5jr4RJzMVIIZmn9bVDy81wgPC9lL K3hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776298967; x=1776903767; 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=32BeK9NcDM0TTacs4Hgu5YnQIjPRb6EDjdK365GBPos=; b=LJVDqi8do1pl4rYYadPJ3hhlkUIIAJDXvP+8LdTa5m20xY57M1R5IGcr5oeEp0p0na HCRM8FZ3avfip0k4XiP/PIuDBIeHCxM28CSKQKzK9Z+MzrSs6cqb1MviqY4OLeWIAP7u JeNbEqEUdsUxghvxJxckQeMxp0BUpdY1FNDHlCD2Hjy2cKUPhYN92wB+CEGX1lNC38qD OMPLFOSNSORGtOJuFq+xFBRpy7vjGiuixO84nryv+jOTKRclfXEcxV/Or128DK2zBjZy GyC58EbHTVSHf8bppPEQE9EgK2cNEDsnkw/MSdw+TcQmDCM7BNi2s1Ow5/TeDnETi5WK +uKA== X-Forwarded-Encrypted: i=1; AFNElJ8YyjZL1A1FgNF5eoVEcacjqwA31WR+LhxD3xi0rXuArc11+Eoj106J5GdtDUmivDG6aENZmfqMMO10+rA=@vger.kernel.org X-Gm-Message-State: AOJu0YzQV1NFDMTHWGfyuRkK4nowi+l2L4vme8IzCMmIA59Yu5/RhxT7 KxEXX/BCY1gFXKBfqWfNJ3eHNw57x2Y0gQfx2yg0jYqVguDLwAsAeOnIGwIHgZr2qxGfHdvmf1P D+Wz2ftrum6nJcYi7+AE4Ei3+qRaMf35ZoqNw X-Gm-Gg: AeBDietyEgwKWq0mt/3uKZI7Z+H8YijI4j56whwgUXacybX+pEFgRgt9PQsoDseMHUW Ax6e49/TQ2FEI+Hn8G9OmL+hdTI/PU8mahbyw7asP7o4RiAqNfK4jrBOP1+EKijGN5WynuvIeF0 9TUG62qCjZL5NoqOSJZe/FDwh9hUWpk1axKDjJZFiPS2yGb0p4S5Is2h1GbYWc8/KlgspHiG98i eNev1NCTtXUH4P0rF5UFcKVIASHkjUmGjiiqyW/zTV6rv1b0cSPJKudZHUnbJvMFUHCLofS+mWZ dKuwJxJKCP4c4yZoahMt0cL2r/MIWg6dZ6Y1aHax4J2v2B+DpS3Ol3/ROi/Y/Gjgc9TrXuY52gv pTzjQ7+xj9R9OEiZPVUNa35omvqX9x/UJ1c+MXOfDDileUhR++/7zh0mZYp/vofop X-Received: by 2002:a05:6a00:809:b0:81f:453d:1ab9 with SMTP id d2e1a72fcca58-82f678215a0mr2547248b3a.3.1776298967035; Wed, 15 Apr 2026 17:22:47 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.128]) by smtp-relay.gmail.com with ESMTPS id d2e1a72fcca58-82f6741a4a2sm280415b3a.7.2026.04.15.17.22.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 17:22:47 -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 A7CFE3405AE; Wed, 15 Apr 2026 18:22:45 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 914E7E41B93; Wed, 15 Apr 2026 18:22:45 -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 v2 0/6] block: fix integrity offset/length conversions Date: Wed, 15 Apr 2026 18:22:08 -0600 Message-ID: <20260416002214.2048150-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. 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 | 5 +++-- 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 | 28 +++++++++++++++++++++------- include/linux/bvec.h | 1 + 8 files changed, 33 insertions(+), 29 deletions(-) -- 2.45.2