From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: peff@peff.net, dstolee@microsoft.com
Subject: [PATCH 0/4] midx: verify MIDX checksum before reusing
Date: Wed, 23 Jun 2021 14:39:04 -0400 [thread overview]
Message-ID: <cover.1624473543.git.me@ttaylorr.com> (raw)
Here is a small series that came out of a corruption we noticed at GitHub. The
corruption is described in the third patch, but the gist is this:
- After writing a MIDX, we experience a disk failure that corrupts the
contents of the repository's MIDX.
- We later go to write another MIDX, notice that one is already there, and
then blindly reuse its data without checking its validity, resulting in a
MIDX that contains corrupt data, but whose trailing checksum matches the
preceding contents.
This series checks the validity of the trailing checksum when reusing a MIDX
while writing a new one, as well as a few other related fix-ups. That should be
sufficient to avoid propagating corrupt data forward while writing a MIDX.
We could go further here and run 'git multi-pack-index verify' on the existing
MIDX while writing a new one, but the point of this reuse is to avoid having to
re-compute/verify the contents of an existing MIDX. So a more lightweight option
is pursued here, but alternatives are discussed in 3/4.
Thanks in advance for your review.
Taylor Blau (4):
csum-file: introduce checksum_valid()
commit-graph: rewrite to use checksum_valid()
midx: don't reuse corrupt MIDXs when writing
midx: report checksum mismatches during 'verify'
commit-graph.c | 14 ++++++--------
csum-file.c | 16 ++++++++++++++++
csum-file.h | 3 +++
midx.c | 13 +++++++++++++
pack-check.c | 11 +----------
t/t5319-multi-pack-index.sh | 13 +++++++++++++
6 files changed, 52 insertions(+), 18 deletions(-)
--
2.31.1.163.ga65ce7f831
next reply other threads:[~2021-06-23 18:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 18:39 Taylor Blau [this message]
2021-06-23 18:39 ` [PATCH 1/4] csum-file: introduce checksum_valid() Taylor Blau
2021-06-24 19:42 ` Jeff King
2021-06-23 18:39 ` [PATCH 2/4] commit-graph: rewrite to use checksum_valid() Taylor Blau
2021-06-24 19:42 ` Jeff King
2021-06-23 18:39 ` [PATCH 3/4] midx: don't reuse corrupt MIDXs when writing Taylor Blau
2021-06-24 20:00 ` Jeff King
2021-06-23 18:39 ` [PATCH 4/4] midx: report checksum mismatches during 'verify' Taylor Blau
2021-06-24 4:22 ` Bagas Sanjaya
2021-06-24 20:10 ` Jeff King
2021-11-10 23:11 ` SZEDER Gábor
2021-11-11 10:05 ` Jeff King
2021-11-16 21:10 ` Taylor Blau
2021-11-16 21:38 ` [PATCH] t5319: corrupt more bytes of the midx checksum Jeff King
2021-11-16 21:43 ` Taylor Blau
2021-11-16 22:12 ` Derrick Stolee
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1624473543.git.me@ttaylorr.com \
--to=me@ttaylorr.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.