[Ocfs2-tools-devel] [PATCH 03/44] libocfs2: Add ocfs2_read_refcount_block().

Joel Becker Joel.Becker at oracle.com
Thu Dec 31 12:24:35 PST 2009


On Thu, Dec 31, 2009 at 10:27:30PM +0800, Tao Ma wrote:
> >>>+	if (ret == 0 && rb->rf_list.l_next_free_rec > rb->rf_list.l_count)
> >>>+		ret = OCFS2_ET_CORRUPT_EXTENT_BLOCK;
> oh, actually here is a bug. rf_list is only valid in case it is a
> tree, not a leaf refcount block.
> We can't test this until we trust the flag.
> So my opinion here is that we remove this check and rename
> ocfs2_read_refcount_block_no_check to ocfs2_read_refcount_block.

	While checking each field for sanity isn't really the
mission of non-fsck programs anyway.  If the value is bad, though, how
do we keep folks from walking off the end...ok, the swapping code uses
ocfs2_swap_barrier().
	I can see why fsck doesn't want the check.  It wants to be able
to get the block and fix the field.  Good to remember.  But do we want
other programs to walk off the end?  Same goes for inline data size when
reading an inode, and other things.  Heck, we don't even check
next_free_rec when reading inodes.

Joel

-- 

"To announce that there must be no criticism of them president, or
 that we are to stand by the president, right or wrong, is not only
 unpatriotic and servile, but is morally treasonable to the American
 public."
	- Theodore Roosevelt

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list