]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.16.7/nfs-fix-a-bogus-warning-in-nfs_generic_pgio.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.7 / nfs-fix-a-bogus-warning-in-nfs_generic_pgio.patch
CommitLineData
a72a3eef
GKH
1From b8fb9c30f25e45dab5d2cd310ab6913b6861d00f Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <trond.myklebust@primarydata.com>
3Date: Mon, 13 Oct 2014 10:56:12 -0400
4Subject: NFS: Fix a bogus warning in nfs_generic_pgio
5
6From: Trond Myklebust <trond.myklebust@primarydata.com>
7
8commit b8fb9c30f25e45dab5d2cd310ab6913b6861d00f upstream.
9
10It is OK for pageused == pagecount in the loop, as long as we don't add
11another entry to the *pages array. Move the test so that it only triggers
12in that case.
13
14Reported-by: Steve Dickson <SteveD@redhat.com>
15Fixes: bba5c1887a92 (nfs: disallow duplicate pages in pgio page vectors)
16Cc: Weston Andros Adamson <dros@primarydata.com>
17Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 fs/nfs/pagelist.c | 7 +++----
22 1 file changed, 3 insertions(+), 4 deletions(-)
23
24--- a/fs/nfs/pagelist.c
25+++ b/fs/nfs/pagelist.c
26@@ -754,12 +754,11 @@ int nfs_generic_pgio(struct nfs_pageio_d
27 nfs_list_remove_request(req);
28 nfs_list_add_request(req, &hdr->pages);
29
30- if (WARN_ON_ONCE(pageused >= pagecount))
31- return nfs_pgio_error(desc, hdr);
32-
33 if (!last_page || last_page != req->wb_page) {
34- *pages++ = last_page = req->wb_page;
35 pageused++;
36+ if (pageused > pagecount)
37+ break;
38+ *pages++ = last_page = req->wb_page;
39 }
40 }
41 if (WARN_ON_ONCE(pageused != pagecount))