FAT: Unlock before calling the file cache.

Otherwise if the file cache calls us again from a different thread,
as it sometimes does when doing concurrent I/O to multiple files,
we will deadlock.

Fixes #14104.
This commit is contained in:
Augustin Cavalier 2021-12-01 16:39:24 -05:00
parent e385e3a009
commit ba0e4a83e5

View File

@ -338,6 +338,8 @@ dosfs_read(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
DPRINTF(0, ("dosfs_read called %" B_PRIuSIZE " bytes at %" B_PRIdOFF
" (vnode id %" B_PRIdINO ")\n", *len, pos, node->vnid));
lock.Unlock();
result = file_cache_read(node->cache, cookie, pos, buf, len);
if (result != B_OK) {
@ -420,8 +422,8 @@ dosfs_write(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
file_map_set_size(node->file_map, node->st_size);
}
lock.Unlock();
result = file_cache_write(node->cache, cookie, pos, buf, len);
return result;
}