All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>,
	git@vger.kernel.org, "Jonathan Tan" <jonathantanmy@google.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Han-Wen Nienhuys" <hanwenn@gmail.com>
Subject: Re: [PATCH] fixup! propagate errno from failing read
Date: Wed, 18 Aug 2021 11:00:36 +0200	[thread overview]
Message-ID: <CAFQ2z_Ni1bvj0Skgp_3p9htQfjn_M=3uF06pyZm_hkXgT_L61g@mail.gmail.com> (raw)
In-Reply-To: <xmqq4kbn7l3l.fsf@gitster.g>

On Wed, Aug 18, 2021 at 12:38 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Han-Wen Nienhuys <hanwen@google.com>
> >
> > This fixes a crash triggered by the BUG() statement.
> >
> > This can occur with symlinked .git/refs. To check availability,
> > refs_verify_refname_available will run refs_read_raw_ref() on each prefix,
> > leading to a read() from .git/refs (which is a directory).
> >
> > When handling the symlink case, it is probably more robust to re-issue the
> > lstat() as a normal stat(), in which case, we would fall back to the directory
> > case.
> >
> > For now, propagating errno from strbuf_read() is simpler and avoids the crash.
> >
> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> > ---
> >     fixup! propagate errno from failing read
>
> Hmph, I do not see a commit with "propagate errno from failing read"
> in its title anywhere in 'seen'.

> I think the convention to assign errno to myerr in this codepath
> originates in a0731250 (refs: explicitly return failure_errno from
> parse_loose_ref_contents, 2021-07-20), and it forgot the part of the
> code being fixed with this patch.  The commit being fixed is already
> is in 'next' as part of the hn/refs-errno-cleanup topic.
>
> Usually, a flaw in a topic that is already in 'next' is corrected by
> a follow-up patch, but then they won't say "fixup!" (none of our
> bugfix patches do).  But a post-release is a special time, as we
> will soon be rewinding 'next', restarting it from the latest release
> and we have a choice to tentatively eject a topic, fix it up or
> even replace it, before merging the corrected topic to 'next'.
>
> Do you mean that you want me to squash this change into that commit
> before the topic graduates to 'master' during the new development
> cycle?  If so please be a bit more explicit next time.  Using the
> title of the commit after "fixup!" would be a good starting point.

The problem fixed here affects anyone who uses git-repo (ie. does
Android development) and runs "git-branch -m", which is a large group
of people, so I think it should not be allowed to get into a release.

So it could be squashed into commit a0731250, or put on top of next as
a separate commit (probably with 'fixup!' removed).

Note that, even though commit a0731250 originates from a branch called
"hn/XXX" and has me as Author, the BUG() call causing the crash was
actually introduced by AEvar when he reworked the series.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

  reply	other threads:[~2021-08-18  9:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 12:31 [PATCH] fixup! propagate errno from failing read Han-Wen Nienhuys via GitGitGadget
2021-08-17 16:14 ` Jonathan Tan
2021-08-18 22:19   ` Jonathan Nieder
2021-08-17 22:38 ` Junio C Hamano
2021-08-18  9:00   ` Han-Wen Nienhuys [this message]
2021-08-18 18:30     ` Junio C Hamano
2021-08-19  0:11       ` Junio C Hamano
2021-08-19  9:01       ` Han-Wen Nienhuys
2021-08-19  3:55 ` Jeff King
2021-08-19  5:01   ` [PATCH] t3200: refactor symlink test Carlo Marcelo Arenas Belón
2021-08-19  5:51     ` Eric Sunshine
2021-08-19  7:52     ` [PATCH v2] t3200: refactor symlink test from hn/refs-errno-cleanup Carlo Marcelo Arenas Belón
2021-08-19 20:26       ` Junio C Hamano
2021-08-19 20:26       ` 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

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

  git send-email \
    --in-reply-to='CAFQ2z_Ni1bvj0Skgp_3p9htQfjn_M=3uF06pyZm_hkXgT_L61g@mail.gmail.com' \
    --to=hanwen@google.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=hanwenn@gmail.com \
    --cc=jonathantanmy@google.com \
    /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.