HomeFreeBSD

Fix a crash bug in zfsd when destroying a pool with I/O errors

Description

Fix a crash bug in zfsd when destroying a pool with I/O errors

cddl/usr.sbin/zfsd/case_file.cc
CaseFile::ReEvaluateByGuid was calling std::for_each on a std::list
of CaseFiles. However, the functor would sometimes remove a
CaseFile from the list, which caused a segfault in std::for_each.
The solution is to remove the use of for_each. Instead, manually
iterate through the list, taking care not to access potentially
invalid iterators.

Sponsored by: Spectra Logic Corp

Details

Provenance
asomersAuthored on
Parents
rS300338: Fix zfsd where the timezone is not UTC
Branches
Unknown
Tags
Unknown