lklfuse: support exclusive locks to avoid duplicate mounts#611
Merged
tavip merged 5 commits intolkl:masterfrom Jul 4, 2025
Merged
lklfuse: support exclusive locks to avoid duplicate mounts#611tavip merged 5 commits intolkl:masterfrom
tavip merged 5 commits intolkl:masterfrom
Conversation
Author
|
The windows build failure here appears to be the same |
Author
|
v2:
|
Author
|
checkpatch still complains but I think it can be ignored: |
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>
Author
|
@tavip : thanks for the review!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.