From b0962c53bde9a485c8ebc401fa1dbe821a76bc3e Mon Sep 17 00:00:00 2001 From: "Ewan D. Milne" Date: Wed, 11 Mar 2020 10:39:30 -0400 Subject: scsi: core: avoid repetitive logging of device offline messages Large queues of I/O to offline devices that are eventually submitted when devices are unblocked result in a many repeated "rejecting I/O to offline device" messages. These messages can fill up the dmesg buffer in crash dumps so no useful prior messages remain. In addition, if a serial console is used, the flood of messages can cause a hard lockup in the console code. Introduce a flag indicating the message has already been logged for the device, and reset the flag when scsi_device_set_state() changes the device state. Link: https://lore.kernel.org/r/20200311143930.20674-1-emilne@redhat.com Reviewed-by: Bart van Assche Signed-off-by: Ewan D. Milne Signed-off-by: Martin K. Petersen --- include/scsi/scsi_device.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/scsi/scsi_device.h') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 579e24c92f2f..c3cba2aaf934 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -203,6 +203,9 @@ struct scsi_device { unsigned unmap_limit_for_ws:1; /* Use the UNMAP limit for WRITE SAME */ unsigned rpm_autosuspend:1; /* Enable runtime autosuspend at device * creation time */ + + bool offline_already; /* Device offline message logged */ + atomic_t disk_events_disable_depth; /* disable depth for disk events */ DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ -- cgit v1.2.3