projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4357ae2
)
scsi: sr: Return appropriate error code when disk is ejected
author
ManYi Li
<limanyi@uniontech.com>
Fri, 11 Jun 2021 09:44:02 +0000
(17:44 +0800)
committer
Sasha Levin
<sashal@kernel.org>
Wed, 7 Jul 2021 12:22:46 +0000
(08:22 -0400)
[ 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
patch
|
blob
|
history
diff --git
a/drivers/scsi/sr.c
b/drivers/scsi/sr.c
index fd4b582110b29f3bb9ad0a6a556813e025495c36..77961f0583674528c68ab64ebb6000948ed8dc1a 100644
(file)
--- a/
drivers/scsi/sr.c
+++ b/
drivers/scsi/sr.c
@@
-220,6
+220,8
@@
static unsigned int sr_get_events(struct scsi_device *sdev)
return DISK_EVENT_EJECT_REQUEST;
else if (med->media_event_code == 2)
return DISK_EVENT_MEDIA_CHANGE;
+ else if (med->media_event_code == 3)
+ return DISK_EVENT_EJECT_REQUEST;
return 0;
}