From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 710473858D32 for ; Mon, 19 Sep 2022 09:30:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 710473858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663579847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JV35DHavFq1A87B5sm4NUkyEleltlRzxbK8k6PwEyEs=; b=dd0PXj3vZNyhB0ZGeMryUYCY7LqdMIJwqi3tHjWJQXc6kUsPHNVkVDDzUwwPFpp19qfRw5 3o2UUrKw3xr/4zHb/Ru5ds9pEh716YjJO+Kpt6rJ22648lAIVl20fVaQeujWgafprPPVTR qOeFhKkUObcxDnisai24U3teIgaOtcI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-0qmCAxIEOza7R6tzZs6oKA-1; Mon, 19 Sep 2022 05:30:44 -0400 X-MC-Unique: 0qmCAxIEOza7R6tzZs6oKA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA8FE3C02193; Mon, 19 Sep 2022 09:30:43 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF4AF40C6EC2; Mon, 19 Sep 2022 09:30:42 +0000 (UTC) From: Florian Weimer To: Andreas Schwab Cc: Florian Weimer via Libc-alpha Subject: Re: [PATCH] Linux: Do not skip d_ino == 0 entries in readdir, readdir64 (bug 12165) References: <87o7vbj1kz.fsf@oldenburg.str.redhat.com> <87r107hil6.fsf@oldenburg.str.redhat.com> Date: Mon, 19 Sep 2022 11:30:40 +0200 In-Reply-To: (Andreas Schwab's message of "Mon, 19 Sep 2022 10:53:49 +0200") Message-ID: <878rmfhfsv.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Andreas Schwab: > On Sep 19 2022, Florian Weimer wrote: > >> * Andreas Schwab: >> >>> On Sep 19 2022, Florian Weimer via Libc-alpha wrote: >>> >>>> - if (bytes <= 0) >>>> - { >>>> - /* On some systems getdents fails with ENOENT when the >>> >>> Shouldn't that be "some file systems"? >>> >>>> - open directory has been rmdir'd already. POSIX.1 >>>> - requires that we treat this condition like normal EOF. */ >>>> - if (bytes < 0 && errno == ENOENT) >>>> - bytes = 0; >>>> - >>>> - /* Don't modifiy errno when reaching EOF. */ >>>> - if (bytes == 0) >>>> - __set_errno (saved_errno); >>>> - dp = NULL; >>>> - break; >>>> - } >>>> - dirp->size = (size_t) bytes; >>>> - >>>> - /* Reset the offset into the buffer. */ >>>> - dirp->offset = 0; >>>> + /* Linux fails with ENOENT if IS_DEADDIR is true for the >>> >>> What is IS_DEADDIR? >> >> It's an internal Linux construct. Isn't this clear from the context? > > I'd rather keep the original comment with the missing word added. I > find it easier to understand without the reference to kernel internals. What about this? /* Linux may fail with ENOENT on some file systems if the directory inode is marked as dead (deleted). POSIX treats this as a regular end-of-directory condition, so do not set errno in that case, to indicate success. */ Thanks, Florian