From patchwork Fri Aug 23 10:38:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anuj Gupta X-Patchwork-Id: 13774963 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) (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 AD9CF156C69 for ; Fri, 23 Aug 2024 10:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724410104; cv=none; b=lfs3Y366nVnsTtKq3glXw2pvATmpIbJnXH5k2Rh/OsDXfrQnmR7ei7/UoFLIwAlY+wPmlKd0k1Fo9qbaYBGYwksYwzvXnOaqKHDXGYSBT7G9xnMADHkCbfRgQdug54Hu9apcYEctASWh4h0S/pFkv3os/JJeO0fNKBFd0q8fQ5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724410104; c=relaxed/simple; bh=LhdbcZF4B80zbfPoh5Hu/R0x2p7V4nerfBZjYBB2iX8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=Ibdciwsivv4/nOLyxo+t1sXi5xTOvmgfhdSG0TvdQVDe4H0irTgjPps1OgqxdEbDTMzBE0tHMtD7G6JJzsijV2F3FJWAGUEWlbXiOF6NaC0sGpv5u38NXtzhidvicKuKka1CSchcsNcHKki6SCp4gvVqfdBvMnGgqv6QV6JZPWk= 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=iOfxQroK; arc=none smtp.client-ip=203.254.224.25 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="iOfxQroK" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240823104820epoutp0210556d9870da161e399c3f9f0f4b91bf~uVdm1lM-L0950809508epoutp02h for ; Fri, 23 Aug 2024 10:48:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240823104820epoutp0210556d9870da161e399c3f9f0f4b91bf~uVdm1lM-L0950809508epoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1724410100; bh=1SgBe/bIw4UZFTnEY47DrIroMxr4nIL6WJSjqlhA05Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOfxQroKP3cP5X8swgFEV1N0e9RWXp5rW5SFApUA4rFQlbn+p4XifMieQbqlEikvA dWlXtp5E8GWTnF1XKN+2KiR79WN2dUmbrI3v+RG5S2NVpcp4MLX84Mzy+URVGLqapX LVwTpqliO+TE2UhgLztAdmlesf3uk0b27Wh7cUrA= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240823104820epcas5p12a938076eb9c62c64199a28fa498e5c3~uVdmIpwER2850228502epcas5p1c; Fri, 23 Aug 2024 10:48:20 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.176]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4Wqxcf39bdz4x9Q0; Fri, 23 Aug 2024 10:48:18 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id A6.8F.09743.1F868C66; Fri, 23 Aug 2024 19:48:17 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240823104620epcas5p2118c152963d6cadfbc9968790ac0e536~uVb2uOBWF1853818538epcas5p29; Fri, 23 Aug 2024 10:46:20 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240823104620epsmtrp29c081cebc9c898dfb876eb8922773530~uVb2thqK50114601146epsmtrp2W; Fri, 23 Aug 2024 10:46:20 +0000 (GMT) X-AuditID: b6c32a4a-3b1fa7000000260f-76-66c868f1a27a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 7D.1B.08964.C7868C66; Fri, 23 Aug 2024 19:46:20 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240823104618epsmtip2230219aa34e06babef4aa6c9b4175d9b~uVb00PXRD1410214102epsmtip2l; Fri, 23 Aug 2024 10:46:18 +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 03/10] block: handle split correctly for user meta bounce buffer Date: Fri, 23 Aug 2024 16:08:03 +0530 Message-Id: <20240823103811.2421-4-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-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJsWRmVeSWpSXmKPExsWy7bCmhu7HjBNpBq+eCVg0TfjLbDFn1TZG i9V3+9ksbh7YyWSxcvVRJot3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Xrzan VkpLrU29r3zy//rDLUkmW6/6aISfyHU7rl8RxqHEUpyRaKjFXFScCAA/CGPHBAMAAA== X-CMS-MailID: 20240823104620epcas5p2118c152963d6cadfbc9968790ac0e536 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240823104620epcas5p2118c152963d6cadfbc9968790ac0e536 References: <20240823103811.2421-1-anuj20.g@samsung.com> Copy back the bounce buffer to user-space in entirety when the parent bio completes. Signed-off-by: Anuj Gupta --- block/bio-integrity.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 0b69f2b003c3..d8b810a2b4bf 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -118,9 +118,11 @@ static void bio_integrity_unpin_bvec(struct bio_vec *bv, int nr_vecs, static void bio_integrity_uncopy_user(struct bio_integrity_payload *bip) { + struct bio *bio = bip->bip_bio; + struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk); unsigned short nr_vecs = bip->bip_max_vcnt - 1; struct bio_vec *copy = &bip->bip_vec[1]; - size_t bytes = bip->bip_iter.bi_size; + size_t bytes = bio_iter_integrity_bytes(bi, bip->bio_iter); struct iov_iter iter; int ret; @@ -253,6 +255,7 @@ static int bio_integrity_copy_user(struct bio *bio, struct bio_vec *bvec, bip->bip_flags |= BIP_COPY_USER; bip->bip_iter.bi_sector = seed; bip->bip_vcnt = nr_vecs; + bip->bio_iter = bio->bi_iter; return 0; free_bip: bio_integrity_free(bio);