From: Duy Nguyen Date: Tue, 02 Oct 2018 17:02:09 GMT Subject: Re: [PATCH v7 6/7] ieot: add Index Entry Offset Table (IEOT) extension Message-ID: In-Reply-To: <351b9746-6c2e-a658-3f51-71c1f4cbc3ac@gmail.com> On Tue, Oct 2, 2018 at 6:34 PM Ben Peart wrote: > >> + offset = lseek(newfd, 0, SEEK_CUR) + write_buffer_len; > > > > This only works correctly if the ce_write_entry() from the last > > iteration has flushed everything to out to newfd. Maybe it does, but > > it's error prone to rely on that in my opinion. Maybe we need an > > explicit ce_write_flush() here to make sure. > > > > This logic already takes any unflushed data into account - the offset is > what has been flushed to disk (lseek) plus the amount still in the > buffer (write_buffer_len) waiting to be flushed. I don't see any need > to force an additional flush and adding one could have a negative impact > on performance. Eck! How did I miss that write_buffer_len :P -- Duy