On Tue, 23 Oct 2007 17:58:25 +0800 "Yan Zheng" <[EMAIL PROTECTED]> wrote:
> Hello, > > When we want to extent the size of some item in the tree, the typical > function call sequence is: > ... > btrfs_search_slot((trans, root, key, path, size_to_extent, 1); > ... > btrfs_extend_item(trans, root, path, size_to_extent); > > There is a flaw in codes like this, to guarantee a leaf has enough > free space, 'btrfs_search_slot' may call 'split_leaf' which split the > leaf or insert a empty leaf. When 'split_leaf' insert a empty leaf, > the lowest level of the btrfs_path points to the empty leaf. After > 'btrfs_search_slot' return, 'btrfs_extend_item' is called, it will be > in trouble to extent a non-exist item. Yes, I've fixed a few mistakes in this area, but I think you're right, I need to add a parameter to search_slot that indicates insert vs extend. Thanks for this test case! -chris _______________________________________________ Btrfs-devel mailing list [email protected] http://oss.oracle.com/mailman/listinfo/btrfs-devel
