Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267AbdGYTZi (ORCPT ); Tue, 25 Jul 2017 15:25:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36980 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754161AbdGYTZe (ORCPT ); Tue, 25 Jul 2017 15:25:34 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Coddington , Anna Schumaker Subject: [PATCH 4.12 151/196] NFS: Fix initialization of nfs_page_array->npages Date: Tue, 25 Jul 2017 12:22:30 -0700 Message-Id: <20170725192053.408821771@linuxfoundation.org> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170725192046.422343510@linuxfoundation.org> References: <20170725192046.422343510@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 33 4.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Coddington commit 2eb3aea7d9c43325a12df312adfc7fb25bbd636b upstream. Commit 8ef9b0b9e1c0 open-coded nfs_pgarray_set(), and left out the initialization of the nfs_page_array's npages. This mistake didn't show up until testing with block layouts, and there shows that all pNFS reads return -EIO. Fixes: 8ef9b0b9e1c0 ("NFS: move nfs_pgarray_set() to open code") Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- fs/nfs/pagelist.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -779,6 +779,7 @@ int nfs_generic_pgio(struct nfs_pageio_d gfp_t gfp_flags = GFP_KERNEL; pagecount = nfs_page_array_len(mirror->pg_base, mirror->pg_count); + pg_array->npages = pagecount; if (pagecount <= ARRAY_SIZE(pg_array->page_array)) pg_array->pagevec = pg_array->page_array;