forked from pool/ocfs2-tools
24 lines
1011 B
Diff
24 lines
1011 B
Diff
|
While running fsck.ocfs2, if an assert is met, fsck.ocfs2 terminates.
|
||
|
This error is still recoverable, because the index of the directory
|
||
|
can be rebuilt. Converting the asserts to an error would return
|
||
|
control to fsck.
|
||
|
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c
|
||
|
===================================================================
|
||
|
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/libocfs2/dir_indexed.c 2013-04-02 04:38:06.444732480 -0500
|
||
|
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c 2013-08-13 09:37:35.120453200 -0500
|
||
|
@@ -1436,9 +1436,11 @@ errcode_t ocfs2_dx_dir_search(ocfs2_file
|
||
|
entry_list = &dx_leaf->dl_list;
|
||
|
}
|
||
|
|
||
|
- assert(entry_list->de_count > 0);
|
||
|
- assert(entry_list->de_num_used > 0);
|
||
|
- assert(dx_root->dr_num_entries > 0);
|
||
|
+ if ((entry_list->de_count == 0) || (entry_list->de_num_used == 0) ||
|
||
|
+ (dx_root->dr_num_entries == 0)) {
|
||
|
+ ret = OCFS2_ET_DIR_CORRUPTED;
|
||
|
+ goto out;
|
||
|
+ }
|
||
|
|
||
|
ret = ocfs2_malloc_block(fs->fs_io, &dir_buf);
|
||
|
if (ret)
|