From patchwork Thu Apr 4 14:47:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 10885717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DF20139A for ; Thu, 4 Apr 2019 14:47:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 661AF28A9C for ; Thu, 4 Apr 2019 14:47:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58B8328AAB; Thu, 4 Apr 2019 14:47:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 025AF28A9C for ; Thu, 4 Apr 2019 14:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbfDDOrr (ORCPT ); Thu, 4 Apr 2019 10:47:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:46506 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726888AbfDDOrr (ORCPT ); Thu, 4 Apr 2019 10:47:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F11D8AF36; Thu, 4 Apr 2019 14:47:45 +0000 (UTC) From: Oliver Neukum To: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH] SCSI: unconditionally clean was_reset Date: Thu, 4 Apr 2019 16:47:22 +0200 Message-Id: <20190404144722.31361-1-oneukum@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; } /*