Skip to content

Commit

Permalink
NFS: Fix a bogus warning in nfs_generic_pgio
Browse files Browse the repository at this point in the history
It is OK for pageused == pagecount in the loop, as long as we don't add
another entry to the *pages array. Move the test so that it only triggers
in that case.

Reported-by: Steve Dickson <[email protected]>
Fixes: bba5c18 (nfs: disallow duplicate pages in pgio page vectors)
Cc: Weston Andros Adamson <[email protected]>
Cc: [email protected] # 3.16.x
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
trondmypd committed Oct 13, 2014
1 parent 3caa0c6 commit b8fb9c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,11 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
nfs_list_remove_request(req);
nfs_list_add_request(req, &hdr->pages);

if (WARN_ON_ONCE(pageused >= pagecount))
return nfs_pgio_error(desc, hdr);

if (!last_page || last_page != req->wb_page) {
*pages++ = last_page = req->wb_page;
pageused++;
if (pageused > pagecount)
break;
*pages++ = last_page = req->wb_page;
}
}
if (WARN_ON_ONCE(pageused != pagecount))
Expand Down

0 comments on commit b8fb9c3

Please sign in to comment.