Re: [PATCH 00/20] Read `packed-refs` using mmap()

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

 



Hi Michael,

On Thu, 14 Sep 2017, Michael Haggerty wrote:

> On 09/13/2017 07:15 PM, Michael Haggerty wrote:
> > [...]
> > * `mmap()` the whole file rather than `read()`ing it.
> > [...]
>
> Apparently this doesn't work on Windows, because the `snapshot` is
> keeping the `packed-refs` file open too long, so the new file can't be
> renamed on top of it.

Indeed, I sent you a mail about it before I checked for new mails ;-)

> I didn't realize that this is even allowed, but TIL that you can close a
> file while keeping it mmapped. Does that technique work on Windows? If
> so, I'll change v2 to do it as sketched below.

I do not know whether that technique works on Windows, but it would not
solve the problem *entirely*, as I outlined in my reply: in
delete_branches(), for example, the main_worktree_ref_store is implicitly
getting its snapshot initialized, and nothing seems to release it.

This is only one example, as I figure that multiple worktrees could cause
even more ref_stores to have unreleased snapshots of the packed-refs file.

I imagine that something like close_all_packs() is needed
("clear_all_snapshots()"?).

Ciao,
Dscho



[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