From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 6797A1F8C6 for ; Thu, 9 Sep 2021 19:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237677AbhIITxQ (ORCPT ); Thu, 9 Sep 2021 15:53:16 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:63934 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbhIITxP (ORCPT ); Thu, 9 Sep 2021 15:53:15 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 11D04EFAC4; Thu, 9 Sep 2021 15:52:05 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Et2g2BzRTP+j R/MsIuEktgQFSOCUgfkC0U9ibeUGjqY=; b=NmbOduSGSbaiNz6N+xgta2zW+Hnc noHJnjFbMUb3izFPOCkGxPRzL4Ro+h6vsNqVCrAW6OdetqkYFeV+jUrTAlIJlYki cNednx7HUOXcniKX1YNt0gySNy5f4Dhy1Ug67o+Vg2CU5ySMwunazviSvZex5r1v R9DNua/+Brdi7yI= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 0851DEFAC3; Thu, 9 Sep 2021 15:52:05 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.196.172.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 6CC83EFAC0; Thu, 9 Sep 2021 15:52:04 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: Taylor Blau , git@vger.kernel.org Subject: Re: [PATCH 9/9] pack-objects: rename .idx files into place after .bitmap files References: <878s06fa14.fsf@evledraar.gmail.com> Date: Thu, 09 Sep 2021 12:52:03 -0700 In-Reply-To: <878s06fa14.fsf@evledraar.gmail.com> (=?utf-8?B?IsOGdmFyIEFy?= =?utf-8?B?bmZqw7Zyw7A=?= Bjarmason"'s message of "Thu, 09 Sep 2021 09:54:44 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 680E944E-11A7-11EC-904C-CD991BBA3BAF-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > We fsync() the file descriptors we're writing out for all the > auxiliary files, but we don't yet fsync() the file descriptor for > the containing directory. Therefore our data might have been writte= n > out, but it's anyone's guess what the state of the directory > containing the file is after we write the *.idx. > > In practice modern OS's are known to be forgiving on that point, so > this will probably solve races in practice for most users. It will > almost certainly make them better than they were before when we > didn't write *.idx files last. We should more generally improve our > use of fsync() to cover containing directories, but that'll > hopefully be addressed by some follow-up series. I'd probably drop the last paragraph, and replace it with a single sentence "we may want to fsync the containing directory once after placing *.idx file in place, but it is outside of the scope of this series", if I were doing this series. Other than that (and I made a few comments on other patches), these were pleasant read. Thanks.