I'm attempting to get a YAFFS2 filesystem to work on a NAND that I am simulating in QEMU using the NAND simulator code in the mainline kernel.

I can mount my simulated NAND device (via its MTD block device) without any errors ($ mount -t yaffs2 /dev/mtdblock0 /mnt/yfs).  I can create files and everything seems to be working well.  I can put debugging printk()s in the source for nandsim.c and see that the write and read functions are in fact getting called and returning successfully.  I also have MTD debugging tunred on (level 3) and its output seems to looks okay to me.  Everything seems fine.

However, when I unmount the filesystem and then mount it again, nothing resides in the filesystem except lost+found.

This happens both when I:
  1.) Mount the filesystem without doing any kind of formatting to the partition (simulated NAND) before mounting it, unmount, and then remount
  2.) When I run mkyaffs2 (modified version of mkyaffs for LP NANDs) with no image to write and then mount the filesystem, umount, and remount

I am not shutting down the QEMU emulator between mounts, because everything would obviously go away then (simulated NAND is in RAM).

Has anyone experienced this before and/or would be willing to offer suggestions?

Thanks in advance,

Ross S.