Well, after reading my configuration my SD card is useless.
What does this mean? You need to throw it away and buy a new one?
Which code I have to write for a clean eject?
All that really needs to be done is close all open files, and make sure you never try to access the device in loop(). Setting the slave select pin HIGH again wouldn't hurt.