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

[PATCH 1/2] reftable/stack: unconditionally reload stack after commit

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 18, 2024, 13:41 UTC
Message-ID
<568aa5b808013ca782fac45d03e01bbf9323bb38.1705585037.git.ps@pks.im>
In-Reply-To
<cover.1705585037.git.ps@pks.im>

After we have committed an addition to the reftable stack we call `reftable_stack_reload()` to reload the stack and thus reflect the changes that were just added. This function will only conditionally reload the stack in case `stack_uptodate()` tells us that the stack needs reloading. This check is wasteful though because we already know that the stack needs reloading.

Call `reftable_stack_reload_maybe_reuse()` instead, which will unconditionally reload the stack. This is merely a conceptual fix, the code in question was not found to cause any problems in practice.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 reftable/stack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reftable/stack.c b/reftable/stack.c
index c28d82299d..705cfb6caa 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -585,7 +585,7 @@ int reftable_addition_commit(struct reftable_addition *add)
 	add->new_tables = NULL;
 	add->new_tables_len = 0;
 
-	err = reftable_stack_reload(add->stack);
+	err = reftable_stack_reload_maybe_reuse(add->stack, 1);
 	if (err)
 		goto done;
 
-- 
2.43.GIT
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 2 of 7 in “reftable/stack: fix race in up-to-date check”
  1. 0/2 reftable/stack: fix race in up-to-date checkPatrick Steinhardt, Jan 18, 2024
  2. 1/2 reftable/stack: unconditionally reload stack after commitPatrick Steinhardt, Jan 18, 2024
  3. 2/2 reftable/stack: fix race in up-to-date checkPatrick Steinhardt, Jan 18, 2024
  4. Junio C HamanoJan 18, 2024
  5. Jeff KingJan 20, 2024
  6. Patrick SteinhardtJan 22, 2024
  7. Jeff KingJan 23, 2024

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.