nfs: skip the rest of a partial record with a zero count

A WRITE request or READ reply with a count of 0 has no file data, and
processing it returned early. For a partially received record this left the
rest of the record unaccounted for, while the input was reported as consumed.
The rest of the record was then parsed as the next RPC record, which failed
and disabled the parser for the flow.

Like the complete record path, skip the rest of the record and continue with
the next record. For a READ reply this includes removing its request from the
request map, as is done for a complete reply.

Ticket: #9188
pull/16529/head
Jason Ish 2 weeks ago committed by Victor Julien
parent 9915449327
commit fd7acaae94

@ -1176,6 +1176,13 @@ impl NFSState {
};
if w.count == 0 {
// No file data, but the rest of a partial record must not be
// parsed as the next RPC record: skip to the record boundary.
// Nothing is pending for a complete record.
if !self.is_udp {
let pending = r.prog_data_size.saturating_sub(r.prog_data.len() as u32);
self.set_skip(Direction::ToServer, pending);
}
return 0;
}
@ -1867,6 +1874,17 @@ impl NFSState {
}
if reply.count == 0 {
// No file data, but the rest of a partial reply must not be
// parsed as the next RPC record: skip to the record boundary.
// Nothing is pending for a complete record.
if !self.is_udp {
let pending = r.prog_data_size.saturating_sub(r.prog_data.len() as u32);
self.set_skip(Direction::ToClient, pending);
}
// done with the request, as for a complete record
if xidmapr.is_none() {
self.requestmap.pop(&r.hdr.xid);
}
return 0;
}

Loading…
Cancel
Save