* checksumfs_lookup(): The flags return parameter was never set, leading to
weird behavior when running in kernel. * checksumfs_io(): Try to lock with timeout when the request is VIP. This works around a potential quasi-deadlock: Most write support FS hooks potentially allocate memory (e.g. in block_cache_get*()) while holding a write lock to a node. When memory is low they have to wait for pages to become available. The page writer might block on such node which in turn would prevent modified pages from becoming eligible for recycling. Should only in rare low memory cases have led to a problem. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37687 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -975,6 +975,7 @@ checksumfs_get_vnode(fs_volume* fsVolume, ino_t id, fs_vnode* vnode,
|
||||
vnode->private_node = node;
|
||||
vnode->ops = &gCheckSumFSVnodeOps;
|
||||
*_type = node->Mode();
|
||||
*_flags = 0;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
@@ -1083,7 +1084,15 @@ checksumfs_io(fs_volume* fsVolume, fs_vnode* vnode, void* cookie,
|
||||
}
|
||||
|
||||
// Read-lock the file -- we'll unlock it in the finished hook.
|
||||
file->ReadLock();
|
||||
if (io_request_is_vip(request)) {
|
||||
// We cannot wait for the node lock indefinitely. So try read-locking
|
||||
// with a timeout (0.1 s).
|
||||
if (!file->ReadLockWithTimeout(B_RELATIVE_TIMEOUT, 100000)) {
|
||||
notify_io_request(request, B_BUSY);
|
||||
RETURN_ERROR(B_BUSY);
|
||||
}
|
||||
} else
|
||||
file->ReadLock();
|
||||
|
||||
RETURN_ERROR(do_iterative_fd_io(volume->FD(), request,
|
||||
iterative_io_get_vecs_hook, iterative_io_finished_hook, file));
|
||||
|
||||
Reference in New Issue
Block a user