HomeFreeBSD

Fix uninitialized scalar value read regression in dmu_recv_begin()

Description

Fix uninitialized scalar value read regression in dmu_recv_begin()

da19d919a853ad05ef300fe000e6c96c4db84bcf changed this in a way that
permits execution to reach if (err == 0) without initializing err.
This could randomly cause the sync task to not execute. We fix that by
initializing err to zero.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reported-by: Coverity (CID-1535377)
Closes #14607

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 10 2023, 10:47 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 14 2023, 9:40 PM
Parents
rG519851122b17: ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG1c212d1b7c47: Fix uninitialized scalar value read regression in dmu_recv_begin() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 14 2023, 9:40 PM