Fix in check_filesystem()

Fix the code in case of missing snapshots. Previously the check was in
a conditional that would be executed if the filesystem had snapshots.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14735
This commit is contained in:
George Amanakis 2023-04-12 17:53:53 +02:00 committed by GitHub
parent 678a3b8f99
commit 574e09d8c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,12 +354,12 @@ check_filesystem(spa_t *spa, uint64_t head_ds, zbookmark_err_phys_t *zep,
dsl_dataset_rele(ds, FTAG);
return (error);
}
}
if (snap_count == 0) {
/* Filesystem without snapshots. */
dsl_dataset_rele(ds, FTAG);
return (0);
}
if (snap_count == 0) {
/* Filesystem without snapshots. */
dsl_dataset_rele(ds, FTAG);
return (0);
}
uint64_t *snap_obj_array = kmem_zalloc(snap_count * sizeof (uint64_t),