From: NeilBrown Date: Mon, 21 Jun 2010 00:11:33 +0000 (+1000) Subject: Temp fix for delaying youth updates. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=f2802c2f09514e0f7272be9adcf3f1dcdc68bfe7;p=LaFS.git Temp fix for delaying youth updates. When we allocate a new segment during checkpoint we need to delay the youth block update, possibly until the roll-forward. This is just a simple hack to avoid the worst of the problem but we need to properly delay it at some stage. Signed-off-by: NeilBrown --- diff --git a/roll.c b/roll.c index 6978b68..1092eb8 100644 --- a/roll.c +++ b/roll.c @@ -506,6 +506,9 @@ static int roll_forward(struct fs *fs) buf = kmalloc(max, GFP_KERNEL); if (buf) while (first != next) { + /* FIXME if this cluster is in a new segment, + * we need to set the youth number for it. + */ err = roll_one(fs, &first, p, pg, max); if (err) break; diff --git a/segments.c b/segments.c index 10375fc..d6f3590 100644 --- a/segments.c +++ b/segments.c @@ -1035,6 +1035,17 @@ void lafs_free_get(struct fs *fs, unsigned int *dev, u32 *seg, *dev = ss->dev; *seg = ss->segment; + if (test_bit(FinalCheckpoint, &fs->fsstate)) { + /* skip youth update, roll forward will do it. */ + /* FIXME should more generally delay the update if we + * are in any checkpoint. + */ + spin_unlock(&fs->lock); + if (db) + putdref(db, MKREF(youth)); + return; + } + if (db && db->b.inode == fs->devs[*dev].segsum && db->b.fileaddr == ((*seg) >> (fs->prime_sb->s_blocksize_bits