]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide-disk: lock media before checking for media change
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 17 Oct 2008 16:09:09 +0000 (18:09 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 17 Oct 2008 16:09:09 +0000 (18:09 +0200)
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-disk.c

index 93ff15e6a9c4347b9ccf536c42513a0920d48bf7..2c48bd81f53708752a1dc51737aa5dfd7c89ddb9 100644 (file)
@@ -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;
 }