[2.3.x] ftruncate doesn't work on vfat (was: StarOffice,Wine,kernel BUG at file.c)

From: Luca Montecchiani (m.luca@iname.com)
Date: Sun Mar 26 2000 - 23:47:51 EST


I try to close by myself the StarOffice saga but unfortunately
I've not so much skill on new linux fs layer :(

What I can say is that the problem is trigged out by ftruncate
putting some printk on fat_get_block seem that :

when ftruncate has 512 or multiple values we got this BUG

79: if (!phys)
       BUG();

otherwise :

69: if (iblock<<9 != MSDOS_I(inode)->mmu_private)
       BUG();

The offending program :

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

main(int argc,char **argv)
{
char buf[]="I want to crash fat filesystem";
int fp=open(argv[1], O_RDWR|O_CREAT, 0666);

ftruncate(fp, 1200);
//ftruncate(fp, 512);
//ftruncate(fp, 1024);

lseek(fp, 1030, SEEK_SET);

write(fp, buf,sizeof(buf));
close(fp);
}

I don't know where but the bug seem to be in fat_get_block() or
fat_truncate() ...

hope this help,
luca

-- 
------------------------------------------------------------------
E-mail......: Luca Montecchiani <m.luca@iname.com>
W.W.W.......: http://i.am/m.luca - http://luca.myip.org
Speakfreely.: sflwl -hlwl.fourmilab.ch luca@
I.C.Q.......: 17655604
-----------------------=(Linux since 1995)=-----------------------

Non esiste vento favorevole per il marinaio che non sa dove andare Seneca

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:18 EST