aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorJKDingwall <[email protected]>2024-10-06 22:36:33 +0100
committerGitHub <[email protected]>2024-10-06 14:36:33 -0700
commit0b4dcbe5b425be70bc10d836d8e66711c690e8d4 (patch)
tree03179a000be1e6ed552ab05cc9e97c263de9cca1 /module
parent995a3a61fdcf6b6b4479f073c19271854c48de6f (diff)
Fix generation of kernel uevents for snapshot rename on linux
`zvol_rename_minors()` needs to be given the full path not just the snapshot name. Use code removed in a0bd735ad 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 <[email protected]> Signed-off-by: James Dingwall <[email protected]> Closes #14223 Closes #16600
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dsl_dataset.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
index 6a9ed8910..2248f644b 100644
--- a/module/zfs/dsl_dataset.c
+++ b/module/zfs/dsl_dataset.c
@@ -2987,6 +2987,7 @@ dsl_dataset_rename_snapshot_sync_impl(dsl_pool_t *dp,
dsl_dataset_t *ds;
uint64_t val;
dmu_tx_t *tx = ddrsa->ddrsa_tx;
+ char *oldname, *newname;
int error;
error = dsl_dataset_snap_lookup(hds, ddrsa->ddrsa_oldsnapname, &val);
@@ -3011,8 +3012,14 @@ dsl_dataset_rename_snapshot_sync_impl(dsl_pool_t *dp,
VERIFY0(zap_add(dp->dp_meta_objset,
dsl_dataset_phys(hds)->ds_snapnames_zapobj,
ds->ds_snapname, 8, 1, &ds->ds_object, tx));
- zvol_rename_minors(dp->dp_spa, ddrsa->ddrsa_oldsnapname,
- ddrsa->ddrsa_newsnapname, B_TRUE);
+
+ oldname = kmem_asprintf("%s@%s", ddrsa->ddrsa_fsname,
+ ddrsa->ddrsa_oldsnapname);
+ newname = kmem_asprintf("%s@%s", ddrsa->ddrsa_fsname,
+ ddrsa->ddrsa_newsnapname);
+ zvol_rename_minors(dp->dp_spa, oldname, newname, B_TRUE);
+ kmem_strfree(oldname);
+ kmem_strfree(newname);
dsl_dataset_rele(ds, FTAG);
return (0);