diff mbox

[RESEND] scsi_debug: fix prevent_allow+verify regressions

Message ID 5651F740.3010707@interlog.com (mailing list archive)
State New, archived
Headers show

Commit Message

Douglas Gilbert Nov. 22, 2015, 5:11 p.m. UTC
Ruediger Meier observed a regression with the PREVENT ALLOW
MEDIUM REMOVAL command in lk 3.19:
   http://www.spinics.net/lists/util-linux-ng/msg11448.html

Inspection indicated the same regression with VERIFY(10).

The patch is against lk 3.19.3 and also works with lk 4.3.0 .
With this patch both commands are accepted and do nothing.

ChangeLog:
   - fix the lk 3.19 regression so that the PREVENT ALLOW
     MEDIUM REMOVAL command is supported once again
   - same fix for VERIFY(10)

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>

Comments

Hannes Reinecke Nov. 24, 2015, 3:04 p.m. UTC | #1
On 11/22/2015 06:11 PM, Douglas Gilbert wrote:
> Ruediger Meier observed a regression with the PREVENT ALLOW
> MEDIUM REMOVAL command in lk 3.19:
>   http://www.spinics.net/lists/util-linux-ng/msg11448.html
> 
> Inspection indicated the same regression with VERIFY(10).
> 
> The patch is against lk 3.19.3 and also works with lk 4.3.0 .
> With this patch both commands are accepted and do nothing.
> 
> ChangeLog:
>   - fix the lk 3.19 regression so that the PREVENT ALLOW
>     MEDIUM REMOVAL command is supported once again
>   - same fix for VERIFY(10)
> 
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Ewan Milne Nov. 24, 2015, 3:25 p.m. UTC | #2
On Sun, 2015-11-22 at 12:11 -0500, Douglas Gilbert wrote:
> Ruediger Meier observed a regression with the PREVENT ALLOW
> MEDIUM REMOVAL command in lk 3.19:
>    http://www.spinics.net/lists/util-linux-ng/msg11448.html
> 
> Inspection indicated the same regression with VERIFY(10).
> 
> The patch is against lk 3.19.3 and also works with lk 4.3.0 .
> With this patch both commands are accepted and do nothing.
> 
> ChangeLog:
>    - fix the lk 3.19 regression so that the PREVENT ALLOW
>      MEDIUM REMOVAL command is supported once again
>    - same fix for VERIFY(10)
> 
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>

Reviewed-by: Ewan D. Milne <emilne@redhat.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Nov. 24, 2015, 8:25 p.m. UTC | #3
>>>>> "Doug" == Douglas Gilbert <dgilbert@interlog.com> writes:

Doug> Ruediger Meier observed a regression with the PREVENT ALLOW MEDIUM
Doug> REMOVAL command in lk 3.19:
Doug> http://www.spinics.net/lists/util-linux-ng/msg11448.html

Applied to 4.4.
Andy Shevchenko Nov. 25, 2015, 8:51 p.m. UTC | #4
Martin, sorry for offtopic, but can you pay a little attention to
http://www.spinics.net/lists/linux-scsi/msg81778.html ? It seems it
wasn't applied.
Martin K. Petersen Nov. 26, 2015, 2:14 a.m. UTC | #5
>>>>> "Andy" == Andy Shevchenko <andy.shevchenko@gmail.com> writes:

Andy,

Andy> but can you pay a little attention to
Andy> http://www.spinics.net/lists/linux-scsi/msg81778.html ? It seems
Andy> it wasn't applied.

Please resubmit to linux-scsi. We'll take a look.
Andy Shevchenko Nov. 27, 2015, 9:19 a.m. UTC | #6
On Thu, Nov 26, 2015 at 4:14 AM, Martin K. Petersen
<martin.petersen@oracle.com> wrote:
>>>>>> "Andy" == Andy Shevchenko <andy.shevchenko@gmail.com> writes:
>
> Andy,
>
> Andy> but can you pay a little attention to
> Andy> http://www.spinics.net/lists/linux-scsi/msg81778.html ? It seems
> Andy> it wasn't applied.
>
> Please resubmit to linux-scsi. We'll take a look.

Done:

http://www.spinics.net/lists/linux-scsi/msg91207.html
diff mbox

Patch

--- a/drivers/scsi/scsi_debug.c	2015-02-11 17:47:09.276206425 -0500
+++ b/drivers/scsi/scsi_debug.c	2015-04-03 22:42:36.343971372 -0400
@@ -455,8 +455,9 @@  static const struct opcode_info_t opcode
 	     0} },
 	{0, 0, 0, F_INV_OP | FF_RESPOND, NULL, NULL, /* MAINT OUT */
 	    {0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
-	{0, 0, 0, F_INV_OP | FF_RESPOND, NULL, NULL, /* VERIFY */
-	    {0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
+	{0, 0x2f, 0, F_D_OUT_MAYBE | FF_DIRECT_IO, NULL, NULL, /* VERIFY(10) */
+	    {10,  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7,
+	     0, 0, 0, 0, 0, 0} },
 	{1, 0x7f, 0x9, F_SA_HIGH | F_D_IN | FF_DIRECT_IO, resp_read_dt0,
 	    vl_iarr, {32,  0xc7, 0, 0, 0, 0, 0x1f, 0x18, 0x0, 0x9, 0xfe, 0,
 		      0xff, 0xff, 0xff, 0xff} },/* VARIABLE LENGTH, READ(32) */
@@ -467,8 +468,8 @@  static const struct opcode_info_t opcode
 	    {10,  0x13, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0xc7, 0, 0, 0, 0, 0,
 	     0} },
 /* 20 */
-	{0, 0, 0, F_INV_OP | FF_RESPOND, NULL, NULL, /* ALLOW REMOVAL */
-	    {0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
+	{0, 0x1e, 0, 0, NULL, NULL, /* ALLOW REMOVAL */
+	    {6,  0, 0, 0, 0x3, 0xc7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
 	{0, 0x1, 0, 0, resp_start_stop, NULL, /* REWIND ?? */
 	    {6,  0x1, 0, 0, 0, 0xc7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} },
 	{0, 0, 0, F_INV_OP | FF_RESPOND, NULL, NULL, /* ATA_PT */