HomeFreeBSD

ffs: wait for trims earlier during unmount to avoid panic

Description

ffs: wait for trims earlier during unmount to avoid panic

All softdep processing is supposed to be completed by
softdep_flushfiles() and no more deps are supposed to be created after
that, but if a pending trim completes after softdep_flushfiles() and
before softdep_unmount() then the blkfree that is performed by
ffs_blkfree_trim_task() will create a dep when none should exist, and
if softdep_unmount() is called before that dep is freed then the
kernel will panic. Prevent this by waiting for trims to complete
earlier in the unmount process, in ffs_flushfiles(), so that any deps
will be freed and any modified CG buffers will be flushed by the final
fsync of the devvp in ffs_flushfiles() as intended.

(cherry picked from commit 3dc5f8e19d8c975a5e27752d65f9aa91d67c9c9e)

Details

Provenance
chsAuthored on Apr 8 2022, 5:19 PM
mariusCommitted on Aug 6 2023, 5:56 PM
Parents
rGaa63608809b6: base: Remove support for the VTOC8 partitioning scheme
Branches
Unknown
Tags
Unknown