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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 A2F30C1975A for ; Wed, 25 Mar 2020 15:29:18 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C15C2076A; Wed, 25 Mar 2020 15:29:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="YMyIOcJ+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="D3ovFGdP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="OYFuAIgD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C15C2076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jH7y0-0005KG-5z; Wed, 25 Mar 2020 15:29:16 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jH7xz-0005K9-Ea for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Mar 2020 15:29:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=s9o1YcFIkmflqsWaxbFgkp4az0GTva1vt7Qz7uMqp0U=; b=YMyIOcJ+Rr8C4vg8NarZtAMxBx EvB8JGg2TNJeWzWBQyhy8UwubFhbmadJx0SXqWSAEsAzHlrSpkv1bcsJ7+wQ+ia0Tgm/sCyIu4XlX A8F+wRVoChT6g3wLeZVLjgfhXCmyaZupxBbjmOzJVF2AgaItZk3LFWZPBuir4vqssK/E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=s9o1YcFIkmflqsWaxbFgkp4az0GTva1vt7Qz7uMqp0U=; b=D3ovFGdP7KO3XP+jcH2Fp4HzP3 Y973xyA+7UaVQBV1b4FYrCkDxUREx1iMA7VHPmL8joR03J0Kh+97LcPIHdiIZb6MsTVA+Sd7CfBZG L/r4nyrHOBt1xr9AFqUwfRwXlvQV5P3KqGtWJLoZjCDlH01zVWryWIK2P1hAHTD34mjg=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jH7xu-00GXto-OG for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Mar 2020 15:29:15 +0000 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3320520409; Wed, 25 Mar 2020 15:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585150140; bh=go8gp5X5K5OQI1lxpw0RRcIOUv+vtN2Xt4lszINpSVo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OYFuAIgDSELsbPZkjA7m82K7TGTMyRQ9dbkvkHK09E9tTOsldIet9fDTIy4pGYP4A Awd2zJ44Bpanck72XTb913evoBw8wuTDBPbvhMUIqZDRBVAn+QfGRMcRg7eayqe5ON dJKAAlOJ89KRGs1gVzN62bGnOQpdl5uQJqeOcv1Y= Date: Wed, 25 Mar 2020 08:28:59 -0700 From: Jaegeuk Kim To: John Message-ID: <20200325152859.GA65658@google.com> References: <418f4ee8-14ed-bdfa-d16c-f68c2992f234@huawei.com> <20200323041143.GC147648@google.com> <20200323150205.GA119787@google.com> <8b47e963-9e12-c945-e40e-a9d54a412d52@huawei.com> <2292eb8d-8357-227f-5448-d1d03b33c042@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1jH7xu-00GXto-OG Subject: Re: [f2fs-dev] fstrim does not recognize FSVER=1.13 of F2FS partitions X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 03/25, John wrote: > On Tue, Mar 24, 2020 at 9:01 PM Chao Yu wrote: > > I guess ssd should support discard, however I saw sdb was wrapped with device > > mapper, which may have different character, just want to check that whether > > device mapper disable the discard. > > > > If backup/restore is hard for you, how about let me add some logs on fstrim > > interface? then we could retry fstrim to see where we actually fail. > > I have an older totally different SSD for testing that seems to support discard: > # hdparm -I /dev/sdc | grep TRIM > * Data Set Management TRIM supported (limit 8 blocks) > * Deterministic read ZEROs after TRIM > > As I test, I created two f2fs partitions on this different SSD: > 1) /dev/sdc2 normal F2FS > 2) /dev/sdc3 encrypted with LUKS (dm-crypt) then formatted to F2FS > > Results: > 1) Regular F2FS > # fstrim -v /regular > /regular: 0 B (0 bytes) trimmed This is normal. > > 2) Encrypted F2FS > # fstrim -v /encrypted > fstrim: /encrypted: the discard operation is not supported It seems dm-crypt has discard-related support, ie., "allow_discards", in ctrl. But, FWIW, the target simply doesn't support discard at all. # grep discards_supported drivers/md/* drivers/md/dm-cache-target.c: ti->discards_supported = true; drivers/md/dm-clone-target.c: ti->discards_supported = true; drivers/md/dm-log-writes.c: ti->discards_supported = true; drivers/md/dm-table.c: if (!tgt->num_discard_bios && tgt->discards_supported) drivers/md/dm-table.c: DMWARN("%s: %s: ignoring discards_supported because num_discard_bios is zero.", drivers/md/dm-table.c: * 'discards_supported') or it relies on _all_ data devices having drivers/md/dm-table.c: if (!ti->discards_supported && drivers/md/dm-thin.c: * Setting 'discards_supported' circumvents the normal drivers/md/dm-thin.c: ti->discards_supported = true; drivers/md/dm-thin.c: ti->discards_supported = true; drivers/md/dm-zoned-target.c: ti->discards_supported = true; > > Can we conclude that the device mapper is some how spoofing fstrim > into thinking the device doesn't support trim? Happy to hear your > thoughts. > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel