Skip to content

Commit 07dde72

Browse files
Don Bracemartinkpetersen
authored andcommitted
scsi: smartpqi: fix volume size updates
Correct logical volume size changes by moving the check for a volume rescan outside of the check for a queue depth change. Signed-off-by: Don Brace <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4e0a517 commit 07dde72

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,17 +2303,23 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info,
23032303
* queue depth, device size.
23042304
*/
23052305
list_for_each_entry(device, &ctrl_info->scsi_device_list, scsi_device_list_entry) {
2306+
/*
2307+
* Check for queue depth change.
2308+
*/
23062309
if (device->sdev && device->queue_depth != device->advertised_queue_depth) {
23072310
device->advertised_queue_depth = device->queue_depth;
23082311
scsi_change_queue_depth(device->sdev, device->advertised_queue_depth);
2309-
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
2310-
if (pqi_volume_rescan_needed(device)) {
2311-
device->rescan = false;
2312-
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
2313-
scsi_rescan_device(device->sdev);
2314-
} else {
2315-
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
2316-
}
2312+
}
2313+
spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags);
2314+
/*
2315+
* Check for changes in the device, such as size.
2316+
*/
2317+
if (pqi_volume_rescan_needed(device)) {
2318+
device->rescan = false;
2319+
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
2320+
scsi_rescan_device(device->sdev);
2321+
} else {
2322+
spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags);
23172323
}
23182324
}
23192325

0 commit comments

Comments
 (0)