TR : DOSFS unlink problem

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Thu Nov 25 18:38:57 UTC 2004


Etienne,

as you mentioned in another message, somebody else already found 
this problem. The reason is, that the unlink call want to check, 
that the directory, where the file is located, is writable. 

Unfortunately, DOSFS does niot keep track of parents, so in the 
structure maintained to manage a file, there is no pointer back 
to the directory, where the file is located in. Therefore, a 
basic operation to "move up one level in the directory tree" 
fails in DOSFS and this makes unlink fail aswell.

I havve already investigated a bit about this problem :-)

I also have the feeling, that DOSFS currently does NOT implement 
file attributes (is this right? sorry if I make wrong 
assumptions here). Then it really does not make sense to walk 
back to the parent directory of the file, and check the access 
attributes (which are not meaningful at all).

I have filed a PR on this.

And I have no clue on how to solve this. Adding "go back to 
parent" support seems a bit difficult. I have started in 
maintaining a "parent_cln" field  in the fat_file_fd_t 
structure, but this is only a start.

Any ideas? 

wkr,
Thomas.


> 
> -----Message d'origine-----
> De : Etienne Fortin [mailto:etienne.fortin at sensio.tv] 
> Envoyé : 25 novembre, 2004 13:02
> À : rtems-users at rtems.com
> Objet : DOSFS unlink problem
> 
> 
> Hi everyone,
> Me again, with my problems :)
> 
> I mounted a filesystem (DOSFS) on /storage.
> 
> In /storage I have a directory named bitstr.
> 
> So the basepath is /storage/bitstr.
> 
> I can create files in /storage/bitstr.
> 
> I can list the files with opendir/readdir...
> 
> BUT, I can't remove files in /storage/bitstr.
> 
> Somewhere in unlink, there's a call to
> rtems_filesystem_evaluate_parent(). It searchs for parent of
> /storage/bitstr (or so it seems). It finds the parent, and it's type is
> RTEMS_FILESYSTEM_MEMORY_FILE and not FAT_DIRECTORY. So, it throws up an
> error saying that it's not a directory.
> 
> Quite strange...
> 
> Any idea?
> 
> Etienne Fortin
> Sensio
> 

--------------------------------------------
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