提交 099ed4c2 编写于 作者: B Bartlomiej Zolnierkiewicz

ide-disk: lock media before checking for media change

Acked-by: NBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 0a70c7f6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册