GNU bug report logs - #29092
Bug related to 64-bit inodes

Previous Next

Package: idutils;

Reported by: Curt McDowell <csm <at> purestorage.com>

Date: Tue, 31 Oct 2017 19:20:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Curt McDowell <csm <at> purestorage.com>
Cc: 29092 <at> debbugs.gnu.org
Subject: bug#29092: [bug-idutils] bug#29092: bug#29092: Bug related to 64-bit inodes
Date: Sat, 16 Dec 2017 16:58:38 -0800
[Message part 1 (text/plain, inline)]
On Tue, Nov 7, 2017 at 1:36 PM, Jim Meyering <jim <at> meyering.net> wrote:
> On Tue, Oct 31, 2017 at 12:03 PM, Curt McDowell <csm <at> purestorage.com> wrote:
>> Hi,
>>
>> I'm running idutils 4.6 on Ubuntu 14.04 to index a large source base that is
>> on an NFS-mounted filesystem that uses 64-bit inodes. mkid incorrectly
>> issues many warnings such as the following:
>>
>> /home/csm/src/idutils-4.6/src/mkid: warning:
>> `/df-csm/ir-csm7/platform/dot/ir/component/si5338/si5338.py' and
>> `/df-csm/ir-csm7/hardware/perf/CTRL_systemC/src/demux.hpp' are the same
>> file, but yield different scans!
>>
>> It turns out these inodes are equal in the lower 32 bits, but are not equal.
>>
>> % ls -li /df-csm/ir-csm7/platform/dot/ir/component/si5338/si5338.py
>> /df-csm/ir-csm7/hardware/perf/CTRL_systemC/src/demux.hpp
>> 33776997256654722 -rwxr-xr-x 1 csm staff  3290 May 22 22:03
>> /df-csm/ir-csm7/hardware/perf/CTRL_systemC/src/demux.hpp
>> 63050394834562946 -rw-r--r-- 1 csm staff 28973 May 22 22:03
>> /df-csm/ir-csm7/platform/dot/ir/component/si5338/si5338.py
>>
>> The inode numbers in hex are 780000030FEF82 and E00000030FEF82,
>> respectively.
>>
>> I believe the bug is that the inode hash functions should account for the
>> size of the di_ino field in case it is 8 bytes wide, rather than assuming
>> they are always 4 bytes:
>>
>> /****************************************************************************/
>> /* Hash stuff for `struct dev_ino'.  */
>>
>> static unsigned long
>> dev_ino_hash_1 (void const *key)
>> {
>>   unsigned long result = 0;
>>   INTEGER_HASH_1 (((struct dev_ino const *) key)->di_dev, result);
>>   INTEGER_HASH_1 (((struct dev_ino const *) key)->di_ino, result);
>>   return result;
>> }
>>
>> static unsigned long
>> dev_ino_hash_2 (void const *key)
>> {
>>   unsigned long result = 0;
>>   INTEGER_HASH_2 (((struct dev_ino const *) key)->di_dev, result);
>>   INTEGER_HASH_2 (((struct dev_ino const *) key)->di_ino, result);
>>   return result;
>> }
>>
>> As an unrelated issue, in order to get idutils 4.6 to compile on Ubuntu
>> 14.0.4 I had to edit lib/stdio.h and change "#if 1" to "#if 0" for the
>> section that deals with the "gets" function (libc 2.19-0ubuntu6.13).
>
> Thank you for the report.
> That is definitely a bug -- and it is over two decades old!
> I will fix this shortly, and will soon make a test release.

It wasn't as prompt as I would have liked, but here's a patch.
I'll make a snapshot today and post separately to the bug-idutils list.
[idu-inode-collision.diff (text/plain, attachment)]

This bug report was last modified 7 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.