From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from quail.birch.relay.mailchannels.net (quail.birch.relay.mailchannels.net [23.83.209.151]) by sourceware.org (Postfix) with ESMTPS id BC02F39A5062 for ; Wed, 9 Jun 2021 18:08:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC02F39A5062 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 38BB2121D51; Wed, 9 Jun 2021 18:08:26 +0000 (UTC) Received: from pdx1-sub0-mail-a68.g.dreamhost.com (100-96-133-111.trex.outbound.svc.cluster.local [100.96.133.111]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BDC28122737; Wed, 9 Jun 2021 18:08:25 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a68.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.133.111 (trex/6.3.1); Wed, 09 Jun 2021 18:08:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Ruddy-Desert: 761991c979e7d7ff_1623262106041_3252323969 X-MC-Loop-Signature: 1623262106041:3727772501 X-MC-Ingress-Time: 1623262106041 Received: from pdx1-sub0-mail-a68.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTP id 74B8B7E434; Wed, 9 Jun 2021 11:08:25 -0700 (PDT) Received: from [192.168.1.126] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a68.g.dreamhost.com (Postfix) with ESMTPSA id 3A1287E48E; Wed, 9 Jun 2021 11:08:21 -0700 (PDT) Subject: Re: [PATCH] Handle DT_UNKNOWN in gconv-modules.d To: Adhemerval Zanella , libc-alpha@sourceware.org Cc: schwab@linux-m68k.org References: <20210609043835.218509-1-siddhesh@sourceware.org> X-DH-BACKEND: pdx1-sub0-mail-a68 From: Siddhesh Poyarekar Message-ID: <637d9c58-610a-e68f-b743-85c99e18be1d@sourceware.org> Date: Wed, 9 Jun 2021 23:38:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3487.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 18:08:30 -0000 On 6/9/21 10:51 PM, Adhemerval Zanella wrote: > > > On 09/06/2021 01:38, Siddhesh Poyarekar via Libc-alpha wrote: >> On filesystems that do not support dt_type, a regular file shows up as >> DT_UNKNOWN. Fall back to using lstat64 to read file properties in >> such cases. > > The patch looks ok, but two things raised checking on this code: 1. > the code is essentially the same on both places and 2. the use of > alloca() even when it is assured that is bounded and 2. > > The former would be nice if could consolidate it (even by adding > a file where both iconvconfig and iconv could include or even > by a GLIBC_PRIVATE symbol), but it is not a deal breaker. I tried to do this but the code came out clumsier because the result (call to handle_file vs read_conf_file) have different semantics. > But I think we should move away from alloca, even when we know it > is bounded (sorry if I didn't catch on the previous patch). For > this specific usage we can use asprintf to create the path or use > a static PATH_MAX buffer. I agree, a static PATH_MAX makes sense, I'll do that. Thanks, Siddhesh