Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


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

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

From Alex Vinokur <alex.vinokur@gmail.com>
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 10:34 -0800
Organization http://groups.google.com
Message-ID <1efa0082-77e7-4e05-8f94-64d0fc152c44@ct2g2000vbb.googlegroups.com> (permalink)
References <11380c99-6acd-4c84-96c2-c37f3b5b9f60@u5g2000vbd.googlegroups.com> <jcddhi$t4m$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw


On Dec 15, 8:16 pm, Huibert Bol <huibert....@quicknet.nl> wrote:
> 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

I am not sure that it was after reboot: difference between asscess
times is about 4 min.
I don't know.

AccessTime = 20111020-153001   Inode = 6914144   ShmKeyDec =
1091272800   ShmKeyHex = 0x410b8060
AccessTime = 20111020-155359   Inode = 6914144   ShmKeyDec =
1091338336   ShmKeyHex = 0x410c8060

Where can I see ftok()-source for Linux?

Thanks

Alex

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