Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 1997 17:43:43 GMT
From:      volf@oasis.IAEhv.nl (Frank Volf)
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        volf@oasis.IAEhv.nl
Subject:   kern/5133: ncrcontrol version mismatch
Message-ID:  <199711231743.RAA03668@oasis.IAEhv.nl>
Resent-Message-ID: <199711231750.JAA21131@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         5133
>Category:       kern
>Synopsis:       ncrcontrol version mismatch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 23 09:50:00 PST 1997
>Last-Modified:
>Originator:     Frank Volf
>Organization:
Frank Volf's private UUCP site, Eindhoven, the Netherlands
>Release:        FreeBSD 2.2.2-RELEASE i386
>Environment:

FreeBSD oasis.IAEhv.nl 2.2.2-RELEASE FreeBSD 2.2.2-RELEASE #1: Wed Nov 19
14:34:41 MET 1997     volf@oasis.IAEhv.nl:/new/usr/src/sys/compile/OASIS i386

>Description:

Kernel compilation with option FAILSAFE changes the size of the internal
data structures of the ncr driver. 

To be precise MAX_START is different for kernels compiled with and without
FAILSAFE. MAX_START is used in the ncb struct, so this structure has a
different size for kernels with and without FAILSAFE.

Unfortunately, the size of this struct is used to calculate the "ncr
version" (as strored in the const ncr_version), which is calculated as

static const u_long     ncr_version = NCR_VERSION       * 11
        + (u_long) sizeof (struct ncb)  *  7
        + (u_long) sizeof (struct ccb)  *  5
        + (u_long) sizeof (struct lcb)  *  3
        + (u_long) sizeof (struct tcb)  *  2;

in ncr.c

A problem arises when compiling the ncrcontrol.c program. This program 
(correctly) checks if the kernel ncr version is equal to the ncr version
with which this program is build. Unfortunately, the FAILSAFE option
is not passed to the cc command line compiling ncrcontrol.c, thus
the ncrcontrol program will *always* complain about the version mismatch
when used with a "FAILSAFE" kernel. Adding -DFAILSAFE to the CFLAGS
in the Makefile fixes the problem for me, but that is of course very
undesirable solution.

Currently, I don't see a clean way to solve this problem, other than always
using the same datastructures (and thus waste a few bytes when FAILSAFE
is specified).

BTW: I only looked at the 2.2.2 kernel code, I don't know if this is
fixed in current.

Frank
>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711231743.RAA03668>