* [PATCH] scsi: sr: Return correct event when media event code is 3
@ 2021-07-26 6:19 Li Manyi
0 siblings, 0 replies; 4+ messages in thread
From: Li Manyi @ 2021-07-26 6:19 UTC (permalink / raw)
To: axboe, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, Li Manyi
the description for media event code 0: NoChg
Media status is unchanged.
the description for media event code 1: EjectRequest
The Drive has received a request from the user (usually through a
mechanical switch on the Drive) to eject the specified slot or media.
the description for media event code 2: NewMedia
The specified slot (or the Drive) has received new media, and is
ready to access it.
the description for media event code 3: MediaRemoval
The media has been removed from the specified slot, and the
Drive is unable to access the media without user intervention.
This applies to media changers only.
fix bug: https://bugzilla.kernel.org/show_bug.cgi?id=213759
Signed-off-by: Li Manyi <limanyi@uniontech.com>
---
drivers/scsi/sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 94c254e9012e..a6d3ac0a6cbc 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -221,7 +221,7 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
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 DISK_EVENT_MEDIA_CHANGE;
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: sr: Return correct event when media event code is 3
2021-07-26 11:49 Li Manyi
@ 2021-07-29 3:37 ` Martin K. Petersen
0 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2021-07-29 3:37 UTC (permalink / raw)
To: axboe, Li Manyi, jejb; +Cc: Martin K . Petersen, linux-kernel, linux-scsi
On Mon, 26 Jul 2021 19:49:13 +0800, Li Manyi wrote:
> the description for media event code 0: NoChg
> Media status is unchanged.
>
> the description for media event code 1: EjectRequest
> The Drive has received a request from the user (usually through a
> mechanical switch on the Drive) to eject the specified slot or media.
>
> [...]
Applied to 5.14/scsi-fixes, thanks!
[1/1] scsi: sr: Return correct event when media event code is 3
https://git.kernel.org/mkp/scsi/c/eea4d790a8d7
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] scsi: sr: Return correct event when media event code is 3
@ 2021-07-26 11:49 Li Manyi
2021-07-29 3:37 ` Martin K. Petersen
0 siblings, 1 reply; 4+ messages in thread
From: Li Manyi @ 2021-07-26 11:49 UTC (permalink / raw)
To: axboe, jejb, martin.petersen; +Cc: linux-kernel, linux-scsi, Li Manyi
the description for media event code 0: NoChg
Media status is unchanged.
the description for media event code 1: EjectRequest
The Drive has received a request from the user (usually through a
mechanical switch on the Drive) to eject the specified slot or media.
the description for media event code 2: NewMedia
The specified slot (or the Drive) has received new media, and is
ready to access it.
the description for media event code 3: MediaRemoval
The media has been removed from the specified slot, and the
Drive is unable to access the media without user intervention.
This applies to media changers only.
fix bug: https://bugzilla.kernel.org/show_bug.cgi?id=213759
Signed-off-by: Li Manyi <limanyi@uniontech.com>
---
drivers/scsi/sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 94c254e9012e..a6d3ac0a6cbc 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -221,7 +221,7 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
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 DISK_EVENT_MEDIA_CHANGE;
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] scsi: sr: Return correct event when media event code is 3
@ 2021-07-26 11:42 Li Manyi
0 siblings, 0 replies; 4+ messages in thread
From: Li Manyi @ 2021-07-26 11:42 UTC (permalink / raw)
To: limanyi; +Cc: linux-kernel, linux-scsi
the description for media event code 0: NoChg
Media status is unchanged.
the description for media event code 1: EjectRequest
The Drive has received a request from the user (usually through a
mechanical switch on the Drive) to eject the specified slot or media.
the description for media event code 2: NewMedia
The specified slot (or the Drive) has received new media, and is
ready to access it.
the description for media event code 3: MediaRemoval
The media has been removed from the specified slot, and the
Drive is unable to access the media without user intervention.
This applies to media changers only.
fix bug: https://bugzilla.kernel.org/show_bug.cgi?id=213759
Signed-off-by: Li Manyi <limanyi@uniontech.com>
---
drivers/scsi/sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 94c254e9012e..a6d3ac0a6cbc 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -221,7 +221,7 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
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 DISK_EVENT_MEDIA_CHANGE;
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-29 3:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 6:19 [PATCH] scsi: sr: Return correct event when media event code is 3 Li Manyi
2021-07-26 11:42 Li Manyi
2021-07-26 11:49 Li Manyi
2021-07-29 3:37 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.