Skip to content

Commit

Permalink
ide-disk: lock media before checking for media change
Browse files Browse the repository at this point in the history
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 17, 2008
1 parent 0a70c7f commit 099ed4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down

0 comments on commit 099ed4c

Please sign in to comment.