patch-1.3.89 linux/drivers/block/ide.c

Next file: linux/drivers/block/ll_rw_blk.c
Previous file: linux/arch/i386/kernel/setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.88/linux/drivers/block/ide.c linux/drivers/block/ide.c
@@ -1808,7 +1808,7 @@
 	ide_drive_t *drive;
 
 	if ((drive = get_info_ptr(inode->i_rdev)) != NULL) {
-		sync_dev(inode->i_rdev);
+		fsync_dev(inode->i_rdev);
 		drive->usage--;
 #ifdef CONFIG_BLK_DEV_IDECD
 		if (drive->media == ide_cdrom) {
@@ -1822,7 +1822,7 @@
 			return;
 		}
 #endif	/* CONFIG_BLK_DEV_IDETAPE */
-		if (drive->removable) {
+		if (drive->removable && !drive->usage) {
 			byte door_unlock[] = {WIN_DOORUNLOCK,0,0,0};
 			struct request rq;
 			invalidate_buffers(inode->i_rdev);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this