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

Re: [PATCH 2/2] files_transaction_prepare(): fix handling of ref lock failure

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 25, 2017, 02:29 UTC
Message-ID
<xmqqwp3khsek.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<6214107e1232a7fe7ca4b7440733ff496f07e537.1508856679.git.mhagger@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 7 quoted lines
> ... But dc39e09942 added another blurb of code between
> the loop and the cleanup. That blurb sometimes resets `ret` to zero,
> making the cleanup code think that the locking was successful.
> ...
> The fix is simple: instead of just breaking out of the loop, jump
> directly to the cleanup code. This fixes some tests in t1404 that were
> added in the previous commit.

OK. Now because we do not break and start packed_transaction but instead jump over that if statement, we'll leave packed_transation instance that we got from transaction_begin() that we called add_update() on, but haven't called transaction_prepare() on behind. That instance is pointed by backend_data pointer which is part of transaction, so presumably transaction_cleanup() called on it in the section labelled "cleanup:" should take care of it?

Thanks for catching the issue and fixing it quickly.  Will queue.
Previous: Jeff KingNext: Jeff King
Message 13 of 14 in “Fix an error-handling path when locking refs”
  1. 0/2 Fix an error-handling path when locking refsMichael Haggerty, Oct 24, 2017
  2. 1/2 t1404: add a bunch of tests of D/F conflictsMichael Haggerty, Oct 24, 2017
  3. Eric SunshineOct 24, 2017
  4. Jeff KingOct 24, 2017
  5. Michael HaggertyOct 25, 2017
  6. Michael HaggertyOct 25, 2017
  7. Jeff KingOct 26, 2017
  8. brian m. carlsonOct 28, 2017
  9. Junio C HamanoOct 29, 2017
  10. brian m. carlsonOct 29, 2017
  11. 2/2 files_transaction_prepare(): fix handling of ref lock failureMichael Haggerty, Oct 24, 2017
  12. Jeff KingOct 24, 2017
  13. Junio C HamanoOct 25, 2017
  14. Jeff KingOct 24, 2017

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.