Dosfs question..?

Daniel Gustafsson daniel.gustafsson at space.se
Thu Nov 18 14:58:23 UTC 2004


 
Hi.

I have debugged the unlink() and the error occurs in msdos_eval_path().

-- in msdos_eval_path(), line 114
...
switch(type)
{
case MSDOS_UP_DIR:

if (fat_fd->fat_file_type != FAT_DIRECTORY)		-->
fat_fd->fat_file_type = 5 = RTEMS_FILESYSTEM_MEMORY_FILE = FAT_FILE
	errno = ENOTDIR;						-->
ERROR!!!
...
--

Steps to mount and create file:

1. msdos_format("/dev/ramdisk0", NULL);
2. ide_part_table_initialize("/dev/ramdisk0");
3. rtems_fs_mount(fs_table, sizeof(...), NULL);

fs_table ~ { "/dev/ramdisk0", "/mnt/ramdisk0" , msdos_ops,
RTEMS_FILESYSTEM_READ_WRITE, flags, 0 }   --> example

4. creat("/mnt/ramdisk0/file1", S_IREAD | S_IWRITE);
5. write to file 1
6. close file 1
7. unlink("/mnt/ramdisk0/file1");					-->
Returns "NOT A DIRECTORY"


Everything is OK but the unlink.

NOTIS: The /mnt/ramdisk0/ doesn't contain "." or "..". If I make a sub
directory in /mnt/ramdisk0/ it will contain "." and "..". 


//DANIEL 


>-----Original Message-----
>From: Eugeny S. Mints [mailto:emints at ru.mvista.com] 
>Sent: Thursday, November 18, 2004 3:08 PM
>To: Thomas Doerfler
>Cc: Daniel Gustafsson; rtems-users at rtems.com
>Subject: Re: Dosfs question..?
>
>Hi All,
>
>Really strange return code. unlink() call should transform into 
>msdos_file_rmnod() routine call. Check whether the msdos routine is 
>reached if not - the issue somewhere in non-msdos related code (start 
>from unlink() routine in libcsupport dir).
>
>How do you mount your msdos volume? I suppose you mount to some IMFS 
>directory (mnt?). My suggestion that the issue is somehow connected to 
>the mount point.
>
>		Eugeny
>
>Thomas Doerfler wrote:
>> Daniel,
>> 
>> I did a quick check of source codes, I really don't 
>> know what is going on in your system. 
>> 
>> My idea, what you might do:
>> - Either step into the unlink call and find out 
>> where the error code is set.
>> 
>> - Or: perform a grep over the libfs source code:
>> grep ENOTDIR cpukit/libfs/src/*/*.c
>> 
>> You will get about 10 results. Set a breakpoint on 
>> every of these lines. Start your code. And look 
>> where the breakpoint is hit. 
>> 
>> The rest is analysis then.
>> 
>> By the way: which string do you pass to the unlink 
>> call?
>> 
>> wkr,
>> Thomas.
>> 
>> 
>> 
>>>Hello.
>>>
>>>I am running rtems 4.6.2 on a ERC32 using TSIM as simulator 
>enviroment. Am
>>>using dosfs on the ramdisk. Everything works fine, as it 
>should, except the
>>>removal of files. I try to use the unlink() but it won't 
>accept the file
>>>(returns "NOT A DIRECTORY"???). What am I doing wrong. Is maybe the
>>>permissions is f**kt up (does dosfs support permissions 
>because I can't
>>>change them).
>>>
>>>Please help me someone or direct me to some documentation 
>about rtems dosfs.
>>>
>>>
>>>Many thanks to Thomas Doerfler for providing to the Rtems 
>community with a
>>>functional format function for dosfs.
>>>
>>>Regards
>>>Daniel Gustavsson 
>> 
>> 
>> --------------------------------------------
>> IMD Ingenieurbuero fuer Microcomputertechnik
>> Thomas Doerfler           Herbststrasse 8
>> D-82178 Puchheim          Germany
>> email:    Thomas.Doerfler at imd-systems.de
>> PGP public key available at: http://www.imd-
>> systems.de/pgp_keys.htm
>> 
>> 
>> 
>
>
>




More information about the users mailing list