Avoid ENOENT response when recently invalidated fuse_ino_t is received from the kernel #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a file is replaced by rename, a parallel open of the filename being replaced (in a race with the rename) may fail with ENOENT, making it appear (incorrectly) as though the rename was not atomic. This happens because the call to fuse_lib_open receives the fuse_ino_t of the file being replaced, which becomes invalidated by the rename operation. When encountering the node which now has no parent, try_get_path returns -ENOENT which then becomes the error result of the file open syscall.
If the reply sent by fuse_lib_open is instead -ESTALE, the renamed file will be opened instead which is the expected behavior. Changing the response in try_get_path also fixes similar rename atomicity races for other operations.
As described in a mailing list post:
https://marc.info/?l=fuse-devel&m=164149468119994&w=2
Fixes #637