| .. | .. |
|---|
| 1014 | 1014 | } |
|---|
| 1015 | 1015 | |
|---|
| 1016 | 1016 | /* |
|---|
| 1017 | + * Check for "Operating parameters have changed" |
|---|
| 1018 | + * due to Hyper-V changing the VHD/VHDX BlockSize |
|---|
| 1019 | + * when adding/removing a differencing disk. This |
|---|
| 1020 | + * causes discard_granularity to change, so do a |
|---|
| 1021 | + * rescan to pick up the new granularity. We don't |
|---|
| 1022 | + * want scsi_report_sense() to output a message |
|---|
| 1023 | + * that a sysadmin wouldn't know what to do with. |
|---|
| 1024 | + */ |
|---|
| 1025 | + if ((asc == 0x3f) && (ascq != 0x03) && |
|---|
| 1026 | + (ascq != 0x0e)) { |
|---|
| 1027 | + process_err_fn = storvsc_device_scan; |
|---|
| 1028 | + set_host_byte(scmnd, DID_REQUEUE); |
|---|
| 1029 | + goto do_work; |
|---|
| 1030 | + } |
|---|
| 1031 | + |
|---|
| 1032 | + /* |
|---|
| 1017 | 1033 | * Otherwise, let upper layer deal with the |
|---|
| 1018 | 1034 | * error when sense message is present |
|---|
| 1019 | 1035 | */ |
|---|
| .. | .. |
|---|
| 1521 | 1537 | { |
|---|
| 1522 | 1538 | blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ)); |
|---|
| 1523 | 1539 | |
|---|
| 1540 | + /* storvsc devices don't support MAINTENANCE_IN SCSI cmd */ |
|---|
| 1541 | + sdevice->no_report_opcodes = 1; |
|---|
| 1524 | 1542 | sdevice->no_write_same = 1; |
|---|
| 1525 | 1543 | |
|---|
| 1526 | 1544 | /* |
|---|
| .. | .. |
|---|
| 1625 | 1643 | */ |
|---|
| 1626 | 1644 | static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) |
|---|
| 1627 | 1645 | { |
|---|
| 1628 | | -#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS) |
|---|
| 1629 | | - if (scmnd->device->host->transportt == fc_transport_template) |
|---|
| 1630 | | - return fc_eh_timed_out(scmnd); |
|---|
| 1631 | | -#endif |
|---|
| 1632 | 1646 | return BLK_EH_RESET_TIMER; |
|---|
| 1633 | 1647 | } |
|---|
| 1634 | 1648 | |
|---|
| .. | .. |
|---|
| 1740 | 1754 | |
|---|
| 1741 | 1755 | length = scsi_bufflen(scmnd); |
|---|
| 1742 | 1756 | payload = (struct vmbus_packet_mpb_array *)&cmd_request->mpb; |
|---|
| 1743 | | - payload_sz = sizeof(cmd_request->mpb); |
|---|
| 1757 | + payload_sz = 0; |
|---|
| 1744 | 1758 | |
|---|
| 1745 | 1759 | if (sg_count) { |
|---|
| 1746 | 1760 | unsigned int hvpgoff = 0; |
|---|
| .. | .. |
|---|
| 1748 | 1762 | unsigned int hvpg_count = HVPFN_UP(offset_in_hvpg + length); |
|---|
| 1749 | 1763 | u64 hvpfn; |
|---|
| 1750 | 1764 | |
|---|
| 1751 | | - if (hvpg_count > MAX_PAGE_BUFFER_COUNT) { |
|---|
| 1765 | + payload_sz = (hvpg_count * sizeof(u64) + |
|---|
| 1766 | + sizeof(struct vmbus_packet_mpb_array)); |
|---|
| 1752 | 1767 | |
|---|
| 1753 | | - payload_sz = (hvpg_count * sizeof(u64) + |
|---|
| 1754 | | - sizeof(struct vmbus_packet_mpb_array)); |
|---|
| 1768 | + if (hvpg_count > MAX_PAGE_BUFFER_COUNT) { |
|---|
| 1755 | 1769 | payload = kzalloc(payload_sz, GFP_ATOMIC); |
|---|
| 1756 | 1770 | if (!payload) |
|---|
| 1757 | 1771 | return SCSI_MLQUEUE_DEVICE_BUSY; |
|---|