From patchwork Wed Oct 16 11:29: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: 836093 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 AC1F2208217 for ; Wed, 16 Oct 2024 12:36:15 +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=1729082177; cv=none; b=MrjCtBxfZnVjvFKuwQDKTCoH32fwQV5qQH0TMTWXtZAERil+TlMzhV8woPZYAzhfiCeJzXAWOM0LIvcfFXot8CL0uELH3ar8KNBtolg3s3ReVvN7o/Qh4bawe8z0sn9wMhdTet3Wc1Q7+fymctCFGINLlzwH97XZe8IzOTOXGeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729082177; c=relaxed/simple; bh=80iN9wH8fZxRyeNmWrkbWUyfZDLjnh4UxZJ8TgsMhwQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=EJLIuMP24Aqw7B2e4TXIJo9eOCxo6tTUx0tp2aYc0krfNZ/QwRT3UVpFMJh3lG/48Gqetu2O/hAEzCqMHWS+3miW50aZnWdC+/H5cH11fCb6tUnk3b5oP7hiRg/9fBJFeHvkdUIjbgsRTJhWBohqmH54i7nAEI6350+ncLPj2zY= 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=qTxxlxP2; 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="qTxxlxP2" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20241016123613epoutp041582a9eda9ce533fc79df430f5eb38b9~_7xN4mdr-1941219412epoutp04e for ; Wed, 16 Oct 2024 12:36:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20241016123613epoutp041582a9eda9ce533fc79df430f5eb38b9~_7xN4mdr-1941219412epoutp04e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1729082173; bh=j7kMMqrhvwE2U0rxzDSx84hS80YAqcLX62yw/e5POuY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qTxxlxP2uiHNWdOkVRzGlZtNl38clk5mvooKlLnQkWC/5wbfrM2AqcD0wvincuxeF 1csi7r0ovhI3r8H8YEpEs/AQza847ZdUrmHwAIEgJEno5GqOAFK9AgkwIIzkSc+VF0 d7r2B2LZluGqF+IvG0iktE7harLsRvv5No1QQvOA= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20241016123613epcas5p4fefeb190c8f152295a5cdf8c574aa8d7~_7xNa1bVV1646816468epcas5p4f; Wed, 16 Oct 2024 12:36:13 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4XT9SC1Myxz4x9Px; Wed, 16 Oct 2024 12:36:11 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E3.01.09770.B33BF076; Wed, 16 Oct 2024 21:36:11 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20241016113736epcas5p3a03665bf0674e68a8f95bbd5f3607357~_6_CEFDD92628326283epcas5p3B; Wed, 16 Oct 2024 11:37:36 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20241016113736epsmtrp23f19cc615b949554c87694a6229b48af~_6_CDSKot1555115551epsmtrp2e; Wed, 16 Oct 2024 11:37:36 +0000 (GMT) X-AuditID: b6c32a4a-e25fa7000000262a-c4-670fb33b0423 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id EC.BA.08229.085AF076; Wed, 16 Oct 2024 20:37:36 +0900 (KST) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20241016113734epsmtip176042ea87fdd663dbe664cf7e714eea5~_6_AIsgrp2871328713epsmtip12; Wed, 16 Oct 2024 11:37:34 +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, 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, vishak.g@samsung.com, Anuj Gupta Subject: [PATCH v4 02/11] block: copy back bounce buffer to user-space correctly in case of split Date: Wed, 16 Oct 2024 16:59:03 +0530 Message-Id: <20241016112912.63542-3-anuj20.g@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241016112912.63542-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+NgFjrAJsWRmVeSWpSXmKPExsWy7bCmuq71Zv50g6Xf2C0+fv3N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/M/1dh3bMt1YZ3G +n93C4PnZ1dfzj0w7bXRjab90oleuTN0N+18keH+KOvx5kk6+6Mv1EuprZ+isnSVV8XmhNCO mFvx61WOd5yw5Zjn/GmHQJzeMrEjR1WTBNmUw+IEChfa5r98p8RSnJFoqMVcVJwIACMVt0YM AwAA X-CMS-MailID: 20241016113736epcas5p3a03665bf0674e68a8f95bbd5f3607357 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20241016113736epcas5p3a03665bf0674e68a8f95bbd5f3607357 References: <20241016112912.63542-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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8c41a380f2bd..8948e635432d 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -119,8 +119,8 @@ static void bio_integrity_unpin_bvec(struct bio_vec *bv, int nr_vecs, static void bio_integrity_uncopy_user(struct bio_integrity_payload *bip) { 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; + struct bio_vec *copy = &bip->bip_vec[1], *bvec = &bip->bip_vec[0]; + size_t bytes = bvec->bv_len; struct iov_iter iter; int ret;