Received: by 10.192.165.148 with SMTP id m20csp4183314imm; Mon, 30 Apr 2018 13:22:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr0yMFR8H9ZiIjoS+oluR1jJItvf8BSjXZ+ZMSrE6or+TPDflHUMDjqpl3wauJ9pi4vB9w3 X-Received: by 2002:a17:902:8a:: with SMTP id a10-v6mr13531325pla.89.1525119773993; Mon, 30 Apr 2018 13:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119773; cv=none; d=google.com; s=arc-20160816; b=UFT4tCa6tIKPZuA996YXZXMVHSGR/tX1PPed0dXsYlf+4OZIPC4k9+EAELtFiorOBT t5jNAmXd63C9d1tyMlYKyEhckBS0rvV7DFj8sT/bleIEO0tJYN9XZ8Qrt4X+tfUUGmIt 0Nc9CArSs5AntmUH/xtqQDH6L9B3Hnlnp8/n/nNb5dSb5GGB6cBtyRumtqmuVFAUVIfQ QFedrZBFwjWKzqDh5nY1tgWKOKBdU5co2xHwj0CoY8qTyRvCdiCSqM1bRKXen+pb3lN5 MqqG0uoyS1W0aaYJLQTbE/EdePEigAtSILZz6mRR5wYlweP0EPS56XXOMcvf7MxUmGlL NjEg== 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=125QQGxOFJwHiKfjAflJx8k3oKcu8l7U37D38ZHJkjI=; b=j8KskNq4KbIhGqm/xeH4kc8dDyqbdv4rYe7Wo7BOKCAZUZRGWeZ1jiyFzAZbgt7br1 s2TK+HVMdcxrmdeAFKeK95AKSG5cyDgQ9WOqoYlv03ao2lrc7WKb5PHwWA6PZj2+f5Vi h7FuXKjWKQnRH7ix6T0C4WpKJ1yAg8Xpc7mT49qXTI4MrFTJMseuZ36AbZHvSOKUlICm jCyM0T21ogFH/QV80AXKwr/0mV7PgzQ0Ek1qK4zx4ZZgPlV5ZHi2jqAnutng/B/aq/hh NWuSXQIhXHxO+ZST1Rklfb1RM7AXoORrtPHeNoqvtymuUqS4M3qqgSwJ2PkcEJu9Aswu VrGQ== 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 s6-v6si8908732plp.18.2018.04.30.13.22.39; Mon, 30 Apr 2018 13:22:53 -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 S1755791AbeD3UWP (ORCPT + 99 others); Mon, 30 Apr 2018 16:22:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755742AbeD3T0k (ORCPT ); Mon, 30 Apr 2018 15:26:40 -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 A5D5B22DBF; Mon, 30 Apr 2018 19:26:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A5D5B22DBF 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.9 40/61] scsi: sd: Defer spinning up drive while SANITIZE is in progress Date: Mon, 30 Apr 2018 12:24:43 -0700 Message-Id: <20180430183954.747408420@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@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.9-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 @@ -1935,6 +1935,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 */