From patchwork Mon Nov 4 14:05:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Gupta X-Patchwork-Id: 13861585 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 C17AC1C07F7 for ; Mon, 4 Nov 2024 15:55:58 +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=1730735761; cv=none; b=BrD3+Nh7vy1Yj+4E4izQxqhMGX5WddOtL84PlTr3AoBj0BLllTjnRDU4ENlcLmkHQUYl3bkoKMxBQVW+p/K7kwYFSOaYtsHDs3G5kzCgKuUtcnp5/oEF9AlIFlW3OHCVWlEkxDRJ5qAvnmowT0BuyAK+Ng3rbcWadgJw+imR4j8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730735761; c=relaxed/simple; bh=z3oZCEUpNWP6ssVVNnvaEMGwTgZ5HxAO2xsIC7OVOu8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=ePr/7GNKwr9IXhG5+Y+YkjoFVwFswCPA1iUc7EwbuV565HNCkdQha2uKUGW76xz6t/QGMuWZJ1xuUuQa41aekm4H0VIBwlcvarw9yMIB+e2qhQhHdjt9ftp3+f7dWETNheHSuBr6h6ACcvMA80V1laZPlzgNbksBEw99GMmZ6vk= 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=snOvUU0P; 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="snOvUU0P" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20241104155556epoutp0436b483cf073629d1f6a12bb2826574fd~EzwA8Qpm_1250312503epoutp04w for ; Mon, 4 Nov 2024 15:55:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20241104155556epoutp0436b483cf073629d1f6a12bb2826574fd~EzwA8Qpm_1250312503epoutp04w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1730735756; bh=n6LNHR2UxOEOGCqUSfrJ4D/dcAXYHqklNM5hsVN/lLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snOvUU0PhjyxpXJ0ImpouSfoOsbjXA5lfd5QXcVj6VGLtDO59E/InvIWbbbJyc+Av SPWXO1sM5Yb/uZVuvLMw861feTr1e53fmIlurIyEitDLE8XVQ3waNdnx2KTUseNgF0 4Ig3m+PNXU7+DtPdtkurEgaFWpkXwGAdS/DlYt1c= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20241104155555epcas5p31d8e2563298b091b0ce53f3e20fdb636~EzwAO_2lC0957809578epcas5p3W; Mon, 4 Nov 2024 15:55:55 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.180]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Xhwzt30BLz4x9Pq; Mon, 4 Nov 2024 15:55:54 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 8B.8A.09770.A8EE8276; Tue, 5 Nov 2024 00:55:54 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20241104141445epcas5p3fa11a5bebe88ac2bb3541850369591f7~EyXq4_IES2421324213epcas5p35; Mon, 4 Nov 2024 14:14:45 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20241104141445epsmtrp2e82a212506f18b40914879ef41c4ab29~EyXq1QKGv1987019870epsmtrp2t; Mon, 4 Nov 2024 14:14:45 +0000 (GMT) X-AuditID: b6c32a4a-e25fa7000000262a-bc-6728ee8af0d3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id C6.DC.18937.5D6D8276; Mon, 4 Nov 2024 23:14:45 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241104141443epsmtip200aef7f4c224e5aa2969207f662dc83d~EyXoYPB9E3011030110epsmtip28; Mon, 4 Nov 2024 14:14:42 +0000 (GMT) From: Anuj Gupta To: axboe@kernel.dk, hch@lst.de, kbusch@kernel.org, martin.petersen@oracle.com, asml.silence@gmail.com, anuj1072538@gmail.com, brauner@kernel.org, jack@suse.cz, viro@zeniv.linux.org.uk 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, vishak.g@samsung.com, linux-fsdevel@vger.kernel.org, Anuj Gupta Subject: [PATCH v7 01/10] block: define set of integrity flags to be inherited by cloned bip Date: Mon, 4 Nov 2024 19:35:52 +0530 Message-Id: <20241104140601.12239-2-anuj20.g@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241104140601.12239-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: H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NO9Z/fyTn3OnPDev fvjw5S6mIKfC3wv9/S86KX4TNni67AEX+92ZNuvkvz9O0MzM36Jg7Ls8sfpKXNRP8WdFMmkX NzqK581NtLhtFrpjXs+ihSsC/a4HbhYrPzV/m+uUeRvOWV8Q23g0fG/CufdvdQ/meuqXvtqx eD63QQjfEQ/91QUrrf5vuazfYjJD9nqCiIy6ZG+p84zDsfXxP304H6ddfmLjPnH+qRgJ4fcN R5RYijMSDbWYi4oTAUT3tAgeAwAA X-CMS-MailID: 20241104141445epcas5p3fa11a5bebe88ac2bb3541850369591f7 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20241104141445epcas5p3fa11a5bebe88ac2bb3541850369591f7 References: <20241104140601.12239-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 Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Keith Busch --- 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 2a4bd6611692..a448a25d13de 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -559,7 +559,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 dbf0f74c1529..0f0cf10222e8 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) \