fsck.reiser4 assertion failure
Hello, Dorin,
Quoted 6 lines · Dorin Popa
Hi,
I use reiser4progs 0.4.20 with repair_fs_open.patch (I had the same problem as David Masover, but the patch fixed it). It seems that fsck.reiser4 encounters some internal error condition. Please see the fsck.reiser4 output in the attached file.
yes, I have fixed this bug yesterday. The patch attached includes the previous patch with all other important fixes for fsck.reiser4 against 0.4.20.
Thank you for the report anyway,
Vitaly Fertman
librepair/filesystem.c +31 -29
@@ -48,11 +48,36 @@ goto error_format_close; } + len =reiser4_format_get_len (repair->fs->format); + +/* Block and oid allocator plugins are specified by format plugin +* unambiguously, so there is nothing to be checked here anymore. */ +if (!(repair->fs->alloc =reiser4_alloc_open (repair->fs, len))) { +aal_fatal ("Failed to open a block allocator." ); + res = -EINVAL ; + goto error_status_close; + } + +if ((error =reiser4_alloc_valid (repair->fs->alloc)) <0 ) + goto error_alloc_close; + +if (error && repair->mode !=RM_CHECK ) { +aal_mess ("Checksums will be fixed later.\n" ); + }else { + res |= error; + } + +if (!(repair->fs->oid =reiser4_oid_open (repair->fs))) { +aal_fatal ("Failed to open an object id allocator." ); + res = -EINVAL ; + goto error_alloc_close; + } + res |=repair_journal_open (repair->fs, journal_device, repair->mode);if (repair_error_fatal (res)) {aal_fatal ("Failed to open the journal." ); - goto error_status_close; + goto error_oid_close; } res |=repair_journal_replay (repair->fs->journal, repair->fs->device);
@@ -69,48 +94,25 @@ "replaying."); goto error_journal_close; } - - len =reiser4_format_get_len (repair->fs->format); - -/* Block and oid allocator plugins are specified by format plugin -* unambiguously, so there is nothing to be checked here anymore. */ -if (!(repair->fs->alloc =reiser4_alloc_open (repair->fs, len))) { -aal_fatal ("Failed to open a block allocator." ); - res = -EINVAL ; - goto error_journal_close; - } -if ((res |= error =reiser4_alloc_valid (repair->fs->alloc)) <0 ) - goto error_alloc_close; - -if (error && repair->mode !=RM_CHECK ) -aal_mess ("Checksums will be fixed later.\n" ); - -if (!(repair->fs->oid =reiser4_oid_open (repair->fs))) { -aal_fatal ("Failed to open an object id allocator." ); - res = -EINVAL ; - goto error_alloc_close; - } -if (!(repair->fs->tree =reiser4_tree_init (repair->fs))) { res = -ENOMEM ; - goto error_oid_close; + goto error_journal_close; } -repair_error_count (repair, res);return 0 ; +error_journal_close: +reiser4_journal_close (repair->fs->journal); + repair->fs->journal =NULL ; + error_oid_close:reiser4_tree_fini (repair->fs->tree); error_alloc_close:reiser4_alloc_close (repair->fs->alloc); repair->fs->alloc =NULL ; - - error_journal_close: -reiser4_journal_close (repair->fs->journal); - repair->fs->journal =NULL ; error_status_close:reiser4_status_close (repair->fs->status);
librepair/item.c +0 -1
@@ -81,7 +81,6 @@aal_assert ("vpf-795" , mode !=RM_CHECK || length == place->len); -aal_assert ("vpf-796" , length == place->len || res);return repair_item_check_fini (place, res, length); }
plugin/item/extent40/extent40_repair.c +11 -8
@@ -21,7 +21,7 @@ ET40_TAIL = 1 << 4 } merge_flag_t; -static int extent40_merge_units (reiser4_place_t *place) { +static int extent40_merge_units (reiser4_place_t *place,int fix) {uint32_t i, count, merged;extent40_t *extent;
@@ -38,11 +38,14 @@et40_set_width (extent -1 ,et40_get_width (extent -1 ) +et40_get_width (extent)); -extent40_shrink (place, i,1 ); - count--; merged++; - extent--; - i--; + +if (fix) { +extent40_shrink (place, i,1 ); + count--; + extent--; + i--; + } } }
@@ -93,7 +96,7 @@ result =RE_FIXABLE ; } - units =extent40_merge_units (place); + units =extent40_merge_units (place, mode !=RM_CHECK );if (units) { aal_error("Node (%llu), item (%u): %u mergable units were "
@@ -168,7 +171,7 @@ res |=RE_FIXABLE ; } - units =extent40_merge_units (place); + units =extent40_merge_units (place, mode !=RM_CHECK );if (units) { aal_error("Node (%llu), item (%u): %u mergable units were "
@@ -441,7 +444,7 @@ }/* Join mergable units within the @place. */ - hint->len =extent40_merge_units (place) *sizeof (extent40_t); + hint->len =extent40_merge_units (place,1 ) *sizeof (extent40_t);place_mkdirty (place);
Hi,
I use reiser4progs 0.4.20 with repair_fs_open.patch (I had the same problem as David Masover, but the patch fixed it). It seems that fsck.reiser4 encounters some internal error condition. Please see the fsck.reiser4 output in the attached file.
Signature · 2 lines
Thanks, Dorin Popa
Fscking the /dev/hda8 block device.
Will check the consistency of the Reiser4 SuperBlock. Will build the Reiser4 FileSystem.
Continue?
(Yes/No): ***** Openning the fs.
Reiser4 fs was detected on the /dev/hda8. Master super block (16):
magic: R4Sb
blksize: 4096
format: 0x0 (format40)
label: usr
Format super block (17):
plugin: format40
description: Disk-format for reiser4, ver. 0.4.20
magic: R4Sb-Default
flushes: 0
mkfs id: 0x1f15877c
blocks: 985981
free blocks: 255430
root block: 30
tail policy: 0x4 (smart)
next oid: 0xebc9f
file count: 126144
tree height: 4
key policy: LARGE
***** Tree Traverse Pass: scanning the reiser4 internal tree.
Read nodes 94104 Nodes left in the tree 94104 Leaves of them 92356, Twigs of them 1717 Time interval: Thu Dec 25 18:16:44 2003 - Thu Dec 25 18:18:05 2003
***** TwigScan Pass: checking extent pointers of all twigs.
Read twigs 1717 Time interval: Thu Dec 25 18:18:05 2003 - Thu Dec 25 18:18:08 2003
***** DiskScan Pass: scanning the partition for unconnected nodes.
Read nodes 21732 Good nodes 45 Leaves of them 37, Twigs of them 8 Time interval: Thu Dec 25 18:18:09 2003 - Thu Dec 25 18:18:11 2003
***** TwigScan Pass: checking extent pointers of all twigs.
vpf-796: Assertion (length == place->len || res) at item.c:84 in function repair_item_check_layout() failed.