]> git.neil.brown.name Git - LaFS.git/commitdiff
roll: add a possibly-useful assertion.
authorNeilBrown <neilb@suse.de>
Tue, 3 May 2011 05:13:46 +0000 (15:13 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 3 May 2011 05:13:46 +0000 (15:13 +1000)
Signed-off-by: NeilBrown <neilb@suse.de>
roll.c

diff --git a/roll.c b/roll.c
index b6d8e3300cdc2c9154d54ceccc212dea5f801c4d..11acf659ae30b102b2226f963c99d42e133bc424 100644 (file)
--- a/roll.c
+++ b/roll.c
@@ -504,6 +504,10 @@ roll_block(struct fs *fs, int fsnum, int inum, int trunc,
                lafs_pin_dblock(blk, CleanSpace); /* cannot fail during ! ->rolled */
 
                lafs_iolock_block(&blk->b);
+               /* The '1' in lafs_summary_update assumes SegRef is set, so
+                * assert that it is.
+                */
+               LAFS_BUG(!test_bit(B_SegRef, &blk->b.flags), &blk->b);
                lafs_summary_update(fs, blk->b.inode, blk->b.physaddr, baddr,
                                    0, fs->phase, 1);
                blk->b.physaddr = baddr;