We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f01be57 commit af2a60dCopy full SHA for af2a60d
1 file changed
src/devices/src/virtio/fs/macos/passthrough.rs
@@ -2063,10 +2063,10 @@ impl FileSystem for PassthroughFs {
2063
return Err(linux_error(io::Error::last_os_error()));
2064
}
2065
2066
- let ret = unsafe { libc::close(fd) };
2067
- if ret == -1 {
2068
- return Err(linux_error(io::Error::last_os_error()));
2069
- }
+ // `file` owns `fd` and closes it on drop. Closing the raw descriptor
+ // here as well races with descriptor reuse and can close an unrelated
+ // virtio-fs handle, surfacing in the guest as sporadic EBADF on tar's
+ // close(). This mirrors the Linux fix in 27910fe.
2070
2071
// We've checked that map_sender is something above.
2072
let sender = map_sender.as_ref().unwrap();
0 commit comments