Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release() not sufficently synchronized #125

Open
infeo opened this issue May 8, 2024 · 1 comment
Open

release() not sufficently synchronized #125

infeo opened this issue May 8, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@infeo
Copy link
Member

infeo commented May 8, 2024

We use path/data locks in order to synchronize callbacks, based on An Efficient Locking Scheme for Path-based File
Systems
.

The release() callback is not covered by this paper. Nonetheless, it requires synchronization, as implemented in ReadOnlyAdapter:

public int release(String path, FileInfo fi) {
try (PathLock pathLock = lockManager.lockForReading(path);
DataLock _ = pathLock.lockDataForReading()) {

The problem with only acquiring read locks is, that while reading data, the resource can be simultaneously released, which might lead to an inconsistent state. Especially in combination with cryptofs, which requires an external locking mechanism, this can pollute the filesystem state.

@infeo infeo added the bug label May 8, 2024
@infeo infeo added this to the 5.0.1 milestone May 8, 2024
@infeo infeo self-assigned this May 8, 2024
@infeo
Copy link
Member Author

infeo commented May 8, 2024

My suggestions is to acquire an Write lock on the data when releasing a resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant