* [PATCH] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()
@ 2017-05-19 21:31 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-05-19 21:31 UTC (permalink / raw)
To: Trond Myklebust, Tom Haynes
Cc: Anna Schumaker, Thomas Gleixner, Weston Andros Adamson,
Fred Isaman, linux-nfs, kernel-janitors
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-19 21:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 21:31 [PATCH] pNFS/flexfiles: missing error code in ff_layout_alloc_lseg() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox