-
Notifications
You must be signed in to change notification settings - Fork 76
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
Provide open and close callbacks to virtual filesystem implementation… #91
base: master
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
ok to test |
…s as described in dCache#38. Signed-off-by: David Kocher <dkocher@iterate.ch>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to do something similar, but at the end decided against it. It's not symmetric, e.q. the some calls accept stateid and have a undefined
behavior. Have a look at https://github.com/dCache/nfs4j/blob/master/core/src/main/java/org/dcache/nfs/v4/FileTracker.java. I think it's quite close to what you want to achieve.
@@ -47,6 +47,7 @@ public void process(CompoundContext context, nfs_resop4 result) | |||
Inode inode = context.currentInode(); | |||
|
|||
stateid4 stateid = Stateids.getCurrentStateidIfNeeded(context, _args.opclose.open_stateid); | |||
context.getFs().close(inode, stateid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can trigger false evens it client tries to close invalid inode or stateid. I think this should be bound to state disposal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. We have worked around this by tracking the stateid in the virtual filesystem implementation.
@@ -206,6 +206,7 @@ public void process(CompoundContext context, nfs_resop4 result) throws ChimeraNF | |||
} | |||
|
|||
context.currentInode(inode); | |||
context.getFs().open(inode, this.getAccessMode(_args.opopen.share_access), result.opopen.resok4.stateid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will mess all opens by file handle, which is quite common, when client already got hanlde by previous readdir, lookup or open.
|
…s as described in #38.
Signed-off-by: David Kocher dkocher@iterate.ch