From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 270AC1F56A for ; Sun, 1 Oct 2023 02:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1696128205; bh=B/jBSaKgRPtu5UGwLGTwJyBjYIQqgET7ag6FTvKYZw8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gELD2j5G5srNsgcbyjxce0aCe7qIqE1/5E6QfAWStHyzKJ7gTnZgPKyp9baSCe+c1 Y6TkxYsodbPE0DEGAzKfUrBE599h/rTJe5eI0p4SeeR9FBqoTe7Sc2Z+SPElLpfskF XcPiVdSkdLvAcGrdBW4lIZUyUvAyDQsvchvTk7NA= From: Eric Wong To: spew@80x24.org Subject: [PATCH 08/16] git: packed_bytes: account for TOUTTOC between glob and stat Date: Sun, 1 Oct 2023 02:43:15 +0000 Message-ID: <20231001024323.1960491-8-e@80x24.org> In-Reply-To: <20231001024323.1960491-1-e@80x24.org> References: <20231001024323.1960491-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's not much we can do about this aside from just ignoring errors and considering un-stat-able files as zero-sized. There's no syscalls which expose FUSE3 `readdirplus' type functionality to userspace. --- lib/PublicInbox/Git.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 1dbd10b7..0fd621e1 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -486,9 +486,7 @@ sub packed_bytes { my ($self) = @_; my $n = 0; my $pack_dir = git_path($self, 'objects/pack'); - foreach my $p (bsd_glob("$pack_dir/*.pack", GLOB_NOSORT)) { - $n += -s $p; - } + $n += (-s $_ // 0) for (bsd_glob("$pack_dir/*.pack", GLOB_NOSORT)); $n }