Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751670AbcLFDap (ORCPT ); Mon, 5 Dec 2016 22:30:45 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:20398 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbcLFDam (ORCPT ); Mon, 5 Dec 2016 22:30:42 -0500 To: Nicolai Stange Cc: Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Shaun Tancheff , Chaitanya Kulkarni , Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sd: make ->no_write_same independent of reported ->max_ws_blocks From: "Martin K. Petersen" Organization: Oracle Corporation References: <20161205235638.11539-1-nicstange@gmail.com> Date: Mon, 05 Dec 2016 22:29:56 -0500 In-Reply-To: <20161205235638.11539-1-nicstange@gmail.com> (Nicolai Stange's message of "Tue, 6 Dec 2016 00:56:38 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1337 Lines: 31 >>>>> "Nicolai" == Nicolai Stange writes: Nicolai, Nicolai> Due to reported problems with Write Same on ATA devices, commit Nicolai> 0ce1b18c42a5 ("libata: Some drives failing on SCT Write Same") Nicolai> strived to report non-support for Write Same on non-zoned ATA Nicolai> devices. Nicolai> However, due to the following control flow in Nicolai> sd_config_write_same() this doesn't always take effect, namely Nicolai> if the ->max_ws_blocks as set in the by the ATA Identify Device Nicolai> exceeds SD_WS10_BLOCKS: I'd much prefer for libata to set no_write_same = 1 for non-ZAC devices. Older SCSI devices have no way to explicitly report that WRITE SAME is supported. So the heuristic is the way it is to permit trying WRITE SAME unless no_write_same has been set by the device driver. libata used to do this prior to the zoned support going in. Nicolai> Since commit e73c23ff736e ("block: add async variant of Nicolai> blkdev_issue_zeroout"), blkdev_issue_zeroout() got a little bit Nicolai> more sensitive towards failing Write Sames on devices that Nicolai> claim to support them and this results in messages like That's something that needs to be addressed. blkdev_issue_zeroout() must cope with WRITE SAME failing and fall back to a manual zeroout. -- Martin K. Petersen Oracle Linux Engineering