Re: [RFC/PATCH] read-cache: write all indexes with the same permissions
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 13, 2018, 16:55 UTC
- Message-ID
- <CACsJy8CaAC0UP+VxYU7zbdQc6DtKYa-FzOnbpNf+_P2L3zfUvQ@mail.gmail.com>
- In-Reply-To
- <20181113153235.25402-1-avarab@gmail.com>
On Tue, Nov 13, 2018 at 4:32 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> I won't have time to finish this today, as noted in > https://public-inbox.org/git/874lcl2e9t.fsf@evledraar.gmail.com/ > there's a pretty major bug here in that we're now writing out literal > sharedindex_XXXXXX files.
It's not the end of the world because create_tempfile opens with O_EXCL so if two processes try to create it at the same time, one will fail, but no corruption or such.
Show 9 quoted lines
> Obviously that needs to be fixed, and the fix is trivial, I can use > another one of the mks_*() functions with the same mode we use to > create the index. > > But we really ought to have tests for the bug this patch introduces, > and as noted in the E-Mail linked above we don't. > > So hopefully Duy or someone with more knowledge of the split index > will chime in to say what's missing there...
I don't have any bright idea how to catch the literal _XXXXX file. It's a temporary file and will not last long enough for us to verify unless we intercept open() calls with LD_PRELOAD.
-- Duy