Run zvol_create_minors() only if in non-error case

This commit is contained in:
Martin Matuska 2013-03-19 22:27:15 +00:00
parent e56718d734
commit a0abc0d302
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/libzfs_core/; revision=248538

View File

@ -1289,10 +1289,12 @@ dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors)
#ifdef __FreeBSD__
#ifdef _KERNEL
for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL;
pair = nvlist_next_nvpair(snaps, pair)) {
char *snapname = nvpair_name(pair);
zvol_create_minors(snapname);
if (error == 0) {
for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL;
pair = nvlist_next_nvpair(snaps, pair)) {
char *snapname = nvpair_name(pair);
zvol_create_minors(snapname);
}
}
#endif
#endif