]> git.hungrycats.org Git - linux/commitdiff
NFS: Fix initialization of nfs_page_array->npages
authorBenjamin Coddington <bcodding@redhat.com>
Fri, 9 Jun 2017 15:03:23 +0000 (11:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:10:20 +0000 (15:10 -0700)
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 <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c

index ad92b401326c69a154b514b11764a2bc4a04a1cb..7ddba5022948ccdf43b543f519d284bd84795587 100644 (file)
@@ -779,6 +779,7 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
        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;