Not an answer to your problem, but as a bit of general advice from someone who’s been there, if you haven’t already done so, I highly recommend testing your driver at low level with something like ChaN’s “Low level disk I/O module function checker” (http://elm-chan.org/fsw/ff/res/app4.c). (See freeRTOS-Plus-FAT file library - corrupted files.)
EDIT:
You can find a version adapted to my FreeRTOS+FAT driver here: app4-IO_module_function_checker.c
Make sure that passes cleanly before trying to debug at the filesystem level.