system hangs trying to recover hive registry on a 100% full filesystem



Hi mates,



On a system with these characteristics:

----------------------------------------------------------

WinCE 600, with R2

A Nand Flash block device driver.

The Nand Flashdisk is loaded early in the boot process to be able to load
the registry.

Hive registry enabled on the Nand Flashdisk

The Filesystem mounted on the Nand Flashdisk is exFAT.



We have faced following issue:

----------------------------------------------------------

If I over fill in the Filesystem with a file bigger than available space so
it ends full.

And then I force to save the registry by calling:

dwRet = RegFlushKey( HKEY_LOCAL_MACHINE );

if (dwRet != ERROR_SUCCESS)

RETAILMSG(1, (TEXT("\r\nSaveReg HKEY_LOCAL_MACHINE Error.
dwRet=0x%x\r\n"), dwRet));



dwRet = RegFlushKey( HKEY_CURRENT_USER );

if (dwRet != ERROR_SUCCESS)

RETAILMSG(1, (TEXT("\r\nSaveReg HKEY_CURRENT_USER Error.
dwRet=0x%x\r\n"), dwRet));



RegFlushKey fails (as expected) with 0x70=ERROR_DISK_FULL :

SaveReg HKEY_LOCAL_MACHINE Error. dwRet=0x70

SaveReg HKEY_CURRENT_USER Error. dwRet=0x70



After reset, the system NEVER BOOTS again !!!!!!!!!!!!!!!!!!!.

The last message I see through the console on a retail version is the
FMD_Init function of my block device driver (which success).



To recover it:

---------------------------------

1) If I boot with the 'cleanhive' flag during boot (that normally
makes my device to discard the hive registry and use the one inside nk.bin)
the system still hangs. Bad luck

2) If I erase my nand flash device using the bootloader; then it boots
(but I can't tell my clients to do that J ).

3) If I download exactly the same kernel but pointing the hive
registry to an invented folder in ram instead of flash by:

[HKEY_LOCAL_MACHINE\Init\BootVars]

"SystemHive"="FlashDisk\\system.hv" ->>
"SystemHive"="FlashDisk_Fool\\system.hv"



- The system boots

- The filesystem is OK, I can see all expected files.

- Then I manually delete hive registry files (that are now not system
protected) like Flashdisk\system.hv, flashdisk\default.mky

Boot the original kernel with hive registry pointing to flash:
Then It works again.





I've verified:

--------------------------

It's not really necessary to call RegFlushKey to get the device hang on
next boot. Doing it increase the probability (making it nearly to 100%) but
if I just over-fill and reboot y can also produce the hang (I think it
depends on the OS deciding to flush the registry itself).

It's not related with the page size of the flash. I've tested 2048 and 512
byte devices.

We have this implementation (hive registry on a nand flash device) over 2
very different BSP with independent block device drivers.so I don't think we
have an error there in the BSP.

This happen both using and not using R2 Flash MDD model.

That makes me point to a failure on the OS (hive registry).




Any idea?



Thanks in advance,

Buji



--

Héctor Bujanda

Digi International Inc.

Milicias 13-bajo.

E-26003 Logroño

Spain

Phone: +34 941270060

Fax: +34 941237770

mailto:hector.bujanda@xxxxxxxx

http://www.digi.com




.



Relevant Pages


Quantcast