
38 Cal.3d 884 (1985)
700 P.2d 1290
215 Cal. Rptr. 288
ARROW SAND AND GRAVEL, INC., Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; SUNBURST DECORATIVE ROCK, INC., Real Party in Interest.
Docket No. L.A. 31971.
Supreme Court of California.
June 27, 1985.
*886 COUNSEL
Richard M. Atkinson and Annie Verdries for Petitioner.
No appearance for Respondent.
Martin L. Abrams for Real Party in Interest.
OPINION
GRODIN, J.
This case presents an equal protection challenge to the provisions of Code of Civil Procedure section 409.[1] For the reasons discussed below, we reject this challenge and uphold the statute as written.

I.
Sunburst Decorative Rock, Inc., filed an action against Arrow Sand and Gravel (petitioner) to obtain judicial foreclosure on a deed of trust secured by certain real property to which Arrow held title. Arrow filed an answer to the complaint alleging certain affirmative defenses, but filed no cross-complaint. Sunburst moved for summary judgment and its motion was granted. Sunburst waived a deficiency judgment and a commissioner's foreclosure sale of the property was scheduled.
At this point, Arrow caused to be recorded a notice of lis pendens, announcing its intent to appeal from the underlying judgment. Sunburst moved *887 to expunge the lis pendens pursuant to section 409.1. The basis of Sunburst's motion was that section 409, subdivision (a) provides that a notice of lis pendens may be recorded in an action concerning real property or affecting the title or the right of possession of real property, only by a plaintiff or by a defendant who files a cross-complaint; since Arrow falls within neither class, it was not entitled to record such a notice.[2] Arrow opposed the motion, arguing that section 409, if so construed, violated equal protection guarantees.
Respondent trial court granted Sunburst's motion and issued an order expunging the lis pendens. Arrow then filed a notice of appeal from the foreclosure judgment. At the foreclosure sale, Sunburst purchased the property. Arrow now seeks a writ of mandate pursuant to section 409.4, contending that the trial court erred in granting the motion to expunge.[3]

II.
(1a) Petitioner's equal protection argument is that defendant titleholders appealing from adverse foreclosure judgments are in a position similar to plaintiffs or cross-complaining defendants asserting claims against real property at the outset of any legal action. Based on this premise, Arrow argues that there is no rational basis for allowing the latter claimants to protect their claims against property by recording a notice of lis pendens while denying defendants like Arrow the same protection. Petitioner's analysis is incomplete in that it ignores the statutory assurance of the finality of judicially ordered sales. A recorded notice of lis pendens would not serve to vitiate the title of a purchaser at a judicial foreclosure sale. (2) (See fn. 4.), *888 (1b) Thus, in this special context, section 409 withholds no protection from defendant titleholders which it affords to other litigants.[4]
(3) "... `"The purpose of a lis pendens is merely to furnish a means of notifying all persons of the pendency of an action and thereby to bind any person who may acquire an interest in [the] property, subsequent to the institution of the action, by any judgment which may be secured in the action affecting the property." [Citations.]' ... `"`The general rule is, that one not a party to a suit [italics added] is not affected by the judgment; the exception at common law is, that a pendente lite purchaser, though not a party, was so affected; the qualification of the doctrine made by our statute is, that such purchaser is not affected unless notice of such lis pendens be filed with the recorder.' [Citations.]"'" (Kendall-Brief Co. v. Superior Court, supra, 60 Cal. App.3d 462, 468.)
But any party to an action concerning title to real property necessarily has actual notice of the pending proceeding and therefore takes any interest acquired subject to the judgment rendered. (See Albertson v. Raboff (1956) 46 Cal.2d 375, 379 [295 P.2d 405].) For this reason, California law has *889 historically protected the title of a defendant titleholder throughout the period of appeal when the purchaser at the judicial sale was a party to the underlying litigation.
Thus, where the plaintiff in the action purchases the defendant's property under a sale ordered by a judgment, the former owner, after reversal on appeal, may have the sale set aside and be restored to possession. (See Reynolds v. Harris, supra, 14 Cal. 667.) The same rule was applied to plaintiff's assignee (Di Nola v. Allison (1904) 143 Cal. 106 [76 P. 976]) and to plaintiff's grantee, even if the plaintiff had conveyed to a third party before defendant appealed from the underlying judgment (Mills v. Laing (1918) 38 Cal. App. 776 [177 P. 493]).
Under this view of the law, the only time the title of a defendant titleholder might be irrevocably lost pending appeal from a foreclosure judgment would be on the relatively rare occasion that a stranger to the underlying action purchased the property at the judicial sale.[5] Apparently, the question whether such a purchaser should be considered a purchaser pendente lite or a bona fide purchaser if the underlying judgment was subsequently reversed on appeal was never explicitly decided in California. In the majority of other jurisdictions which have considered the problem, the rule has been that reversal of an order or decree directing a judicial sale does not divest a purchaser in good faith who is a stranger to the proceeding of his title, provided there has been no stay of proceedings. (47 Am.Jur.2d, Judicial Sales, § 53 et seq., p. 340 et seq.) And it has been held that the good faith status of such a purchaser is not impeached even by notice that defendant titleholder intended to file an appeal from the underlying decree. (Rose v. Cox (1944) 297 Ky. 458 [179 S.W.2d 871]; Annot. (1945) 155 A.L.R. 1246.)
The potential conflict between this approach and the rule of lis pendens has been noted by commentators, but few courts have explicitly addressed the relationship between the two rules. (47 Am.Jur.2d, Judicial Sales, § 62, pp. 347, 348; Annot., Reversal, Upon Writ of Error or Appeal, of Decree Directing Judicial Sale as Affecting Title of Stranger to Litigation Who Purchased at Such Sale Before Appeal or Pending Appeal Without Supersedeas (1945) 155 A.L.R. 1252, 1267, § II(f).) Of the cases which have considered this conflict, the majority have concluded that the rule of notice of lis pendens does not apply to a purchaser at a judicial sale who is not a *890 party to the litigation. (McDonald v. Rankin (1909) 92 Ark. 173 [122 S.W. 88]; Feaster v. Fleming (1870) 56 Ill. 457; Rose v. Cox, supra, 179 S.W.2d 871; Evans v. Kahr (1899) 60 Kan. 719 [57 P. 950, 58 P. 467].) The rationale for this result lay in the necessity of encouraging reliance upon courts' decrees in this context. "There must be reliance upon the judgments and decrees of the courts. Deprive purchasers at judicial sales, of protection from them, and our titles become mere shadows. [Citations.]" (Feaster, supra, at p. 460.)
We are aware of only one case stating that a defendant could protect his title to real property transferred in a judicial foreclosure sale by recording a notice of lis pendens. (See Continental Secur. Corp. v. Wetherbee (1937) 187 La. 773 [175 So. 571].) And, in that case, the court refused to divest the stranger's title on the basis that defendant had not timely complied with the statutory requirements for recording such a notice.
Thus it appears that, under California law, a recorded notice of lis pendens was unnecessary to protect defendant titleholder's interest if plaintiff purchased the property, and of doubtful efficacy if the purchaser was a stranger to the action. At this point, however, any survey of precedents in this area of law is primarily of academic interest. (1c) In 1982, the Legislature enacted a comprehensive revision of the law of enforcement of judgments which completely eliminated the possibility that judicial sales be set aside on reversal of the underlying judgment regardless of the identity of the purchaser. Under the 1982 act, section 701.680 pertains to foreclosure sales of real property where plaintiff waives a deficiency judgment. (See §§ 726, subd. (e); 716.020, subd. (b).) This section provides, in subdivision (a), that except in cases where the sale was improper because of irregularities in the proceedings, such a sale "is absolute and may not be set aside for any reason." (Italics added.) In light of the fact that subdivision (b) of the same section discusses the judgment debtor's remedies in the event the "judgment is reversed, vacated, or otherwise set aside ...," it is apparent that the Legislature has determined that judicial sales of real property may not be set aside on the basis that the underlying judgment ordering the sale has been reversed.
The rationale for this provision is explained in the Law Revision Commission's Recommendations (Law Revision Report, p. 1115 et seq.). Under prior law, judgment debtors enjoyed a statutory right to redeem their property by paying the purchaser the sale price plus the amount of any prior liens, interest, and expenses, within 12 months after the sale. Although the purpose of this law was to protect the interests of the judgment debtor, its effect was to depress the potential value of property sold at such sales by imposing severe restrictions on the purchaser's title. In the commission's *891 view the new law will better serve public policy by assuring a fair bid for the property. The Legislative Committee comment to section 701.680 makes clear that, in the Legislature's view, the defendant's interest in the title to the property is adequately protected by the statutory provisions permitting a stay on appeal. (§§ 916, 917.4.)
Under section 917.4, the defendant in a foreclosure action can seek to stay the enforcement of an order of sale by submitting an undertaking in an amount fixed by the trial court to insure against waste. In the event such a defendant fails to obtain a stay from the trial court he may still seek supersedeas from the Court of Appeal.
As a legal matter, recording a notice of lis pendens is not an impediment to the sale of real property. It simply provides constructive notice of pertinent pending legal actions and protects the priority of the litigant's interest. Petitioner here proceeds under the notion that recording a notice of lis pendens would somehow protect its title to the property in spite of a judicial foreclosure sale. But, unless a defendant titleholder seeks and receives a statutory stay of enforcement or supersedeas from a higher court, the judicial sale may proceed. And, once consummated, the sale cannot be set aside for any reason. Thus, section 409, which allows certain litigants to record notices of lis pendens, affords these litigants no protection where title to the property is conveyed through a judicial sale.
For the foregoing reasons, there is no denial of equal protection to defendant titleholders in petitioner's situation. The petition for a writ of mandate is denied and the alternative writ previously issued is discharged.
Bird, C.J., Mosk, J., Kaus, J., Broussard, J., Reynoso, J., and Lucas, J., concurred.
NOTES
[1]  Unless otherwise noted, all statutory references are to the Code of Civil Procedure.
[2]  Section 409, subdivision (a) provides: "In an action concerning real property or affecting the title or the right of possession of real property, the plaintiff, at the time of filing the complaint, and the defendant, at the time of filing a cross-complaint, or at any time afterwards, may record in the office of the recorder of the county in which the property is situated, a notice of the pendency of the action, containing the names of the parties, and the object of the action or cross-action, and a description of the property in that county affected thereby. This section authorizes a notice of an action concerning real property pending in any United States district court to be recorded and indexed in the same manner and in the same place as herein provided with respect to notices of action pending in courts of this state. From the time of filing such notice for record only, shall a purchaser or encumbrancer of the property affected thereby be deemed to have constructive notice of the pendency of the action as it relates to the real property and only of its pendency against parties designated by their real names."
[3]  In this instance, the Court of Appeal issued the alternative writ. In view of sections 916 and 917.4, providing for stay of a judgment or order directing the sale of real property, it appears that a plain, speedy, and adequate remedy in the ordinary course of law was available to petitioner. We would not, therefore, have issued the alternative writ. (See § 1086.)
[4]  Petitioner's claim arises in the context of judicial foreclosures, and its petition contains no analysis of other actions. Because we conclude that section 409 does not deny equal protection in this context, we do not undertake to decide potential equal protection problems in situations which have not yet been brought to our attention.

We note, however, that in actions concerning real property, defendant titleholders enjoy certain equitable protections unavailable to other litigants. Thus, for purposes of equal protection analysis, it does not appear that such defendants are situated similarly to the classes of litigants mentioned in section 409. In contexts other than judicial foreclosure, defendant titleholders' interests are protected by the rule of restitution upon reversal of judgment. "[A] party obtaining through a judgment, before reversal, any advantage or benefit, must restore what he got to the other party, after the reversal." (Reynolds v. Harris (1860) 14 Cal. 667, 680.) In addition, "[A] person who purchases property after entry of judgment of the trial court in an action affecting the property, within contemplation of the doctrine of lis pendens, and also after review proceedings have been formally initiated, is looked on as a pendente lite purchaser, in the sense that he takes the property subject to the outcome of the review proceedings. It has been broadly stated that except as to purchases made at sales carried out under and by judicial decree, a person who, in making a purchase of property, relies on an appealable decision takes the risk of the ultimate decision." (51 Am.Jur.2d, Lis Pendens, § 38, p. 985, italics added, fns. omitted; see also Di Nola v. Allison (1904) 143 Cal. 106 [76 P. 976].) Thus it appears that, for purposes of protecting his interests in the title to a disputed parcel of real property, a defendant titleholder is not situated similarly to a plaintiff or a cross-complaining defendant whose claims, in the absence of a recorded notice of lis pendens, would be unprotected.
Indeed, it is doubtful whether section 409 was intended for the use of defendant titleholders in any case. The more appropriate purpose of the provision applicable to defendants who file cross-complaints appears to be to protect the interests of defendants in land-related litigation who do not hold the legal title to the land against which they assert a claim. (See, e.g., Orekar v. Lager (1932) 122 Cal. App. 370 [10 P.2d 178] [defendant cross-complained seeking to set aside as fraudulent a deed conveying the property to a third party cross-defendant]; Kendall-Brief Co. v. Superior Court (1976) 60 Cal. App.3d 462 [131 Cal. Rptr. 515] [defendant's cross-complaint affected title to real property owned by plaintiff].)
[5]  We note that, in this case, as in almost all others, plaintiff was the purchaser at the judicial sale. See California Law Revision Commission's 1982 Creditors' Remedies Legislation (operative July 1, 1983) with official comments (Sept. 1982) 16 Cal. Law Revision Com. Rep. (1982) Recommendation, note 398 and accompanying text, page 1117 (hereafter Law Revision Report).
