Bug 169750

Summary: diskdump.c : wrong arg type for find_dump_device()
Product: [Fedora] Fedora Reporter: Stephan GUILLOUX <stephan.guilloux>
Component: kernelAssignee: Nobuhiro Tachino <ntachino>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: aimamura, anderson, davej, ktokunag, wtogami
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: 2005-10-25 07:42:03 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:

Description Stephan GUILLOUX 2005-10-02 23:49:15 UTC
Description of problem:
  Function find_dump_device() is always called with void * argument,
  but uses it as struct dump_device_s *, which is wrong.
  Found in the original diskdump patch, on FC3. Probably exists also
  in FC4 or other red-hat products.

Version-Release number of selected component (if applicable):
  kernel-2.6.12-1.1378_FC3

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
  Initial diskdump (over 2.6.9) patch has the same pb.
  - In ide-dump.c, the function ide_dump_probe returns a ide_drive_t 
    pointer.
  - In scsi_dump.c, the function scsi_dump_probe returns a scsi_device
    pointer.
  The value returned by xxx_probe is given as is to find_dump_device(),
  which use them as disk_dump_device pointers. Below, one possible patch :


diff -ru linux-2.6.12.old/drivers/block/diskdump.c
linux-2.6.12.new/drivers/block/diskdump.c
--- linux-2.6.12.old/drivers/block/diskdump.c   2005-10-02 02:49:49.000000000 +0200
+++ linux-2.6.12.new/drivers/block/diskdump.c   2005-10-03 01:47:59.000000000 +0200
@@ -689,12 +689,12 @@
        return NULL;
 }
 
-static struct disk_dump_device *find_dump_device(struct disk_dump_device *device)
+static struct disk_dump_device *find_dump_device(void *real_device)
 {
        struct disk_dump_device *dump_device;
 
        list_for_each_entry(dump_device, &disk_dump_devices, list)
-               if (device->device == dump_device->device)
+               if (dump_device->device == real_device)
                        return  dump_device;
        return NULL;
 }

Comment 1 Stephan GUILLOUX 2005-10-03 08:01:35 UTC
Other related BUG #id
167752 â Either diskdumputils should be removed or diskdumps supported

I had a look into the kernel.src.rpm :
None of dump-ide or dump-scsi are present, but they exist in diskdump-1.0 
archive. Is diskdump still supported ?



Comment 2 Jeff Moyer 2005-10-17 21:28:10 UTC
Dave,

I'm not sure who needs to look at this.  Can you see to it that the proper
maintainer is alerted?

Comment 3 Nobuhiro Tachino 2005-10-18 14:27:08 UTC
Thank you. Your patch is correct. Actually the diskdump for kernel v2.4 has the
same code which you provided. Porting to v2.6 seems to have slipped the bug into
the code.


Comment 4 Nobuhiro Tachino 2005-10-18 14:29:15 UTC
(In reply to comment #1)
> Other related BUG #id
> 167752 â Either diskdumputils should be removed or diskdumps supported
> 
> I had a look into the kernel.src.rpm :
> None of dump-ide or dump-scsi are present, but they exist in diskdump-1.0 
> archive. Is diskdump still supported ?

diskdump is not supported in FC.