Received: by 10.192.165.148 with SMTP id m20csp4193064imm; Mon, 30 Apr 2018 13:34:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrD1YkuZZfEqkFl6Cnkz4ewLVuYvry747uc0vdxbXBQPv6cXRzTKo6ksmAt0CXrruXlru/3 X-Received: by 2002:a63:6883:: with SMTP id d125-v6mr11223539pgc.9.1525120477776; Mon, 30 Apr 2018 13:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120477; cv=none; d=google.com; s=arc-20160816; b=xgHkzVMSWtRu5vBwRu+CsZi7gytoFcUQ8sqFUFsZuNGEE/tqg5MQkdlLDgqhklSMjr iBKeRlPbRdIM/tT3jRxnwhczCDfGIbiOZ0BcOTh7CJsj0t88F5zj5B/+zj2KaAD8N+WS bgdVV6kTn8I6wiXxJea6N6qMMn+e2JQbTTCpF23qcHiLA/chkwQsI460quN08y4nkD3/ +QYdLVFEUwLDf6lDp7wSI8O4VbtK1qSkx+bangms+UeZRifVxzlqHHlSu78sB6zsuntr kyeLmsYcCBrHmazEI1TC627I9eaRAEPEDAc4a809j9YjnPA2ophRDm4Gro5xsfXcqQzo UM/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=Ww5iymCPa/+VsiyBkU8qz5ishGkCD440oLGbs3KVCrI=; b=lg9HricPmCW2A1oCmdAXaoqKJu/779EEAPDSMJjN21YDn5YxlzYy/J/rM2lKTSzxG9 lEyqNJBgUMtRAg2aqQCCoa8PDcZbOUE1VPScKulECeQ2MLPqF2akOKq8YtMhE3g266e5 0vLSxrzeevagf8CvrEPjtVLH43pcLDzkj7MbPh+AHSVqdbMGC6Fdp2h87dLIWCuGjr8B 1b2OlbhDzofGgnZGj7wJesqw5/Jg20Oh8SN42z0kT2yzBO/fpbgNYJ3jZ0EvYuG8Hbxc ylIPy0jXJy9hG2Nzqba+9v4ZPZ6gqP1jKT0bdTEtY62uASRL6QWH7s82mQOi304QQvaw d4HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si8028783pla.271.2018.04.30.13.34.23; Mon, 30 Apr 2018 13:34:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755603AbeD3UeQ (ORCPT + 99 others); Mon, 30 Apr 2018 16:34:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755471AbeD3T0B (ORCPT ); Mon, 30 Apr 2018 15:26:01 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93A4322DBF; Mon, 30 Apr 2018 19:26:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93A4322DBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Rajashekhara , "Martin K. Petersen" Subject: [PATCH 4.4 34/44] scsi: sd: Defer spinning up drive while SANITIZE is in progress Date: Mon, 30 Apr 2018 12:24:45 -0700 Message-Id: <20180430190947.695033898@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430190946.093694747@linuxfoundation.org> References: <20180430190946.093694747@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mahesh Rajashekhara commit 505aa4b6a8834a2300971c5220c380c3271ebde3 upstream. A drive being sanitized will return NOT READY / ASC 0x4 / ASCQ 0x1b ("LOGICAL UNIT NOT READY. SANITIZE IN PROGRESS"). Prevent spinning up the drive until this condition clears. [mkp: tweaked commit message] Signed-off-by: Mahesh Rajashekhara Cc: Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1929,6 +1929,8 @@ sd_spinup_disk(struct scsi_disk *sdkp) break; /* standby */ if (sshdr.asc == 4 && sshdr.ascq == 0xc) break; /* unavailable */ + if (sshdr.asc == 4 && sshdr.ascq == 0x1b) + break; /* sanitize in progress */ /* * Issue command to spin up drive when not ready */