scsi: sr: Return appropriate error code when disk is ejected
authorManYi Li <limanyi@uniontech.com>
Fri, 11 Jun 2021 09:44:02 +0000 (17:44 +0800)
committerSasha Levin <sashal@kernel.org>
Wed, 7 Jul 2021 12:22:46 +0000 (08:22 -0400)
commitf77f97238496aeab597d573aa1703441626da999
tree54b3149c35b4b4ebdfda0b6a31b6303d7e549cff
parent4357ae26d4cd133a86982f23cb6b321304faac50
scsi: sr: Return appropriate error code when disk is ejected

[ Upstream commit 7dd753ca59d6c8cc09aa1ed24f7657524803c7f3 ]

Handle a reported media event code of 3. This indicates that the media has
been removed from the drive and user intervention is required to proceed.
Return DISK_EVENT_EJECT_REQUEST in that case.

Link: https://lore.kernel.org/r/20210611094402.23884-1-limanyi@uniontech.com
Signed-off-by: ManYi Li <limanyi@uniontech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/sr.c