HomeFreeBSD

Generalize the fix from r322757 and apply it to several more places.

Description

Generalize the fix from r322757 and apply it to several more places.

The code accesses bp->b_dep without owning the ufs mount softdep lock,
which makes it possible for the derefenced workitem to be freed in
parallel. In particular, the deallocate_dependencies(),
softdep_disk_io_initiation() and softdep_disk_write_complete() are
affected.

Move the code to safely calculate ump from the buffer with
dependencies into the helper softdep_bp_to_mp() and use it for all
found cases.

Tested by: pho (as part of the bigger patch)
Reviewed by: mckusick (as part of the bigger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on
Reviewer
mckusick
Parents
rS327722: When handling write completion, take SU lock around calls to
Branches
Unknown
Tags
Unknown