From: Trond Myklebust Date: Thu, 21 Jan 2016 20:39:40 +0000 (-0500) Subject: pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn X-Git-Tag: v4.1.12-92~150^2~267 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8af7cbd8a78290761dfb77641d4d3e2da5eea050;p=users%2Fjedix%2Flinux-maple.git pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn Orabug: 23330776 [ Upstream commit 082fa37d1351a41afc491d44a1d095cb8d919aa2 ] We must not skip encoding the statistics, or the server will see an XDR encoding error. Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Sasha Levin (cherry picked from commit 9295dee2df7af7ea4233b664a8d4d4d057748e2f) Signed-off-by: Dan Duval --- diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index fecd9201dbadf..c2abdc7db6c33 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1484,11 +1484,9 @@ ff_layout_encode_layoutreturn(struct pnfs_layout_hdr *lo, start = xdr_reserve_space(xdr, 4); BUG_ON(!start); - if (ff_layout_encode_ioerr(flo, xdr, args)) - goto out; - + ff_layout_encode_ioerr(flo, xdr, args); ff_layout_encode_iostats(flo, xdr, args); -out: + *start = cpu_to_be32((xdr->p - start - 1) * 4); dprintk("%s: Return\n", __func__); }