From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379666; b=upJHBvpiwKl7/cNLbVJvG7VTKbv8Oa2SXq+HjLvtPOdcK0o24STchiosNp9w3peqGfby uTuSaPniheNXVW3YTMVVpnXN0ST076h14X3TVD6MvTCrw/OdxdSxcy1XFkWHQlxuDilo8 sbFdZjdtaEUG8UftrywttIjcc1S66owr3/Y09bFgVy6fsRX2i0qrwpzrLIaYKlsOTFNhi +cQyJRntv4EoFrE1ghCDQ6ZERjT9kMZ7ar2qt9bt08g3m0is98bDKx6qA6AFKYgtSKpBe /2fMU9uF82O1ICs8K8kYVi4E4S8GLLhAWuQQOcnYyZa+2LxpoYOKGzFzvNNKltk0+Ag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379666; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Spam-Status: X-Spam-Checker-Version; bh=CWzt2tGFtJoWs7yQokrPEzgq4OSWatTowrAUHdCJgNE=; b=jJl3GwG3cRjCqSciLMM8LTXaoOD686cLaXbtxEZB8LBGSw7b+FkXsOlSrme43fVjuI2S M+3j7ZalwvORwC/bdXmPOryPjqmHwblnA1DecL5I4QqPwXSblg21q/NzxEDZpGrW3XmmH BeRCepg9VsexoeeGt5J/gMpuIk9xc36GCMyNlWgLxjZr5NAk+5uUiFDSjFVV0o94Iol+u OuQfl0WIUE1JxQDybbI4zK4FYQkRnXKBkQo30PQTB47NNnEiRu3fgLLfGcGBmZPinvqmD 0kgSrQEEVXTgBh1yCCRWuzyrkcokgjKO3GPmP03MnGQOB/S1BN2CH9s3JeOfqoZrgNQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b="ZVrg/Nnt"; arc=none smtp.remote-ip=13.77.154.182 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20920606A333 for ; Fri, 4 Dec 2026 10:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20920606A333 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=ZVrg/Nnt Received: from [192.168.1.70] (unknown [52.172.102.222]) by linux.microsoft.com (Postfix) with ESMTPSA id B8F8220B7175; Fri, 4 Dec 2026 02:21:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B8F8220B7175 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796379665; bh=CWzt2tGFtJoWs7yQokrPEzgq4OSWatTowrAUHdCJgNE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZVrg/NntbkSRfNypmo4JIIgwf9dWds8hkP+dZiuhGN5sIG8iCYP1TZtHnB5wi0hnR Og8zLFIk9C/STFq2qBnY0iTd0y5phzzP3mpdgP/JFBDBA1Lj+yg8EIRVVinV9gTHCi yHTndT8S1VIz6TnwBOCnjibG9DrgRHXQmLBwPHNo= Message-ID: Date: Fri, 4 Dec 2026 15:50:58 +0530 X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] iov_iter: Allow DMA-compatible device pages in bvec extraction To: sashiko-reviews@lists.linux.dev, hch@lst.de, david@kernel.org, axboe@kernel.dk, akpm@linux-foundation.org, viro@zeniv.linux.org.uk Cc: osalvador@suse.de, logang@deltatee.com, leon@kernel.org, kbusch@kernel.org, ssengar@linux.microsoft.com, linux-mm@kvack.org, linux-cxl@vger.kernel.org References: <20261203084315.3776182-1-namjain@linux.microsoft.com> Content-Language: en-US From: Naman Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/4/2026 2:13 PM, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential > issue to consider: > - [Low] iov_iter: inaccurate Fixes trailer cites 38446014648c instead of > 12da89e8844a > -- > > commit 41e8c0f2dd22c3f923973ea161eb22f302ba5525 > Author: Naman Jain > >> iov_iter: Allow DMA-compatible device pages in bvec extraction >> >> Commit 38446014648c ("block: don't merge different kinds of P2P transfers >> in a single bio") made bio_add_page() reject pages from different >> dev_pagemaps. This was needed for PCI P2PDMA, but also rejected pages >> with compatible DMA mapping requirements. >> >> Commit 41c665aae2b5 ("block: relax pgmap check in bio_add_page for >> compatible zone device pages") allows these pages in separate bvecs. >> Commit 13920e4b7b784 ("block: add pgmap check to biovec_phys_mergeable") >> prevents physically contiguous bvecs from different pgmaps from being >> merged into one segment. >> >> But iov_iter_extract_bvecs() still rejects pages from different pgmaps >> without checking their DMA compatibility. Direct I/O uses this helper, >> so a non-atomic request submitted as a single bio transfers only the >> data before the pgmap boundary and returns fewer bytes than requested. >> >> Fix this by moving zone_device_pages_compatible() from blk.h to >> memremap.h and using it in iov_iter_extract_bvecs(). Rename the helper to >> zone_device_pages_dma_compatible() to make its purpose clear. >> >> Fixes: 38446014648c ("block: don't merge different kinds of P2P transfers in a single bio") >> Cc: stable@vger.kernel.org >> Signed-off-by: Naman Jain > > [Severity: Low] > Should the Fixes tag cite 12da89e8844a ("block: open code bio_add_page > and fix handling of mismatching P2P ranges") instead? > > Commit 38446014648c ("block: don't merge different kinds of P2P transfers > in a single bio") only touched bio_add_page() and > bio_integrity_add_page(), which 41c665aae2b5 ("block: relax pgmap check > in bio_add_page for compatible zone device pages") already fixed. > > The separate check in the page-extraction loop came from 12da89e8844a > ("block: open code bio_add_page and fix handling of mismatching P2P > ranges") and was moved to iov_iter_extract_bvecs() by 91b73c458182 > ("iov_iter: extract a iov_iter_extract_bvecs helper from bio code"). > > With Cc: stable@vger.kernel.org, the current Fixes tag targets older > stable trees that do not have iov_iter_extract_bvecs() and already carry > the bio_add_page() fix. > I think this is correct, we should use the Fix tag suggested here: Fixes: 12da89e8844a ("block: open code bio_add_page and fix handling of mismatching P2P ranges") Please correct this if possible, while picking the patch, or let me know if I should spin v3 for this change. Regards, Naman