Bug 16174

Summary: block devices won't build as modules: linux-2.2.16-sard.patch
Product: [Retired] Red Hat Raw Hide Reporter: Michael Tokarev <mjt>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: pfrields, sct
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-30 03:22:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
updated sard.patch for 2.2.16-22 none

Description Michael Tokarev 2000-08-14 17:12:31 UTC
In this patch (linux-2.2.16-sard.patch), there are some new
routines introduced in addition to standard ones in 2.2.16.
(kernel rpm 2.2.16-17, 2.2.16-21, maybe others).
Them are in drivers/block/ll_rw_blk.c at most.  But -- should
them be exported using EXPORT_SYMBOL()!?! :)
When I build hdd, scsi etc disk support as a module (by default
RedHat builds them to kernel), and attemtps to load that modules,
I get unresolved symbols, e.g. req_finished_io.
Here is a list of missing code in the end of drivers/block/ll_rw_blk.c
that should be in linux-2.2.16-sard.patch:

 EXPORT_SYMBOL(disk_round_stats);
 EXPORT_SYMBOL(req_new_io);
 EXPORT_SYMBOL(req_finished_io);

Actually I don't know if them are used -- it is just a list of all
non-static new routines.  req_finished_io _is_ used.

Ok, this situation seemed to trigger bug in modutils: depmod should
_not_ see that non-exported symbols, and should also complain about
unresolved symbols; but it generates modules.dep "correctly", and
only insmod/modprobe complains about unresolves when them fails to
load modules...  Uff, I spent a _lot_ of time searching why my modules
won't load! :(

And also one note about this patch (linux-2.2.16-sard.patch).
I don't know just how RedHat builds his binary rpms.  Previous
kernel rpm release (2.2.16-17) included that patch with
a typo (major_gendisks instead major_gendisk), resulting in
failed compilation!.  But I see compiled kernel-2.2.16-17.iXXX.rpm!
Wow!...  No comments on both facts...

I will not generate a patch here, since it will be itself against a
patch, and "patch for a patch" sounds just funny ... :)

Comment 1 Michael K. Johnson 2000-08-14 19:46:57 UTC
*** Bug 16136 has been marked as a duplicate of this bug. ***

Comment 2 Michael Tokarev 2000-10-19 16:16:47 UTC
Created attachment 4389 [details]
updated sard.patch for 2.2.16-22

Comment 3 Michael Tokarev 2000-10-19 16:20:34 UTC
I finally changed the patch for 2.2.16-22 kernel.  This is original
sard.patch applied with backup (-b -z .sard), with 3 EXPORT_SYMBOL
added to ll_rw_blk.c, and diffed against *.sard.  This also cleans
up some line numbers.  Is that so difficult to fix the problem? :)

Comment 4 Michael Tokarev 2000-10-19 17:08:16 UTC
This is another small set of changes as alternate to full sard.patch I attached
(my patch will not work on 2.2.16-24 due to differences with pcmcia).
Add this lines to the original _patch_ file at the end of changes for
linux/drivers/block/ll_rw_blk.c.  This can be done by hand.

--- cut ---
@@ -1143,3 +1282,6 @@
 EXPORT_SYMBOL(end_that_request_first);
 EXPORT_SYMBOL(end_that_request_last);
 EXPORT_SYMBOL(blkelv_ioctl);
+EXPORT_SYMBOL(disk_round_stats);
+EXPORT_SYMBOL(req_new_io);
+EXPORT_SYMBOL(req_finished_io);
--- cut ---

(the changes will go to the end of ll_rw_blk.c file; the above lines
should be placed just before line "--- linux/drivers/block/ps2esdi.c.sard"
in 2.2.16-24).
I ask again: is this _so_ difficult ?!  Problem was reported
at 2000-08-14, now it is 2000-10-19, more than two months for
trivial problem! :(

BTW, as I can guess, this whole thing is for supporting sar, aka
system activity reporter (from sysstat package), right?  If so,
than the patch is not complete.  For example, even with this patch,
sar won't report activities for softraid and raw partitions/devices
(not pretty shure but it seemed to be so, at least for raw).