Xiahou Ba had all along not been on good terms with Guo Huai, so he feared that he would end up like Cao Shuang, hence he fled and defected to Shu. In autumn, Jiang Wei led Shu forces to attack the Wei-controlled Yong Province, had two fortresses constructed at Qushan (麴山; southeast of present-day Min County, Gansu), and ordered his officers Ju An (句安) and Li Xin (李歆) to guard them. He also contacted the Qiang tribes and requested assistance from them in harassing the commanderies in Yong Province. Guo Huai discussed with Chen Tai, the Inspector of Yong Province, on how to deal with the Shu invasion. Chen Tai said: "The fortresses at Qushan may be well-defended, but the roads leading into Shu are difficult to travel, so they will require a sufficient amount of supplies. The Qiang tribes are worried about this weakness of the Shu army, so they may not be willing to help Shu. If we surround the fortresses and attack them, we can easily capture them. Even if Shu reinforcements arrive, the dangerous mountainous terrain will cause them to be worn out." Guo Huai then ordered Chen Tai, Xu Zhi and Deng Ai to lead Wei forces to attack the fortresses at Qushan and cut off their food and water supplies. Ju An and Li Xin led their men to taunt Deng Ai to attack them, but Deng Ai ignored them. As time passed, the two fortresses gradually ran out of supplies. Jiang Wei led his troops from Mount Niutou (牛頭山; west of present-day Zhaohua District, Guangyuan, Sichuan) to reinforce the fortresses. They encountered Chen Tai and his troops along the way. Chen Tai said: ""The Art of War" says that the best way to win a battle is to win without fighting. If we manage to occupy Mount Niutou, Jiang Wei's return route will be sealed off and he can be easily captured by us." He then ordered his troops to build forts to resist Jiang Wei's forces but refrain from engaging the enemy. At the same time, he also wrote to Guo Huai and requested his help in attacking Mount Niutou. Guo Huai did so and led his troops across the Tao River in preparation for attacking Mount Niutou. After Jiang Wei retreated, Ju An and Li Xin became isolated at the fortresses at Qushan, so they had no choice but to surrender to the enemy.