]>
Commit | Line | Data |
---|---|---|
a72a3eef GKH |
1 | From b8fb9c30f25e45dab5d2cd310ab6913b6861d00f Mon Sep 17 00:00:00 2001 |
2 | From: Trond Myklebust <trond.myklebust@primarydata.com> | |
3 | Date: Mon, 13 Oct 2014 10:56:12 -0400 | |
4 | Subject: NFS: Fix a bogus warning in nfs_generic_pgio | |
5 | ||
6 | From: Trond Myklebust <trond.myklebust@primarydata.com> | |
7 | ||
8 | commit b8fb9c30f25e45dab5d2cd310ab6913b6861d00f upstream. | |
9 | ||
10 | It is OK for pageused == pagecount in the loop, as long as we don't add | |
11 | another entry to the *pages array. Move the test so that it only triggers | |
12 | in that case. | |
13 | ||
14 | Reported-by: Steve Dickson <SteveD@redhat.com> | |
15 | Fixes: bba5c1887a92 (nfs: disallow duplicate pages in pgio page vectors) | |
16 | Cc: Weston Andros Adamson <dros@primarydata.com> | |
17 | Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> | |
18 | Signed-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)) |