lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.4 071/167] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()
    Date
    From: Dan Carpenter <dan.carpenter@oracle.com>

    [ Upstream commit 662f9a105b4322b8559d448f86110e6ec24b8738 ]

    If xdr_inline_decode() fails then we end up returning ERR_PTR(0). The
    caller treats NULL returns as -ENOMEM so it doesn't really hurt runtime,
    but obviously we intended to set an error code here.

    Fixes: d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    fs/nfs/flexfilelayout/flexfilelayout.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
    index 54313322ee5b..c8e90152b61b 100644
    --- a/fs/nfs/flexfilelayout/flexfilelayout.c
    +++ b/fs/nfs/flexfilelayout/flexfilelayout.c
    @@ -461,6 +461,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
    goto out_err_free;

    /* fh */
    + rc = -EIO;
    p = xdr_inline_decode(&stream, 4);
    if (!p)
    goto out_err_free;
    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-19 18:21    [W:8.845 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site