-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: open blockdevices with exclusive flock for partitioning
This fixes spurious race conditions when user disks are partitioned and formatted in `mountUserDisks` task. While this task runs, `udevd` is running to allow various `/dev/` symlinks to be used for user disks. At the same time `udevd` might trigger syscall `BLKRRPART` at any time concurrently with Talos which leads to a race on kernel side when Talos tries to update kernel partition table while kernel does it on its own as a result of `udevd` call. As part of the fix, `RereadPartitionTable()` calls were removed (they trigger `BLKRRPART` and they're not needed as Talos updates partition table on its own). Some cleanups to make sure blockdevice is open/closed just in matching pairs (no lingering open blockdevice instances). This is import for `WithExclusiveLock()` calls, as it would lead to a deadlock if previous blockdevice instance is not closed. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
- Loading branch information
Showing
5 changed files
with
90 additions
and
95 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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