git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Xavier Morel <xavier.morel@masklinn.net>, git@vger.kernel.org
Subject: Re: [PATCH 3/3] fsck: downgrade tree badFilemode to "info"
Date: Thu, 11 Aug 2022 04:33:11 -0400	[thread overview]
Message-ID: <YvS+x35sxXmO5H1h@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqo7wriwfl.fsf@gitster.g>

On Wed, Aug 10, 2022 at 03:08:14PM -0700, Junio C Hamano wrote:

> I was almost sure that before we "unified" the codepath for normal
> tree reading and the one used for fsck in a mistaken way, which was
> fixed in this series, we were catching these anomalous mode bits,
> but the suspected regression is too long ago that it does not make a
> practical difference if it was always broken or it was broken long
> time ago.  The risk to start complaining on existing projects is the
> same either way.

I agree with the "it was so long ago it does not matter", but for the
sake of posterity, here's what my digging found:

  - we got the mode fsck checks in 64071805ed (git-fsck-cache: be
    stricter about "tree" objects, 2005-07-27), though there is a proto
    version that is even a little older. Back then we were using a
    linked list to hold the parsed tree entries (!), but it was parsed
    by a central spot in parse_tree_buffer().

  - that linked list code went away in 15b5536ee4 (Remove last vestiges
    of generic tree_entry_list, 2006-05-29). But...

  - ...by then we already had 1b0c7174a1 (tree/diff header cleanup.,
    2006-03-29), which had tree_entry_extract(). And that commit
    introduced canon_mode, including the same "set unexpected things to
    a default", though of course back then it waas S_IFDIR since
    gitlinks didn't exist. ;)

  - that canon_mode() was just a rename from DIFF_FILE_CANON_MODE(),
    which ultimately came from 67574c403f ([PATCH] diff: mode bits
    fixes, 2005-06-01)

So some form of canon_mode() does predate the fsck checks, but I _think_
the fsck code was using the old linked-list version until 15b5536ee4,
and would not have been affected. So yes, there were probably 10 months
in 2005-2006 where we would have detected these. :)

Again, probably not important, but it was interesting for me at least to
see the evolution of the tree code. Most of those changes predate my
involvement with the code.

-Peff

  reply	other threads:[~2022-08-11  8:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 13:43 fsck: BAD_FILEMODE diagnostic broken / never triggers Xavier Morel
2022-08-09 22:48 ` Jeff King
2022-08-09 23:28   ` Jeff King
2022-08-10 15:01     ` Xavier Morel
2022-08-10 20:04       ` Jeff King
2022-08-10 20:59         ` [PATCH 0/3] actually detect bad file modes in fsck Jeff King
2022-08-10 21:01           ` [PATCH 1/3] tree-walk: add a mechanism for getting non-canonicalized modes Jeff King
2022-08-10 21:02           ` [PATCH 2/3] fsck: actually detect bad file modes in trees Jeff King
2022-08-10 21:35             ` Junio C Hamano
2022-08-10 21:46               ` Jeff King
2022-08-10 21:54                 ` Junio C Hamano
2022-08-10 21:04           ` [PATCH 3/3] fsck: downgrade tree badFilemode to "info" Jeff King
2022-08-10 22:08             ` Junio C Hamano
2022-08-11  8:33               ` Jeff King [this message]
2022-08-11 16:24                 ` Junio C Hamano
2022-08-11  9:39           ` [PATCH 0/3] actually detect bad file modes in fsck Ævar Arnfjörð Bjarmason
2022-08-14  7:03             ` Jeff King

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=YvS+x35sxXmO5H1h@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=xavier.morel@masklinn.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.
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).