From patchwork Fri Aug 23 10:38:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Gupta X-Patchwork-Id: 823888 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA505187347 for ; Fri, 23 Aug 2024 10:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724410094; cv=none; b=KYR8EHe6RnOY/qRM/FyGFNueQxduyrxf6UXOsoIJzyqNWm9kOOWEv9MeJrlFC/HroLLifnx9zJlM4xm2QsVL2XVpdKoGucmH19A9yZ185QObmBFykDr2hRxCRFPAS1NnFR/V0ew+hS27WiVhRGbOkvPGxBYQlolr0ErFt9nlfyI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724410094; c=relaxed/simple; bh=d7rXebeSEm18bCB7MKc526gnn9BA+iKBq0twd4J7e+4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=Vft2me3SaMjhlmy8QQDYXqiBuWYC/Y1PjCPlhFzT1TyEaCOBDwkcwJonZ+oqXupeo8klJYkMbT3+/z8GP4Vgl2STuuH1l3vMAYyM0d4IeytkdR7ltcFD9BNvxVlFV5dXEgQwYFh14pUTum68/fJ9E9UM6vZQpS820t6w8rYfziA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=TxRIAD/l; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="TxRIAD/l" Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240823104809epoutp048878ea0d5182fcc2b5c64edfc6288875~uVdcqXknK1659916599epoutp04N for ; Fri, 23 Aug 2024 10:48:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240823104809epoutp048878ea0d5182fcc2b5c64edfc6288875~uVdcqXknK1659916599epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1724410089; bh=jMx8UpUspdytnu+Xq0U/x/8sHusVPIVYMik9VsbX5dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TxRIAD/l5b0q3HPoQ7KkF0/uffuQBLB8U/l7r0MenTiTr2snbit/wVL/gMcMAzTWc LmlMq52YSbelFEa5g0yBDwa2zb3QnqHLyyfNHF7FzS62K9CtKS8PJxnruU+IwoCEar RtlZYqrNHx+1NOpnKEnHBbGhGd+/B8sYX+P3i+vM= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20240823104806epcas5p365b10ec701f48979e49694b199d5fb7e~uVdZhIeMo0529105291epcas5p3Y; Fri, 23 Aug 2024 10:48:06 +0000 (GMT) Received: from epsmgec5p1-new.samsung.com (unknown [182.195.38.178]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4WqxcN5H75z4x9Q1; Fri, 23 Aug 2024 10:48:04 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmgec5p1-new.samsung.com (Symantec Messaging Gateway) with SMTP id 3F.7A.19863.4E868C66; Fri, 23 Aug 2024 19:48:04 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20240823104616epcas5p4bd315bd116ea7e32b1abf7e174af64a1~uVbyr-QcC3268132681epcas5p4l; Fri, 23 Aug 2024 10:46:16 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240823104616epsmtrp19e122e7c3e3f792d82b6528df3ed01d6~uVbyrIHkr0200002000epsmtrp1i; Fri, 23 Aug 2024 10:46:16 +0000 (GMT) X-AuditID: b6c32a50-ef5fe70000004d97-de-66c868e41339 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 7C.1B.08964.87868C66; Fri, 23 Aug 2024 19:46:16 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240823104614epsmtip227daa07025f3459d97df93b29cdc2537~uVbw0JSpS1442714427epsmtip2Y; Fri, 23 Aug 2024 10:46:14 +0000 (GMT) From: Anuj Gupta To: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org, martin.petersen@oracle.com, asml.silence@gmail.com, krisman@suse.de Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, gost.dev@samsung.com, linux-scsi@vger.kernel.org, Anuj Gupta Subject: [PATCH v3 01/10] block: define set of integrity flags to be inherited by cloned bip Date: Fri, 23 Aug 2024 16:08:01 +0530 Message-Id: <20240823103811.2421-2-anuj20.g@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823103811.2421-1-anuj20.g@samsung.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJJsWRmVeSWpSXmKPExsWy7bCmuu6TjBNpBs3b1C2aJvxltpizahuj xeq7/WwWNw/sZLJYuf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PmfFMT+2VUZd+LvU9M+K4/numZQ9KH3/9 edDOL5XB8iK/XNZm7a50uTNHnwd/S7+y5pj8EyWW4oxEQy3mouJEALYkjOYFAwAA X-CMS-MailID: 20240823104616epcas5p4bd315bd116ea7e32b1abf7e174af64a1 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240823104616epcas5p4bd315bd116ea7e32b1abf7e174af64a1 References: <20240823103811.2421-1-anuj20.g@samsung.com> Introduce BIP_CLONE_FLAGS describing integrity flags that should be inherited in the cloned bip from the parent. Suggested-by: Christoph Hellwig Signed-off-by: Anuj Gupta --- block/bio-integrity.c | 2 +- include/linux/bio-integrity.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8d1fb38f745f..0b69f2b003c3 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -567,7 +567,7 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, bip->bip_vec = bip_src->bip_vec; bip->bip_iter = bip_src->bip_iter; - bip->bip_flags = bip_src->bip_flags & ~BIP_BLOCK_INTEGRITY; + bip->bip_flags = bip_src->bip_flags & BIP_CLONE_FLAGS; return 0; } diff --git a/include/linux/bio-integrity.h b/include/linux/bio-integrity.h index dd831c269e99..485d8a43017a 100644 --- a/include/linux/bio-integrity.h +++ b/include/linux/bio-integrity.h @@ -30,6 +30,9 @@ struct bio_integrity_payload { struct bio_vec bip_inline_vecs[];/* embedded bvec array */ }; +#define BIP_CLONE_FLAGS (BIP_MAPPED_INTEGRITY | BIP_CTRL_NOCHECK | \ + BIP_DISK_NOCHECK | BIP_IP_CHECKSUM) + #ifdef CONFIG_BLK_DEV_INTEGRITY #define bip_for_each_vec(bvl, bip, iter) \