|This article is about an older version of DF.|
Often a job in a kitchen, still or farmer's workshop will be canceled with the announcement ...needs unrotten (item). That doesn't mean you only have rotten ones, it means there is not an appropriate item that is available. Items that are forbidden, marked for chasming, or that have no path will be disregarded for workshop tasks.
Prepared food will rot the same as meat, cheese, and fish (raw or prepared), but plants will wither instead of producing miasma. The only place where food will not rot is in a container (such as a barrel), in a stockpile, in a trade depot (but not yet purchased), in somebody's inventory, or scheduled for use in a job (e.g. hauling). While you'd expect milk, fat, and tallow to rot also, it seems that they do not, nor, similarly, do any of the other categories of food, including flour, drinks, or seeds.
Note that meat and fish gradually degrades over time in this version (e.g. a prepared cave fish becoming a "xcave fishx", "Xcave fishX", then "XXcave fishXX", before finally disintegrating into some bones), and this does not cause miasma.
Once miasma has been generated (there is a purple square), it will spread for a while, eventually disappearing. This is true even if the original source has been removed: you can still have a spreading cloud of miasma even after you've cleaned up monarch butterfly remains. Miasma will pass through statues and impassable workshop tiles, but it can be stopped by doors, floodgates, and drawbridges.
To avoid miasma, either keep anything rotten outside, or alternatively have a subterranean refuse pile on its own in a room with several doors; this should halt the miasma's advance (although the room itself will still stink up).
Of course, once you've dug deep enough, you can simply dump any unwanted garbage in the chasm, destroying it before it has a chance to rot. Unless you've already filled the chasm with magma, however, this may make its inhabitants unhappy.
If you do encounter miasma coming from a kitchen, you can stop more by deconstructing the kitchen and making the area the kitchen was in a food stockpile. Miasma from a kitchen is (likely) caused by cooked food being left inside the kitchen because of not having food containers to put it in. Butcher shops suffer from the same problem.
Note that dwarves interrupted in mid-meal will abandon their food. Food abandoned in this manner can never be interacted with (picked up, stored, or chasmed) by any dwarf ever again, including the dwarf who abandoned it. If the food is abandoned underground, it will eventually rot and generate miasma.