If a reset of a SCSI device requires no relocking of the door, the flag must be reset anyway, lest it trigger unnecessary door action later on.
Signed-off-by: Oliver Neukum <oneu...@suse.com> --- drivers/scsi/scsi_error.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 16eef068e9e9..afb8cf0cdfed 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1990,10 +1990,9 @@ static void scsi_restart_operations(struct Scsi_Host *shost) * is no point trying to lock the door of an off-line device. */ shost_for_each_device(sdev, shost) { - if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) { + if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) scsi_eh_lock_door(sdev); - sdev->was_reset = 0; - } + sdev->was_reset = 0; } /* -- 2.16.4