Excerpts from David Sterba's message of 2011-06-13 13:31:04 -0400:
> smatch reported a dead code. It seems to allow wrong item size counting
> in leaves, as the first for loop does not adjust the maximum number for
> items that would fit in BTRFS_LEAF_DATA_SIZE, and the rest of the code
> works with the wrong value. The value of 'nr' is accompanied with
> accumulating total_data and total_size, which are compared to the leaf
> size and probably prevent this bug to do more harm, but the errorneously
> computed value of 'nr' is later used in moving existing items and lastly
> for setting up the item for new data.
> 
> The bug has a potential to silently corrupt data when leaves are near to
> full, though I'm not aware of any related reports so far.

btrfs_insert_some_items is actually dead code.  I've just deleted it
instead, but you're completely right that this is a bug.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to