Source-Changes-HG archive

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

[src/trunk]: src/sys/kern The decision that `disksort_cylinder' uses to decid...



details:   https://anonhg.NetBSD.org/src/rev/6645b8678ce7
branches:  trunk
changeset: 481405:6645b8678ce7
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri Jan 28 09:27:38 2000 +0000

description:
The decision that `disksort_cylinder' uses to decide if the buffer needs
to go to the inversion list is incomplete. If the cylinders are equal
block numbers must be checked.

This caused lockups if some buffers with the same cylinder were cycling
through the list, as it may happen with softdep enabled.

Fixes PR #9197.

diffstat:

 sys/kern/subr_disk.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 1081f498a01c -r 6645b8678ce7 sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c      Fri Jan 28 08:09:48 2000 +0000
+++ b/sys/kern/subr_disk.c      Fri Jan 28 09:27:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_disk.c,v 1.26 2000/01/21 23:20:51 thorpej Exp $   */
+/*     $NetBSD: subr_disk.c,v 1.27 2000/01/28 09:27:38 hannken Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
@@ -139,7 +139,8 @@
         * If we lie after the first (currently active) request, then we
         * must locate the second request list and add ourselves to it.
         */
-       if (bp->b_cylinder < bq->b_cylinder) {
+       if (bp->b_cylinder < bq->b_cylinder ||
+           (bp->b_cylinder == bq->b_cylinder && bp->b_blkno < bq->b_blkno)) {
                while ((nbq = BUFQ_NEXT(bq)) != NULL) {
                        /*
                         * Check for an ``inversion'' in the normally ascending



Home | Main Index | Thread Index | Old Index