linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* incorrect inode count on reiserfs
@ 2003-12-08 13:26 Petr Sebor
  2003-12-08 13:51 ` Nikita Danilov
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Sebor @ 2003-12-08 13:26 UTC (permalink / raw)
  To: linux-kernel

I have noticed this behavior when moving the inn2 news server to 
2.6.0-test11 kernel
from 2.4.23
(inn2 refuses to start because if free inode shortage)

2.6.0-test11:
df -i:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda1                  0       0       0    -  /
/dev/sdb1                  0       0       0    -  /mnt/sdb1

while df shows:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1            243208608  11069612 232138996   5% /
/dev/sdb1             36150172     32840  36117332   1% /mnt/sdb1

different reiserfs based machine with 2.4.23; this is where the inn2
used to work before, but the inode test was not failing because of the
'always-nonzero' inode count:

df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/hde1            4294967295       0 4294967295    0% /
/dev/hdg1            4294967295       0 4294967295    0% /mnt/d2

df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hde1             77634256  77092844    541412 100% /
/dev/hdg1             38586912  19156508  19430404  50% /mnt/d2

another 2.6.0-test11 machine with ext2 reports inode counts correctly. 
my assumption is
that the problem is somehow reiserfs related, but my knowledge ends here.
all reiser fs's are of version 3.6

any ideas?

Petr


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

* Re: incorrect inode count on reiserfs
  2003-12-08 13:26 incorrect inode count on reiserfs Petr Sebor
@ 2003-12-08 13:51 ` Nikita Danilov
  2003-12-08 14:06   ` Petr Sebor
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nikita Danilov @ 2003-12-08 13:51 UTC (permalink / raw)
  To: Petr Sebor; +Cc: linux-kernel

Petr Sebor writes:
 > I have noticed this behavior when moving the inn2 news server to 
 > 2.6.0-test11 kernel
 > from 2.4.23
 > (inn2 refuses to start because if free inode shortage)
 > 
 > 2.6.0-test11:
 > df -i:
 > 
 > Filesystem            Inodes   IUsed   IFree IUse% Mounted on
 > /dev/sda1                  0       0       0    -  /
 > /dev/sdb1                  0       0       0    -  /mnt/sdb1
 > 
 > while df shows:
 > Filesystem           1K-blocks      Used Available Use% Mounted on
 > /dev/sda1            243208608  11069612 232138996   5% /
 > /dev/sdb1             36150172     32840  36117332   1% /mnt/sdb1
 > 
 > different reiserfs based machine with 2.4.23; this is where the inn2
 > used to work before, but the inode test was not failing because of the
 > 'always-nonzero' inode count:
 > 
 > df -i
 > Filesystem            Inodes   IUsed   IFree IUse% Mounted on
 > /dev/hde1            4294967295       0 4294967295    0% /
 > /dev/hdg1            4294967295       0 4294967295    0% /mnt/d2
 > 
 > df
 > Filesystem           1K-blocks      Used Available Use% Mounted on
 > /dev/hde1             77634256  77092844    541412 100% /
 > /dev/hdg1             38586912  19156508  19430404  50% /mnt/d2
 > 
 > another 2.6.0-test11 machine with ext2 reports inode counts correctly. 
 > my assumption is
 > that the problem is somehow reiserfs related, but my knowledge ends here.
 > all reiser fs's are of version 3.6

reiserfs has no fixed predefined number of inodes on the file
system. Hence, field f_files of struct statfs (see man 2 statfs) is not
applicable to this file system. Man page explicitly says:

       Fields that are undefined for a particular file system are
       set  to  0.

Previous man page stated that file system should put -1 (4294967295)
into undefined fields. Reiserfs has been changed to conform to the
changed specification.

SuS simply says:

NAME

    fstatvfs, statvfs - get file system information

SYNOPSIS

    [XSI] #include <sys/statvfs.h>

    int fstatvfs(int fildes, struct statvfs *buf);
    int statvfs(const char *restrict path, struct statvfs *restrict buf);

DESCRIPTION

    [...]

    It is unspecified whether all members of the statvfs structure have
    meaningful values on all file systems.

 > 
 > any ideas?

inn2 should be fixed. :)

Fix would really be simple: ignore test results if ->f_files is 0 or
0xffffffff.

 > 
 > Petr
 > 

Nikita.

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

* Re: incorrect inode count on reiserfs
  2003-12-08 13:51 ` Nikita Danilov
@ 2003-12-08 14:06   ` Petr Sebor
  2003-12-08 14:11   ` Andreas Schwab
  2003-12-08 14:35   ` Erik Hensema
  2 siblings, 0 replies; 9+ messages in thread
From: Petr Sebor @ 2003-12-08 14:06 UTC (permalink / raw)
  To: Nikita Danilov; +Cc: linux-kernel

Nikita Danilov wrote:

>reiserfs has no fixed predefined number of inodes on the file
>system. Hence, field f_files of struct statfs (see man 2 statfs) is not
>applicable to this file system. Man page explicitly says:
>
>       Fields that are undefined for a particular file system are
>       set  to  0.
>  
>
duh, I thought that f_files is applicable to reiserfs as well...

>Fix would really be simple: ignore test results if ->f_files is 0 or
>0xffffffff.
>  
>
ok, sorry for the noise... as for the inn2, I have disabled the free 
inode check in innwatch.ctl and it works well

thanks!
Petr


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

* Re: incorrect inode count on reiserfs
  2003-12-08 13:51 ` Nikita Danilov
  2003-12-08 14:06   ` Petr Sebor
@ 2003-12-08 14:11   ` Andreas Schwab
  2003-12-08 14:35   ` Erik Hensema
  2 siblings, 0 replies; 9+ messages in thread
From: Andreas Schwab @ 2003-12-08 14:11 UTC (permalink / raw)
  To: Nikita Danilov; +Cc: Petr Sebor, linux-kernel

Nikita Danilov <Nikita@Namesys.COM> writes:

> inn2 should be fixed. :)
>
> Fix would really be simple: ignore test results if ->f_files is 0 or
> 0xffffffff.

That should better be (fsfilcnt_t)-1.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: incorrect inode count on reiserfs
  2003-12-08 13:51 ` Nikita Danilov
  2003-12-08 14:06   ` Petr Sebor
  2003-12-08 14:11   ` Andreas Schwab
@ 2003-12-08 14:35   ` Erik Hensema
  2003-12-08 15:33     ` Nikita Danilov
  2003-12-08 16:09     ` Matthias Urlichs
  2 siblings, 2 replies; 9+ messages in thread
From: Erik Hensema @ 2003-12-08 14:35 UTC (permalink / raw)
  To: linux-kernel

Nikita Danilov (Nikita@Namesys.COM) wrote:
> Petr Sebor writes:
> > I have noticed this behavior when moving the inn2 news server to 
> > 2.6.0-test11 kernel
> > from 2.4.23
> > (inn2 refuses to start because if free inode shortage)

[...]

> reiserfs has no fixed predefined number of inodes on the file
> system. Hence, field f_files of struct statfs (see man 2 statfs) is not
> applicable to this file system. Man page explicitly says:
> 
>        Fields that are undefined for a particular file system are
>        set  to  0.
> 
> Previous man page stated that file system should put -1 (4294967295)
> into undefined fields. Reiserfs has been changed to conform to the
> changed specification.

[...]

> Fix would really be simple: ignore test results if ->f_files is 0 or
> 0xffffffff.

But innwatch checks for a out-of-inodes condition. How can it differentiate
between a undefined number of inodes (field set to 0) and a system that ran
out of inodes (field dropped to 0)?

A '4294967295 inodes should be enough for anyone'-situation is preferable I
think.

-- 
Erik Hensema <erik@hensema.net>

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

* Re: incorrect inode count on reiserfs
  2003-12-08 14:35   ` Erik Hensema
@ 2003-12-08 15:33     ` Nikita Danilov
  2003-12-08 16:09     ` Matthias Urlichs
  1 sibling, 0 replies; 9+ messages in thread
From: Nikita Danilov @ 2003-12-08 15:33 UTC (permalink / raw)
  To: erik; +Cc: linux-kernel

Erik Hensema writes:
 > Nikita Danilov (Nikita@Namesys.COM) wrote:
 > > Petr Sebor writes:
 > > > I have noticed this behavior when moving the inn2 news server to 
 > > > 2.6.0-test11 kernel
 > > > from 2.4.23
 > > > (inn2 refuses to start because if free inode shortage)
 > 
 > [...]
 > 
 > > reiserfs has no fixed predefined number of inodes on the file
 > > system. Hence, field f_files of struct statfs (see man 2 statfs) is not
 > > applicable to this file system. Man page explicitly says:
 > > 
 > >        Fields that are undefined for a particular file system are
 > >        set  to  0.
 > > 
 > > Previous man page stated that file system should put -1 (4294967295)
 > > into undefined fields. Reiserfs has been changed to conform to the
 > > changed specification.
 > 
 > [...]
 > 
 > > Fix would really be simple: ignore test results if ->f_files is 0 or
 > > 0xffffffff.
 > 
 > But innwatch checks for a out-of-inodes condition. How can it differentiate
 > between a undefined number of inodes (field set to 0) and a system that ran
 > out of inodes (field dropped to 0)?
 > 
 > A '4294967295 inodes should be enough for anyone'-situation is preferable I
 > think.

This is messy, because we have both statfs and statfs64 and this would
lead to the overflow detection problems.

I don't know what is the best solution here. statfs(2) is just not very
good interface. It was obviously designed to serve ffs/ufs/ext2 type
file systems only.

Looking at the magic in f_type field, is ugly, but should work.

 > 
 > -- 
 > Erik Hensema <erik@hensema.net>

Nikita.

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

* Re: incorrect inode count on reiserfs
  2003-12-08 14:35   ` Erik Hensema
  2003-12-08 15:33     ` Nikita Danilov
@ 2003-12-08 16:09     ` Matthias Urlichs
  2003-12-08 17:24       ` Erik Hensema
  1 sibling, 1 reply; 9+ messages in thread
From: Matthias Urlichs @ 2003-12-08 16:09 UTC (permalink / raw)
  To: linux-kernel

Hi, Erik Hensema wrote:

> But innwatch checks for a out-of-inodes condition. How can it differentiate
> between a undefined number of inodes (field set to 0) and a system that ran
> out of inodes (field dropped to 0)?
> 
Create a file. Watch that succeed. Check whether this succeeds, and that
the number of free inodes is still zero.
Delete the file. Check that the number of free inodes is _still_ zero.

Repeat a few times, with random sub-second delay if you're feeling
especially paranoid today, for added confidence.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
"The Establishment Clause, unlike the Free Exercise Clause, does not
 depend upon any showing of direct governmental compulsion and is violated
 by the enactment of laws which establish an official religion whether
 those laws operate directly to coerce nonobserving individuals or not."
          [U.S. Supreme Court, Wallace v. Jaffree (1985)]


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

* Re: incorrect inode count on reiserfs
  2003-12-08 16:09     ` Matthias Urlichs
@ 2003-12-08 17:24       ` Erik Hensema
  2003-12-09  3:01         ` Herbert Poetzl
  0 siblings, 1 reply; 9+ messages in thread
From: Erik Hensema @ 2003-12-08 17:24 UTC (permalink / raw)
  To: linux-kernel

Matthias Urlichs (smurf@smurf.noris.de) wrote:
> Hi, Erik Hensema wrote:
> 
>> But innwatch checks for a out-of-inodes condition. How can it differentiate
>> between a undefined number of inodes (field set to 0) and a system that ran
>> out of inodes (field dropped to 0)?
>> 
> Create a file. Watch that succeed. Check whether this succeeds, and that
> the number of free inodes is still zero.
> Delete the file. Check that the number of free inodes is _still_ zero.
> 
> Repeat a few times, with random sub-second delay if you're feeling
> especially paranoid today, for added confidence.

So what hack is uglier? ;-)

-- 
Erik Hensema <erik@hensema.net>

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

* Re: incorrect inode count on reiserfs
  2003-12-08 17:24       ` Erik Hensema
@ 2003-12-09  3:01         ` Herbert Poetzl
  0 siblings, 0 replies; 9+ messages in thread
From: Herbert Poetzl @ 2003-12-09  3:01 UTC (permalink / raw)
  To: Erik Hensema; +Cc: linux-kernel

On Mon, Dec 08, 2003 at 05:24:02PM +0000, Erik Hensema wrote:
> Matthias Urlichs (smurf@smurf.noris.de) wrote:
> > Hi, Erik Hensema wrote:
> > 
> >> But innwatch checks for a out-of-inodes condition. How can it differentiate
> >> between a undefined number of inodes (field set to 0) and a system that ran
> >> out of inodes (field dropped to 0)?
> >> 
> > Create a file. Watch that succeed. Check whether this succeeds, and that
> > the number of free inodes is still zero.
> > Delete the file. Check that the number of free inodes is _still_ zero.
> > 
> > Repeat a few times, with random sub-second delay if you're feeling
> > especially paranoid today, for added confidence.
> 
> So what hack is uglier? ;-)

hmm, well, maybe the fact that an 'inode' filesystem
which ran out of inodes will not report a total of 
0 inodes could help against all this uglyness ...

best,
Herbert

> -- 
> Erik Hensema <erik@hensema.net>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2003-12-09  3:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-08 13:26 incorrect inode count on reiserfs Petr Sebor
2003-12-08 13:51 ` Nikita Danilov
2003-12-08 14:06   ` Petr Sebor
2003-12-08 14:11   ` Andreas Schwab
2003-12-08 14:35   ` Erik Hensema
2003-12-08 15:33     ` Nikita Danilov
2003-12-08 16:09     ` Matthias Urlichs
2003-12-08 17:24       ` Erik Hensema
2003-12-09  3:01         ` Herbert Poetzl

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 NNTP newsgroup(s).