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
Should Inode.Forgotten() return true if Inode.changeCounter == 0? #504
Comments
I would have to think this through in depth to double-check, but Forgotten() is intended for enabling cleanup in a scenario when you are sure the inode cannot be revived. If you are (re)using the inodes, then clearly you are reviving the inode. In a reuse scenario, the value of If you want to securely reuse inodes, I'd put the eligible inodes in a global queue protected by mutex. You can put them in the queue if they are Does that make sense? |
maybe I misunderstand the bugreport, though. Who or what is issuing the |
The code I'm talking about is here and here. It's not reusing inodes, it's reusing the |
"Forgotten() is intended for enabling cleanup in a scenario when you are sure the inode cannot be revived." leads me to believe the current behavior of To be clear, I'm also fine with adding an |
Hey Han-Wen, did you have time to think about this and figure out which proposal I mentioned is more desirable? FWIW it looks like |
unfortunately, I haven't. Familial duties have been taking all my time. |
I recently discovered a bug in a go-fuse client related to the
Inode.Forgotten()
function. Roughly speaking, the client has logic for creating and reusing Inode Inos, and relies on callingInode.Forgotten()
to detect when Inos can be reused. However, Forgotten() returnstrue
briefly between Inode construction and Inode initialization, so races can occur and lead to Ino reuse. This is a bit awkward to fix in the client, so I thought I'd ask ifInode.Forgotten()
should really returntrue
ifInode.lookupCount == 0
as in that case the Inode has not actually been initialized yet, or alternatively, if anInitialized()
function could be added allowing the caller to check if an Inode has been initialized or not?The text was updated successfully, but these errors were encountered: