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>
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;
*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