Re: [PATCH 0/3] rename *.idx file into place last (also after *.bitmap)
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Sep 7, 2021, 22:36 UTC
- Message-ID
- <YTfpYsJ0J5t+xf8v@nand.local>
- In-Reply-To
- <cover-0.3-00000000000-20210907T193600Z-avarab@gmail.com>
On Tue, Sep 07, 2021 at 09:42:35PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> I came up with this on top of Taylor's series which fixes the order in > which we write files associated with pack files[1]. His series fixes a > race where we write *.idx before *.rev, but left the issue of writing > *.bitmap after *.idx, this series fixes that. Now we'll really write > the *.idx last.
Nice catch. And fixing this race (by moving the .bitmap into place before the .idx) doesn't create another race, because open_pack_bitmap_1() returns early when the call to open_pack_index() fails.
(And furthermore, open_pack_bitmap_1() is only called on the list of packs generated by calling prepare_pack() over each file in objects/pack, which only adds a pack to the list if its .idx file exists, too).
I reviewed this series and left a few notes which I would like to see addressed/responded to before queuing, but this seems to be generally of the right approach to me.
Thanks, Taylor