diff options
author | Peter Osterlund <petero2@telia.com> | 2006-02-14 21:52:56 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-15 00:09:33 (GMT) |
commit | 948423e5ccc33bc257384ad4b339214c577bc926 (patch) | |
tree | fca922bbce34cf69c561b34bb40c796cd982ae27 | |
parent | 01fd9fda2ce462b44bafdac2fe6aacacf23531f2 (diff) | |
download | linux-fsl-qoriq-948423e5ccc33bc257384ad4b339214c577bc926.tar.xz |
[PATCH] pktcdvd: Don't unlock the door if the disc is in use
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>
-rw-r--r-- | drivers/block/pktcdvd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index edf6bf2..89d8fe0 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -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: |