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

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

From
Utsav Shah via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 8, 2019, 07:09 UTC
Message-ID
<pull.458.git.1573196960.gitgitgadget@gmail.com>

The checks added in 3444ec2 to ensure that the fsmonitor_dirty bitmap does not have more bits than the index do not play well with the split index.

git update-index --fsmonitor --split-index calls write_locked_index which calls write_shared_index as well as write_split_index. The first call fills up the fsmonitor_dirty bitmap, and the second modifies the index such that istate->cache_nr is zero and this assert is hit.

The test written does reproduce the error, but only flakily. There is limited difference with GIT_TEST_FSMONITOR=fsmonitor-all or GIT_TEST_FSMONITOR=fsmonitor-watchman, so the flakiness might come from somewhere else, which I haven't tracked down.

The test also requires checkout of a new branch, and checking out back to master. It's clear that the index gets into some poor state through these operations, and there is a deeper bug somewhere.

At the very least, this patch mitigates an over-eager check for split index users while maintaining good invariants for the standard case. Also, I haven't been able to reproduce this with "standard" user commands, like status/checkout/stash, so the blast radius seems limited.

Helped-by: Kevin Willford kewillf@microsoft.com [kewillf@microsoft.com]
Helped-by: Junio C Hamano gitster@pobox.com [gitster@pobox.com]
Signed-off-by: Utsav Shah utsav@dropbox.com [utsav@dropbox.com]
Utsav Shah (1):
  fsmonitor: skip sanity check if the index is split
 fsmonitor.c                 |  8 ++++----
 t/t7519-status-fsmonitor.sh | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+), 4 deletions(-)
base-commit: 566a1439f6f56c2171b8853ddbca0ad3f5098770
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-458%2FUtsav2%2Fsplit-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-458/Utsav2/split-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/458
-- 
gitgitgadget
Next: Utsav Shah via GitGitGadget
Message 1 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.