Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2487849ybg; Sun, 27 Oct 2019 19:49:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxL5uPs2adH3D4YX7tuZVBnCsy73lIKDDylBCI9qv09zvG3MwerCzSp/ewVWu/8Lc6OIN2c X-Received: by 2002:a50:e606:: with SMTP id y6mr17229062edm.261.1572230964319; Sun, 27 Oct 2019 19:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572230964; cv=none; d=google.com; s=arc-20160816; b=1IKzEAHF4FLAaReTidp7ebso00vXtVrypgKQ0tzkYPd2Wl+iJWsvhC8STlQ6KMeTlP iDhBOz/Fmmu+HarKwD3oxloJgmv/cYfTqOogxuMmCmYVRX6UpP/srZdHrIYmNtKYSqF3 69IZZJTKNLv7I0QnYG/FcmVLcWAXD1ZkBYIPwp2dAvm+DinTCD1rlD+WSwP/BMJH9JVF oS0L3oO0pq+UA2Hy6BbkQIJGbO7RzVQHcqOt2onHGx+IJzyd+j/q4PEmrXkCrrSkidy1 VVlJ1A2IKx2vUQuFsHTnswFRsCy/7+Tb+rb8EUn86468vEaXDqbA2kjwf98JlrvdRNdS dvag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mcRYtVQqYofCcj19lACRYbbZo/zuNUQNNhFqBrqclRg=; b=mZVaPnaLzEiYfGKn+u5FN/nAAiEoEC1yVsl2puMBeKTKejQsYDLBGV/QZ9rmyn2KfN KxLafX3NpX5dpKMgVh8XjDcm7ovtHccjAbi5GMYErIZoK5+h5Gcs/KrhjzAQHdVXGwgu C4ehXaRrhvaSf1mywCGRH3/ATfHz3xyikIxB74rC90oPtfQE5V6XLrBkC+ZT6sM9oMTf Ph8hDf/zeR/VwBVWMal35F1R7+R80oxhiOqdQtCng+vqA+y4WoV55aLE7ANv3uL42xPQ AbHk7+KWQbNl+fDNMbH0AysiDM4RYM3PouVEXH3CHbF7s0nmQWlNSyOsPO92vAW/6dZ2 o4+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mVcWh7ta; 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 b50si6575992ede.28.2019.10.27.19.49.00; Sun, 27 Oct 2019 19:49:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=mVcWh7ta; 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 S1729768AbfJ0VKu (ORCPT + 99 others); Sun, 27 Oct 2019 17:10:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728879AbfJ0VKs (ORCPT ); Sun, 27 Oct 2019 17:10:48 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (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 6AD92208C0; Sun, 27 Oct 2019 21:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572210647; bh=Kin03poEpPqo7IQuKmDiZFT5cHxaIpyJ2RAzFwtVhSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVcWh7taBjy5CJPU9zq2/ETCjEzfCExa0/SI1mZCHvgHkxE/qNsVuOdaDJUvgihv5 PAl5efcyhvdZ4E3aLg8zSDqZEal9wQ0OW1xRfcuukxzrdG1MOQ3FX5LQb3p3zKSTNx JTQTSTIzYOJMOxs92b5NtO26BdsB+3dOEetHXw+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , "Martin K. Petersen" Subject: [PATCH 4.14 087/119] scsi: sd: Ignore a failure to sync cache due to lack of authorization Date: Sun, 27 Oct 2019 22:01:04 +0100 Message-Id: <20191027203347.479606199@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203259.948006506@linuxfoundation.org> References: <20191027203259.948006506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum commit 21e3d6c81179bbdfa279efc8de456c34b814cfd2 upstream. I've got a report about a UAS drive enclosure reporting back Sense: Logical unit access not authorized if the drive it holds is password protected. While the drive is obviously unusable in that state as a mass storage device, it still exists as a sd device and when the system is asked to perform a suspend of the drive, it will be sent a SYNCHRONIZE CACHE. If that fails due to password protection, the error must be ignored. Cc: Link: https://lore.kernel.org/r/20190903101840.16483-1-oneukum@suse.com Signed-off-by: Oliver Neukum Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1658,7 +1658,8 @@ static int sd_sync_cache(struct scsi_dis /* we need to evaluate the error return */ if (scsi_sense_valid(sshdr) && (sshdr->asc == 0x3a || /* medium not present */ - sshdr->asc == 0x20)) /* invalid command */ + sshdr->asc == 0x20 || /* invalid command */ + (sshdr->asc == 0x74 && sshdr->ascq == 0x71))) /* drive is password locked */ /* this is no error here */ return 0;