git: hammer2 - Fix persist_refs race on chain IPC
dillon at crater.dragonflybsd.org
Thu Aug 24 09:50:23 PDT 2017
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Thu Aug 24 09:47:00 2017 -0700
hammer2 - Fix persist_refs race on chain IPC
* The chain->lockcnt and chain->persist_refs mechanism was poorly
implemented and had a race which could leave chain->data intact
on the last unlock and/or cause memory corruption.
* Fold persist_refs into lockcnt and remove persist_refs. Obtain or
upgrade the mutex to exclusive BEFORE doing the 1->0 transition.
Still not perfect, but shouldn't have any more holes.
Summary of changes:
sys/vfs/hammer2/hammer2.h | 2 +-
sys/vfs/hammer2/hammer2_chain.c | 113 ++++++++++++++++++++++++----------------
2 files changed, 69 insertions(+), 46 deletions(-)
DragonFly BSD source repository
More information about the Commits