Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp788148ybj; Thu, 7 May 2020 07:40:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLf1yU3fPWdilRMYpQqtN6alrbcy4JWKkdQSLyHL1QpGUa+XKTKeKQ8XwWLbDYtAi4zu+7n X-Received: by 2002:a05:6402:8ca:: with SMTP id d10mr12528926edz.167.1588862404119; Thu, 07 May 2020 07:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588862404; cv=none; d=google.com; s=arc-20160816; b=gV8dDlTIQkZBEjd+hKGqwyFM+zKk6DD+JZqIO2+K2FIqi2OpefTJsmdIf6WpEQLVfO RLsNu1IDLGuMuxAqALvDEhKVn6OS8cazxuyH5BN2DL5NLRmw3KyHNJzhZzhO8spQwP0g 3WkiaIbQRquGFPj6q8fbq5ihD/JXFtvikA2S4602GOAHpQkfEfSUSd/86w7x9ncDFrJe xcIUwqBpXGgoC9sjkJoECX8E+b8xUFaWFLXr2Gak42ixl66yL2hIxPC4fXQxnIH2uujl AK10qtNmHqweN6JYJ6d/n+dxM9QE/P2CjksREmbI6+3VV25Xli/8r49hwJQklxKTcxQI 6J6Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B4R1bYtvbi8ZlXqwCkUP3hrcNVmfzfiG4FvuQLGC6qM=; b=wAKcdLR5XpDOTF9UZut6ZzoGCg1yybHibjAY4m4U3ag0nnf/F7MlaQxXsCLS3gskBP QdvbINnVzOFHKCsziDLpni4/6P8Rx+GvL1SXAHxbnloXRD0pCBkTg4CRNBe9pczbzQMc ziBlEINYhu+bd4hKHpLDwkZU4/YATWP7lAQKGqOPjZv4FHhj2KZhwj6V/GjMPufZfYvy 1nreId5PuHBV5qXwzr2WWcaGhx5yzpElTfaEOZjCgJXkjF40nElfP+nme5aOHMzXoNRj RQgKLUo+0aEZ9M2kUBlSbnI3johYNwBTXDY9U0i2bePqsxz+sYB82dgTjoJTwnUKBKGu hC+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MteUrxW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch13si3289638ejb.338.2020.05.07.07.39.40; Thu, 07 May 2020 07:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MteUrxW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728642AbgEGOiY (ORCPT + 99 others); Thu, 7 May 2020 10:38:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:53514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726774AbgEGO1m (ORCPT ); Thu, 7 May 2020 10:27:42 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6061E20870; Thu, 7 May 2020 14:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588861661; bh=AbF2uNFJWRWl/L5czMYiTGS/1WgEFm5qePayN96IG0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MteUrxW8vja2negiTpGhTzftXr1O5QxoahaHMBFkhujKt0kb0kVhFGPYxyfbCuBl1 Gqmr1K/IqI6GW9TCuI8M8Niqup9JGQ50irbE6OnHEeVDWbJCpAFC/6mtznT3WYIvhY fqZu2ANglPMOZe+6O6XfdiOMMIzZ7FmJYDqE8T5c= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Disseldorp , Bart Van Assche , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Subject: [PATCH AUTOSEL 5.6 11/50] scsi: target/iblock: fix WRITE SAME zeroing Date: Thu, 7 May 2020 10:26:47 -0400 Message-Id: <20200507142726.25751-11-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200507142726.25751-1-sashal@kernel.org> References: <20200507142726.25751-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Disseldorp [ Upstream commit 1d2ff149b263c9325875726a7804a0c75ef7112e ] SBC4 specifies that WRITE SAME requests with the UNMAP bit set to zero "shall perform the specified write operation to each LBA specified by the command". Commit 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") modified the iblock backend to call blkdev_issue_zeroout() when handling WRITE SAME requests with UNMAP=0 and a zero data segment. The iblock blkdev_issue_zeroout() call incorrectly provides a flags parameter of 0 (bool false), instead of BLKDEV_ZERO_NOUNMAP. The bool false parameter reflects the blkdev_issue_zeroout() API prior to commit ee472d835c26 ("block: add a flags argument to (__)blkdev_issue_zeroout") which was merged shortly before 2237498f0b5c. Link: https://lore.kernel.org/r/20200419163109.11689-1-ddiss@suse.de Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") Reviewed-by: Bart Van Assche Signed-off-by: David Disseldorp Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/target_core_iblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 51ffd5c002dee..1c181d31f4c87 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -432,7 +432,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) target_to_linux_sector(dev, cmd->t_task_lba), target_to_linux_sector(dev, sbc_get_write_same_sectors(cmd)), - GFP_KERNEL, false); + GFP_KERNEL, BLKDEV_ZERO_NOUNMAP); if (ret) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; -- 2.20.1