Skip to content

driver/node: recreate device if owner or device mode is unexpected#680

Merged
pluser merged 3 commits intomainfrom
driver/review-device-reuse-condition
Mar 27, 2023
Merged

driver/node: recreate device if owner or device mode is unexpected#680
pluser merged 3 commits intomainfrom
driver/review-device-reuse-condition

Conversation

@daichimukai
Copy link
Copy Markdown
Contributor

When topolvm-node received a NodePublishVolume CSI request, it creates a device file. It reuse the file if the file already exists and its mode satisfies some conditions. However, it ignores many parts of the permission bits and, more over, the owner of the file.

This PR changes to require that the owner and the file type match with expectation in order to reuse the device file.

Signed-off-by: Daichi Mukai <daichi-mukai@cybozu.co.jp>
The `devicePermission` variable contains not only the file permission
bits but the file type bits. It should be rather called as `deviceMode`.

Signed-off-by: Daichi Mukai <daichi-mukai@cybozu.co.jp>
When topolvm-node received a NodePublishVolume CSI request, it creates a
device file. It reuse the file if the file already exists and its mode
satisfies some conditions. However, it ignores many parts of the
permission bits and, more over, the owner of the file.

This PR changes to require that the owner and the file type match with
expectation in order to reuse the device file.

Signed-off-by: Daichi Mukai <daichi-mukai@cybozu.co.jp>
@daichimukai daichimukai marked this pull request as ready for review March 22, 2023 00:16
@daichimukai daichimukai requested a review from a team as a code owner March 22, 2023 00:16
@daichimukai daichimukai requested review from peng225 and pluser March 22, 2023 00:16
@pluser pluser merged commit 2a699e6 into main Mar 27, 2023
@pluser pluser deleted the driver/review-device-reuse-condition branch March 27, 2023 10:05
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

Successfully merging this pull request may close these issues.

3 participants