Thanks for the bug report. How about the attached patch instead? It's a bit more conservative than what you proposed. (I haven't tested it.)
From 49b9f54ff66d126c4c0d58ccfbc2b85f96f845fc Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Thu, 31 Mar 2022 18:26:03 -0700
Subject: [PATCH] Retry file creation more aggressively
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/extract.c (maybe_recoverable): When deciding whether to
retry file creation, don’t insist on our making intermediate
subdirectories; it’s OK if some other process made them.
Problem reported by James Abbatiello in:
https://lists.gnu.org/r/bug-tar/2022-03/msg00000.html
---
 src/extract.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/extract.c b/src/extract.c
index e7be463e..8fffe56a 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -824,7 +824,7 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made)
 
     case ENOENT:
       /* Attempt creating missing intermediate directories.  */
-      if (make_directories (file_name, interdir_made) == 0 && *interdir_made)
+      if (make_directories (file_name, interdir_made) == 0)
 	return RECOVER_OK;
       break;
 
-- 
2.32.0

Reply via email to