Re: Can getdents return zero inode numbers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Apr 8, 2016, at 12:40 PM, Florian Weimer <fweimer@xxxxxxxxxx> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> On 03/11/2016 10:20 PM, Andreas Dilger wrote:
>> On Mar 11, 2016, at 10:34 AM, Florian Weimer <fweimer@xxxxxxxxxx>
>> 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.
> 
> Thanks.
> 
> Which file systems do this?  Is it possible to see this in action?

I suspect that this is mostly or completely a non-issue in Linux, since
all of the directory entries are copied from the filesystem directory
into struct dirent, and ext4 does not return entries with i_ino = 0
back to userspace.

This was more of a problem with older *nix that allowed applications to
read the on-disk directory data directly.  GNU ls has NOT_AN_INODE_NUMBER=0
and treats those dirents specially, but that code is so awfully structured
it is hard to see what it is doing.

Cheers, Andreas





Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux