Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / sd.c
index 0f96eb0ddbfaeffb771b7a92a5ab33c4b3e22c76..03163ac5fe9583362491efa831275c77a59e6122 100644 (file)
@@ -1211,9 +1211,6 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
        dix = scsi_prot_sg_count(cmd);
        dif = scsi_host_dif_capable(cmd->device->host, sdkp->protection_type);
 
        dix = scsi_prot_sg_count(cmd);
        dif = scsi_host_dif_capable(cmd->device->host, sdkp->protection_type);
 
-       if (write && dix)
-               t10_pi_prepare(cmd->request, sdkp->protection_type);
-
        if (dif || dix)
                protect = sd_setup_protect_cmnd(cmd, dix, dif);
        else
        if (dif || dix)
                protect = sd_setup_protect_cmnd(cmd, dix, dif);
        else
@@ -1293,7 +1290,9 @@ static blk_status_t sd_init_command(struct scsi_cmnd *cmd)
        case REQ_OP_WRITE:
                return sd_setup_read_write_cmnd(cmd);
        case REQ_OP_ZONE_RESET:
        case REQ_OP_WRITE:
                return sd_setup_read_write_cmnd(cmd);
        case REQ_OP_ZONE_RESET:
-               return sd_zbc_setup_reset_cmnd(cmd);
+               return sd_zbc_setup_reset_cmnd(cmd, false);
+       case REQ_OP_ZONE_RESET_ALL:
+               return sd_zbc_setup_reset_cmnd(cmd, true);
        default:
                WARN_ON_ONCE(1);
                return BLK_STS_NOTSUPP;
        default:
                WARN_ON_ONCE(1);
                return BLK_STS_NOTSUPP;
@@ -1960,6 +1959,7 @@ static int sd_done(struct scsi_cmnd *SCpnt)
        case REQ_OP_WRITE_ZEROES:
        case REQ_OP_WRITE_SAME:
        case REQ_OP_ZONE_RESET:
        case REQ_OP_WRITE_ZEROES:
        case REQ_OP_WRITE_SAME:
        case REQ_OP_ZONE_RESET:
+       case REQ_OP_ZONE_RESET_ALL:
                if (!result) {
                        good_bytes = blk_rq_bytes(req);
                        scsi_set_resid(SCpnt, 0);
                if (!result) {
                        good_bytes = blk_rq_bytes(req);
                        scsi_set_resid(SCpnt, 0);
@@ -2053,11 +2053,6 @@ static int sd_done(struct scsi_cmnd *SCpnt)
                                           "sd_done: completed %d of %d bytes\n",
                                           good_bytes, scsi_bufflen(SCpnt)));
 
                                           "sd_done: completed %d of %d bytes\n",
                                           good_bytes, scsi_bufflen(SCpnt)));
 
-       if (rq_data_dir(SCpnt->request) == READ && scsi_prot_sg_count(SCpnt) &&
-           good_bytes)
-               t10_pi_complete(SCpnt->request, sdkp->protection_type,
-                               good_bytes / scsi_prot_interval(SCpnt));
-
        return good_bytes;
 }
 
        return good_bytes;
 }