git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fixup! propagate errno from failing read

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 17, 2021, 22:38 UTC
Message-ID
<xmqq4kbn7l3l.fsf@gitster.g>
In-Reply-To
<pull.1068.git.git.1629203489546.gitgitgadget@gmail.com>
"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 17 quoted lines
> 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.

Thanks.
Previous: Jonathan NiederNext: Han-Wen Nienhuys
Message 4 of 14 in “fixup! propagate errno from failing read”
  1. fixup! propagate errno from failing readHan-Wen Nienhuys via GitGitGadget, Aug 17, 2021
  2. Jonathan TanAug 17, 2021
  3. Jonathan NiederAug 18, 2021
  4. Junio C HamanoAug 17, 2021
  5. Han-Wen NienhuysAug 18, 2021
  6. Junio C HamanoAug 18, 2021
  7. Junio C HamanoAug 19, 2021
  8. Han-Wen NienhuysAug 19, 2021
  9. Jeff KingAug 19, 2021
  10. t3200: refactor symlink testCarlo Marcelo Arenas Belón, Aug 19, 2021
  11. Eric SunshineAug 19, 2021
  12. t3200: refactor symlink test from hn/refs-errno-cleanupCarlo Marcelo Arenas Belón, Aug 19, 2021
  13. Junio C HamanoAug 19, 2021
  14. Junio C HamanoAug 19, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.