Sale deed

Sir my father had purchased a land through registered sale deed in the year 2010 from "A" bonafidely and got his name recorded in the mutation. Now we came to know that Mr. A has sold the same land to Mr. B in the year 2005 through a valid and registered sale deed.. Now Mr. A ceased to be the owner and the sale deed of B will prevail as the first registered sale deed..but however We were in the possession and use of the same land since 2010.. In 2014 B had filed a permanent prohibitory injunction suit against my father, which was dismissed in default.. Now there is compromise between my father and B..and we are ready to pay to B the amount of land to get a fresh sale deed registered in our favour, after getting the name of my father removed from the mutation records of the land and then get the name of B as owner w.r.t the first sale deed.. Sir what kind of suit should i file just in order to make sure that B will not change his mind( i mean i want to make him liable in front of court to transfer me the said land legally, after i get the name of my father removed)