From ticso@cicely8.cicely.de Sat Jun 26 02:05:21 1999
Return-Path: <ticso@cicely8.cicely.de>
Received: from mail.du.gtn.com (mail.du.gtn.com [194.77.9.57])
	by hub.freebsd.org (Postfix) with ESMTP id 5B97A14F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 1999 02:05:19 -0700 (PDT)
	(envelope-from ticso@cicely8.cicely.de)
Received: from cicely7.cicely.de (cicely.de [194.231.9.142])
	by mail.du.gtn.com (8.8.6/8.8.6) with ESMTP id KAA14734
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 1999 10:58:15 +0200 (MET DST)
Received: from cicely8.cicely.de (cicely8.cicely.de [10.1.2.10])
	by cicely7.cicely.de (8.9.0/8.9.0) with ESMTP id LAA00597
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Jun 1999 11:05:09 +0200 (CEST)
Received: (from ticso@localhost)
	by cicely8.cicely.de (8.9.3/8.9.2) id LAA36567;
	Sat, 26 Jun 1999 11:06:02 +0200 (CEST)
	(envelope-from ticso)
Message-Id: <199906260906.LAA36567@cicely8.cicely.de>
Date: Sat, 26 Jun 1999 11:06:02 +0200 (CEST)
From: Bernd Walter <ticso@cicely.de>
Sender: ticso@cicely8.cicely.de
Reply-To: ticso@cicely.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: rman forgets to store flags in some cases
X-Send-Pr-Version: 3.2

>Number:         12399
>Category:       kern
>Synopsis:       rman forgets to store flags in some cases
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 26 02:10:01 PDT 1999
>Closed-Date:    Sat Jun 26 03:28:08 PDT 1999
>Last-Modified:  Tue Nov 27 18:30:41 PST 2001
>Originator:     Bernd Walter
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Cosmo-Project http://www.cosmo-project.de
>Environment:

current as of 25th June 1999

FreeBSD  4.0-CURRENT FreeBSD 4.0-CURRENT #0: Sat Jun 26 08:22:14 CEST 1999     r
oot@:/var/d0/src-1999-06-25/src/sys/compile/CICELY5  i386

>Description:

rman_reserve_resource() forgets to store the given flags in case
'candidate region is entire chunk'

In my case it forgot to remember the shareable flags for a pci-device
and the next device with the same irq was unable to allocate the needed resource

I already wrote "Justin T. Gibbs" <gibbs@plutotech.com>,
Matthew Jacob <mjacob@feral.com> and Peter Wemm <peter@FreeBSD.ORG>
about the problem

>How-To-Repeat:

In my case I only need to boot with an unpatched kernel.
It is reproduceable if you setup a situation I descibed.

>Fix:

In my fix there will bit 5 set in the flags - I don't know if this is correct.  

root@cicely8# diff -u sys/kern/subr_rman.c.ori sys/kern/subr_rman.c             
--- sys/kern/subr_rman.c.ori    Sun Jun 20 15:40:14 1999                        
+++ sys/kern/subr_rman.c        Sun Jun 20 15:40:42 1999                        
@@ -244,7 +244,7 @@                                                             
				printf("candidate region is entire chunk\n");   
 #endif /* RMAN_DEBUG */                                                        
				rv = s;                                         
-				rv->r_flags |= RF_ALLOCATED;                    
+				rv->r_flags |= RF_ALLOCATED | flags;            
				rv->r_dev = dev;                                
				goto out;                                       
			}                                                       


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dfr 
State-Changed-When: Sat Jun 26 03:28:08 PDT 1999 
State-Changed-Why:  
Fixed in version 1.8 of subr_rman.c 
>Unformatted:
