public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: CYGWIN inode over Samba share not constructed from   IndexNumber
@ 2012-05-11 16:58 starlight.2012q2
  2012-05-11 17:59 ` Corinna Vinschen
  0 siblings, 1 reply; 11+ messages in thread
From: starlight.2012q2 @ 2012-05-11 16:58 UTC (permalink / raw)
  To: cygwin

Here is the logic Samba uses for inode
determination, per Jermey Allison:



Ok, here's how we construct the 64-bit return
value for that field:

/********************************************************************
 Create a 64 bit FileIndex. If the file is on the same device as
 the root of the share, just return the 64-bit inode. If it isn't,
 mangle as we used to do.
********************************************************************/

uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf)
{
   uint64_t file_index;
   if (conn->base_share_dev == psbuf->st_ex_dev) {
      return (uint64_t)psbuf->st_ex_ino;
   }
   file_index = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */
   file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */
   return file_index;
}


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread
* CYGWIN inode over Samba share not constructed from  IndexNumber
@ 2012-05-11 15:53 starlight.2012q2
  2012-05-11 16:22 ` Corinna Vinschen
  2012-05-11 16:24 ` Corinna Vinschen
  0 siblings, 2 replies; 11+ messages in thread
From: starlight.2012q2 @ 2012-05-11 15:53 UTC (permalink / raw)
  To: cygwin

Hello,

Ran into a quirk that caused some trouble.

For some reason CYGWIN 1.7.5 (I know this is old)
is constructing inode values for files on
Samba (3.6.4) shares with a different algorithm
than is used for files on NTFS volumes.

This caused a script that checks for matching
hard-links to fail.

Confirmed that Samba is returning the actual
inode values in 'IndexNumber' with 'procmon'
while running the

   stat -c '%h %d %i' filename

command.  See https://lists.samba.org/archive/samba/2012-May/167381.html.

Is CYGWIN mistaking the Samba share for a FAT32
volume and using an inode-faking algo?  Or
is it something else?  Was this fixed in
a newer version of CYGWIN?  I did try a search
but came up with nothing.  With NTFS the
inode values reported do match the underlying
'IndexNumber' value.

Please CC me with any replies as I am not
subscribed to the list.

Thanks


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-05-21 10:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-11 16:58 CYGWIN inode over Samba share not constructed from IndexNumber starlight.2012q2
2012-05-11 17:59 ` Corinna Vinschen
2012-05-11 19:49   ` starlight.2012q2
2012-05-11 21:15   ` Jeremy Allison
2012-05-12 10:54     ` Corinna Vinschen
2012-05-14 17:33       ` Jeremy Allison
2012-05-21 10:49         ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2012-05-11 15:53 starlight.2012q2
2012-05-11 16:22 ` Corinna Vinschen
2012-05-11 16:24 ` Corinna Vinschen
2012-05-11 16:38   ` starlight.2012q2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).