{"thread":{"id":"45798","subject":"[PATCH v8] read-cache: call verify_hdr() in a background thread","startedAt":"2017-04-25T18:41:32Z","lastAt":"2017-04-27T00:41:10Z","messageCount":7,"participants":["git@jeffhostetler.com","Junio C Hamano","Jeff Hostetler"],"isPatch":true,"patchVersion":8,"patchTotal":null},"messages":[{"id":"317827","messageId":"20170425184109.46168-1-git@jeffhostetler.com","threadId":"45798","inReplyTo":null,"subject":"[PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"","fromEmail":"git@jeffhostetler.com","sentAt":"2017-04-25T18:41:08Z","receivedAt":"2017-04-25T18:41:32Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Jeff Hostetler <jeffhost@microsoft.com>\n\nVersion 8 of this patch converts the unit test to use\nperl to corrupt the index checksum (rather than altering\na filename) and also verifies the fsck error message as\nsuggested in response to v7 on the mailing list.\n\nIf there are no other suggestions, I think this version\nshould be considered final.\n\n\nJeff Hostetler (1):\n  read-cache: force_verify_index_checksum\n\n builtin/fsck.c  |  1 +\n cache.h         |  2 ++\n read-cache.c    |  7 +++++++\n t/t1450-fsck.sh | 32 ++++++++++++++++++++++++++++++++\n 4 files changed, 42 insertions(+)\n\n-- \n2.9.3\n\n"},{"id":"317828","messageId":"20170425184109.46168-2-git@jeffhostetler.com","threadId":"45798","inReplyTo":"20170425184109.46168-1-git@jeffhostetler.com","subject":"[PATCH v8] read-cache: force_verify_index_checksum","fromName":"","fromEmail":"git@jeffhostetler.com","sentAt":"2017-04-25T18:41:09Z","receivedAt":"2017-04-25T18:41:33Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Jeff Hostetler <jeffhost@microsoft.com>\n\nTeach git to skip verification of the SHA1-1 checksum at the end of\nthe index file in verify_hdr() which is called from read_index()\nunless the \"force_verify_index_checksum\" global variable is set.\n\nTeach fsck to force this verification.\n\nThe checksum verification is for detecting disk corruption, and for\nsmall projects, the time it takes to compute SHA-1 is not that\nsignificant, but for gigantic repositories this calculation adds\nsignificant time to every command.\n\nThese effect can be seen using t/perf/p0002-read-cache.sh:\n\nTest                                          HEAD~1            HEAD\n--------------------------------------------------------------------------------------\n0002.1: read_cache/discard_cache 1000 times   0.66(0.44+0.20)   0.30(0.27+0.02) -54.5%\n\nSigned-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n---\n builtin/fsck.c  |  1 +\n cache.h         |  2 ++\n read-cache.c    |  7 +++++++\n t/t1450-fsck.sh | 32 ++++++++++++++++++++++++++++++++\n 4 files changed, 42 insertions(+)\n\ndiff --git a/builtin/fsck.c b/builtin/fsck.c\nindex 1a5cacc..5512d06 100644\n--- a/builtin/fsck.c\n+++ b/builtin/fsck.c\n@@ -771,6 +771,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (keep_cache_objects) {\n+\t\tverify_index_checksum = 1;\n \t\tread_cache();\n \t\tfor (i = 0; i < active_nr; i++) {\n \t\t\tunsigned int mode;\ndiff --git a/cache.h b/cache.h\nindex 80b6372..87f13bf 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -685,6 +685,8 @@ extern void update_index_if_able(struct index_state *, struct lock_file *);\n extern int hold_locked_index(struct lock_file *, int);\n extern void set_alternate_index_output(const char *);\n \n+extern int verify_index_checksum;\n+\n /* Environment bits from configuration mechanism */\n extern int trust_executable_bit;\n extern int trust_ctime;\ndiff --git a/read-cache.c b/read-cache.c\nindex 9054369..c4205aa 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1371,6 +1371,9 @@ struct ondisk_cache_entry_extended {\n \t\t\t    ondisk_cache_entry_extended_size(ce_namelen(ce)) : \\\n \t\t\t    ondisk_cache_entry_size(ce_namelen(ce)))\n \n+/* Allow fsck to force verification of the index checksum. */\n+int verify_index_checksum;\n+\n static int verify_hdr(struct cache_header *hdr, unsigned long size)\n {\n \tgit_SHA_CTX c;\n@@ -1382,6 +1385,10 @@ static int verify_hdr(struct cache_header *hdr, unsigned long size)\n \thdr_version = ntohl(hdr->hdr_version);\n \tif (hdr_version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < hdr_version)\n \t\treturn error(\"bad index version %d\", hdr_version);\n+\n+\tif (!verify_index_checksum)\n+\t\treturn 0;\n+\n \tgit_SHA1_Init(&c);\n \tgit_SHA1_Update(&c, hdr, size - 20);\n \tgit_SHA1_Final(sha1, &c);\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 33a51c9..eff1cd6 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -689,4 +689,36 @@ test_expect_success 'bogus head does not fallback to all heads' '\n \t! grep $blob out\n '\n \n+# Corrupt the checksum on the index.\n+# Add 1 to the last byte in the SHA.\n+corrupt_index_checksum () {\n+    perl -w -e '\n+\tuse Fcntl \":seek\";\n+\topen my $fh, \"+<\", \".git/index\" or die \"open: $!\";\n+\tbinmode $fh;\n+\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n+\tread $fh, my $in_byte, 1 or die \"read: $!\";\n+\n+\t$in_value = unpack(\"C\", $in_byte);\n+\t$out_value = ($in_value + 1) & 255;\n+\n+\t$out_byte = pack(\"C\", $out_value);\n+\n+\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n+\tprint $fh $out_byte;\n+\tclose $fh or die \"close: $!\";\n+    '\n+}\n+\n+# Corrupt the checksum on the index and then\n+# verify that only fsck notices.\n+test_expect_success 'detect corrupt index file in fsck' '\n+\tcp .git/index .git/index.backup &&\n+\ttest_when_finished \"mv .git/index.backup .git/index\" &&\n+\tcorrupt_index_checksum &&\n+\ttest_must_fail git fsck --cache 2>expect &&\n+\tgrep \"bad index file\" expect &&\n+\tgit status\n+'\n+\n test_done\n-- \n2.9.3\n\n"},{"id":"317900","messageId":"xmqqd1bzst95.fsf@gitster.mtv.corp.google.com","threadId":"45798","inReplyTo":"20170425184109.46168-1-git@jeffhostetler.com","subject":"Re: [PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-26T04:11:18Z","receivedAt":"2017-04-26T04:11:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"git@jeffhostetler.com writes:\n\n> From: Jeff Hostetler <jeffhost@microsoft.com>\n>\n> Version 8 of this patch converts the unit test to use\n> perl to corrupt the index checksum (rather than altering\n> a filename) and also verifies the fsck error message as\n> suggested in response to v7 on the mailing list.\n>\n> If there are no other suggestions, I think this version\n> should be considered final.\n\nOops.  The earlier one has already been in 'master' for a few days.\nLet's make this an incremental update.  \n\nIs the description in the following something you are OK with (so\nthat I can add your sign-off)?\n\nThanks.\n\n-- >8 --\nFrom: Jeff Hostetler <jeffhost@microsoft.com>\nDate: Tue, 25 Apr 2017 18:41:09 +0000\nSubject: t1450: avoid use of \"sed\" on the index, which is a binary file\n\nThe previous step added a path zzzzzzzz to the index, and then used\n\"sed\" to replace this string to yyyyyyyy to create a test case where\nthe checksum at the end of the file does not match the contents.\n\nUnfortunately, use of \"sed\" on a non-text file is not portable.\nInstead, use a Perl script that seeks to the end and modifies the\nlast byte of the file (where we _know_ stores the trailing\nchecksum).\n\n\n---\n t/t1450-fsck.sh | 33 ++++++++++++++++++++++++++-------\n 1 file changed, 26 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\nindex 677e15a7a4..eff1cd68e9 100755\n--- a/t/t1450-fsck.sh\n+++ b/t/t1450-fsck.sh\n@@ -689,16 +689,35 @@ test_expect_success 'bogus head does not fallback to all heads' '\n \t! grep $blob out\n '\n \n+# Corrupt the checksum on the index.\n+# Add 1 to the last byte in the SHA.\n+corrupt_index_checksum () {\n+    perl -w -e '\n+\tuse Fcntl \":seek\";\n+\topen my $fh, \"+<\", \".git/index\" or die \"open: $!\";\n+\tbinmode $fh;\n+\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n+\tread $fh, my $in_byte, 1 or die \"read: $!\";\n+\n+\t$in_value = unpack(\"C\", $in_byte);\n+\t$out_value = ($in_value + 1) & 255;\n+\n+\t$out_byte = pack(\"C\", $out_value);\n+\n+\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n+\tprint $fh $out_byte;\n+\tclose $fh or die \"close: $!\";\n+    '\n+}\n+\n+# Corrupt the checksum on the index and then\n+# verify that only fsck notices.\n test_expect_success 'detect corrupt index file in fsck' '\n \tcp .git/index .git/index.backup &&\n \ttest_when_finished \"mv .git/index.backup .git/index\" &&\n-\techo zzzzzzzz >zzzzzzzz &&\n-\tgit add zzzzzzzz &&\n-\tsed -e \"s/zzzzzzzz/yyyyyyyy/\" .git/index >.git/index.yyy &&\n-\tmv .git/index.yyy .git/index &&\n-\t# Confirm that fsck detects invalid checksum\n-\ttest_must_fail git fsck --cache &&\n-\t# Confirm that status no longer complains about invalid checksum\n+\tcorrupt_index_checksum &&\n+\ttest_must_fail git fsck --cache 2>expect &&\n+\tgrep \"bad index file\" expect &&\n \tgit status\n '\n \n"},{"id":"317901","messageId":"xmqq8tmnss66.fsf@gitster.mtv.corp.google.com","threadId":"45798","inReplyTo":"xmqqd1bzst95.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-26T04:34:41Z","receivedAt":"2017-04-26T04:34:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> git@jeffhostetler.com writes:\n>\n>> From: Jeff Hostetler <jeffhost@microsoft.com>\n>>\n>> Version 8 of this patch converts the unit test to use\n>> perl to corrupt the index checksum (rather than altering\n>> a filename) and also verifies the fsck error message as\n>> suggested in response to v7 on the mailing list.\n>>\n>> If there are no other suggestions, I think this version\n>> should be considered final.\n>\n> Oops.  The earlier one has already been in 'master' for a few days.\n> Let's make this an incremental update.  \n>\n> Is the description in the following something you are OK with (so\n> that I can add your sign-off)?\n>\n> Thanks.\n\nBy the way, I said I am fine with the two-liner version in Dscho's\nmessage, but I am also OK with this version that does not use a\nseparate dd and instead does everything in a single invocation of\nPerl.  As long as you've tested this version, there is no point\nreplacing it with yet another one.\n\nThanks.\n\n> -- >8 --\n> From: Jeff Hostetler <jeffhost@microsoft.com>\n> Date: Tue, 25 Apr 2017 18:41:09 +0000\n> Subject: t1450: avoid use of \"sed\" on the index, which is a binary file\n>\n> The previous step added a path zzzzzzzz to the index, and then used\n> \"sed\" to replace this string to yyyyyyyy to create a test case where\n> the checksum at the end of the file does not match the contents.\n>\n> Unfortunately, use of \"sed\" on a non-text file is not portable.\n> Instead, use a Perl script that seeks to the end and modifies the\n> last byte of the file (where we _know_ stores the trailing\n> checksum).\n>\n>\n> ---\n>  t/t1450-fsck.sh | 33 ++++++++++++++++++++++++++-------\n>  1 file changed, 26 insertions(+), 7 deletions(-)\n>\n> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\n> index 677e15a7a4..eff1cd68e9 100755\n> --- a/t/t1450-fsck.sh\n> +++ b/t/t1450-fsck.sh\n> @@ -689,16 +689,35 @@ test_expect_success 'bogus head does not fallback to all heads' '\n>  \t! grep $blob out\n>  '\n>  \n> +# Corrupt the checksum on the index.\n> +# Add 1 to the last byte in the SHA.\n> +corrupt_index_checksum () {\n> +    perl -w -e '\n> +\tuse Fcntl \":seek\";\n> +\topen my $fh, \"+<\", \".git/index\" or die \"open: $!\";\n> +\tbinmode $fh;\n> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n> +\tread $fh, my $in_byte, 1 or die \"read: $!\";\n> +\n> +\t$in_value = unpack(\"C\", $in_byte);\n> +\t$out_value = ($in_value + 1) & 255;\n> +\n> +\t$out_byte = pack(\"C\", $out_value);\n> +\n> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n> +\tprint $fh $out_byte;\n> +\tclose $fh or die \"close: $!\";\n> +    '\n> +}\n> +\n> +# Corrupt the checksum on the index and then\n> +# verify that only fsck notices.\n>  test_expect_success 'detect corrupt index file in fsck' '\n>  \tcp .git/index .git/index.backup &&\n>  \ttest_when_finished \"mv .git/index.backup .git/index\" &&\n> -\techo zzzzzzzz >zzzzzzzz &&\n> -\tgit add zzzzzzzz &&\n> -\tsed -e \"s/zzzzzzzz/yyyyyyyy/\" .git/index >.git/index.yyy &&\n> -\tmv .git/index.yyy .git/index &&\n> -\t# Confirm that fsck detects invalid checksum\n> -\ttest_must_fail git fsck --cache &&\n> -\t# Confirm that status no longer complains about invalid checksum\n> +\tcorrupt_index_checksum &&\n> +\ttest_must_fail git fsck --cache 2>expect &&\n> +\tgrep \"bad index file\" expect &&\n>  \tgit status\n>  '\n>  \n"},{"id":"317929","messageId":"3c0e7ab7-d41a-26f9-b90f-89c7aef58a28@jeffhostetler.com","threadId":"45798","inReplyTo":"xmqqd1bzst95.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-04-26T13:03:07Z","receivedAt":"2017-04-26T13:03:15Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\nOn 4/26/2017 12:11 AM, Junio C Hamano wrote:\n> git@jeffhostetler.com writes:\n>\n>> From: Jeff Hostetler <jeffhost@microsoft.com>\n>>\n>> Version 8 of this patch converts the unit test to use\n>> perl to corrupt the index checksum (rather than altering\n>> a filename) and also verifies the fsck error message as\n>> suggested in response to v7 on the mailing list.\n>>\n>> If there are no other suggestions, I think this version\n>> should be considered final.\n> Oops.  The earlier one has already been in 'master' for a few days.\n> Let's make this an incremental update.\n>\n> Is the description in the following something you are OK with (so\n> that I can add your sign-off)?\n\nYes, this is fine.  Thanks!\nJeff\n\n>\n> Thanks.\n>\n> -- >8 --\n> From: Jeff Hostetler <jeffhost@microsoft.com>\n> Date: Tue, 25 Apr 2017 18:41:09 +0000\n> Subject: t1450: avoid use of \"sed\" on the index, which is a binary file\n>\n> The previous step added a path zzzzzzzz to the index, and then used\n> \"sed\" to replace this string to yyyyyyyy to create a test case where\n> the checksum at the end of the file does not match the contents.\n>\n> Unfortunately, use of \"sed\" on a non-text file is not portable.\n> Instead, use a Perl script that seeks to the end and modifies the\n> last byte of the file (where we _know_ stores the trailing\n> checksum).\n>\n>\n> ---\n>   t/t1450-fsck.sh | 33 ++++++++++++++++++++++++++-------\n>   1 file changed, 26 insertions(+), 7 deletions(-)\n>\n> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\n> index 677e15a7a4..eff1cd68e9 100755\n> --- a/t/t1450-fsck.sh\n> +++ b/t/t1450-fsck.sh\n> @@ -689,16 +689,35 @@ test_expect_success 'bogus head does not fallback to all heads' '\n>   \t! grep $blob out\n>   '\n>   \n> +# Corrupt the checksum on the index.\n> +# Add 1 to the last byte in the SHA.\n> +corrupt_index_checksum () {\n> +    perl -w -e '\n> +\tuse Fcntl \":seek\";\n> +\topen my $fh, \"+<\", \".git/index\" or die \"open: $!\";\n> +\tbinmode $fh;\n> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n> +\tread $fh, my $in_byte, 1 or die \"read: $!\";\n> +\n> +\t$in_value = unpack(\"C\", $in_byte);\n> +\t$out_value = ($in_value + 1) & 255;\n> +\n> +\t$out_byte = pack(\"C\", $out_value);\n> +\n> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n> +\tprint $fh $out_byte;\n> +\tclose $fh or die \"close: $!\";\n> +    '\n> +}\n> +\n> +# Corrupt the checksum on the index and then\n> +# verify that only fsck notices.\n>   test_expect_success 'detect corrupt index file in fsck' '\n>   \tcp .git/index .git/index.backup &&\n>   \ttest_when_finished \"mv .git/index.backup .git/index\" &&\n> -\techo zzzzzzzz >zzzzzzzz &&\n> -\tgit add zzzzzzzz &&\n> -\tsed -e \"s/zzzzzzzz/yyyyyyyy/\" .git/index >.git/index.yyy &&\n> -\tmv .git/index.yyy .git/index &&\n> -\t# Confirm that fsck detects invalid checksum\n> -\ttest_must_fail git fsck --cache &&\n> -\t# Confirm that status no longer complains about invalid checksum\n> +\tcorrupt_index_checksum &&\n> +\ttest_must_fail git fsck --cache 2>expect &&\n> +\tgrep \"bad index file\" expect &&\n>   \tgit status\n>   '\n>   \n\n"},{"id":"317930","messageId":"5a97967d-5cf2-dc62-7f84-524556a9ca4c@jeffhostetler.com","threadId":"45798","inReplyTo":"xmqq8tmnss66.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-04-26T13:06:37Z","receivedAt":"2017-04-26T13:06:49Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 4/26/2017 12:34 AM, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> git@jeffhostetler.com writes:\n>>\n>>> From: Jeff Hostetler <jeffhost@microsoft.com>\n>>>\n>>> Version 8 of this patch converts the unit test to use\n>>> perl to corrupt the index checksum (rather than altering\n>>> a filename) and also verifies the fsck error message as\n>>> suggested in response to v7 on the mailing list.\n>>>\n>>> If there are no other suggestions, I think this version\n>>> should be considered final.\n>> Oops.  The earlier one has already been in 'master' for a few days.\n>> Let's make this an incremental update.\n>>\n>> Is the description in the following something you are OK with (so\n>> that I can add your sign-off)?\n>>\n>> Thanks.\n> By the way, I said I am fine with the two-liner version in Dscho's\n> message, but I am also OK with this version that does not use a\n> separate dd and instead does everything in a single invocation of\n> Perl.  As long as you've tested this version, there is no point\n> replacing it with yet another one.\n\nEither version is fine.  I'd say use my perl version as I have tested it and\nit is simple enough and already in the tree.  I don't think it's worth the\nbother to switch it to the dd version.\n\nThanks\nJeff\n\n> Thanks.\n>\n>> -- >8 --\n>> From: Jeff Hostetler <jeffhost@microsoft.com>\n>> Date: Tue, 25 Apr 2017 18:41:09 +0000\n>> Subject: t1450: avoid use of \"sed\" on the index, which is a binary file\n>>\n>> The previous step added a path zzzzzzzz to the index, and then used\n>> \"sed\" to replace this string to yyyyyyyy to create a test case where\n>> the checksum at the end of the file does not match the contents.\n>>\n>> Unfortunately, use of \"sed\" on a non-text file is not portable.\n>> Instead, use a Perl script that seeks to the end and modifies the\n>> last byte of the file (where we _know_ stores the trailing\n>> checksum).\n>>\n>>\n>> ---\n>>   t/t1450-fsck.sh | 33 ++++++++++++++++++++++++++-------\n>>   1 file changed, 26 insertions(+), 7 deletions(-)\n>>\n>> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh\n>> index 677e15a7a4..eff1cd68e9 100755\n>> --- a/t/t1450-fsck.sh\n>> +++ b/t/t1450-fsck.sh\n>> @@ -689,16 +689,35 @@ test_expect_success 'bogus head does not fallback to all heads' '\n>>   \t! grep $blob out\n>>   '\n>>   \n>> +# Corrupt the checksum on the index.\n>> +# Add 1 to the last byte in the SHA.\n>> +corrupt_index_checksum () {\n>> +    perl -w -e '\n>> +\tuse Fcntl \":seek\";\n>> +\topen my $fh, \"+<\", \".git/index\" or die \"open: $!\";\n>> +\tbinmode $fh;\n>> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n>> +\tread $fh, my $in_byte, 1 or die \"read: $!\";\n>> +\n>> +\t$in_value = unpack(\"C\", $in_byte);\n>> +\t$out_value = ($in_value + 1) & 255;\n>> +\n>> +\t$out_byte = pack(\"C\", $out_value);\n>> +\n>> +\tseek $fh, -1, SEEK_END or die \"seek: $!\";\n>> +\tprint $fh $out_byte;\n>> +\tclose $fh or die \"close: $!\";\n>> +    '\n>> +}\n>> +\n>> +# Corrupt the checksum on the index and then\n>> +# verify that only fsck notices.\n>>   test_expect_success 'detect corrupt index file in fsck' '\n>>   \tcp .git/index .git/index.backup &&\n>>   \ttest_when_finished \"mv .git/index.backup .git/index\" &&\n>> -\techo zzzzzzzz >zzzzzzzz &&\n>> -\tgit add zzzzzzzz &&\n>> -\tsed -e \"s/zzzzzzzz/yyyyyyyy/\" .git/index >.git/index.yyy &&\n>> -\tmv .git/index.yyy .git/index &&\n>> -\t# Confirm that fsck detects invalid checksum\n>> -\ttest_must_fail git fsck --cache &&\n>> -\t# Confirm that status no longer complains about invalid checksum\n>> +\tcorrupt_index_checksum &&\n>> +\ttest_must_fail git fsck --cache 2>expect &&\n>> +\tgrep \"bad index file\" expect &&\n>>   \tgit status\n>>   '\n>>   \n\n"},{"id":"318020","messageId":"xmqq60hqr8bl.fsf@gitster.mtv.corp.google.com","threadId":"45798","inReplyTo":"5a97967d-5cf2-dc62-7f84-524556a9ca4c@jeffhostetler.com","subject":"Re: [PATCH v8] read-cache: call verify_hdr() in a background thread","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-27T00:41:02Z","receivedAt":"2017-04-27T00:41:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Hostetler <git@jeffhostetler.com> writes:\n\n> Either version is fine.  I'd say use my perl version as I have tested it and\n> it is simple enough and already in the tree.  I don't think it's worth the\n> bother to switch it to the dd version.\n\nThanks, I agree what you said is very sensible.\n"}]}