git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Utsav Shah via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Utsav Shah <ukshah2@illinois.edu>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/1] fsmonitor: skip sanity check if the index is split
Date: Fri, 08 Nov 2019 07:09:19 +0000	[thread overview]
Message-ID: <pull.458.git.1573196960.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2019-11-08  7:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08  7:09 Utsav Shah via GitGitGadget [this message]
2019-11-08  7:09 ` [PATCH 1/1] fsmonitor: skip sanity check if the index is split Utsav Shah via GitGitGadget
2019-11-12 11:18   ` SZEDER Gábor
2019-11-12 21:08     ` Utsav Shah
2019-11-11  1:43 ` [PATCH 0/1] " Junio C Hamano
2019-11-11  2:01   ` Junio C Hamano
2019-11-11 16:55     ` Kevin Willford
2019-11-11 17:25       ` Utsav Shah
2019-11-11 18:21         ` Kevin Willford
2019-11-11 17:30       ` William Baker
2019-11-13  1:30       ` Junio C Hamano
2019-11-14  2:55         ` Utsav Shah
2019-11-14 16:41         ` William Baker
2019-11-15  5:04           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.458.git.1573196960.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ukshah2@illinois.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).