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

feat: make probe always open blockdevices in readonly mode #45

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

Unix4ever
Copy link
Member

Fixes: #44

Signed-off-by: Artem Chernyshev [email protected]

@Unix4ever
Copy link
Member Author

/approve

@@ -149,7 +149,7 @@ func probe(devpath string) (devpaths []string) {
// Start by opening the block device.
// If a partition table was not found, it is still possible that a
// file system exists without a partition table.
bd, err := blockdevice.Open(devpath)
bd, err := blockdevice.Open(devpath, blockdevice.WithMode(blockdevice.ReadonlyMode))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope we don't write to probed devices later? (I don't know if there's any good chance to track through it?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the code, it doesn't look like we do. I'm going to run integration tests in Talos now to see if anything got broken.

@Unix4ever
Copy link
Member Author

/m --ff

@talos-bot talos-bot merged commit e367f9d into siderolabs:master Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open disk in read/write mode
3 participants