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

Re: [PATCH 0/1] fsmonitor: skip sanity check if the index is split

From
WBWilliam Baker <williamtbakeremail@gmail.com>
Date
Nov 11, 2019, 17:30 UTC
Message-ID
<ba3736b8-9f44-5438-36c3-213d8a3d621e@gmail.com>
In-Reply-To
<BN6PR21MB07869E8D1DCAF189C4E472A891740@BN6PR21MB0786.namprd21.prod.outlook.com>
On 11/11/19 8:55 AM, Kevin Willford wrote:
Show 24 quoted lines
>>
>> The istate->cache[] is a dynamic array whose size is managed via the usual
>> ALLOC_GROW() using istate->cache_nr and istate->cache_alloc, whether the
>> split-index feature is in use.  When your patch makes a difference, then,
>> doesn't the access to istate->cache[] pick up a random garbage and then flip
>> the bit?
>>
>> Puzzled...  In any case, "check is worse than over-eager, it simply is wrong" I
>> wrote in the message I am responding to is totally incorrect, it seems.  It
>> smells like lifting the check would just hide the underlying problem under the
>> rug?
> 
> I agree.  The only 2 places that excluding the split-index make sense are in
> read_fsmonitor_extension and write_fsmonitor_extension because the
> index_state that is being passing into those methods could be the delta index
> in which case the number of entries for the fsmonitor bitmap would almost
> always be more and cause the BUG to be hit which it should not be.
> 
> The reason it is not needed and should not be in the other 2 places is they
> are ran from tweak_fsmonitor which is ran at post_read_index_from which
> is after the base and delta indexes have been loaded into the indes_state and
> the index_state will have all the entries and if the fsmonitor bitmap is bigger
> than the number of entries then the BUG should be hit. 
> 

I agree. While working on the 3444ec2e patch I missed that read_fsmonitor_extension and write_fsmonitor_extension could be called with the delta index rather than the full index.

I think it makes sense to leave the check in the other two places.

Thanks, William

Previous: Kevin WillfordNext: Junio C Hamano
Message 10 of 14 in “fsmonitor: skip sanity check if the index is split”
  1. 0/1 fsmonitor: skip sanity check if the index is splitUtsav Shah via GitGitGadget, Nov 8, 2019
  2. 1/1 fsmonitor: skip sanity check if the index is splitUtsav Shah via GitGitGadget, Nov 8, 2019
  3. SZEDER GáborNov 12, 2019
  4. Utsav ShahNov 12, 2019
  5. Junio C HamanoNov 11, 2019
  6. Junio C HamanoNov 11, 2019
  7. Kevin WillfordNov 11, 2019
  8. Utsav ShahNov 11, 2019
  9. Kevin WillfordNov 11, 2019
  10. William BakerNov 11, 2019
  11. Junio C HamanoNov 13, 2019
  12. Utsav ShahNov 14, 2019
  13. William BakerNov 14, 2019
  14. Junio C HamanoNov 15, 2019

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.