scsi: handle zone resources errors
[sfrench/cifs-2.6.git] / drivers / scsi / scsi_lib.c
index a89478a0c5888d56e7ab7646f3883754a1a6e2ea..72b12102f77706e490e0d5788edffe75e2e950cc 100644 (file)
@@ -758,6 +758,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;