-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix volmode=none property behavior at import time #6426
Merged
Merged
Conversation
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
At import time spa_import() calls zvol_create_minors() directly: with the current implementation we have no way to avoid device node creation when volmode=none. Fix this by enforcing volmode=none directly in zvol_alloc(). Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
loli10K
force-pushed
the
fix-zvol-volmode-import
branch
from
July 30, 2017 06:43
e38a104
to
91b6116
Compare
loli10K
commented
Jul 30, 2017
@@ -3425,7 +3425,7 @@ function swap_setup | |||
typeset swapdev=$1 | |||
|
|||
if is_linux; then | |||
log_must mkswap $swapdev > /dev/null 2>&1 | |||
log_must eval "mkswap $swapdev > /dev/null 2>&1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the eval
we can't see the message logged by log_must
:
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/setup (run as root) [00:03] [PASS]
22:00:26.22 SUCCESS: zpool create -f testpool loop0
22:00:26.25 SUCCESS: zfs create -V 256m testpool/testvol
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_001_pos (run as root) [00:00] [FAIL]
22:00:29.38 ASSERTION: Verify that a zvol can be used as a swap device
22:00:29.38 NOTE: Add zvol volume as swap space
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_002_pos (run as root) [00:00] [FAIL]
22:00:29.47 ASSERTION: Using a zvol as swap space, fill /var/tmp to 80%.
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_003_pos (run as root) [00:00] [SKIP]
22:00:29.56 Modifies global non-ZFS system config
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos (run as root) [00:03] [FAIL]
22:00:29.58 ASSERTION: For an added swap zvol, (2G <= volsize <= 16G)
22:00:29.60 SUCCESS: zfs create -s -b 8192 -V 262144 testpool/vol_262144
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_005_pos (run as root) [00:00] [SKIP]
22:00:32.88 swaplow + swaplen unsupported Linux options
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos (run as root) [00:00] [SKIP]
22:00:32.90 swaplow + swaplen unsupported Linux options
Test: /usr/share/zfs/zfs-tests/tests/functional/zvol/zvol_swap/cleanup (run as root) [00:00] [PASS]
behlendorf
approved these changes
Jul 31, 2017
tonyhutter
pushed a commit
to tonyhutter/zfs
that referenced
this pull request
Jul 31, 2017
At import time spa_import() calls zvol_create_minors() directly: with the current implementation we have no way to avoid device node creation when volmode=none. Fix this by enforcing volmode=none directly in zvol_alloc(). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#6426
tonyhutter
pushed a commit
that referenced
this pull request
Aug 2, 2017
At import time spa_import() calls zvol_create_minors() directly: with the current implementation we have no way to avoid device node creation when volmode=none. Fix this by enforcing volmode=none directly in zvol_alloc(). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #6426
Fabian-Gruenbichler
pushed a commit
to Fabian-Gruenbichler/zfs
that referenced
this pull request
Sep 6, 2017
At import time spa_import() calls zvol_create_minors() directly: with the current implementation we have no way to avoid device node creation when volmode=none. Fix this by enforcing volmode=none directly in zvol_alloc(). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#6426
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.
Description
At import time
spa_import()
callszvol_create_minors()
directly: with the current implementation we have no way to avoid device node creation whenvolmode=none
.Fix this by enforcing
volmode=none
directly inzvol_alloc()
.Motivation and Context
I encountered this issue importing an old USB disk used to backup virtual machines: i set
volmode=none
on the root dataset but subsequent imports were still creating device nodes.How Has This Been Tested?
I've updated the ZTS script
tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
Types of changes
Checklist:
Signed-off-by
.