Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042104imm; Mon, 16 Jul 2018 00:44:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfS4DwEN58IiOqjjLse7X6U2N1JALzfjH4xFADtae3y/PBW1vuLton81VpuqSgD0vpW2vBZ X-Received: by 2002:a63:524e:: with SMTP id s14-v6mr14751499pgl.35.1531727054242; Mon, 16 Jul 2018 00:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727054; cv=none; d=google.com; s=arc-20160816; b=Kykp+n1wYkX39h4Oup4WMm98/P1xG9kPngdyx38MhHU59DfONXkaDapwxavNa+67VA ZnAR9Zge1rnjB/6P0rPC1MhZk5hLbDTw8TYF+Yyu0ERKevnuC5AMRPJYAZLRwPBI3Oce q7B3AF7Fl/mLuUpM5+dEGQOfN/9+v2/DbKVDsrTzW6Xkx2VwtZeGa0PFLO28CHj5dZSP 31iHDxxrA+22kF3EM143SmGoo2YN/1+pE3KjeGU+CGTJx/KPM+1wDgnxrIEciAQCArkW UwK06GQuEKSRupM80myHO1kZWCJ8oA51o/rtFhNbFhGyn3BMxMOrfORaKChvhnFHkRaI 6NoQ== 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 :arc-authentication-results; bh=ItRauMK5EBx66NXIr2jxbmahOTQgMAhGivbzZveoycA=; b=NecJtkVmLAovIc6aC5Z+i/XQeEtiEOpga7fm0qGyUD2BhsZyzmW8uRQ/1biaOJ/GHX o9kGSX2mzb+zh8B4md8MkmCq+RMTlsOSF0qLTfZkQaK/peI7jVIEct8XdsdwXrNJvoYr GImbHgw+zPEiFvjZF2r9lxAFiYswTDJ9I5c1Ss6xO3lnOFzn92CqUZu+fIysl2mXK+rs YZ4rLz6JCJNE63DMmcr/9YOv2JSYPKirzydHymTO6IMOhl4AZPPmJxBeGfsR+qY+qu/d 6f1sQkRXr5oE2VlH9uV7ldjfk4zGXxpWuPXQLl/9w+Vq4/+04VaQcPZxjOt8gji9i3Bf KHOA== 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 m23-v6si2009652pgb.420.2018.07.16.00.43.59; Mon, 16 Jul 2018 00:44:14 -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 S2388849AbeGPIIt (ORCPT + 99 others); Mon, 16 Jul 2018 04:08:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47850 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbeGPIIs (ORCPT ); Mon, 16 Jul 2018 04:08:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6F5BBC03; Mon, 16 Jul 2018 07:42:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Butterfield , Damien Le Moal , Tejun Heo Subject: [PATCH 4.9 08/32] ata: Fix ZBC_OUT all bit handling Date: Mon, 16 Jul 2018 09:36:16 +0200 Message-Id: <20180716073505.462986205@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@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: Damien Le Moal commit 6edf1d4cb0acde3a0a5dac849f33031bd7abb7b1 upstream. If the ALL bit is set in the ZBC_OUT command, the command zone ID field (block) should be ignored. Reported-by: David Butterfield Signed-off-by: Damien Le Moal Cc: stable@vger.kernel.org Signed-off-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-scsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -3772,7 +3772,14 @@ static unsigned int ata_scsi_zbc_out_xla */ goto invalid_param_len; } - if (block >= dev->n_sectors) { + + all = cdb[14] & 0x1; + if (all) { + /* + * Ignore the block address (zone ID) as defined by ZBC. + */ + block = 0; + } else if (block >= dev->n_sectors) { /* * Block must be a valid zone ID (a zone start LBA). */ @@ -3780,8 +3787,6 @@ static unsigned int ata_scsi_zbc_out_xla goto invalid_fld; } - all = cdb[14] & 0x1; - if (ata_ncq_enabled(qc->dev) && ata_fpdma_zac_mgmt_out_supported(qc->dev)) { tf->protocol = ATA_PROT_NCQ_NODATA;