-
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
issue #14223: fix generation of kernel uevents for snapshot rename on linux #16600
issue #14223: fix generation of kernel uevents for snapshot rename on linux #16600
Conversation
9958306
to
9f207e2
Compare
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.
Looks good, thanks for running this down. Let's just make sure to also update at least one of the functional/cli_root/zfs_rename/
test cases to verify the link is update for renamed volume snapshots.
@behlendorf I've had a look around the tests and wondered if function/zvol/... might be a more appropriate area as there a lots of tests here using diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
index 1fc2d2780..3d229dccd 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_snapdev.ksh
@@ -118,4 +118,15 @@ verify_inherited 'snapdev' 'hidden' $SUBZVOL $VOLFS
blockdev_missing $SUBSNAPDEV
blockdev_exists $SNAPDEV
+# 4. Verify "rename" is correctly reflected when "snapdev=visible"
+# 4.1 First create a snapshot and verify the device is present
+log_must zfs snapshot $SNAP
+log_must zfs set snapdev=visible $ZVOL
+blockdev_exists $SNAPDEV
+# 4.2 rename the snapshot and verify the devices are updated
+log_must zfs rename $SNAP $SNAP-new
+blockdev_missing $SNAPDEV
+blockdev_exists $SNAPDEV-new
+log_must zfs destroy $SNAP-new
+
log_pass "ZFS volume property 'snapdev' works as expected" |
@JKDingwall sure that'd be fine. It does look like it would fit in better there. |
9f207e2
to
3c2f69a
Compare
…ot rename `zvol_rename_minors()` needs to be given the full path not just the snapshot name. Use code removed in a0bd735 as a guide to providing the necessary values. Closes openzfs#14223 Signed-off-by: James Dingwall <james@dingwall.me.uk>
…ename After renaming a snapshot with 'snapdev=visible' ensure that the /dev entries are updated to reflect the rename. Signed-off-by: James Dingwall <james@dingwall.me.uk>
3c2f69a
to
156c952
Compare
The test failures appear to be in a different area to this change so I think it is all in order now. |
Looks good. The couple of failures observed are all unrelated known test issues. |
`zvol_rename_minors()` needs to be given the full path not just the snapshot name. Use code removed in a0bd735 as a guide to providing the necessary values. Add ZTS check for /dev changes after snapshot rename. After renaming a snapshot with 'snapdev=visible' ensure that the /dev entries are updated to reflect the rename. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: James Dingwall <james@dingwall.me.uk> Closes openzfs#14223 Closes openzfs#16600
`zvol_rename_minors()` needs to be given the full path not just the snapshot name. Use code removed in a0bd735 as a guide to providing the necessary values. Add ZTS check for /dev changes after snapshot rename. After renaming a snapshot with 'snapdev=visible' ensure that the /dev entries are updated to reflect the rename. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: James Dingwall <james@dingwall.me.uk> Closes openzfs#14223 Closes openzfs#16600
`zvol_rename_minors()` needs to be given the full path not just the snapshot name. Use code removed in a0bd735 as a guide to providing the necessary values. Add ZTS check for /dev changes after snapshot rename. After renaming a snapshot with 'snapdev=visible' ensure that the /dev entries are updated to reflect the rename. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: James Dingwall <james@dingwall.me.uk> Closes openzfs#14223 Closes openzfs#16600
zvol_rename_minors()
needs to be given the full path not just the snapshot name. Use code removed in a0bd735 as a guide to providing the necessary values.Closes #14223
Motivation and Context
Renaming a snapshot
zfs rename zpool/volume@snap1 zpool/volume@snap2
should result in the udev generated link for /dev/zvol/zpool/volume@snap1 being removed and a new /dev/zvol/zpool/volume@snap2 being created. Without this then trying to access the snapshot content via the old name results inENOENT
and the new name is not present.#14223
Description
The change here ensures that the full path to the snapshot is provided to
zvol_rename_minors()
and not just the plain snapshot name.How Has This Been Tested?
The kernel module has been rebuilt on the test system with this change and the behaviour of the rename is now as expected, the old link is removed and a new link exists. Content of the snapshot is available via the new link.
make deb
has also been executed and the full set of packages has been used to rebuild a virtual machine disk image. The image has been booted and no regressions have been noted.I am not a FreeBSD user so I'm unsure if there was an issue on that platform or how this code may affect it.
N/A.
Types of changes
Checklist:
Signed-off-by
.