Skip to content

Commit

Permalink
Fix bug in file read
Browse files Browse the repository at this point in the history
  • Loading branch information
hunhoffe committed Sep 20, 2023
1 parent e81fa0d commit b03c0cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/src/arch/x86_64/rackscale/fileops/rw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ pub(crate) fn handle_read(hdr: &mut RPCHeader, payload: &mut [u8]) -> Result<(),
return Ok(());
}

let payload_offset = core::mem::size_of::<KResult<(u64, u64)>>();
let ret = cnrfs::MlnrKernelNode::file_read(
pid,
fd,
&mut &mut payload[HDR_LEN..HDR_LEN + len as usize][..],
&mut &mut payload[payload_offset..payload_offset + len as usize][..],
offset,
);
let extra_data = match ret {
Expand Down

0 comments on commit b03c0cd

Please sign in to comment.