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 162433BAD8F for ; Fri, 24 Apr 2026 11:39:49 +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=1777030790; cv=none; b=gWEyyB7266KEOn9isktrvRbcrhOM+CH0XiHzvsfVFC07+VmwNifwb9hXsTYwPPjfh9+//ksUE5aqqf6+8OSdvKQ5uW6kUojW9yy9MHWYg/5rNT3zVFzMLDL4frKgu9v24sX3Y4IBVcTMvsJcKwCofI24OAIheSYPDcuufvMocLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777030790; c=relaxed/simple; bh=eyNaJXFjJl8guznsbPc2WyW1JisAMAbK/hgLHo9QuAg=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=bnO9bDrAteqS+lXnj/ZDRqtZ7KqG2kEjU6a30NHWN+Y7G/oz02JgGmHPUZCTqiLvVsCadHoPQ+u2kBM1KredG7mTDkvFs9w+F3PWjzOtj7cid9mZOqLnFrfrJ4uOHaVSwcvwOMUTgEIpS7/jJ/nqULMmtRQtVr27sUWg33GXPdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=kwF/5h4g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="kwF/5h4g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6775FC19425; Fri, 24 Apr 2026 11:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1777030789; bh=eyNaJXFjJl8guznsbPc2WyW1JisAMAbK/hgLHo9QuAg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kwF/5h4giSsJl3rn1dcWli10j7U7yuKlJUwOCJdbQBkpx272Mn9Kip0y2dzgVG6hJ rp4XbHLqaSSEJJfkK/PxBziuGuMAfch1P3Nrvn3EKJTlKe6kLjwcsIC4fXkgMouQ5/ f2VIu6zlYKawY66cNGGkulu3rrd2jJYNQUF25KvU= Date: Fri, 24 Apr 2026 04:39:48 -0700 From: Andrew Morton To: Greg Kroah-Hartman Cc: "David Hildenbrand (Arm)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jason Gunthorpe , John Hubbard , Peter Xu Subject: Re: [PATCH v2] mm/gup: honour FOLL_PIN in NOMMU __get_user_pages_locked() Message-Id: <20260424043948.a1b0ef6218e3dc13e5f7a97d@linux-foundation.org> In-Reply-To: <2026042431-charter-ranging-597c@gregkh> References: <2026042303-vendor-outright-b9d2@gregkh> <2026042431-charter-ranging-597c@gregkh> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 24 Apr 2026 13:31:34 +0200 Greg Kroah-Hartman wrote: > > > @@ -2019,8 +2020,14 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start, > > > > > > if (pages) { > > > pages[i] = virt_to_page((void *)start); > > > - if (pages[i]) > > > - get_page(pages[i]); > > > + if (!pages[i]) > > > + break; > > > > Best to mention that change in the patch description. I really think this is the > > right thing to do (returning NULL in the page array is just very dubious). > > Ick, I see Andrew already grabbed this so I'll just leave it for now, > thanks for the help and review! Andrew does copy-n-paste ;)