Update to a warning message to provide more debugging info
authorMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 11 Mar 2011 19:34:04 +0000 (11:34 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Fri, 11 Mar 2011 19:34:04 +0000 (11:34 -0800)
bluesky/file.c

index e0c6255..72467f3 100644 (file)
@@ -100,7 +100,11 @@ void bluesky_file_truncate(BlueSkyInode *inode, uint64_t size)
                     && lastblock_old < BLUESKY_BLOCK_SIZE) {
                 bluesky_block_touch(inode, inode->blocks->len - 1, TRUE);
                 gsize old_size = b->dirty->len;
-                g_warn_if_fail(lastblock_old != old_size);
+                if (lastblock_old != old_size) {
+                    fprintf(stderr,
+                            "Warning: last block size = %zd, expected %d\n",
+                            old_size, lastblock_old);
+                }
                 bluesky_string_resize(b->dirty, BLUESKY_BLOCK_SIZE);
                 memset(&b->dirty->data[old_size], 0,
                        BLUESKY_BLOCK_SIZE - old_size);