-
Notifications
You must be signed in to change notification settings - Fork 144
lklfuse: support exclusive locks to avoid duplicate mounts #611
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
Conversation
|
The windows build failure here appears to be the same |
|
v2:
|
|
checkpatch still complains but I think it can be ignored: |
tavip
left a comment
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.
LGTM, left a couple minor comments. Thanks @ddiss!
This lock-while-mounted behaviour is similar to what QEMU does, and can help avoid duplicate mounts. Allowing for an explicit lock path that differs from the filesystem image / block device path was intentional, to ensure non-flock supporting filesystems can still be used. Also, there are cases where a block device and partition (e.g. sda and sda1) can both provide access to the same filesystem image, in which case an FS-ID based lock would make sense. Signed-off-by: David Disseldorp <ddiss@suse.de>
Use an ID_FS_UUID based lock file to avoid duplicate mounts. If udev doesn't provide an id then use a static noid path, ensuring lock conflict with any other id-less mount. Signed-off-by: David Disseldorp <ddiss@suse.de>
This tests that two lklfuse instances using the same lock file result in a lock conflict (exit status 2) for the instance started last. Signed-off-by: David Disseldorp <ddiss@suse.de>
The sleep appears to have been there since the initial tests were added. It shouldn't be necessary so remove it. Signed-off-by: David Disseldorp <ddiss@suse.de>
TEST_FAILED isn't set anywhere. Use test.sh defined TEST_FAILURE. Signed-off-by: David Disseldorp <ddiss@suse.de>
|
@tavip : thanks for the review!
|
Duplicate mounts are a risk when running multiple lklfuse instances, as we don't have a single arbitrator to manage access. This patchset adds a new
lockparameter, which can provide host-sideflock()based exclusion.