From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f228.google.com (mail-pg1-f228.google.com [209.85.215.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 E158E33E34B for ; Fri, 3 Apr 2026 19:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775245283; cv=none; b=fTMxVqwM3XlW5Iy4cxdEzqWTzCR0V9G+cSJxLLfg8q2pUZmhn9IvKnyqRcm0mg0yxUs5yuKZdHteY/nLWErSEG17I8NiByhhGo8wbPQGrqunEJRT0nT2DQZ5n53IZyfVkBoXiZcxACdXqF+/5pW5Rp5RzOWX2rIEo8zwICn4Cz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775245283; c=relaxed/simple; bh=s7a0+emFgbEKsMfKwqFAYZyCvfuCzCFK+lgraS8d/hY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TMtlUmqCETpGPLCbNRED6RdXoxljidNUlImwwZJw50IjofhHw4yRC24uAvBdaXYpyP6TMlSP7O9ULzTtw9zx70GBghgpC1Ri7J/rFabipZSPfOlJi+gqintz1L2Rd2SrQPFUVQUq8jxy1AQCnS0l0PmR5/H6oWNu9iQv87GBLQ4= 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=X732gt4d; arc=none smtp.client-ip=209.85.215.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="X732gt4d" Received: by mail-pg1-f228.google.com with SMTP id 41be03b00d2f7-c76bb670cbfso73760a12.3 for ; Fri, 03 Apr 2026 12:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1775245281; x=1775850081; 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=M7691Rpd885rtdqhZsGvsmlwE0WhG23SmYwp1iH7phM=; b=X732gt4dYDZzpBF8SuUQOx8NkFdM1i6ui7jdBAYvQe2ifH/A+vh9D5jpdIh0KgpEs4 fZtxi34Ik5ZVDX2IIqhCIDGtSSmokaQgy5KN1ILrSz/QAmfz2cLAHARVsyNxbN0C31eG 7rLkiYfVUhwX8lWuXZoYtMs0nZfdgjLcgyS0kSnsvsDLq4/YPVTdO2MLJqssdwwgKlug M4wfJ/BHnC1lcHyHHYSNyO7kswBYNLGf+bugvgBdfFa+NWolNp/Ie5Pp62rjh6fnRqLV tUlcFoCnceB9lXZPpqItu2Mks0m8QIEIVLr80iYFLyIWkFivMH3GNlCjK1nj6I2rvdwF 9x8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775245281; x=1775850081; 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=M7691Rpd885rtdqhZsGvsmlwE0WhG23SmYwp1iH7phM=; b=oe2ZLXPt5cCsM+dE8Riuj4L3cyYwFpKZAra+11ercSBwV+5ha1BBIAuyjm+IvPyR4C dT3JGNwZGJ9P0hWlkdd8MN4eSVekx3SLgYEgk04/PiBj+HOen+I7+Q7kNWwAWjDop4OZ CnFt5zYJDwvumd4rb/pW6Z1AHbTWK0XMqAFfCVCNX4QANl7bXfnO3kfQL167bP6GV9vO S/zdgbtx1klvb93scjHBcwK/gmMKwvdemwMbGv+9Ks9NbG0GTbM6ueZ2ugROT9NMEG/X jfO70My5v1r+CIs/JBhjCgyOMQCi5miRuaPU0k87WnCfiVfXZ2l8x5Oam0SApG4swEtq oOSg== X-Forwarded-Encrypted: i=1; AJvYcCUHqIu1EMOPe9Y2VNxwhdE73gCS3EQ3vIuq2JEzo1x1mzfYCSaYLgY/7RGmImQVxVmA3Z7erjaNXTg91pY=@vger.kernel.org X-Gm-Message-State: AOJu0YwLAAWFRsnxfPmCJ+ipJLkmQTuGP2gc+o205AhS17yhwoba7Oyw W1RI0LqgbLrHy0TnHlHqnWC9/R93aEaiiof1htuNqKjJZknD8XCLmqrfYzPD/a4rIvXfEVia6kw 0W9KBqwTbCA0xeI/bT2MYyCiezbfuaHG17R6AL6Zpv0moLPou7Ybx X-Gm-Gg: AeBDieuKHhdf247dLOvidWOqRjZ5Q3A2NDqPbK7idMTSMvn69hfCLg3JjKWwhMttIfu DX1cXX/MBlxLlBJ8GzMWmXogR4KuMY4+tiEVHS9sZ9egoHdvErAx6RDhbQsyU/4di6qn0aRjGkM PSbIut6gn6emzqiLzBhohdwi8j24XlKJUMUVPTKOTsZr2HsuQPZFL0+Z5qA5FMYxkZZqaIGNsUk pJqbobbjWQzY1xAr/TnAtm05nYfxtab0qwmJvw5Jc4O6AAtPQeQiVXvfq255aJlGUvpTRVhalA2 /yauVL9kOfTyoBL6bfjkfjp0M7+fcAciKoO6HNLvd/IKpFqvghpuwzCtvfjvozaBjIv2cdQxyUm 8lSuVRRVJcElBkJi94lH3gusbnnrtSglVXP1iAh4= X-Received: by 2002:a05:6a00:2d12:b0:82c:66ba:5f80 with SMTP id d2e1a72fcca58-82d0db7b707mr2480662b3a.4.1775245281177; Fri, 03 Apr 2026 12:41:21 -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 d2e1a72fcca58-82cf9c40eadsm676630b3a.8.2026.04.03.12.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 12:41:21 -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 8432334014E; Fri, 3 Apr 2026 13:41:20 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 6A065E41AC2; Fri, 3 Apr 2026 13:41:20 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH 0/6] block: fix integrity offset/length conversions Date: Fri, 3 Apr 2026 13:41:03 -0600 Message-ID: <20260403194109.2255933-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. Caleb Sander Mateos (6): blk-integrity: take sector_t in bio_integrity_intervals() block: use integrity interval instead of sector as seed bio-integrity-fs: pass data iter to bio_integrity_verify() bio-integrity-fs: use integrity interval instead of sector as seed t10-pi: use bio_integrity_intervals() helper target: use bio_integrity_intervals() helper block/bio-integrity-fs.c | 5 +++-- block/bio-integrity.c | 2 +- block/t10-pi.c | 4 ++-- drivers/nvme/target/io-cmd-bdev.c | 3 +-- drivers/target/target_core_iblock.c | 3 +-- include/linux/blk-integrity.h | 12 ++++++------ 6 files changed, 14 insertions(+), 15 deletions(-) -- 2.45.2