Re: [Yaffs] yaffs rmdir issue

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
CC: Li YingChao-RJN637
Subject: Re: [Yaffs] yaffs rmdir issue
On Monday 10 August 2009 15:14:03 Li YingChao-RJN637 wrote:
> Hi,
>
> When the directory is NOT empty, I try to remove dir by "rmdir"
> command. Normal should return fail, but YAFFS return true. The files
> under this directory is lost, and the file space can not be free.
> Seems "yaffs_UnlinkWorker" don't check if the directory is empty when
> obj->variantType is YAFFS_OBJECT_TYPE_DIRECTORY
>
> # # mount -t yaffs2 /dev/block/mtdblock9 /debug
> # # cd /debug
> # # ls -l
> drw-rw-rw- root     root              1970-01-01 05:31 lost+found
> # # mkdir aaa
> # # cp /data/flash_eraseall aaa
> # # df .
> .: 9216K total, 2780K used, 6436K available (block size 4096)
> # # ls -l
> drwxrwxrwx root     root              1970-01-01 05:32 aaa
> drw-rw-rw- root     root              1970-01-01 05:31 lost+found
> # # rm aaa
> rm failed for aaa, Is a directory
> # # ls -l aaa
> -rwxrwxrwx root     root      1660816 1970-01-01 05:32 flash_eraseall
> # # rmdir aaa
> # # ls -l
> drw-rw-rw- root     root              1970-01-01 05:31 lost+found
> # # df .
> .: 9216K total, 2780K used, 6436K available (block size 4096)
> # #

>
> # /data/busybox uname -a
> Linux localhost 2.6.29-omap1 #1 Sun Aug 2 22:32:04 CDT 2009 armv7l
> unknown


Thanks for reporting that.

Get latest cvs. It should work now:

root@linux-dual-head:/mnt# mkdir d
root@linux-dual-head:/mnt# touch d/f
root@linux-dual-head:/mnt# rmdir d
rmdir: failed to remove `d': Directory not empty
root@linux-dual-head:/mnt# rm d/f
root@linux-dual-head:/mnt# rmdir d
root@linux-dual-head:/mnt#

-- CHarles