NFSv4.2: Ensure we always reset the result->count in decode_read_plus()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 8 Dec 2020 18:11:11 +0000 (13:11 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 14 Dec 2020 11:51:07 +0000 (06:51 -0500)
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs42xdr.c

index c0b8fcd266c9858d0390a9fee3e5f0cda9f3d85d..1c21db640f4d933210bc30e58df47c89823b9862 100644 (file)
@@ -1087,6 +1087,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
        if (unlikely(!p))
                return -EIO;
 
+       res->count = 0;
        eof = be32_to_cpup(p++);
        segments = be32_to_cpup(p++);
        if (segments == 0)