Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.os.linux.development.system > #331

Re: ftok() on Linux generated different keys for the same inode and the same file name

From Huibert Bol <huibert.bol@quicknet.nl>
Newsgroups comp.unix.programmer, comp.os.linux.development.system
Subject Re: ftok() on Linux generated different keys for the same inode and the same file name
Date 2011-12-15 19:16 +0100
Organization A noiseless patient Spider
Message-ID <jcddhi$t4m$1@dont-email.me> (permalink)
References <11380c99-6acd-4c84-96c2-c37f3b5b9f60@u5g2000vbd.googlegroups.com>

Cross-posted to 2 groups.

Show all headers | View raw


Alex Vinokur wrote:

> It seems that ftok() on Linux generated different keys for the same
> inode and the same file name.
>
> Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
> x86_64 x86_64 GNU/Linux
>
> AccessTime = 20111020-153001   Inode = 6914144   ShmKeyDec =
> 1091272800   ShmKeyHex = 0x410b8060
> AccessTime = 20111020-155359   Inode = 6914144   ShmKeyDec =
> 1091338336   ShmKeyHex = 0x410c8060

After a reboot, right?  From the source:

  key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
         | ((proj_id & 0xff) << 24));

The parts that differ are set to the device number, perhaps your disks
were detected in a different order.

-- 
Huibert
"Okay... really not something I needed to see."  --Raven

Back to comp.os.linux.development.system | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-15 06:25 -0800
  Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-15 07:20 -0800
  Re: ftok() on Linux generated different keys for the same inode and the same file name Huibert Bol <huibert.bol@quicknet.nl> - 2011-12-15 19:16 +0100
    Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-15 10:34 -0800
      Re: ftok() on Linux generated different keys for the same inode and the same file name Huibert Bol <huibert.bol@quicknet.nl> - 2011-12-15 19:47 +0100
        Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-18 04:46 -0800
          Re: ftok() on Linux generated different keys for the same inode and the same file name Huibert Bol <huibert.bol@quicknet.nl> - 2011-12-18 19:05 +0100
            Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-18 10:13 -0800
      Re: ftok() on Linux generated different keys for the same inode and the same file name André Gillibert <MetaEntropy.removeThis@gmail.com> - 2011-12-17 11:57 +0100
        Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-18 04:58 -0800
          Re: ftok() on Linux generated different keys for the same inode and the same file name André Gillibert <MetaEntropy.removeThis@gmail.com> - 2011-12-19 11:00 +0100
    Re: ftok() on Linux generated different keys for the same inode and the same file name Alex Vinokur <alex.vinokur@gmail.com> - 2011-12-15 10:38 -0800
      Re: ftok() on Linux generated different keys for the same inode and the same file name André Gillibert <MetaEntropy.removeThis@gmail.com> - 2011-12-18 11:08 +0100

csiph-web