lkml.org 
[lkml]   [2013]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.8 139/152] nfsd4: fix xdr decoding of large non-write compounds
    Date
    3.8.13.14 -stable review patch.  If anyone has any objections, please let me know.

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

    From: "J. Bruce Fields" <bfields@redhat.com>

    commit 365da4adebb1c012febf81019ad3dc5bb52e2a13 upstream.

    This fixes a regression from 247500820ebd02ad87525db5d9b199e5b66f6636
    "nfsd4: fix decoding of compounds across page boundaries". The previous
    code was correct: argp->pagelist is initialized in
    nfs4svc_deocde_compoundargs to rqstp->rq_arg.pages, and is therefore a
    pointer to the page *after* the page we are currently decoding.

    The reason that patch nevertheless fixed a problem with decoding
    compounds containing write was a bug in the write decoding introduced by
    5a80a54d21c96590d013378d8c5f65f879451ab4 "nfsd4: reorganize write
    decoding", after which write decoding no longer adhered to the rule that
    argp->pagelist point to the next page.

    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    [ kamal: backport to 3.8 (next_decode_page change is in read_buf) ]
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    fs/nfsd/nfs4xdr.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
    index 859d145..3ed8550 100644
    --- a/fs/nfsd/nfs4xdr.c
    +++ b/fs/nfsd/nfs4xdr.c
    @@ -162,8 +162,8 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
    */
    memcpy(p, argp->p, avail);
    /* step to next page */
    - argp->pagelist++;
    argp->p = page_address(argp->pagelist[0]);
    + argp->pagelist++;
    if (argp->pagelen < PAGE_SIZE) {
    argp->end = argp->p + (argp->pagelen>>2);
    argp->pagelen = 0;
    @@ -1160,6 +1160,7 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
    len -= pages * PAGE_SIZE;

    argp->p = (__be32 *)page_address(argp->pagelist[0]);
    + argp->pagelist++;
    argp->end = argp->p + XDR_QUADLEN(PAGE_SIZE);
    }
    argp->p += XDR_QUADLEN(len);
    --
    1.8.3.2


    \
     
     \ /
      Last update: 2013-12-07 00:41    [W:2.387 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site