From patchwork Thu Jul 2 14:24:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 11639039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAC6D6C1 for ; Thu, 2 Jul 2020 14:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C95A82089D for ; Thu, 2 Jul 2020 14:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729867AbgGBOYm (ORCPT ); Thu, 2 Jul 2020 10:24:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:43864 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729437AbgGBOYm (ORCPT ); Thu, 2 Jul 2020 10:24:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 19898AB98; Thu, 2 Jul 2020 14:24:41 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , Bart van Assche , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCH] scsi: allow state transitions BLOCK -> BLOCK Date: Thu, 2 Jul 2020 16:24:36 +0200 Message-Id: <20200702142436.98336-1-hare@suse.de> 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 scsi_transport_srp.c will call scsi_target_block() repeatedly without calling scsi_target_unblock() first. So allow the idempotent state transition BLOCK -> BLOCK to avoid a warning here. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1362f4f17dfd..55666e5ef151 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2322,6 +2322,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) switch (oldstate) { case SDEV_RUNNING: case SDEV_CREATED_BLOCK: + case SDEV_BLOCK: case SDEV_QUIESCE: case SDEV_OFFLINE: break;