Skip to content
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

Delete symlinks before removing devices #746

Open
DemiMarie opened this issue Feb 6, 2022 · 2 comments
Open

Delete symlinks before removing devices #746

DemiMarie opened this issue Feb 6, 2022 · 2 comments

Comments

@DemiMarie
Copy link

Before destroying a device-mapper device, devicemapper-rs should delete the symlink for that device under /dev/mapper. This avoids race conditions by ensuring that opening /dev/mapper/somedevice always returns the correct device if it succeeds.

@jbaublitz
Copy link
Member

Hi @DemiMarie! Symlinks are all managed by udev so our libraries removing the links does not really solve the problem. Can you tell me a little bit more about the specific problem you're bumping into so we can see if we can provide some other suggestions? Is there something happening where the symlink is taking a long time to be removed?

@DemiMarie
Copy link
Author

Hi @DemiMarie! Symlinks are all managed by udev so our libraries removing the links does not really solve the problem. Can you tell me a little bit more about the specific problem you're bumping into so we can see if we can provide some other suggestions? Is there something happening where the symlink is taking a long time to be removed?

The advantage of managing the links manually is that it avoids race conditions, by ensuring that /dev/mapper/something is deleted before the device node it points to is destroyed and potentially reused for something else. udev cannot make that guarantee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants