fsck: Add some more log messages.
authorAndre Noll <maan@systemlinux.org>
Sat, 11 Jul 2009 21:25:29 +0000 (23:25 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 11 Jul 2009 21:25:29 +0000 (23:25 +0200)
These were helpful to find the bug which was fixed by the previous patch.

fsck.c
util.c

diff --git a/fsck.c b/fsck.c
index f4f1071149e783519f6f0fc6c7acfcf4dcdd0b30..c5fdf3545cc1e4d9d3159787984ba7ee6b7d5a42 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -512,6 +512,8 @@ static int check_for_invalid_objects(struct osl_table *t, uint32_t **lost_bytes)
        /* first count used bytes */
        FOR_EACH_MAPPED_COLUMN(i, t, cd) {
                loss[i] = t->columns[i].data_map.size;
+               DEBUG_LOG("column %i data map: %u bytes\n", i,
+                       t->columns[i].data_map.size);
                for (j = 0; j < t->num_rows; j++) {
                        struct osl_object obj;
                        ret = get_mapped_object(t, i, j, &obj);
@@ -885,8 +887,11 @@ static int fsck_init(struct osl_table_description *desc, struct osl_table **t)
                ret = map_table(*t, (MAP_TBL_FL_IGNORE_DIRTY));
        else
                ret = map_table(*t, 0);
-       if (ret >= 0)
+       if (ret >= 0) {
                (*t)->num_rows = table_num_rows(*t);
+               DEBUG_LOG("index header size: %d\n", (*t)->index_header_size);
+               DEBUG_LOG("row index size: %d\n", (*t)->row_index_size);
+       }
 out:
        return ret;
 }
diff --git a/util.c b/util.c
index 64d83c84f3292ffffa87af4f5129c891f4e3796e..db80854203728d50081c98fe128e6c5d6c22b3ae 100644 (file)
--- a/util.c
+++ b/util.c
@@ -61,8 +61,10 @@ int write_all(int fd, const char *buf, size_t *len)
        *len = 0;
        while (*len < total) {
                int ret = __write(fd, buf + *len, total - *len);
-               if (ret < 0)
+               if (ret < 0) {
+                       ERROR_LOG("write error: %s\n", strerror(errno));
                        return ret;
+               }
                *len += ret;
        }
        return 1;