Messages in this thread | | | Date | Mon, 10 Feb 97 04:51 GMT | From | (Peter Benie) | Subject | Umsdos bug and query |
| |
In linux-2.0.27/fs/umsdos/namei.c, there is a bug which will be triggered when the disk is full or has some other fault. On line 724, result the entry for the --linux-.--- file is created. If it fails, msdos_create can return without setting result. iput will then be called with result set to an uninitialised value.
Line 712 /* #Specification: mkdir / umsdos directory / create EMD When we created a new sub-directory in a UMSDOS directory (one with full UMSDOS semantic), we create immediately an EMD file in the new sub-directory so it inherit UMSDOS semantic. */ struct inode *subdir; ret = umsdos_real_lookup (dir,info.fake.fname ,info.fake.len,&subdir); if (ret == 0){ struct inode *result; Line 724 ret = msdos_create (subdir,UMSDOS_EMD_FILE ,UMSDOS_EMD_NAMELEN,S_IFREG|0777,&result); subdir = NULL; Line 726 iput (result); } if (ret < 0){ printk ("UMSDOS: Can't create empty --linux-.---\n"); } iput (subdir);
It would be better if the printk were written: printk (KERN_INFO "UMSDOS: Can't create empty " UMSDOS_EMD_FILE "\n");
On a related topic, is it possible to have an msdos directory under a msdos directory? I've tried creating the directory under umsdos and removing the --linux-.--- file under MSDOS. When you do this, '..' is missing from the subdirectory causing getcwd to fail. '..' appears to be present under MSDOS, but I wouldn't trust it to tell me the truth.
Peter Benie
| |