Source-Changes-HG archive

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

[src/trunk]: src/sys/kern extent_alloc_subregion1(): when a candidate region ...



details:   https://anonhg.NetBSD.org/src/rev/fa179a15cd2b
branches:  trunk
changeset: 521937:fa179a15cd2b
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Feb 09 01:00:09 2002 +0000

description:
extent_alloc_subregion1(): when a candidate region doesn't fit after being
rounded up to respect boundary limits, adjust newstart and last before
skiping to the next region. Otherwise we may check the same candidate
region against the start of the next region, no the one immediatly following
the hole, leading to corrupted map.

This fixes the panic seen on sparc64 with scsi drivers, and probably fixes
PR 15489.

diffstat:

 sys/kern/subr_extent.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r e5d07991c8f4 -r fa179a15cd2b sys/kern/subr_extent.c
--- a/sys/kern/subr_extent.c    Fri Feb 08 23:50:53 2002 +0000
+++ b/sys/kern/subr_extent.c    Sat Feb 09 01:00:09 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_extent.c,v 1.44 2001/11/12 15:25:19 lukem Exp $   */
+/*     $NetBSD: subr_extent.c,v 1.45 2002/02/09 01:00:09 bouyer Exp $  */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.44 2001/11/12 15:25:19 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.45 2002/02/09 01:00:09 bouyer Exp $");
 
 #ifdef _KERNEL
 #include <sys/param.h>
@@ -722,7 +722,7 @@
                                        newend = newstart + (size - 1);
                                        dontcross += boundary;
                                        if (!LE_OV(newstart, size, rp->er_start))
-                                               continue;
+                                               goto skip;
                                }
 
                                /*
@@ -757,6 +757,7 @@
                        }
                }
 
+skip:
                /*
                 * Skip past the current region and check again.
                 */



Home | Main Index | Thread Index | Old Index