From nobody Sat Feb 7 09:59:25 2026 Received: from mail-pl1-f225.google.com (mail-pl1-f225.google.com [209.85.214.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 C4CB1203710 for ; Tue, 6 Jan 2026 00:58:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767661091; cv=none; b=hwBgKIEEQApxuNkza7w1kCyZd7Dh4ZpEuJGIz5kxZheIXho0TEO+855M53vDGAB/QZ1TWQZ3DNQAVoowjWnEtk1YSqKv4hPf5wWb03HTxwIofXZBR5M/EKhqyx4i5MsRDoeINOY1mli6tdUyOVxXyhXl1SmLSViRSroHKGc/ES8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767661091; c=relaxed/simple; bh=O5LwPvfpq0YjRitfoT/GodeSOREFQSeNsNbJMNj4XeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=spPnmwrPuD5/CQWHLJm2t7+UjnSE6iLEdp90anukxht+w8VFYL7o7BG3ru7OzicFfZ4gko9OWGMTryhNZCzVPz9RIKm5rHHw/OB5yJ4OjCYiaaL1/lUI504DbaU7kBq15/Tf9CusU02HCO+G2+fopPwKlvlJl4TGVhVL7Jx50DM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=Lm6+4W4T; arc=none smtp.client-ip=209.85.214.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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="Lm6+4W4T" Received: by mail-pl1-f225.google.com with SMTP id d9443c01a7336-2a31d7107faso564745ad.0 for ; Mon, 05 Jan 2026 16:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767661089; x=1768265889; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bChEZ5QV1bk69mFc450SD6apMVEjUAARVBTDyWj0adc=; b=Lm6+4W4TK61xv2pilsDlpzNY3E1QC7x7PJUyuSLv+vQwUmV+54CPtxK2EhV1od7poi 76KgRPtcktif04Fg66whjB7VtBXfgtwY6eIJnJe19HWroMXfyeiwIMJFMRjNsDE/2GPh +7pRyYdHV4/d1hkQ3k4anRdOLtITaKsj4h2ezV01+B2k28bis84Rre+82rMpP6IMScrd 90AoZnGeCCh7NvnFq4oesboH0cfantCQcQNYX8X0uBJLYoSo1g4E+1OofoXMaep6YmgK Sj4YlYRFbjqDnuxMnZMNp4fN9Nq9+XwFusYFFHEipVhu/6m+cYie330Z5id4oKA7bF10 kFNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767661089; x=1768265889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bChEZ5QV1bk69mFc450SD6apMVEjUAARVBTDyWj0adc=; b=HXd1NluMo/Yg4D3S524d5p8yXI0r6gJtbIT775Bt9LBI07pPehXDAu2RRBkI8ftMIm yvuBpYxLfbFmS23KYrq3i4jV+lGWPkmE1Esk3KQ0tfshpp7cCKiN8+iUCU9QrQOhsOwk 2nspDLntgSsLiblt0Ux/PdfsLjA0ZU/2WYomGwHINRfHBw7EgzFFQJW6dA5lgDyypzN/ dAQgxpFnKD5rzzeYEMoyCI/nMRbGjeRyp7nuaiAGqNG4m9JqglP3u/+NjvflkLqY8KQT g8Cgt7x9nDWwx9emlIrs8mc2EzHmjCBIR9nqQ7THHxfmzsIUtTSiX8xawsE/BuCcl//V MfsQ== X-Forwarded-Encrypted: i=1; AJvYcCU6AsM+7SGr/DzqcgZvgJUfUr0GDTCxoICA+HFLzcjYyV25nvP1lz2b2FTxH/JwtLIh3H9XhzPchWHcStM=@vger.kernel.org X-Gm-Message-State: AOJu0YzxCKWtz0AdTfYWnV5Dj0OBnXeKOb/sG1cOApD/ZPv3duUCZ02M dkVv+Gc1xUbyoDWBZ+miC661dg+bIYo8c3V1NRaLYetme+P/yIF3wh5FAIjNTnYTlhx6poWpOmB poOs1BiaumAZtmj2VkbSn39fKoFCZiThQuzMP X-Gm-Gg: AY/fxX75PkI5lu0aqwM8DqukMG7jRXkpHOUQwHKAr+R8moszLSMwY8LU/9VBGx64yWH SW5ljcU0Sd9MmiLjSq0aXoUjF5hvhd2Xo54Q4gAMEBtbHYvxN2TAzqq0ML/5uolHd0RmkOBF/H4 Y8ucVjxhdZGMfQz2EevCYW1wWo/0ZBKcx9LZVTARy+iFj2rjxnpdJ3XMeTmQnNoiYW3DyCNl+FH Ab6/4XESb52hlAbjt40JjRun0hqYRUftzqJwiPsh+ogAd7ObxclczXPQ5UgovU2Qi54GyGAX8DK DQ+kFl778JYblqhmfENvAGOIphs5Dyinauo6EQbNA/7dwDH8mfpme5qLQ1oD8opEZdn440VuTUr SKnaSeHXcg2hE92lmTDc+VcufqwAp4EO6I2eGGUvo8w== X-Google-Smtp-Source: AGHT+IEt7v5piZcP5t5FBeU95eBGQgO16vibqCKp8Tght51rRbRk0ygbQXPn5D5FjMvVvssdzo/+nh0s9KFs X-Received: by 2002:a17:903:3204:b0:2a0:8963:c13e with SMTP id d9443c01a7336-2a3e2e402e1mr8732335ad.7.1767661089054; Mon, 05 Jan 2026 16:58:09 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-2a3e3cae5cbsm842285ad.39.2026.01.05.16.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 16:58:09 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.49.34.222]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 7FBDE3401CC; Mon, 5 Jan 2026 17:58:08 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 6FAC9E44554; Mon, 5 Jan 2026 17:58:08 -0700 (MST) From: Caleb Sander Mateos To: Ming Lei , Jens Axboe , Shuah Khan Cc: linux-block@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Stanley Zhang , Uday Shankar , "Martin K . Petersen" , Caleb Sander Mateos Subject: [PATCH v3 04/19] ublk: set UBLK_IO_F_INTEGRITY in ublksrv_io_desc Date: Mon, 5 Jan 2026 17:57:36 -0700 Message-ID: <20260106005752.3784925-5-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260106005752.3784925-1-csander@purestorage.com> References: <20260106005752.3784925-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Indicate to the ublk server when an incoming request has integrity data by setting UBLK_IO_F_INTEGRITY in the ublksrv_io_desc's op_flags field. Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei --- drivers/block/ublk_drv.c | 3 +++ include/uapi/linux/ublk_cmd.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 066c6ae062a0..2b0a9720921d 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1120,10 +1120,13 @@ static inline unsigned int ublk_req_build_flags(str= uct request *req) flags |=3D UBLK_IO_F_NOUNMAP; =20 if (req->cmd_flags & REQ_SWAP) flags |=3D UBLK_IO_F_SWAP; =20 + if (blk_integrity_rq(req)) + flags |=3D UBLK_IO_F_INTEGRITY; + return flags; } =20 static blk_status_t ublk_setup_iod(struct ublk_queue *ubq, struct request = *req) { diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h index a54c47832fa2..c1103ad5925b 100644 --- a/include/uapi/linux/ublk_cmd.h +++ b/include/uapi/linux/ublk_cmd.h @@ -412,10 +412,12 @@ struct ublksrv_ctrl_dev_info { * * ublk server has to check this flag if UBLK_AUTO_BUF_REG_FALLBACK is * passed in. */ #define UBLK_IO_F_NEED_REG_BUF (1U << 17) +/* Request has an integrity data buffer */ +#define UBLK_IO_F_INTEGRITY (1UL << 18) =20 /* * io cmd is described by this structure, and stored in share memory, inde= xed * by request tag. * --=20 2.45.2