]> git.neil.brown.name Git - LaFS.git/commit
Avoid a race in lafs_get_cleanable.
authorNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 01:47:30 +0000 (12:47 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 01:47:30 +0000 (12:47 +1100)
commit88d2373e57dbc9c937cba44d616fde154ee001c1
tree04952f09795afe35c5ef6cb6a5a25ab6ea73e5f1
parentb087f054db292a0dcd707bceda8196acc7ed536f
Avoid a race in lafs_get_cleanable.

If we find a cleanable segment that is actually clean, then we
drop the lock and try to add it.  If something else removed it at
just this time we end up with a refcount issue as we are meant to
take references to youth_db and usage0_db when adding things to the
table, and we don't have them any more.

So simply allow the 'add_clean' to fail as that is safe.

Signed-off-by: NeilBrown <neilb@suse.de>
segments.c