From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965358AbcBCWBZ (ORCPT ); Wed, 3 Feb 2016 17:01:25 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:50447 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965281AbcBCWBJ (ORCPT ); Wed, 3 Feb 2016 17:01:09 -0500 To: jiangyiwen Cc: , , , , =?utf-8?B?THVr?= =?utf-8?B?w6HFoQ==?= Czerner , , "Qijiang \(Joseph\, Euler\)" Subject: Re: [dm-devel] [PATCH] block: do not return -EOPNOTSUPP only when issue a discard request From: "Martin K. Petersen" Organization: Oracle Corporation References: <56B1CE5C.10201@huawei.com> Date: Wed, 03 Feb 2016 17:00:56 -0500 In-Reply-To: <56B1CE5C.10201@huawei.com> (jiangyiwen@huawei.com's message of "Wed, 3 Feb 2016 17:54:36 +0800") 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 >>>>> "Yiwen" == jiangyiwen writes: Yiwen> commit 8af1954d172a("blkdev: Do not return -EOPNOTSUPP if discard Yiwen> is supported") only solve the situation of discard, because When Yiwen> applications issue a discard request to device, they can't expect Yiwen> deterministic behaviour. However, WRITE SAME should not ignore Yiwen> error with EOPNOTSUPP, because if applications issue WRITE SAME Yiwen> requests to device, it should return deterministic results to Yiwen> applications according to the T10 standard, or else it will cause Yiwen> an inconsistent state between upper layer and bottom layer. Yiwen> So ignoring error with EOPNOTSUPP only in discard situation. If an underlying device fails a WRITE SAME request, SCSI will not return EOPNOTSUPP. Instead we will mark 0 bytes of the request as complete and disable WRITE SAME support on the device. So any EOPNOTSUPP error in this case would be coming from MD/DM. That said, I agree with the patch. Reviewed-by: Martin K. Petersen -- Martin K. Petersen Oracle Linux Engineering