diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-01-21 15:39:40 -0500 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-02-15 15:45:19 -0500 |
commit | 9295dee2df7af7ea4233b664a8d4d4d057748e2f (patch) | |
tree | 1f1a484154cfa3d5e21292fa1312e995c643b018 | |
parent | b085ab71a7e748a9edb77a36ceadbab514ce0947 (diff) | |
download | lwn-9295dee2df7af7ea4233b664a8d4d4d057748e2f.tar.gz lwn-9295dee2df7af7ea4233b664a8d4d4d057748e2f.zip |
pNFS/flexfiles: Fix an XDR encoding bug in layoutreturn
[ Upstream commit 082fa37d1351a41afc491d44a1d095cb8d919aa2 ]
We must not skip encoding the statistics, or the server will see an
XDR encoding error.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index fecd9201dbad..c2abdc7db6c3 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__); } |