Hi,

I'm trying to use YAFFS2 for my root file system.

I have flashed a NAND FLASH partition with YAFFS2 rootfs image and I could boot from this partition.
Here are commands:
flash_eraseall /dev/mtd2
nandwrite -a -o /dev/mtd2 ./rootfs.yaffs2

Now, after booting using YAFFS2, when I paly around, I get YAFFS BUG print on the console,
Especially when I try to execute,

 -  rm some_soft_link_file
 -  rm some_dir/ -rf

even though actually files are removed ,
YAFFS prints bug prints as:

==>> yaffs bug: fs/yaffs2/yaffs_guts.c 6836
==>> yaffs bug: fs/yaffs2/yaffs_guts.c 6763
==>> yaffs bug: fs/yaffs2/yaffs_guts.c 6763

- rm a_simple_file doesn't print any bug.

-----Here is the snippet of the code I'm using (latest one downloaded from yaffs website). The BUG locations are in BOLD ----

static void yaffs_AddObjectToDirectory(yaffs_Object * directory,
                                       yaffs_Object * obj)
{

        if (!directory) {
                T(YAFFS_TRACE_ALWAYS,
                  (TSTR
                   ("tragedy: Trying to add an object to a null pointer directory"
                    TENDSTR)));
                YBUG();
        }
        if (directory->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
                T(YAFFS_TRACE_ALWAYS,
                  (TSTR
                   ("tragedy: Trying to add an object to a non-directory"
                    TENDSTR)));
                YBUG();
        }

        if (obj->siblings.prev == NULL) {
                /* Not initialised */
                YBUG();

        } else if (ylist_empty(&obj->siblings)) {
                YBUG();// line number 6836
        }


        yaffs_VerifyDirectory(directory);

        yaffs_RemoveObjectFromDirectory(obj);


        /* Now add it */
        ylist_add(&obj->siblings, &directory->variant.directoryVariant.children);
        obj->parent = directory;

        if (directory == obj->myDev->unlinkedDir
            || directory == obj->myDev->deletedDir) {
                obj->unlinked = 1;
                obj->myDev->nUnlinkedFiles++;
                obj->renameAllowed = 0;
        }

        yaffs_VerifyDirectory(directory);
        yaffs_VerifyObjectInDirectory(obj);


}

---
static void yaffs_VerifyDirectory(yaffs_Object *directory)
{

        struct ylist_head *lh;
        yaffs_Object *listObj;

        if(!directory)
                YBUG();//line number 6763

        if(yaffs_SkipFullVerification(directory->myDev))
                return;


        if(directory->variantType != YAFFS_OBJECT_TYPE_DIRECTORY){
                T(YAFFS_TRACE_ALWAYS, (TSTR("Directory has wrong type: %d" TENDSTR),directory->variantType));
                YBUG();
        }

        /* Iterate through the objects in each hash entry */

        ylist_for_each(lh, &directory->variant.directoryVariant.children) {
                if (lh) {
                        listObj = ylist_entry(lh, yaffs_Object, siblings);
                        if(listObj->parent != directory){
                                T(YAFFS_TRACE_ALWAYS, (TSTR("Object in directory list has wrong parent %p" TENDSTR),listObj->parent));

                                YBUG();
                        }
                        yaffs_VerifyObjectInDirectory(listObj);
                }
         }

}

How could this be solved. Waiting for your Help!!

Regards,
Hari