]> git.neil.brown.name Git - LaFS.git/commitdiff
fix max height for segment skiplist.
authorNeilBrown <neilb@suse.de>
Sun, 2 Aug 2009 09:29:52 +0000 (19:29 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 2 Aug 2009 09:29:52 +0000 (19:29 +1000)
The max is defined as 8, but we use 9 !!!
Fix this and make sure it doesn't happen again.

segments.c
state.h

index bb3928c57a983ccc4bc018af34dba32a1d29c657..21d55b56500f1034258ad40cfef465d73c9d65b7 100644 (file)
@@ -699,6 +699,7 @@ int lafs_segtrack_init(struct segtracker *st)
        st->size[1] = 1;
        st->size[2] = 5;
        st->size[3] = 9;
+       BUG_ON(9 > SEG_MAX_HEIGHT);
 
        st->unused.first = st->unused.last = 0xffff;
        st->cleanable.first = st->cleanable.last = 0xffff;
diff --git a/state.h b/state.h
index 0453d384c971282d82eba5489d11d40afb5ecca6..ba1bfcbcd833af2982243f6d529689dcb0f4342d 100644 (file)
--- a/state.h
+++ b/state.h
@@ -151,7 +151,7 @@ struct fs {
        int     youth_block;    /* block number of next block to decay */
        int checkpoint_youth; // FIXME make sure this gets decayed
 
-#define        SEG_MAX_HEIGHT (8)
+#define        SEG_MAX_HEIGHT (9)
        struct segtracker {
                void *page[4];
                int size[4]; /* entry size in page as "number of skip pointers" */