Issue 17963: avoid mounting "noauto" volumes from initramfs#18083
Closed
crazybert wants to merge 1 commit intoopenzfs:masterfrom
Closed
Issue 17963: avoid mounting "noauto" volumes from initramfs#18083crazybert wants to merge 1 commit intoopenzfs:masterfrom
crazybert wants to merge 1 commit intoopenzfs:masterfrom
Conversation
Contributor
|
This looks ready-to-go. Can you remove the Draft tag and add a commit message that makes checkstyle happy, like: |
073fac6 to
dccef3e
Compare
80286a0 to
dccef3e
Compare
Author
Apparently someone had a strong feeling that "noauto" should not be skipped. |
dccef3e to
f5d0c89
Compare
Fixes: openzfs#17963 Signed-off-by: Kirill Bykov <crazybert@gmail.com>
Contributor
|
@crazybert ah, I clearly missed all the action in #17963. Please ping me once you guys reach consensus in #17963 and want to move forward with this PR. |
Contributor
|
Yep, like I said in #17963 (specifically in this comment), I don't agree that this is a solution. It might fix one particular scenario (in the "works for me" sense), but it breaks the more general concept of coexisting multiple OS installations on a single pool. |
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.
Motivation and Context
Fixes: #17963
A Debian user reported that datasets with
canmount=noautowere being mounted (or at least attempted to be mounted) during boot by the initramfs scripts. This is incorrect behavior, as thecanmount=noautoproperty is intended to prevent automatic mounting of filesystems, allowing them to be mounted manually when needed.The initramfs scripts currently skip mounting filesystems with
canmount=offduring boot, but did not respect thecanmount=noautoproperty. This is inconsistent with the behavior of the main ZFS mount code, which skipsnoautofilesystems duringzfs mount -aoperations.Description
This change adds a check in the
mount_fs()function withincontrib/initramfs/scripts/zfs(around line 368) to skip mounting filesystems that havecanmount=noautoset. The check follows the same pattern as the existingcanmount=offcheck, ensuring consistency in the code.The change is minimal and non-invasive:
[ "${_canmount}" = "noauto" ] && return 0canmount=offcheck (line 367)Note: There is an outdated comment in the code (lines 348-351) that states the script needs to mount filesystems with
canmount=noauto. This comment should be updated to reflect the corrected behavior, but that is outside the scope of this bug fix.This makes the initramfs behavior consistent with:
zfs mount -abehavior incmd/zfs/zfs_main.cetc/systemd/system-generators/zfs-mount-generator.ccanmount=noautopropertyHow Has This Been Tested?
Testing performed:
canmount=noautoare now skipped during initramfs bootcanmountpropertycanmount=oncontinue to mount as expectedcanmount=offcontinue to be skipped (existing behavior preserved)Test environment:
canmountproperty valuesTypes of changes
Checklist:
Signed-off-by.