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
1 changed files with 5 additions and 5 deletions

View File

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