Opened 13 years ago

Last modified 3 months ago

#74 assigned defect

libc: inode id & copy

Reported by: bird Owned by: bird
Priority: normal Milestone:
Component: libc-backend Version: 0.6
Severity: normal Keywords: inode number
Cc:

Description

The current inode number scheme is missing one bit in it's implementation. When we're copying files using OS/2 facilities, or even zipping/unzipping stuff, we end up creating duplicate inode numbers.

The inode number generation is made up of two 32-bit numbers generated from the cannonized native path of the object. We then distiguish between creating a new object, correcting the inode value of an existing object, and generating a completely new one for an existing one. In the first case we have to generate both parts, and we use crc32 and sdbm for that. In the second case we read the inode number from the disk, but we regenerates the sdbm part. In the third case we generate both using djb2 and sdbm.

Attachments (1)

fs.diff (740 bytes) - added by komh 3 months ago.
Patch calculating inode whenever stat()ed.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by bird

  • Milestone changed from libc-0.6.2 to libc-0.6.3

comment:2 Changed 12 years ago by bird

  • Milestone changed from libc-0.6.3 to libc-0.6.4

comment:3 Changed 8 years ago by bird

  • Status changed from new to assigned

comment:4 Changed 7 years ago by bird

  • Milestone changed from libc-0.6.5 to libc-0.6.6

comment:5 Changed 6 years ago by ydario

  • Milestone libc-0.6.6 deleted

comment:6 Changed 3 months ago by komh

Here is the patch calculating inodes whenever stat()'ed. Even if files have the same inode on a disk, a program using stat() will show the different inodes.

At the beginning place, I'm not sure storing inodes into EA is right. It would be better to generate fake inodes whenever needed like this approach.

Changed 3 months ago by komh

Patch calculating inode whenever stat()ed.

Note: See TracTickets for help on using tickets.