The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* inode values in file system driver
@ 2003-05-10 20:18 Adrian McMenamin
  2003-05-13 13:51 ` Erik Mouw
  0 siblings, 1 reply; 7+ messages in thread
From: Adrian McMenamin @ 2003-05-10 20:18 UTC (permalink / raw)
  To: linux-kernel

Am I allowed to assign the value 0 to an inode in a file system driver? I seem 
to be having problems with a file that is being assigned this inode value 
(its a FAT based filesystem so the inode values are totally artificial).

Adrian McMenamin

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

* Re: inode values in file system driver
  2003-05-10 20:18 inode values in file system driver Adrian McMenamin
@ 2003-05-13 13:51 ` Erik Mouw
  2003-05-13 14:33   ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Erik Mouw @ 2003-05-13 13:51 UTC (permalink / raw)
  To: Adrian McMenamin; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

On Sat, May 10, 2003 at 09:18:20PM +0100, Adrian McMenamin wrote:
> Am I allowed to assign the value 0 to an inode in a file system driver? I seem 
> to be having problems with a file that is being assigned this inode value 
> (its a FAT based filesystem so the inode values are totally artificial).

Yes, you are. However, glibc thinks that inode 0 is special and won't
show it.

Example: mount an NTFS filesystem with -o show_sys_files and do ls on
the mountpoint. You won't see the file $MFT, but it is there when you
copy it: cp /mountpoint/\$MFT /tmp .

Yes, this is a bug in glibc.


Erik

-- 
Erik Mouw
J.A.K.Mouw@its.tudelft.nl  mouw@nl.linux.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: inode values in file system driver
  2003-05-13 13:51 ` Erik Mouw
@ 2003-05-13 14:33   ` Andreas Schwab
  2003-05-13 14:47     ` Nikita Danilov
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2003-05-13 14:33 UTC (permalink / raw)
  To: Erik Mouw; +Cc: Adrian McMenamin, linux-kernel

Erik Mouw <J.A.K.Mouw@its.tudelft.nl> writes:

|> On Sat, May 10, 2003 at 09:18:20PM +0100, Adrian McMenamin wrote:
|> > Am I allowed to assign the value 0 to an inode in a file system driver? I seem 
|> > to be having problems with a file that is being assigned this inode value 
|> > (its a FAT based filesystem so the inode values are totally artificial).
|> 
|> Yes, you are. However, glibc thinks that inode 0 is special and won't
|> show it.

BS. This has nothing at all to do with glibc.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: inode values in file system driver
  2003-05-13 14:33   ` Andreas Schwab
@ 2003-05-13 14:47     ` Nikita Danilov
  2003-05-13 14:56       ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Nikita Danilov @ 2003-05-13 14:47 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Erik Mouw, Adrian McMenamin, linux-kernel

Andreas Schwab writes:
 > Erik Mouw <J.A.K.Mouw@its.tudelft.nl> writes:
 > 
 > |> On Sat, May 10, 2003 at 09:18:20PM +0100, Adrian McMenamin wrote:
 > |> > Am I allowed to assign the value 0 to an inode in a file system driver? I seem 
 > |> > to be having problems with a file that is being assigned this inode value 
 > |> > (its a FAT based filesystem so the inode values are totally artificial).
 > |> 
 > |> Yes, you are. However, glibc thinks that inode 0 is special and won't
 > |> show it.
 > 
 > BS. This has nothing at all to do with glibc.

from glibc-2.2.4/sysdeps/unix/readdir.c:

      /* Skip deleted files.  */
    } while (dp->d_ino == 0);

In other words, readdir(3) will not return dirent for inode with ino 0.

 > 
 > Andreas.
 > 

Nikita.

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

* Re: inode values in file system driver
  2003-05-13 14:47     ` Nikita Danilov
@ 2003-05-13 14:56       ` Andreas Schwab
  2003-05-13 18:54         ` Adrian McMenamin
  2003-05-14 18:31         ` Adrian McMenamin
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Schwab @ 2003-05-13 14:56 UTC (permalink / raw)
  To: Nikita Danilov; +Cc: Erik Mouw, Adrian McMenamin, linux-kernel

Nikita Danilov <Nikita@Namesys.COM> writes:

|> Andreas Schwab writes:
|>  > Erik Mouw <J.A.K.Mouw@its.tudelft.nl> writes:
|>  > 
|>  > |> On Sat, May 10, 2003 at 09:18:20PM +0100, Adrian McMenamin wrote:
|>  > |> > Am I allowed to assign the value 0 to an inode in a file system driver? I seem 
|>  > |> > to be having problems with a file that is being assigned this inode value 
|>  > |> > (its a FAT based filesystem so the inode values are totally artificial).
|>  > |> 
|>  > |> Yes, you are. However, glibc thinks that inode 0 is special and won't
|>  > |> show it.
|>  > 
|>  > BS. This has nothing at all to do with glibc.
|> 
|> from glibc-2.2.4/sysdeps/unix/readdir.c:
|> 
|>       /* Skip deleted files.  */
|>     } while (dp->d_ino == 0);
|> 
|> In other words, readdir(3) will not return dirent for inode with ino 0.

I stand corrected.  I was thinking of getdirentries, which does not have
this problem.  But this is traditional Unix behaviour.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: inode values in file system driver
  2003-05-13 14:56       ` Andreas Schwab
@ 2003-05-13 18:54         ` Adrian McMenamin
  2003-05-14 18:31         ` Adrian McMenamin
  1 sibling, 0 replies; 7+ messages in thread
From: Adrian McMenamin @ 2003-05-13 18:54 UTC (permalink / raw)
  To: Andreas Schwab, Nikita Danilov; +Cc: Erik Mouw, linux-kernel

On Tuesday 13 May 2003 15:56, Andreas Schwab wrote:
> Nikita Danilov <Nikita@Namesys.COM> writes:
> |> Andreas Schwab writes:
> |>  > Erik Mouw <J.A.K.Mouw@its.tudelft.nl> writes:
> |>  > |> On Sat, May 10, 2003 at 09:18:20PM +0100, Adrian McMenamin wrote:
> |>  > |> > Am I allowed to assign the value 0 to an inode in a file system
> |>  > |> > driver? I seem to be having problems with a file that is being
> |>  > |> > assigned this inode value (its a FAT based filesystem so the
> |>  > |> > inode values are totally artificial).
> |>  > |>
> |>  > |> Yes, you are. However, glibc thinks that inode 0 is special and
> |>  > |> won't show it.
> |>  >
> |>  > BS. This has nothing at all to do with glibc.
> |>
> |> from glibc-2.2.4/sysdeps/unix/readdir.c:
> |>
> |>       /* Skip deleted files.  */
> |>     } while (dp->d_ino == 0);
> |>
> |> In other words, readdir(3) will not return dirent for inode with ino 0.
>
> I stand corrected.  I was thinking of getdirentries, which does not have
> this problem.  But this is traditional Unix behaviour.
>
> Andreas.


Thanks. At least I know why my driver is failing now.

Adrian


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

* Re: inode values in file system driver
  2003-05-13 14:56       ` Andreas Schwab
  2003-05-13 18:54         ` Adrian McMenamin
@ 2003-05-14 18:31         ` Adrian McMenamin
  1 sibling, 0 replies; 7+ messages in thread
From: Adrian McMenamin @ 2003-05-14 18:31 UTC (permalink / raw)
  To: Andreas Schwab, Nikita Danilov; +Cc: Erik Mouw, linux-kernel

On Tuesday 13 May 2003 15:56, Andreas Schwab wrote:
> Nikita Danilov <Nikita@Namesys.COM> writes:


> |> In other words, readdir(3) will not return dirent for inode with ino 0.
>
> I stand corrected.  I was thinking of getdirentries, which does not have
> this problem.  But this is traditional Unix behaviour.
>


OK. I've worked round this in my driver. It will now list the file, and does 
so with inode 0 (I have not tinkered with anything outside my driver, so this 
won't have any impact on any other fs). Is this A Bad Thing?

Adrian


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

end of thread, other threads:[~2003-05-14 18:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-10 20:18 inode values in file system driver Adrian McMenamin
2003-05-13 13:51 ` Erik Mouw
2003-05-13 14:33   ` Andreas Schwab
2003-05-13 14:47     ` Nikita Danilov
2003-05-13 14:56       ` Andreas Schwab
2003-05-13 18:54         ` Adrian McMenamin
2003-05-14 18:31         ` Adrian McMenamin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox