Re: [PATCH] Fix "unpack-objects --strict"

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

 



On Thu, Aug 13, 2009 at 12:33:45PM -0700, Junio C Hamano wrote:
> When unpack-objects is run under the --strict option, objects that have
> pointers to other objects are verified for the reachability at the end, by
> calling check_object() on each of them, and letting check_object to walk
> the reachable objects from them using fsck_walk() recursively.
> 
> The function however misunderstands the semantics of fsck_walk() function
> when it makes a call to it, setting itself as the callback.  fsck_walk()
> expects the callback function to return a non-zero value to signal an
> error (negative value causes an immediate abort, positive value is still
> an error but allows further checks on sibling objects) and return zero to
> signal a success.  The function however returned 1 on some non error
> cases, and to cover up this mistake, complained only when fsck_walk() did
> not detect any error.
> 
> To fix this double-bug, make the function return zero on all success
> cases, and also check for non-zero return from fsck_walk() for an error.

I've applied this patch and your small follow-up patch here and the error
indeed disappears. I can't comment on the semantical correctness of the
patch.

Thanks,
-- 
Frank Lichtenheld <frank@xxxxxxxxxxxxxx>
www: http://www.djpig.de/
--
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]