Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs lfs: Assert page identity doesn't change.



details:   https://anonhg.NetBSD.org/src/rev/221d8ae940c9
branches:  trunk
changeset: 374230:221d8ae940c9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Apr 11 14:50:47 2023 +0000

description:
lfs: Assert page identity doesn't change.

Forgot what I was debugging when I inserted a relookup in my local
tree months or years ago, but whatever it was, if that solved a
problem, this KDASSERT will make the problem more obvious.

diffstat:

 sys/ufs/lfs/lfs_pages.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 233629c4d119 -r 221d8ae940c9 sys/ufs/lfs/lfs_pages.c
--- a/sys/ufs/lfs/lfs_pages.c   Tue Apr 11 14:22:10 2023 +0000
+++ b/sys/ufs/lfs/lfs_pages.c   Tue Apr 11 14:50:47 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_pages.c,v 1.26 2020/09/05 16:30:13 riastradh Exp $ */
+/*     $NetBSD: lfs_pages.c,v 1.27 2023/04/11 14:50:47 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.26 2020/09/05 16:30:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.27 2023/04/11 14:50:47 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -499,6 +499,9 @@ retry:
                        while (pg->flags & PG_BUSY) {
                                uvm_pagewait(pg, vp->v_uobj.vmobjlock, "lfsput2");
                                rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
+                               /* XXX Page can't change identity here? */
+                               KDASSERT(pg ==
+                                   uvm_pagelookup(&vp->v_uobj, off));
                        }
                        uvm_pagelock(pg);
                        uvm_pageactivate(pg);



Home | Main Index | Thread Index | Old Index