From: Junio C Hamano Date: Fri, 10 Jun 2022 21:33:07 GMT Subject: Re: [PATCH v14 2/7] object-file.c: do fsync() and close() before post-write die() Message-ID: In-Reply-To: <0b9bc499-18c7-e8ab-5c89-f9e1a98685bc@web.de> René Scharfe writes: > Am 10.06.22 um 16:46 schrieb Han Xin: >> From: Ævar Arnfjörð Bjarmason >> >> Change write_loose_object() to do an fsync() and close() before the >> oideq() sanity check at the end. This change re-joins code that was >> split up by the die() sanity check added in 748af44c63e (sha1_file: be >> paranoid when creating loose objects, 2010-02-21). >> >> I don't think that this change matters in itself, if we called die() >> it was possible that our data wouldn't fully make it to disk, but in >> any case we were writing data that we'd consider corrupted. It's >> possible that a subsequent "git fsck" will be less confused now. > > This is done before renaming the file, so git fsck is going to see (at > most) a tmp_obj_?????? file, which it ignores in either case, right? Yes, I thought I pointed that out in my review on the previous round, but I missed that it was still here in this round X-<. Thanks for noticing.