From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Thu, 9 Sep 2021 12:09:59 +0100 Subject: [Cluster-devel] [PATCH v7 01/19] iov_iter: Fix iov_iter_get_pages{, _alloc} page fault return value In-Reply-To: <20210827164926.1726765-2-agruenba@redhat.com> References: <20210827164926.1726765-1-agruenba@redhat.com> <20210827164926.1726765-2-agruenba@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Aug 27, 2021 at 06:49:08PM +0200, Andreas Gruenbacher wrote: > Both iov_iter_get_pages and iov_iter_get_pages_alloc return the number > of bytes of the iovec they could get the pages for. When they cannot > get any pages, they're supposed to return 0, but when the start of the > iovec isn't page aligned, the calculation goes wrong and they return a > negative value. Fix both functions. > > In addition, change iov_iter_get_pages_alloc to return NULL in that case > to prevent resource leaks. > > Signed-off-by: Andreas Gruenbacher Looks good, Reviewed-by: Christoph Hellwig