]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Suppress static analyzer warning in dmu_objset_create_impl_dnstats()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Mon, 6 Mar 2023 16:15:37 +0000 (11:15 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Mar 2023 21:52:15 +0000 (13:52 -0800)
ae7e7006500ca37c471dd625cd5cbfc590b49885 added an assertion to suppress
a complaint from Clang's static analyzer. Unfortunately, it missed
another way for Clang to complain about this function. This adds another
assertion to handle that.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14575

module/zfs/dmu_objset.c

index 133f678dea53c690dc36b623033909e885830398..c19ebf424953ee7e236b1223e88b99a74de27a20 100644 (file)
@@ -1128,6 +1128,7 @@ dmu_objset_create_impl_dnstats(spa_t *spa, dsl_dataset_t *ds, blkptr_t *bp,
                            OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE;
                }
                if (dmu_objset_projectquota_enabled(os)) {
+                       ASSERT3P(ds, !=, NULL);
                        ds->ds_feature_activation[
                            SPA_FEATURE_PROJECT_QUOTA] = (void *)B_TRUE;
                        os->os_phys->os_flags |=