(a)
Except as provided in subdivision (b), no judgment or claim for any deficiency shall be had or allowed against the personal representative or the estate if (1) there is a foreclosure or sale under a security interest, lien, mortgage, or deed of trust and (2) the proceeds of sale of the encumbered property are insufficient to pay the note, the security interest, lien, mortgage, or deed of trust, and the costs or expenses of sale.
(b)
If the note, security interest, mortgage, or deed of trust was given to pay, reduce, extend, or renew a lien, security interest, mortgage, or deed of trust existing on property of the estate at the time of death of the decedent and the indebtedness secured thereby was a claim established under Part 4 (commencing with Section 9000), the part of the indebtedness remaining unsatisfied shall be classed with other established claims.