summaryrefslogtreecommitdiff
path: root/src/btree/bt_vrfy_dsk.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-09-15 08:57:57 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-09-15 08:57:57 -0400
commit6fee3e5f618bc14297629874460438e2cbcb6672 (patch)
tree00f20da5f157a63b87f6d8e05f9bd0fd8b038952 /src/btree/bt_vrfy_dsk.c
parent0605b00f8b384ab74808f8c9d9b4906cc81fe673 (diff)
downloadmongo-6fee3e5f618bc14297629874460438e2cbcb6672.tar.gz
Change the invalid address error message from "eof" to "corrupt or eof",
it can be either.
Diffstat (limited to 'src/btree/bt_vrfy_dsk.c')
-rw-r--r--src/btree/bt_vrfy_dsk.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/btree/bt_vrfy_dsk.c b/src/btree/bt_vrfy_dsk.c
index c37870cea8f..cf86ca9bec3 100644
--- a/src/btree/bt_vrfy_dsk.c
+++ b/src/btree/bt_vrfy_dsk.c
@@ -8,10 +8,10 @@
#include "wt_internal.h"
-static int __err_cell_corrupted(WT_SESSION_IMPL *, uint32_t, const char *);
+static int __err_cell_corrupt(WT_SESSION_IMPL *, uint32_t, const char *);
+static int __err_cell_corrupt_or_eof(WT_SESSION_IMPL *, uint32_t, const char *);
static int __err_cell_type(
WT_SESSION_IMPL *, uint32_t, const char *, uint8_t, uint8_t);
-static int __err_eof(WT_SESSION_IMPL *, uint32_t, const char *);
static int __verify_dsk_chunk(
WT_SESSION_IMPL *, const char *, const WT_PAGE_HEADER *, uint32_t);
static int __verify_dsk_col_fix(
@@ -224,7 +224,7 @@ __verify_dsk_row(
/* Carefully unpack the cell. */
if (__wt_cell_unpack_safe(cell, unpack, dsk, end) != 0) {
- ret = __err_cell_corrupted(session, cell_num, tag);
+ ret = __err_cell_corrupt(session, cell_num, tag);
goto err;
}
@@ -296,8 +296,11 @@ __verify_dsk_row(
ret = bm->addr_invalid(
bm, session, unpack->data, unpack->size);
WT_RET_ERROR_OK(ret, EINVAL);
- if (ret == EINVAL)
- goto eof;
+ if (ret == EINVAL) {
+ ret = __err_cell_corrupt_or_eof(
+ session, cell_num, tag);
+ goto err;
+ }
break;
}
@@ -454,10 +457,6 @@ key_compare: /*
tag, key_cnt, dsk->u.entries);
if (0) {
-eof: ret = __err_eof(session, cell_num, tag);
- }
-
- if (0) {
err: if (ret == 0)
ret = WT_ERROR;
}
@@ -494,7 +493,7 @@ __verify_dsk_col_int(
/* Carefully unpack the cell. */
if (__wt_cell_unpack_safe(cell, unpack, dsk, end) != 0)
- return (__err_cell_corrupted(session, cell_num, tag));
+ return (__err_cell_corrupt(session, cell_num, tag));
/* Check the raw and collapsed cell types. */
WT_RET(__err_cell_type(
@@ -506,7 +505,8 @@ __verify_dsk_col_int(
ret = bm->addr_invalid(bm, session, unpack->data, unpack->size);
WT_RET_ERROR_OK(ret, EINVAL);
if (ret == EINVAL)
- return (__err_eof(session, cell_num, tag));
+ return (
+ __err_cell_corrupt_or_eof(session, cell_num, tag));
}
WT_RET(__verify_dsk_memsize(session, tag, dsk, cell));
@@ -564,7 +564,7 @@ __verify_dsk_col_var(
/* Carefully unpack the cell. */
if (__wt_cell_unpack_safe(cell, unpack, dsk, end) != 0)
- return (__err_cell_corrupted(session, cell_num, tag));
+ return (__err_cell_corrupt(session, cell_num, tag));
/* Check the raw and collapsed cell types. */
WT_RET(__err_cell_type(
@@ -579,7 +579,8 @@ __verify_dsk_col_var(
bm, session, unpack->data, unpack->size);
WT_RET_ERROR_OK(ret, EINVAL);
if (ret == EINVAL)
- return (__err_eof(session, cell_num, tag));
+ return (__err_cell_corrupt_or_eof(
+ session, cell_num, tag));
}
/*
@@ -681,11 +682,11 @@ __verify_dsk_chunk(WT_SESSION_IMPL *session,
}
/*
- * __err_cell_corrupted --
+ * __err_cell_corrupt --
* Generic corrupted cell, we couldn't read it.
*/
static int
-__err_cell_corrupted(
+__err_cell_corrupt(
WT_SESSION_IMPL *session, uint32_t entry_num, const char *tag)
{
WT_RET_VRFY(session,
@@ -694,6 +695,20 @@ __err_cell_corrupted(
}
/*
+ * __err_cell_corrupt_or_eof --
+ * Generic corrupted cell or item references non-existent file pages error.
+ */
+static int
+__err_cell_corrupt_or_eof(
+ WT_SESSION_IMPL *session, uint32_t entry_num, const char *tag)
+{
+ WT_RET_VRFY(session,
+ "item %" PRIu32 " on page at %s is a corrupted cell or references "
+ "non-existent file pages",
+ entry_num, tag);
+}
+
+/*
* __err_cell_type --
* Generic illegal cell type for a particular page type error.
*/
@@ -751,16 +766,3 @@ __err_cell_type(WT_SESSION_IMPL *session,
entry_num, tag,
__wt_cell_type_string(cell_type), __wt_page_type_string(dsk_type));
}
-
-/*
- * __err_eof --
- * Generic item references non-existent file pages error.
- */
-static int
-__err_eof(WT_SESSION_IMPL *session, uint32_t entry_num, const char *tag)
-{
- WT_RET_VRFY(session,
- "off-page item %" PRIu32
- " on page at %s references non-existent file pages",
- entry_num, tag);
-}