From d16e7226ea99f7979333b14422b98a55231f566d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 11 Jul 2009 23:25:29 +0200 Subject: [PATCH] fsck: Add some more log messages. These were helpful to find the bug which was fixed by the previous patch. --- fsck.c | 7 ++++++- util.c | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fsck.c b/fsck.c index f4f1071..c5fdf35 100644 --- 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 64d83c8..db80854 100644 --- 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; -- 2.39.2