mkdir() error on RFS

Chris Johns chrisj at rtems.org
Mon Jul 4 00:19:01 UTC 2011


On 3/07/11 1:01 AM, Xiang Cui wrote:
> mkdir("test/..",0777) on RFS seems to raise an error. It should return
> EEXIST. The test code is something like the below and I omit all the
> check of status code to make it clean.
> I use sparc_sis and RTEMS 4.11.

Yes this looks like a problem. Repeated using the sample program fileio 
on HEAD and it looks like 4.10 has the same bug:

$ sparc-rtems4.11-run 
sparc-rtems4.11/c/sis/testsuites/samples/fileio/fileio.exe


*** FILE I/O SAMPLE AND TEST ***
  =========================
  RTEMS FILE I/O Test Menu
  =========================
    p -> part_table_initialize
    f -> mount all disks in fs_table
    l -> list  file
    r -> read  file
    w -> write file
    s -> start shell
    Enter your selection ==>s
Creating /etc/passwd and group with three useable accounts
root/pwd , test/pwd, rtems/NO PASSWORD
  =========================
  starting shell
  =========================

RTEMS SHELL (Ver.1.0-FRC):/dev/console. May  8 2011. 'help' to list 
commands.
[/] # mkrd
Register RAM Disk Driver [blocks=1024 block-size=512]:successful
[/] # mkrfs /dev/rda
[/] # mkdir rd
[/] # mount -t rfs /dev/rda /rd
mounted /dev/rda -> /rd
[/] # cd rd
[/rd] # mkdir test/..
mkdir 'test/..' failed:No such file or directory
[/rd] # mkdir test
[/rd] # mkdir test/..
mkdir 'test/..' failed:No such file or directory
[/rd] #

I have fixed the RFS file system with a patch which is going in soon:

RTEMS SHELL (Ver.1.0-FRC):/dev/console. Jul  4 2011. 'help' to list 
commands.
[/] # mkrd
Register RAM Disk Driver [blocks=1024 block-size=512]:successful
[/] # mkrfs /dev/rda
[/] # mkdir rd
[/] # mount -t rfs /dev/rda /rd
mounted /dev/rda -> /rd
[/] # cd rd
[/rd] # mkdir test
[/rd] # mkdir test/..
mkdir 'test/..' failed:File exists

I have raised a PR (https://www.rtems.org/pr1827).

Chris



More information about the users mailing list