From 574e09d8c6b49f223417e9aadb14367ac9db18f6 Mon Sep 17 00:00:00 2001 From: George Amanakis Date: Wed, 12 Apr 2023 17:53:53 +0200 Subject: [PATCH] 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 Reviewed-by: Tino Reichardt Signed-off-by: George Amanakis Closes #14735 --- module/zfs/spa_errlog.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/zfs/spa_errlog.c b/module/zfs/spa_errlog.c index af144ef169..3bc8619b51 100644 --- a/module/zfs/spa_errlog.c +++ b/module/zfs/spa_errlog.c @@ -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),