Merge tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_lib.c
index ab676ce2d051e7bd5857d4a6460c724377069208..60c7a7d74852c53f65541f738eaf7e8c983489f2 100644 (file)
@@ -777,6 +777,15 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
                        /* See SSC3rXX or current. */
                        action = ACTION_FAIL;
                        break;
+               case DATA_PROTECT:
+                       action = ACTION_FAIL;
+                       if ((sshdr.asc == 0x0C && sshdr.ascq == 0x12) ||
+                           (sshdr.asc == 0x55 &&
+                            (sshdr.ascq == 0x0E || sshdr.ascq == 0x0F))) {
+                               /* Insufficient zone resources */
+                               blk_stat = BLK_STS_ZONE_OPEN_RESOURCE;
+                       }
+                       break;
                default:
                        action = ACTION_FAIL;
                        break;