mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-06 02:24:14 +08:00
nfsd: Don't set eof on a truncated READ_PLUS
If the READ_PLUS operation was truncated due to an error, then ensure we
clear the 'eof' flag.
Fixes: 9f0b5792f0
("NFSD: Encode a full READ_PLUS reply")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
72d78717c6
commit
b68f0cbd3f
@ -4860,14 +4860,15 @@ out:
|
||||
if (nfserr && segments == 0)
|
||||
xdr_truncate_encode(xdr, starting_len);
|
||||
else {
|
||||
if (nfserr) {
|
||||
xdr_truncate_encode(xdr, last_segment);
|
||||
nfserr = nfs_ok;
|
||||
eof = 0;
|
||||
}
|
||||
tmp = htonl(eof);
|
||||
write_bytes_to_xdr_buf(xdr->buf, starting_len, &tmp, 4);
|
||||
tmp = htonl(segments);
|
||||
write_bytes_to_xdr_buf(xdr->buf, starting_len + 4, &tmp, 4);
|
||||
if (nfserr) {
|
||||
xdr_truncate_encode(xdr, last_segment);
|
||||
nfserr = nfs_ok;
|
||||
}
|
||||
}
|
||||
|
||||
return nfserr;
|
||||
|
Loading…
Reference in New Issue
Block a user