lkml.org 
[lkml]   [2014]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16 055/127] NFS: Fix a bogus warning in nfs_generic_pgio
    Date
    3.16-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Trond Myklebust <trond.myklebust@primarydata.com>

    commit b8fb9c30f25e45dab5d2cd310ab6913b6861d00f upstream.

    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 <SteveD@redhat.com>
    Fixes: bba5c1887a92 (nfs: disallow duplicate pages in pgio page vectors)
    Cc: Weston Andros Adamson <dros@primarydata.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/nfs/pagelist.c | 7 +++----
    1 file changed, 3 insertions(+), 4 deletions(-)

    --- a/fs/nfs/pagelist.c
    +++ b/fs/nfs/pagelist.c
    @@ -754,12 +754,11 @@ int nfs_generic_pgio(struct nfs_pageio_d
    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))



    \
     
     \ /
      Last update: 2014-10-28 08:41    [W:3.256 / U:0.864 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site