-
Notifications
You must be signed in to change notification settings - Fork 341
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
Flock implementation with test. #153
Conversation
fuse/test/flock_test.go
Outdated
return | ||
} | ||
|
||
if out, err := runExternalFlock(tc.mountFile); err != nil { |
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.
is there no lighter weight mechanism for this? There must be some command-line utility that exposes flock?
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.
There is the flock command but it's part of util-linux-ng, I don't think it's very portable.
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'd rather use that, and skip the test if we can't find the binary. Running the test binary from within the test binary sounds like it might easily break
@hanwen did you get a chance to look at it? |
squashed and committed as ae2e1d5 |
I think there is still something missing. I have mounted a loopback filesystem with
loopback debug output:
As you can see, no FLOCK call! The kernel does not seem to pass the call to us. Maybe we have to set a capability bit when mounting? |
Ok I think what is missing is that the flock-related operations ( |
There was a test (which I didn't run but looked plausible). Are you saying
it's completely broken?
Op di 2 mei 2017 21:25 schreef rfjakob <[email protected]>:
… Ok I think what is missing is that the flock-related operations (_OP_GETLK
etc.) are handled in opcode.go
<https://github.com/hanwen/go-fuse/blob/master/fuse/opcode.go>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#153 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAB7O8VctNhbp1pW5VfUKdJCHFj-pd7uks5r14M5gaJpZM4M-oXx>
.
|
Yes it is missing the kernel interface. But, it does no harm, the new code is just never called at the moment. The test passes because the kernel keeps track of the locks when the filesystem does not support locking. |
Please let me know if it doesn't work as expected.
Fixes #134