[PATCH 0/2] pack-write,repack: prevent opening packs too early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This pair of patches fixes a race where the .idx is moved into place
before the .rev file, allowing the pack to be in a state where it
appears a .rev file wasn't generated.

This can cause Git to inadvertently take the slow "generate the
reverse index on-the-fly", which does not impact correctness, but is
unnecessarily slow when compared to reading the .rev file.

The race is fixed by moving the .idx into place only after all other
pack-related files have already been written. The first patch fixes
the direct `pack-objects` case, and the second patch fixes `repack`
(which also renames pack files around).

Thanks in advance for your review.

Taylor Blau (2):
  pack-write.c: rename `.idx` file into place last
  builtin/repack.c: move `.idx` files into place last

 builtin/repack.c |  2 +-
 pack-write.c     | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.33.0.96.g73915697e6



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux