mirror of
https://github.com/schoebel/mars
synced 2025-02-27 01:50:38 +00:00
aio: safeguard potential race on fd_uninstall
This commit is contained in:
parent
a615ef907b
commit
8544ef4117
@ -834,15 +834,15 @@ void _destroy_ioctx(struct aio_output *output)
|
||||
#endif
|
||||
}
|
||||
|
||||
mutex_lock(&_fd_lock);
|
||||
fd = output->fd;
|
||||
if (likely(fd >= 0)) {
|
||||
MARS_DBG("destroying fd %d\n", fd);
|
||||
mutex_lock(&_fd_lock);
|
||||
fd_uninstall(fd);
|
||||
put_unused_fd(fd);
|
||||
output->fd = -1;
|
||||
mutex_unlock(&_fd_lock);
|
||||
}
|
||||
mutex_unlock(&_fd_lock);
|
||||
|
||||
done:
|
||||
if (likely(current->mm)) {
|
||||
|
Loading…
Reference in New Issue
Block a user