summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 18:09:09 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 18:09:09 +0200
commit099ed4c2f5d54a5e1e490250805fb9727d622c0c (patch)
tree3c7e5ac0dd9dac409ed32d14b8863eefc0fa784a
parent0a70c7f67a24b45e105ad10ac1d7e73fe50ec765 (diff)
ide-disk: lock media before checking for media change
Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 93ff15e6a9c4..2c48bd81f537 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -842,7 +842,6 @@ static int idedisk_open(struct inode *inode, struct file *filp)
idkp->openers++;
if ((drive->dev_flags & IDE_DFLAG_REMOVABLE) && idkp->openers == 1) {
- check_disk_change(inode->i_bdev);
/*
* Ignore the return code from door_lock,
* since the open() has already succeeded,
@@ -851,6 +850,7 @@ static int idedisk_open(struct inode *inode, struct file *filp)
if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) &&
idedisk_set_doorlock(drive, 1))
drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
+ check_disk_change(inode->i_bdev);
}
return 0;
}