Possible fix to race condition to EBADF
This commit is contained in:
@@ -71,8 +71,11 @@ impl UnmapResult {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
/// TODO: This is not ideal, the lock must be held until try_close(), however that would break borrowing rules.
|
||||
/// Proper unmap operation would be a recursive operation, since closing a file can trigger another unmap().
|
||||
/// We should refactor Result of munmap() to handle unmap and closing files recursively.
|
||||
let (scheme_id, number) = {
|
||||
let desc = description.read(token.token());
|
||||
let desc = description.write(token.token());
|
||||
(desc.scheme, desc.number)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user