git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Prevent git from rehashing 4GBi files

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2022, 16:36 UTC
Message-ID
<xmqqr156obxg.fsf@gitster.g>
In-Reply-To
<f3f883cb-9141-6871-0f3d-3d3293a17f5f@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
Show 12 quoted lines
> This "Munge" above isn't telling the reader 'why'/'what' is going on.
> The comment should in some way highlight that a zero size result is
> special, and that we have the roll over issue when the stored in 32 bits
> - the double duty of racy vs changed in the stat data heuristic.
> Synonyms of 'munge' ?
>
>
>> + */
>> +unsigned int munge_st_size(off_t st_size) {
>> +	unsigned int sd_size = st_size;
>> +
>> +	if(!sd_size && st_size)
Style.
>> +		return 0x80000000;
>> +	else
>> +		return sd_size;
>> +}

This may treat non-zero multiple of 4GiB as "not racy", but has anybody double checked the concern Réne brought up earlier that a 4GiB file that was added and then got rewritten to 2GiB within the same second would suddenly start getting treated as not racy?

The patch (the firnal version of it anyway) needs to be accompanied by a handful of test additions to tickle corner cases like that.

Thanks, all, for working on this.
Previous: Philip OakleyNext: Philip Oakley
Message 4 of 6 in “Prevent git from rehashing 4GBi files”
  1. Prevent git from rehashing 4GBi filesJason Hatton, May 6, 2022
  2. Torsten BögershausenMay 6, 2022
  3. Philip OakleyMay 6, 2022
  4. Junio C HamanoMay 6, 2022
  5. Philip OakleyMay 6, 2022
  6. Junio C HamanoMay 6, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.