[Orca-dev] Re: One stray system with disk problems
Jon Tankersley
jon.tankersley at eds.com
Mon Jul 5 08:09:44 PDT 2004
We are going to upgrade to SE 3.3.1 and orcallator.se 1.37, but I tried 1.37
just to see. And low and behold it worked. The logic in the disk map is
much cleaner in 1.37.
-----Original Message-----
From: Dmitry Berezin [mailto:dmitryb at rutgers.edu]
Sent: Monday, July 05, 2004 1:00 AM
To: Jon Tankersley
Cc: orca-dev at orcaware.com; Blair Zajac
Subject: Re: [Orca-dev] Re: One stray system with disk problems
Hi Jon,
I have to say I feel bad that I did not get a chance to reply with this
sooner since I promised a patch for this problem. Well, here you go...
First of all, here is my understanding of the problem:
SE has a documented "feature" - "The MAX_DISK and MAX_IF constants will
often have a larger value than the number of actual resources on the
system." (SE User Manual); thus, GLOBAL_diskinfo_size, being set to MAX_DISK
will also be greater then the actual number of disks in the system. In
orcallator.se, RAWDISK code uses GLOBAL_disk_info[] array to map short disk
names, reported by kstat, to long names. Raw_disk_map function implements a
rather convoluted (sorry Alan) way of dealing with this - it uses multiple
calls to raw_disk_short_name_cmp function and the assumption that disk names
come before partition names in GLOBAL_disk_info[] to detect the end of the
entries with data. Well, there are several of (much easier, IMHO) ways of
doing this:
1. Do what disks.se does -
for(i=0; i<GLOBAL_diskinfo_size; i++) {
if (GLOBAL_disk_info[i].short_name == nil) {
break;
}
...
}
2. Use GLOBAL_disk_count instead of GLOBAL_diskinfo_size. GLOBAL_disk_count
is initialized in live_rules.se (used by orcallator.se) and is equal to the
actual number of disks. 2a. Use RAW_disk_count instead of
GLOBAL_diskinfo_size. It was just initialized to the actual number of disks.
3. Instead of comparing short disk names in a loop, use find_inst access
function, defined in diskinfo.se to get an index into GLOBAL_disk_info[].
Based on the SE debug output that you have posted, this is exactly the place
where orcallator.se crashes on your system.
Try this - replace raw_disk_map() function with this version:
raw_disk_map() {
int i;
int index;
for (i=0; i<RAW_disk_count; ++i) {
// Do not map st & fd devices.
if (strncmp(RAW_disk[i].short_name, "st", 2) != 0 &&
strncmp(RAW_disk[i].short_name, "fd", 2) != 0) {
index = find_inst(RAW_disk[i].short_name);
if (index != -1) {
strcpy(RAW_disk[i].long_name, GLOBAL_disk_info[index].long_name);
}
}
}
RAW_disk_map = 0;
}
Hope this will fix it.
-Dmitry.
P.S. Can you send me the full se debug output with the crash (orcallator
1.37). Based on the data in your other posts, you shouldn't have had this
problem, so it would be very helpful for me to understand why _you_ ran into
this issue.
More information about the Orca-dev
mailing list