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); } --
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Linus Torvalds | Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.. |
| Paul Jackson | Re: cpuset-remove-sched-domain-hooks-from-cpusets |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Linus Torvalds | Re: [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [klibc] [patch] import socket defines |
