*bugfix* for 2.0.31

Gerd Knorr (kraxel@goldbach.isdn.cs.tu-berlin.de)
Thu, 25 Sep 1997 11:09:26 +0200 (MEST)


Closes a race window by moving around the module usage count update. Had a
oops today becauce kerneld removed the scsi cdrom module while the drive
closed the tray.

Gerd

-----------------------------------------------------------------------
--- drivers/scsi/sr.c-2.0.31 Thu Sep 25 10:58:17 1997
+++ drivers/scsi/sr.c Thu Sep 25 11:00:57 1997
@@ -601,6 +601,8 @@
if (filp->f_mode & 2)
return -EROFS;

+ if(sr_template.usage_count) (*sr_template.usage_count)++;
+
sr_ioctl(inode,filp,CDROMCLOSETRAY,0);
check_disk_change(inode->i_rdev);

@@ -608,7 +610,6 @@
sr_ioctl(inode, NULL, SCSI_IOCTL_DOORLOCK, 0);
if (scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)
(*scsi_CDs[MINOR(inode->i_rdev)].device->host->hostt->usage_count)++;
- if(sr_template.usage_count) (*sr_template.usage_count)++;

sr_photocd(inode);