]> git.neil.brown.name Git - LaFS.git/commitdiff
Temp fix for delaying youth updates.
authorNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:11:33 +0000 (10:11 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:29:33 +0000 (10:29 +1000)
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 <neilb@suse.de>
roll.c
segments.c

diff --git a/roll.c b/roll.c
index 6978b689d13e0ac4b11d4e4c2ff35287ee8f2a12..1092eb858912dc3e4ba3c829686e4a8552fec952 100644 (file)
--- 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;
index 10375fc326cb635f8f88280c6b71ab21c8e964a5..d6f3590dc5190ebee33917ff4f8646cee12568c6 100644 (file)
@@ -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