]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: fix log trimming races
authorSage Weil <sage@newdream.net>
Thu, 28 Jul 2011 22:24:23 +0000 (15:24 -0700)
committerSage Weil <sage@newdream.net>
Thu, 28 Jul 2011 23:01:07 +0000 (16:01 -0700)
commitf82b6298dfb46f4ed4b4f97c6f8de86bdc03cecd
treea8c6c85d347308470af644e868e5c95c51a39565
parent8fe50b84d842f5b266f88b24f0102baab62f4f6e
mds: fix log trimming races

trim() would iterate over segments.  It would take the *p segment, ++p,
then call try_expire().  But the _expired() function would also clean up
and (if possible) retire subsequent segments on the list if they were on
the expired list, invalidating the p iterator.

Untangle the mess by making expired segment trimming (i.e. removing from
segment list) a separate operation performed only by trim() (probably a
good idea anyway).  This keeps the iterator safe/stable.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/MDLog.cc
src/mds/MDLog.h