Skip to content

Commit

Permalink
[PATCH] pktcdvd: Don't unlock the door if the disc is in use
Browse files Browse the repository at this point in the history
Unlocking the door when the disc is in use is obviously not good, because then
it's possible to eject the disc at the wrong time and cause severe disc data
corruption.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Peter Osterlund authored and Linus Torvalds committed Feb 15, 2006
1 parent 01fd9fd commit 948423e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,8 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
* The door gets locked when the device is opened, so we
* have to unlock it or else the eject command fails.
*/
pkt_lock_door(pd, 0);
if (pd->refcnt == 1)
pkt_lock_door(pd, 0);
return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg);

default:
Expand Down

0 comments on commit 948423e

Please sign in to comment.