Unsolved

10 Posts

766

October 6th, 2021 18:00

Inode number uniqueness

I am using REST api to list directory content. As per rest api documentation each file/dir has an id, which is also the inode number. I want to confirm following things about uniqueness of the id/inode number.

 

  1. Is Inode number unique across all the nodes in cluster.
  2. Will Inode number ever be reused for another file(after first file deletion). What will happen in case all inodes in the system are exhausted, will it use some of the deleted files inode numbers?
  3. What is the data structure used to store inode number, is it uint64?

 

I want to enumerate and store the file list across delete/renames and planning to use inode number as unique id, want to make sure no two files will ever share same id for a cluster.

Moderator

 • 

7.7K Posts

October 7th, 2021 08:00

Hello SadhanaP,

Inode numbers are never re-used in OneFS, i.e. they basically keep increasing for new files.  Inode numbers are pre-pooled ranges of inode number across the cluster. A new file can get a /lower/ inode number than an older file if the new file happens be created from a different inode 'pool'. But over time, numbers increase.

10 Posts

October 10th, 2021 22:00

Thanks for the update. What will happen when billions of files are created and deleted repeatedly? Will inode number get exhausted? I believe inode number is unit64 so there is limit on max inode number. 
Also how does this work with NFS where there is smaller number limit on inode.

Moderator

 • 

7.7K Posts

October 11th, 2021 15:00

Hello SadhanaP,

It is best to call in so that we can gather some system information and can give you a better picture of how it will work.

Top