2

I asked a question on codereview to know if I could safely replace the following code:

:inode => [stat.ino, stat.dev_major, stat.dev_minor],

which threw NotImplementedError because of jruby not retrieving the stat implementation for dev_major/dev_minor on Solaris, by

:inode => [stat.ino, nil, nil],

and from their explanation I understood that if I operate on a single hard drive it is ok, but if my files are spread on multiple hard drives, there is a (small) risk of collision with two inodes being the same number.

But in my case, all logs files from every servers are mounted in the same directory through NFS, so I was wondering if when accessing the files, the inode numbers retrieved by ruby would be the actual inode numbers of the remote files, or a "local" inode number of the NFS link, in which case I would be safe to operate.

BTW I am not very familiar with those notions and english is not my mother language, so I apologize if I am being unclear.

Thanks for your help

3
  • You could always test it. Write some files over NFS, then compare the ls -li output from your NFS mount and locally on the NFS server itself.
    – Nathan C
    Apr 15, 2014 at 13:57
  • Unfortunately I can't. I lack privileges and passwords. But I can try to ask the sysadmins..
    – Aldian
    Apr 15, 2014 at 14:27
  • But the more I think about it, the more I doubt it: If NFS enforced the same inode as on the remote server, there would be collision risks with existent files from the local host. Additionally they say that NFS is using custom FileHandles carefully designed to preserve unicity and prevent collision risks and security, and I think local inodes should be the inodes from those handles, it would make more sense.
    – Aldian
    Apr 15, 2014 at 14:56

1 Answer 1

1

The inode numbers come from the NFS servers (the systems that contain the log files). The system your ruby application is running on is a NFS client. So, yes, there is the potential for inode number collisions.

1
  • As I stated in a reply that was deleted by @Dave M, I checked this myself by executing ls -li on both NFS client and server and saw that it was the same
    – Aldian
    Apr 22, 2014 at 8:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .