[btrfs-devel][patch]fix for btrfs_truncate_in_trans

Yan Zheng yanzheng at 21cn.com
Mon Sep 17 08:31:12 PDT 2007


Hello

I think I find another bug in btrfs_truncate_in_trans. following code
is copy from btrfs_truncate_in_trans. It's seem that the 'break' makes
the function exit premature,
In my test(create a 1M extent, then truncate it to 512K) , the
function exits when csum item is encountered.  Remove the 'break'
makes things even worse, when do ftruncate operation, system hangs
immediately. I'll try to fix it tomorrow if you agree :)

if (del_item) {
	ret = btrfs_del_item(trans, root, path);
	if (ret)
		goto error;
} else {
	break;
}

Regards
YZ



More information about the Btrfs-devel mailing list