We're getting a lot of questions about proper management of seeds and barrels, stemming from the unfortunatey dwarfish tendency to use the closest available container for an item, regardless of whether or not that's the intended use. So for example, if a dwarf picks up a Plump Helmet Spawn in the dining room, he needs to store it either in a bag, or in a stockpile square. He seeks out the closest of any such, and puts the seed down. Typically, he ends up putting the seed into a bag not in a stockpile square. Ideally, he would put the seed in a bag that is in a stockpile square. The proliferation of mostly-empty bags (and, to a lesser extent, barrels) is a major problem, especially when you throw milling into the mix.
My suggestion is as follows: disallow placement of bags into barrels. Instead, mark bags as belonging to stockpiles, much as barrels and bins are now. While a bag need not be in a stockpile to be claimed by that stockpile, stockpiles will not claim more bags than they have space. When placing food items into storage, dwarves should look *only* at the existing stockpile storage including claimed containers. If the stockpile is currently full, and cannot claim any more bags (either because there are none, or because the stockpile has already claimed as many bags as it has squares), then the storage job is cancelled. If it is full, but can claim more bags, then an empty bag is found and marked as owned by the stockpile, and the seed is stuck into it; a future job can then move the bag to the stockpile once an open space has been made for it.
This should ensure that bags are used efficiently when it comes to storing seeds. There's a secondary problem with dye, flour, and the like, but that should be fixable with restacking, and in the meantime, you can just import the relevant trade goods.