Stability of layered channel flow of magnetic fluids