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-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=082fa37d1351a41afc491d44a1d095cb8d919aa2;p=openwrt%2Fstaging%2Fblogic.git pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn 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+ --- diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 405f46ba490e..2a2e2d8ddee5 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1859,11 +1859,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__); }