From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A8424368263; Tue, 24 Mar 2026 10:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774349193; cv=none; b=MOFdGsNsTXXSVK/EXs48VGIes0En8P3BJMYJEd7qxX18ipVglD9LagtZHHAU7ZzRC35JNjqMmFjLpJx/jfqYp80A0AfyXjDFuAm8lr/o+y0mXM09651OodF7mYYr9bzqbN16KSBmJb5t2j7/e4Rlrx+s2Kqig4w4A9kCzA83jjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774349193; c=relaxed/simple; bh=WMEerWakA31QDIRRh1QiXx8aw7EYn+862Ive463FIxg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IqeO+6wQgm5kkZK7smQUR3aOZQ8P9y3UKo7GLXYk+9eO2TXUlmQzP0MKua2200z8Q2XZgB8rE1j1GY8/LqRMw2IrjzOrntDIJ9uT1OfKax/TZZOPLEFtApONdh53Fa1pw99R3+Tk4LXvYMXQtvwXCIz4NMK6tyG5o6m5z/JDvSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sRYV/SsW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sRYV/SsW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E725AC19424; Tue, 24 Mar 2026 10:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774349192; bh=WMEerWakA31QDIRRh1QiXx8aw7EYn+862Ive463FIxg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sRYV/SsWeoCU4rAac48A/OHspAXPDQk8BSViRS/suRAnoU18SJsr6hr0c+5iuVxG9 eXHcAhdTBXsvusq4VOTea51g9RrRMxvmD/TWcRcqz4BrYpF0gGRYZANGEgFkzTzMEE eB2MIMTCAoTBk/UKXYpTur9vulG+EP40W619rAh3viXt3Y1UnqorcKkeyeACDr8zZR IzXjhAKe95RbXpf6iBaCEmpIYeqVFXbcBgKvmEoaxlN+h3r+B4gL0YMNRWgZLYJ3yu 6KTAOXFNdOqESMXeyxke3FeW9AoW1DTJYifGbrjLStiXcREPMM8ZoQvCqx+u5OeJEK WIgEyQ51/Ee/w== Message-ID: <899470f6-8b22-42a3-9dca-1a11e246147d@kernel.org> Date: Tue, 24 Mar 2026 11:46:22 +0100 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 01/21] mm: various small mmap_prepare cleanups Content-Language: en-US To: "Lorenzo Stoakes (Oracle)" , Andrew Morton Cc: Jonathan Corbet , Clemens Ladisch , Arnd Bergmann , Greg Kroah-Hartman , "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Bodo Stroesser , "Martin K . Petersen" , David Howells , Marc Dionne , Alexander Viro , Christian Brauner , Jan Kara , David Hildenbrand , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-staging@lists.linux.dev, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Ryan Roberts References: <99f408e4694f44ab12bdc55fe0bd9685d3bd1117.1774045440.git.ljs@kernel.org> From: "Vlastimil Babka (SUSE)" In-Reply-To: <99f408e4694f44ab12bdc55fe0bd9685d3bd1117.1774045440.git.ljs@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/20/26 23:39, Lorenzo Stoakes (Oracle) wrote: > Rather than passing arbitrary fields, pass a vm_area_desc pointer to mmap > prepare functions to mmap prepare, and an action and vma pointer to mmap > complete in order to put all the action-specific logic in the function > actually doing the work. > > Additionally, allow mmap prepare functions to return an error so we can > error out as soon as possible if there is something logically incorrect in > the input. > > Update remap_pfn_range_prepare() to properly check the input range for the > CoW case. > > Also remove io_remap_pfn_range_complete(), as we can simply set up the > fields correctly in io_remap_pfn_range_prepare() and use > remap_pfn_range_complete() for this. > > While we're here, make remap_pfn_range_prepare_vma() a little neater, and > pass mmap_action directly to call_action_complete(). > > Then, update compat_vma_mmap() to perform its logic directly, as > __compat_vma_map() is not used by anything so we don't need to export it. > > Also update compat_vma_mmap() to use vfs_mmap_prepare() rather than > calling the mmap_prepare op directly. > > Finally, update the VMA userland tests to reflect the changes. > > Signed-off-by: Lorenzo Stoakes (Oracle) Acked-by: Vlastimil Babka (SUSE)