From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE47EC43381 for ; Tue, 19 Mar 2019 11:02:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DCCC20828 for ; Tue, 19 Mar 2019 11:02:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfCSLCu (ORCPT ); Tue, 19 Mar 2019 07:02:50 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:44758 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726782AbfCSLCt (ORCPT ); Tue, 19 Mar 2019 07:02:49 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E6C54AFD543FAB76BBF4; Tue, 19 Mar 2019 19:02:47 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Tue, 19 Mar 2019 19:02:42 +0800 Subject: Re: [PATCH 3/3] f2fs: improve discard handling with multi-device volumes To: Damien Le Moal , Jaegeuk Kim , CC: , Matias Bjorling , Masato Suzuki References: <20190316001308.18115-1-damien.lemoal@wdc.com> <20190316001308.18115-4-damien.lemoal@wdc.com> From: Chao Yu Message-ID: Date: Tue, 19 Mar 2019 19:02:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190316001308.18115-4-damien.lemoal@wdc.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 2019/3/16 8:13, Damien Le Moal wrote: > f2fs_hw_support_discard() only tests if the super block device supports > discard. However, for a multi-device volume, not all disks used may > support discard. Improve the check performed to test all devices of > the volume and report discard as supported if at least one device of > the volume supports discard. To implement this, introduce the helper > function f2fs_bdev_support_discard(), which returns true for zoned block > devices (where discard is processed as a zone reset) and for regular > disks supporting the discard command. > > f2fs_bdev_support_discard() is also used in __queue_discard_cmd() to > handle discard command issuing for a particular device of the volume. > That is, prevent issuing a discard command for block devices that do > not support it. > > Signed-off-by: Damien Le Moal Reviewed-by: Chao Yu Thanks,