From 099ed4c2f5d54a5e1e490250805fb9727d622c0c Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 17 Oct 2008 18:09:09 +0200 Subject: ide-disk: lock media before checking for media change Acked-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide') diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 93ff15e6a9c..2c48bd81f53 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; } -- cgit v1.2.3-70-g09d2