From 1522a2f6bfdd3bf6071cdf41ae11f245e2812b5b Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 16 Oct 2026 15:47:39 -0600 Subject: [PATCH] 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 --- rust/src/nfs/nfs.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index 1466031433..ffb019e571 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -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; }