diff --git a/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp b/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp index 4b36b4e3bb..cea433b082 100644 --- a/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp @@ -71,6 +71,7 @@ iterative_io_finished_hook(void* cookie, io_request* request, status_t status, { Inode* inode = (Inode*)cookie; rw_lock_read_unlock(inode->Lock()); + put_vnode(inode->GetVolume()->FSVolume(), inode->ID()); return B_OK; } @@ -328,6 +329,8 @@ exfat_io(fs_volume* _volume, fs_vnode* _node, void* _cookie, // We lock the node here and will unlock it in the "finished" hook. rw_lock_read_lock(inode->Lock()); + acquire_vnode(_volume, inode->ID()); + return do_iterative_fd_io(volume->Device(), request, iterative_io_get_vecs_hook, iterative_io_finished_hook, inode); } diff --git a/src/add-ons/kernel/file_systems/fat/kernel_interface.cpp b/src/add-ons/kernel/file_systems/fat/kernel_interface.cpp index ab1d7de415..c147ffc22a 100644 --- a/src/add-ons/kernel/file_systems/fat/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/fat/kernel_interface.cpp @@ -1031,6 +1031,7 @@ dosfs_io(fs_volume* volume, fs_vnode* vnode, void* cookie, io_request* request) mount* bsdVolume = reinterpret_cast(volume->private_volume); msdosfsmount* fatVolume = reinterpret_cast(bsdVolume->mnt_data); struct vnode* bsdNode = reinterpret_cast(vnode->private_node); + denode* fatNode = reinterpret_cast(bsdNode->v_data); #ifndef FS_SHELL if (io_request_is_write(request) && MOUNTED_READ_ONLY(fatVolume) != 0) { @@ -1053,6 +1054,8 @@ dosfs_io(fs_volume* volume, fs_vnode* vnode, void* cookie, io_request* request) rw_lock_read_lock(&bsdNode->v_vnlock->haikuRW); + acquire_vnode(volume, fatNode->de_inode); + RETURN_ERROR(do_iterative_fd_io(fatVolume->pm_dev->si_fd, request, iterative_io_get_vecs_hook, iterative_io_finished_hook, bsdNode)); } @@ -3870,8 +3873,10 @@ iterative_io_finished_hook(void* cookie, io_request* request, status_t status, b size_t bytesTransferred) { vnode* bsdNode = reinterpret_cast(cookie); + denode* fatNode = reinterpret_cast(bsdNode->v_data); rw_lock_read_unlock(&bsdNode->v_vnlock->haikuRW); + put_vnode(bsdNode->v_mount->mnt_fsvolume, fatNode->de_inode); return B_OK; }