Skip to content

Commit

Permalink
9pfs: honor tread.size (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow authored Nov 25, 2023
1 parent 999f725 commit f0733f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/propolis/src/hw/virtio/p9fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ impl HostFSHandler {
Ok(_) => {}
}

let space_left = msize as usize
let read_count = u32::min(msize, msg.count);

let space_left = read_count as usize
- size_of::<u32>() // Rread.size
- size_of::<MessageType>() // Rread.typ
- size_of::<u16>() // Rread.tag
Expand Down

0 comments on commit f0733f9

Please sign in to comment.