From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 159B8C43603 for ; Mon, 16 Dec 2019 21:25:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC2722067C for ; Mon, 16 Dec 2019 21:25:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="mImRrloU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726764AbfLPVZH (ORCPT ); Mon, 16 Dec 2019 16:25:07 -0500 Received: from pb-smtp20.pobox.com ([173.228.157.52]:60002 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbfLPVZH (ORCPT ); Mon, 16 Dec 2019 16:25:07 -0500 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9C48296A05; Mon, 16 Dec 2019 16:25:06 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=a8I6XTiIuth7E//H8297Q6hKKWw=; b=mImRrl oUvSILd0Fn9sbfqtJicniv9DFlS1ljmFTGRSTLshUC1vq1vszBajPlNJJltl9Jdt BCXe2kzwsHV2MX3rNOm3rnh7x6QF9O/lzRPUleAwUomrQBZzmmVYH2EHj8t73++b keE/Sr1mY4heR73qMNtAmnTf+prLQ7QHTYXkA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=SVvxq+0KdNduJL2ikxtQfYxE3k6JU/Fq SuU+2fi4YV3DM0g26zQiHy44mJPlTF/zjKKQNd4Iqg0yNw7ptQ/cIXOflRIR9I5V URYJOT9durA4G7v4Mzr95bJ6YjxtOUYpKJKHnzqH6lTa2gfYIYx3uIprPO/Hz+lv TpnQ9UqpQeI= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 95D4D96A04; Mon, 16 Dec 2019 16:25:06 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.76.80.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id AD02D96A03; Mon, 16 Dec 2019 16:25:03 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: Elijah Newren Cc: Johannes Schindelin , Elijah Newren via GitGitGadget , Git Mailing List , blees@dcon.de, Kyle Meyer , Samuel Lijin Subject: Re: [PATCH v2 6/8] dir: fix checks on common prefix directory References: <9839aca00a10b16d96c47db631ac025281ffc864.1576008027.git.gitgitgadget@gmail.com> Date: Mon, 16 Dec 2019 13:25:01 -0800 In-Reply-To: (Elijah Newren's message of "Mon, 16 Dec 2019 13:08:44 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 8612007A-204A-11EA-8C8F-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Elijah Newren writes: > Any bright ideas about what to do here? Restructuring the code so that we do not use "struct dirent" in the first place, even in the original code that used only those obtained from readdir(), perhaps? Then the codepath that would take the _thing_ that describes the diretory entry would expect to see the data in the struct you define (not "struct dirent" from the system), and you can safely manufacture ones out of thin air.