From: NeilBrown Date: Fri, 2 Jul 2010 23:21:21 +0000 (+1000) Subject: Don't remove a block from cleaning list until B_Realloc is set. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=dd330641108f73d66540745e6ccc7b390f30f1d7;p=LaFS.git Don't remove a block from cleaning list until B_Realloc is set. This ensures that a race with erase_dblock will either run into the mutex, or be able to clear Realloc immediately. Signed-off-by: NeilBrown --- diff --git a/clean.c b/clean.c index 17812c7..3744ec3 100644 --- a/clean.c +++ b/clean.c @@ -487,9 +487,9 @@ static int try_clean(struct fs *fs, struct toclean *tc) putref(cb, MKREF(clean2)); continue; } - list_del_init(&b->cleaning); if (err) { + list_del_init(&b->cleaning); iput(b->b.inode); putref(cb, MKREF(clean2)); putdref(b, MKREF(cleaning)); @@ -504,6 +504,7 @@ static int try_clean(struct fs *fs, struct toclean *tc) * ref on the inode, so it is safe to drop our * ref now */ + list_del_init(&b->cleaning); iput(b->b.inode); putdref(b, MKREF(cleaning)); putref(cb, MKREF(clean2));