From owner-freebsd-bugs Thu Jan 28 04:00:09 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA04678 for freebsd-bugs-outgoing; Thu, 28 Jan 1999 04:00:09 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA04175 for ; Thu, 28 Jan 1999 04:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id EAA17620; Thu, 28 Jan 1999 04:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA03527; Thu, 28 Jan 1999 03:52:26 -0800 (PST) (envelope-from nobody) Message-Id: <199901281152.DAA03527@hub.freebsd.org> Date: Thu, 28 Jan 1999 03:52:26 -0800 (PST) From: rock@cs.uni-sb.de To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: kern/9748: error in queue handling of at_shutdown() in kern_shutdown.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9748 >Category: kern >Synopsis: error in queue handling of at_shutdown() in kern_shutdown.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 28 04:00:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Daniel Rock >Release: 4.0-current >Organization: >Environment: But is present in kern_shutdown.c since priorities were introduced (rev 1.41) >Description: Inserting shutdown on priority basis doesn't fully work: The 2nd function is always placed behind the 1st function in the queue, regardless of the function priority >How-To-Repeat: at_shutdown_pri(func1, arg, QUEUE, SHUTDOWN_PRI_LAST); at_shutdown_pri(func2, arg, QUEUE, SHUTDOWN_PRI_FIRST); func1 is executed before func2 (if these are the first calls to at_shutdown_pri for queue QUEUE) >Fix: Simple three line fix: Index: kern_shutdown.c =================================================================== RCS file: /data/cvs/src/sys/kern/kern_shutdown.c,v retrieving revision 1.44 diff -c -r1.44 kern_shutdown.c *** kern_shutdown.c 1998/12/28 23:03:00 1.44 --- kern_shutdown.c 1999/01/28 11:42:52 *************** *** 470,476 **** int at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri) { ! sle_p ep, ip; if (queue < SHUTDOWN_PRE_SYNC || queue > SHUTDOWN_FINAL) { --- 470,476 ---- int at_shutdown_pri(bootlist_fn function, void *arg, int queue, int pri) { ! sle_p op, ep, ip; if (queue < SHUTDOWN_PRE_SYNC || queue > SHUTDOWN_FINAL) { *************** *** 492,498 **** if (ip == NULL) { LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links); } else { ! for (; LIST_NEXT(ip, links) != NULL; ip = LIST_NEXT(ip, links)) { if (ep->priority < ip->priority) { LIST_INSERT_BEFORE(ip, ep, links); ep = NULL; --- 492,498 ---- if (ip == NULL) { LIST_INSERT_HEAD(&shutdown_lists[queue], ep, links); } else { ! for (; ip != NULL; op = ip, ip = LIST_NEXT(ip, links)) { if (ep->priority < ip->priority) { LIST_INSERT_BEFORE(ip, ep, links); ep = NULL; *************** *** 500,506 **** } } if (ep != NULL) ! LIST_INSERT_AFTER(ip, ep, links); } return (0); } --- 500,506 ---- } } if (ep != NULL) ! LIST_INSERT_AFTER(op, ep, links); } return (0); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message