[Btrfs-devel] I'm confused by set_extent_bit

Yan Zheng yanzheng at 21cn.com
Mon Sep 10 08:27:52 PDT 2007


Hi,  Chris

I'm confused by following code fragment in set_extent_bit. the last
statement 'goto out' in the body of test looks very strange.I think if
goto label 'out'  there,  bits for range [start, state->start]  aren't
set.  Perhaps the order of this test and next one should exchange.

	if (state->start <= end && state->end > end) {
		set = state->state & bits;
		if (exclusive && set) {
			*failed_start = start;
			err = -EEXIST;
			goto out;
		}
		err = split_state(tree, state, prealloc, end + 1);
		BUG_ON(err == -EEXIST);

		prealloc->state |= bits;
		merge_state(tree, prealloc);
		prealloc = NULL;
		goto out;
	}

Regards
YZ



More information about the Btrfs-devel mailing list