Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: smartpqi: Update volume size after expansion

After modifying logical volume size, lsblk command still shows previous
size of logical volume.

When the driver gets any event from firmware it schedules rescan worker
with delay of 10 seconds. If array expansion is so quick that it gets
completed in a second, the driver could not catch logical volume expansion
due to worker delay.

Since driver does not detect volume expansion, driver would not call
rescan device to update new size to the OS.

Link: https://lore.kernel.org/r/164375211833.440833.17023155389220583731.stgit@brunhilda.pdev.net
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Scott Teel <scott.teel@microchip.com>
Signed-off-by: Mahesh Rajashekhara <mahesh.rajashekhara@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mahesh Rajashekhara and committed by
Martin K. Petersen
27655e9d b73357a1

+13 -8
+1
drivers/scsi/smartpqi/smartpqi.h
··· 1322 1322 bool controller_online; 1323 1323 bool block_requests; 1324 1324 bool scan_blocked; 1325 + u8 logical_volume_rescan_needed : 1; 1325 1326 u8 inbound_spanning_supported : 1; 1326 1327 u8 outbound_spanning_supported : 1; 1327 1328 u8 pqi_mode_enabled : 1;
+12 -8
drivers/scsi/smartpqi/smartpqi_init.c
··· 2015 2015 2016 2016 /* Assumes the SCSI device list lock is held. */ 2017 2017 2018 - static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device, 2019 - struct pqi_scsi_dev *new_device) 2018 + static void pqi_scsi_update_device(struct pqi_ctrl_info *ctrl_info, 2019 + struct pqi_scsi_dev *existing_device, struct pqi_scsi_dev *new_device) 2020 2020 { 2021 2021 existing_device->device_type = new_device->device_type; 2022 2022 existing_device->bus = new_device->bus; ··· 2026 2026 existing_device->target_lun_valid = true; 2027 2027 } 2028 2028 2029 - if ((existing_device->volume_status == CISS_LV_QUEUED_FOR_EXPANSION || 2030 - existing_device->volume_status == CISS_LV_UNDERGOING_EXPANSION) && 2031 - new_device->volume_status == CISS_LV_OK) 2029 + if (pqi_is_logical_device(existing_device) && 2030 + ctrl_info->logical_volume_rescan_needed) 2032 2031 existing_device->rescan = true; 2033 2032 2034 2033 /* By definition, the scsi3addr and wwid fields are already the same. */ ··· 2145 2146 */ 2146 2147 device->new_device = false; 2147 2148 matching_device->device_gone = false; 2148 - pqi_scsi_update_device(matching_device, device); 2149 + pqi_scsi_update_device(ctrl_info, matching_device, device); 2149 2150 break; 2150 2151 case DEVICE_NOT_FOUND: 2151 2152 /* ··· 2217 2218 } 2218 2219 2219 2220 /* 2220 - * Notify the SCSI ML if the queue depth of any existing device has 2221 - * changed. 2221 + * Notify the SML of any existing device changes such as; 2222 + * queue depth, device size. 2222 2223 */ 2223 2224 list_for_each_entry(device, &ctrl_info->scsi_device_list, scsi_device_list_entry) { 2224 2225 if (device->sdev && device->queue_depth != device->advertised_queue_depth) { ··· 2247 2248 } 2248 2249 } 2249 2250 } 2251 + 2252 + ctrl_info->logical_volume_rescan_needed = false; 2253 + 2250 2254 } 2251 2255 2252 2256 static inline bool pqi_is_supported_device(struct pqi_scsi_dev *device) ··· 3705 3703 } else { 3706 3704 ack_event = true; 3707 3705 rescan_needed = true; 3706 + if (event->event_type == PQI_EVENT_TYPE_LOGICAL_DEVICE) 3707 + ctrl_info->logical_volume_rescan_needed = true; 3708 3708 } 3709 3709 if (ack_event) 3710 3710 pqi_acknowledge_event(ctrl_info, event);