From: Bartlomiej Zolnierkiewicz Date: Fri, 17 Oct 2008 16:09:09 +0000 (+0200) Subject: ide-disk: lock media before checking for media change X-Git-Tag: v2.6.28-rc1~83^2~34 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=099ed4c2f5d54a5e1e490250805fb9727d622c0c;p=linux-2.6-omap-h63xx.git ide-disk: lock media before checking for media change Acked-by: Borislav Petkov Signed-off-by: Bartlomiej Zolnierkiewicz --- 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; }