BUG Report in iso9660_fs in 1.3.90 (f_blocks is wrong)

Tigran Aivazian (tigran@zetnet.co.uk)
Wed, 17 Apr 1996 16:32:58 +0000 (GMT)


Hello guys,

I noticed a bug in (f)statfs(2) when called on iso9660 filesystem.
Look what it shows:

Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/sda5 297379 214682 67338 76% /
/dev/sda6 99120 78492 15509 84% /home
/dev/sda7 98135 23809 69258 26% /users
/dev/sda1 495666 31927 463739 6% /usr/src
/dev/hdd 342694 342694 0 100% /cdrom

As you see, it says that /cdrom has 342694 blocks which is twice as small
as it used to be. After booting with different kernel versions here is what
I found:

1.3.20 Ok
1.3.81 Ok
1.3.88 Not Ok
1.3.90 Not Ok

In fs/isofs/inode.c there is a function called isofs_statfs() which fills in
the statfs buffer:

tmp.f_blocks = sb->u.isofs_sb.s_nzones;

and the number that ends up in f_blocks is incorrect. Btw, I wrote a trivial
test program just to make sure that it is not df(1L) that misbehaves but,
indeed, the Kernel.

I heard that someone said "Any bug will be fixed within 24 hours if you
isolated it within a function". Lets see....

If I fix it myself I will let you guys know.

Regards,
Tigran.