lkml.org 
[lkml]   [1996]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectUsage counter for ide-cd module
Date
From


When compiling IDE CD support as a module, and mounting a CDROM,
kerneld will remove the driver after a while, even when the CDROM is
still mounted. I traced this back to a missing usage counter
incrementation. The following patch should fix this problem:

diff -ur 2.1.9/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
--- 2.1.9/linux/drivers/block/ide-cd.c Tue Nov 12 23:31:44 1996
+++ linux/drivers/block/ide-cd.c Tue Nov 12 23:39:36 1996
@@ -2765,13 +2765,19 @@

int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
{
- return cdrom_fops.open (ip, fp);
+ int r;
+ MOD_INC_USE_COUNT;
+ r = cdrom_fops.open (ip, fp);
+ if(r)
+ MOD_DEC_USE_COUNT;
+ return r;
}

void ide_cdrom_release (struct inode *inode, struct file *file,
ide_drive_t *drive)
{
cdrom_fops.release (inode, file);
+ MOD_DEC_USE_COUNT;
}

int ide_cdrom_check_media_change (ide_drive_t *drive)

Regards,

Alain

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.048 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site