Whenever it shall appear in any proceeding in partition that there are parties claiming the same portion adversely to each other, the court may either decide upon such adverse claims, or, in its discretion, direct the share or shares so in controversy to be set off and allotted, subject to the claims of the parties in controversy against each other.