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

Read and write unlinked files with open handles #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ritikm
Copy link

@ritikm ritikm commented Mar 29, 2017

This allows files that have open handles, but have been unlinked after the handle was opened to still be read and written to without errors. To make this possible, the following changes are made:

  • If the user-space daemon implements fgetattr, it will now be called for any unlinked files that have an open handle.
  • If a read call comes in, the kext will allow it to proceed if it realizes the vnode is in use (aka there's at least one open handle).
  • Same thing for a write call.

This allows files that have open handles, but have been unlinked after the handle was opened to still be read and written to without errors. To make this possible, the following changes are made:

* If the user-space daemon implements fgetattr, it will now be called for any unlinked files that have an open handle.
* If a read call comes in, the kext will allow it to proceed if it realizes the vnode is in use (aka there's at least one open handle).
* Same thing for a write call.
@kaushiks
Copy link

@ritikm Unless I'm misreading the original comment

     * But by doing so, we would not get an ENOENT error in case the file does
     * no longer exist (under its original name) for as long as its vnode is in
     * the vnode name cache.
     */

it appears, doing this will make the file in question virtually "un-deletable" (in that the delete will succeed but a stat for it will still succeed) when it has open file handles. Are you not running into this problem?

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

Successfully merging this pull request may close these issues.

2 participants