hammer2 - hardlink stabilization pass
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 17 May 2012 18:34:18 +0000 (11:34 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 17 May 2012 18:34:18 +0000 (11:34 -0700)
* Fix another edge case where nkeybits could exceed 64, resulting in
  an assertion.

sys/vfs/hammer2/hammer2_chain.c

index 4dda5ae..a10e4fa 100644 (file)
@@ -1716,11 +1716,10 @@ hammer2_chain_create_indirect(hammer2_mount_t *hmp, hammer2_chain_t *parent,
                nkeybits = keybits;
                if (nkeybits < bref->keybits)
                        nkeybits = bref->keybits;
-               while ((~(((hammer2_key_t)1 << nkeybits) - 1) &
+               while (nkeybits < 64 &&
+                      (~(((hammer2_key_t)1 << nkeybits) - 1) &
                        (key ^ bref->key)) != 0) {
                        ++nkeybits;
-                       if (nkeybits == 64)
-                               break;
                }
 
                /*