[Ocfs2-tools-devel] A patch for fsck.ocfs2 of ocfs2-tools:Add clearing block mechanism for pass1

tao.ma tao.ma at oracle.com
Tue Oct 24 00:40:55 PDT 2006


 In  pass1 of fsck.ocfs2, when o2fsck_check_blocks find the need to 
clear an inode,
currently only i_links_count is set to 0. It is not enough as you can 
see from the
comments.
The old codes look like these.
 /*
     * XXX we should have a helper that clears an inode and backs it out of
     * any book-keeping that it might have been included in, as though it
     * was never seen.  the alternative is to restart pass1 which seems
     * goofy.
     */
    if (vb.vb_clear) {
        di->i_links_count = 0;
        o2fsck_icount_set(ost->ost_icount_in_inodes, di->i_blkno,
                  di->i_links_count);
        di->i_dtime = time(NULL);
        o2fsck_write_inode(ost, di->i_blkno, di);
        /* XXX clear valid flag and stuff? */
    }

So this patch try to add the helper function and clear the inode and its 
stuff.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clear_block.patch
Type: text/x-patch
Size: 6387 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-tools-devel/attachments/20061024/6714db64/clear_block.bin


More information about the Ocfs2-tools-devel mailing list