Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Jeff King
On Tue, Jan 16, 2018 at 12:37:51AM +0100, Kim Gybels wrote: > > This looks good to me, and since it's a recent-ish regression, I think > > we should take the minimal fix here. > > The minimal fix being a simple NULL check before munmap()? Sorry to be unclear. I just meant that your patch is prob

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Kim Gybels
On (15/01/18 16:15), Jeff King wrote: > On Sat, Jan 13, 2018 at 05:11:49PM +0100, Kim Gybels wrote: > > > Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use > > read() instead of mmap() for small packed-refs files. > > > > This also fixes the problem[1] where xmmap() return

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-15 Thread Jeff King
On Sat, Jan 13, 2018 at 05:11:49PM +0100, Kim Gybels wrote: > Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use > read() instead of mmap() for small packed-refs files. > > This also fixes the problem[1] where xmmap() returns NULL for zero > length[2], for which munmap() lat

Re: [PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-13 Thread Johannes Schindelin
Hi, On Sat, 13 Jan 2018, Kim Gybels wrote: > Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use Maybe use ea68b0ce9f8 (hash-object: don't use mmap() for small files, 2010-02-21) instead of the full commit name? > read() instead of mmap() for small packed-

[PATCH] packed_ref_cache: don't use mmap() for small files

2018-01-13 Thread Kim Gybels
Take a hint from commit ea68b0ce9f8ce8da3e360aed3cbd6720159ffbee and use read() instead of mmap() for small packed-refs files. This also fixes the problem[1] where xmmap() returns NULL for zero length[2], for which munmap() later fails. Alternatively, we could simply check for NULL before munmap(