[Ocfs2-tools-devel] a patch for fswreck of ocfs2-tools

tao.ma tao.ma at oracle.com
Tue Aug 29 01:35:13 PDT 2006


Hi all,
    There is a tool named fswreck in ocfs2-tools. It is designed to 
corrupt the disk and verify fsck.ocfs2's function. This patch is the 
first part of fswreck I modify for creating error of EB_BLKNO, EB_GEN, 
EB_GEN_FIX, EXTENT_EB_INVALID,EXTENT_LIST_DEPTH, EXTENT_LIST_COUNT, 
EXTENT_LIST_FREE, EXTENT_BLKNO_UNALIGNED, EXTENT_CLUSTERS_OVERRUN, 
EXTENT_BLKNO_RANGE.
Because there are too many error types(more than 70) that fsck.ocfs2 
want to correct, so I divide them to different groups and corrupt them 
group by group(For group information, please refer to fsck_type.h I add).
the usage of this program is fswreck -c num devicename. Since there are 
already 12 types of corrupt before my work, my group corruption starts 
from 13.

This patch corrupt the following groups:
13 - extent block error: EB_BLKNO, EB_GEN, EB_GEN_FIX, EXTENT_EB_INVALID
14 - extent list error: EXTENT_LIST_DEPTH, EXTENT_LIST_COUNT, 
EXTENT_LIST_FREE
15 - extent record error: EXTENT_BLKNO_UNALIGNED, 
EXTENT_CLUSTERS_OVERRUN, EXTENT_BLKNO_RANGE

So if you input "fswreck -c 13 /dev/sdb1", it will corrput /dev/sdb1 and 
make errors of EB_BLKNO, EB_GEN, EB_GEN_FIX, EXTENT_EB_INVALID. For 14 
and 15, they are similiar. Please note that /dev/sdb1 must be formatted 
as ocfs2 before we run the tool.

I also add a flag in ocfs2_filesys for the convenience of creating a 
file with extent blocks. With this flag, we can easily make a file use 
extent block and this file will not take much disk space. And since now 
this flag is only set by my fswreck, I think this will not affect other 
lib functions.

This patch is a bit longer, so please be patient to review it. :)


-- 
* **     Tao Ma
*     Member of Techincal Staff *

Oracle Asia Development Center
Emerging Technology & Solution Development
*
Tel:        +86 10 8278 6026
Mobile:   +86 13701237602         
URL:       OADC Intranet <http://cdc.oraclecorp.com/>, Oracle.com/cdc 
<http://www.oracle.com/cdc/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: corrupt_extent.patch
Type: text/x-patch
Size: 24146 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-tools-devel/attachments/20060829/ea08028e/corrupt_extent-0001.bin


More information about the Ocfs2-tools-devel mailing list