Re: [PATCH] Don't update unchanged merge entries

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

 



On Sun, 16 Mar 2008, Linus Torvalds wrote:

> In commit 34110cd4e394e3f92c01a4709689b384c34645d8 ("Make 'unpack_trees()' 
> have a separate source and destination index") I introduced a really 
> stupid bug in that it would always add merged entries with the CE_UPDATE 
> flag set. That caused us to always re-write the file, even when it was 
> already up-to-date in the source index.
> 
> Not only is that really stupid from a performance angle, but more 
> importantly it's actively wrong: if we have dirty state in the tree when 
> we merge, overwriting it with the result of the merge will incorrectly 
> overwrite that dirty state.
> 
> This trivially fixes the problem - simply don't set the CE_UPDATE flag 
> when the merge result matches the old state.

While you're at it, you should at least fix the comment. I actually think 
it would be better to have update start out 0 and be set to CE_UPDATE 
after verify_uptodate() and verify_absent(), since those checks are what 
verifies that using CE_UPDATE is okay.

	-Daniel
*This .sig left intentionally blank*
--
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