Received: by 10.192.165.148 with SMTP id m20csp4168997imm; Mon, 30 Apr 2018 13:05:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoK5LcD/pHMe4eX1RdolZ6FwCQg2UwOZTSOU2Wc25qU0i011ErFF5KjwGXwwjlmRsRg342w X-Received: by 2002:a63:3286:: with SMTP id y128-v6mr11246583pgy.419.1525118727562; Mon, 30 Apr 2018 13:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118727; cv=none; d=google.com; s=arc-20160816; b=eFQvajSXcG6laN4AkvgOLCOXyNvSn340TV2Ah0GsIkf1aRr2WwGNDPiV9zkiQbu4kN 0vdZknRGg/rWSu2mu7wH2yDp50jucnXEYOeCdawusCzWtEIP/hp2kU2PTzjBfKOV9sDv 8OGaZWuCCJ2jYfFahibYv8YoGIwrF/RYZoJu1Vsy5OOW42zhBlAavt/TgGpGKuiB3s5o ZSI5q7B1KfU9jyfSmM7lJbj6Cd1wSuvYRKYi9VW5gwph75Er53wyA0ODY3mNrExVvhVm UmH4IAPK70K2OD6jzX/xCa+sMFIrBDwyc/CEGS3aL45CzQmJz6r/bt/vLECpIY2tuOJL IK0Q== 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=zF1Bg62Ci7aujaTubhQdExu8bc8fOREHdgdMPxRhiMc=; b=KGtq3EEEgEokbUQW7lfDHUlYEQCz3rv2uYebFDj7tABto2SeYp84nX7GCyhqcTmgQQ xYiRYDJv2XwvN6jh/83EqrOAdZ0B64othZyzuzZZFxK//GvDEjT98y8xzkf4yNMriynO wDphl4FcrdGdHEsjhw4qSkxxsRgDqBfBwfhRPF8cbi6AKISyBNztnUFwpC7fS0wENWqw MQz/fQ5rGS1I/whTrZH0wCxQwOq7i0OggZq3flGvDiFB1QzCcWxdR/doBeIfVhH4K7bC j+dxNhJ4IZKEqiTbJJpUq9ckSzt+xYkbbNnZMeQKCVXgFNqvkc3IALeaAdQz/+9AaXUt l9yg== 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 v2-v6si6543381pgf.75.2018.04.30.13.05.13; Mon, 30 Apr 2018 13:05:27 -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 S1755335AbeD3T1b (ORCPT + 99 others); Mon, 30 Apr 2018 15:27:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:33874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755961AbeD3T1Z (ORCPT ); Mon, 30 Apr 2018 15:27:25 -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 32D8422DCB; Mon, 30 Apr 2018 19:27:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32D8422DCB 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.14 56/91] scsi: sd: Defer spinning up drive while SANITIZE is in progress Date: Mon, 30 Apr 2018 12:24:38 -0700 Message-Id: <20180430184007.103170251@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@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.14-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 @@ -2132,6 +2132,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 */