From: Dan Carpenter <dan.carpenter@oracle.com> To: Trond Myklebust <trond.myklebust@primarydata.com>, Tom Haynes <loghyr@primarydata.com> Cc: Anna Schumaker <anna.schumaker@netapp.com>, Thomas Gleixner <tglx@linutronix.de>, Weston Andros Adamson <dros@primarydata.com>, Fred Isaman <fred.isaman@gmail.com>, linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg() Date: Fri, 19 May 2017 21:31:12 +0000 [thread overview] Message-ID: <20170519213112.udkpg2nstamr2h2h@mwanda> (raw) 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> diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f5714ee01000..23542dc44a25 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -454,6 +454,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;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: Trond Myklebust <trond.myklebust@primarydata.com>, Tom Haynes <loghyr@primarydata.com> Cc: Anna Schumaker <anna.schumaker@netapp.com>, Thomas Gleixner <tglx@linutronix.de>, Weston Andros Adamson <dros@primarydata.com>, Fred Isaman <fred.isaman@gmail.com>, linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg() Date: Sat, 20 May 2017 00:31:12 +0300 [thread overview] Message-ID: <20170519213112.udkpg2nstamr2h2h@mwanda> (raw) 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> diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f5714ee01000..23542dc44a25 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -454,6 +454,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;
next reply other threads:[~2017-05-19 21:31 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-05-19 21:31 Dan Carpenter [this message] 2017-05-19 21:31 ` [PATCH] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg() Dan Carpenter
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170519213112.udkpg2nstamr2h2h@mwanda \ --to=dan.carpenter@oracle.com \ --cc=anna.schumaker@netapp.com \ --cc=dros@primarydata.com \ --cc=fred.isaman@gmail.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-nfs@vger.kernel.org \ --cc=loghyr@primarydata.com \ --cc=tglx@linutronix.de \ --cc=trond.myklebust@primarydata.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.