From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:45748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751934AbcCKVj5 (ORCPT ); Fri, 11 Mar 2016 16:39:57 -0500 Subject: Re: Can getdents return zero inode numbers? To: Andreas Dilger References: <56E301BC.9090405@redhat.com> <14BE767D-13C2-4946-B8C7-042654875E05@dilger.ca> Cc: Linux FS Devel From: Florian Weimer Message-ID: <56E33B2A.3080400@redhat.com> Date: Fri, 11 Mar 2016 22:39:54 +0100 MIME-Version: 1.0 In-Reply-To: <14BE767D-13C2-4946-B8C7-042654875E05@dilger.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 03/11/2016 10:20 PM, Andreas Dilger wrote: > On Mar 11, 2016, at 10:34 AM, Florian Weimer > wrote: >> >> Is it possible that getdents returns a zero inode number for a >> name which actually has a file (or directory, device node etc.) >> behind it? > > The d_ino == 0 value is valid to return and means that the filename > was unlinked from the directory but the entry was not actually > removed. Okay, so it makes sense to skip over entries with d_ino == 0. I found code in glibc's glob implementation which does that and was a bit puzzled and worried that there might be Linux file systems which have zero inode numbers (so that glob would fail on them). Thanks, Florian