Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mariusz Kozlowski <m.kozlowski@...>
Cc: Andrew Morton <akpm@...>, <kernel-testers@...>, <linux-kernel@...>, <linux-ide@...>
Date: Sunday, August 3, 2008 - 10:41 am

On Sunday 03 August 2008, Mariusz Kozlowski wrote:

[...]


[...]

Thanks for debugging this.  I see the problem now: previous reference
counting fix was totally fscked up and introduced access to cd->drive
after putting last reference on cd (time to re-supply brown paper bag
stock).  The incremental fix (for 2.6.27-rc1-mm1) attached, the fixed
original patch will be posted in the separate mail.


Does it still happen with the 1) fixed?

---
 drivers/ide/ide-cd.c     |    4 +++-
 drivers/ide/ide-disk.c   |    4 +++-
 drivers/ide/ide-floppy.c |    4 +++-
 drivers/ide/ide-tape.c   |    4 +++-
 drivers/scsi/ide-scsi.c  |    4 +++-
 5 files changed, 15 insertions(+), 5 deletions(-)

Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -78,9 +78,11 @@ static struct cdrom_info *ide_cd_get(str
 
 static void ide_cd_put(struct cdrom_info *cd)
 {
+	ide_drive_t *drive = cd->drive;
+
 	mutex_lock(&idecd_ref_mutex);
 	kref_put(&cd->kref, ide_cd_release);
-	ide_device_put(cd->drive);
+	ide_device_put(drive);
 	mutex_unlock(&idecd_ref_mutex);
 }
 
Index: b/drivers/ide/ide-disk.c
===================================================================
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -74,9 +74,11 @@ static struct ide_disk_obj *ide_disk_get
 
 static void ide_disk_put(struct ide_disk_obj *idkp)
 {
+	ide_drive_t *drive = idkp->drive;
+
 	mutex_lock(&idedisk_ref_mutex);
 	kref_put(&idkp->kref, ide_disk_release);
-	ide_device_put(idkp->drive);
+	ide_device_put(drive);
 	mutex_unlock(&idedisk_ref_mutex);
 }
 
Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -179,9 +179,11 @@ static struct ide_floppy_obj *ide_floppy
 
 static void ide_floppy_put(struct ide_floppy_obj *floppy)
 {
+	ide_drive_t *drive = floppy->drive;
+
 	mutex_lock(&idefloppy_ref_mutex);
 	kref_put(&floppy->kref, idefloppy_cleanup_obj);
-	ide_device_put(floppy->drive);
+	ide_device_put(drive);
 	mutex_unlock(&idefloppy_ref_mutex);
 }
 
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -342,9 +342,11 @@ static struct ide_tape_obj *ide_tape_get
 
 static void ide_tape_put(struct ide_tape_obj *tape)
 {
+	ide_drive_t *drive = tape->drive;
+
 	mutex_lock(&idetape_ref_mutex);
 	kref_put(&tape->kref, ide_tape_release);
-	ide_device_put(tape->drive);
+	ide_device_put(drive);
 	mutex_unlock(&idetape_ref_mutex);
 }
 
Index: b/drivers/scsi/ide-scsi.c
===================================================================
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -112,9 +112,11 @@ static struct ide_scsi_obj *ide_scsi_get
 
 static void ide_scsi_put(struct ide_scsi_obj *scsi)
 {
+	ide_drive_t *drive = scsi->drive;
+
 	mutex_lock(&idescsi_ref_mutex);
 	scsi_host_put(scsi->host);
-	ide_device_put(scsi->drive);
+	ide_device_put(drive);
 	mutex_unlock(&idescsi_ref_mutex);
 }
 

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.27-rc1-mm1, Andrew Morton, (Thu Jul 31, 3:03 am)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Mariusz Kozlowski, (Tue Aug 5, 4:26 pm)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Peter Oberparleiter, (Wed Aug 6, 3:23 am)
Re: 2.6.27-rc1-mm1: unable to boot with gcov on x86_64, Mariusz Kozlowski, (Tue Aug 5, 4:29 pm)
Re: 2.6.27-rc1-mm1: sparc64 BUG: using smp_processor_id() in..., Mariusz Kozlowski, (Sat Aug 2, 11:17 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sat Aug 2, 5:23 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Bartlomiej Zolnierkiewicz..., (Sat Aug 2, 12:15 pm)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sat Aug 2, 7:25 pm)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Bartlomiej Zolnierkiewicz..., (Sun Aug 3, 10:41 am)
Re: 2.6.27-rc1-mm1: rmmod ide-cd_mod oops, Mariusz Kozlowski, (Sun Aug 3, 11:45 am)
Re: [BUILD-FAILURE] 2.6.27-rc1-mm1 - allyesconfig build fail..., Peter 1 Oberparleiter, (Fri Aug 1, 11:44 am)
Re: [BUILD-FAILURE] 2.6.27-rc1-mm1 - allyesconfig build fail..., Peter 1 Oberparleiter, (Fri Aug 1, 11:40 am)
2.6.27-rc1-mm1: busyloop time-schedule, Alexey Dobriyan, (Thu Jul 31, 8:23 am)
Re: 2.6.27-rc1-mm1, Balbir Singh, (Thu Jul 31, 4:10 am)