Re: [PATCH 1/4] add generic, type aware object chain walker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mkoegler@xxxxxxxxxxxxxxxxx (Martin Koegler) writes:

> On Sun, Feb 24, 2008 at 07:08:39PM -0800, Junio C Hamano wrote:
> ...
>> > +	while (parents) {
>> > +		result = walk((struct object*)parents->item, OBJ_COMMIT, data);
>> > +		if (result)
>> > +			return result;
>> > +		parents = parents->next;
>> > +	}
>> > +	return 0;
>> > +}
>> 
>> Hmm.  For the purpose of proving there is _no_ error (or an
>> error or more), it would be Ok to return early like this, but
>> won't there be cases where you would want to get as many
>> coverage as possible?
>> 
>> For example, I do not think you can use this to mark reachable
>> objects.  Even if you find error walking the first parent
>> history, you would want to still mark a healthy second parent
>> history reachable.
>
> How should I define the return value of fsck_walk in the presence of
> multiple errors?

Returning error is fine.  That is not what I was talking about.

I was talking about an early return in the code, that does not
callback once you find an error.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux