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 6F08AC2D0E5 for ; Wed, 25 Mar 2020 19:59:39 +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 3194320658; Wed, 25 Mar 2020 19:59:39 +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="QDbbnEtn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="EbLBFAXU"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uJFLOmaY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3194320658 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-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jHCBe-0006RL-B8; Wed, 25 Mar 2020 19:59:38 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jHCBd-0006RE-7f for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Mar 2020 19:59:37 +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=6rd9iA5/mvWejTOA8U4ycTAtHJDRh9Eqc7+SRlv6B5Y=; b=QDbbnEtnZMP7HRxc0OxJE1SPs+ ssvg+6z1slnwEcEJMFtu/rdEeFijbG6IkojQUCCt+/BK76EMLA0Jlr4hLTElvSibMRHFSPU6v8W5f tiaMR6XyNW3ys1Oz8yTu2XhtWWjXykC/0ih24AeYVLEzQkHzowg8bJ8tGQASG04YVeOk=; 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=6rd9iA5/mvWejTOA8U4ycTAtHJDRh9Eqc7+SRlv6B5Y=; b=EbLBFAXU4jK/BC/yronAMyaMgB xq1X1zUZ5T4gMVOC+4/roo6ch3pfqe43k1VC0JV9d2ytheFaKwM0B4K0ZdSTjGFTE1E6RnDH/Vr82 jKl16Vu4S7NKmTXQj6xZMT69vuFeQNYI+xsvCwByEPHlFN/ZSa91JPvRFRVB107arjKw=; 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 1jHCBT-00HAJ2-BN for linux-f2fs-devel@lists.sourceforge.net; Wed, 25 Mar 2020 19:59:37 +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 15CB22074D; Wed, 25 Mar 2020 19:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585166360; bh=JDPXt3GdI1SAo72zl4Gs4IOKs6qX4FkvHJh4/vVmsgE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uJFLOmaYhRl61ma2xtGohyNIzZzdluf5MGOWfuw8ODHYksf6tGBa6kU/7rAxMvdTr s2iTDP+ePyA4wHseLMVUENAJb9BqfiyVXbhCAzskbIURohemvpMgyl5561k7Q0zJoM h5a2JbgM5xWz18hYCbxY8CF2k8dSfKiWtnGTbiQ4= Date: Wed, 25 Mar 2020 12:59:19 -0700 From: Jaegeuk Kim To: John Message-ID: <20200325195919.GA200530@google.com> References: <20200323150205.GA119787@google.com> <8b47e963-9e12-c945-e40e-a9d54a412d52@huawei.com> <2292eb8d-8357-227f-5448-d1d03b33c042@huawei.com> <20200325152859.GA65658@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1jHCBT-00HAJ2-BN 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 Wed, Mar 25, 2020 at 2:41 PM John wrote: > > I can confirm that it is true with an encrypted ext4 partition. I get > > the same error, "fstrim: /mnt/test: the discard operation is not > > supported" when I try it there on the same device. Unless there is a > > good reason for it, not having discard on LUKS encrypted partitions > > seems like a pretty serious omission. Perhaps it is intentional. > > I see now from searching that this is by design, > https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives_(SSD) > > I added the "discard" option to the entry in /etc/crypttab and > rebooted. I am now able to get a successful run of fstrim on this F2FS > partition: > > # fstrim -v /mnt/media > /mnt/media: 0 B (0 bytes) trimmed > > Is it normal to return 0 bytes trimmed for F2FS partitions? By It's normal, and that's why I asked -o nodiscard. The reason is F2FS creates asynchronous discard thread to alleviate long discarding latency among RW IOs. It keeps candidates in memory, and the thread issues them in idle time. In that mode, when you do fstrim, F2FS collects all the discard candidates given address space, and returns zero, since it didn't issue any discard command at the moment. But, if you set -o nodiscard, you can see the actual trimmed size, since F2FS disabled the async discard thread and issue discard rightaway if device supports it. > contrast, if I go to my test SSD, create a LUKS partition, open it > with the --allow-discards option to cryptsetup, format it to ext4, > mount that and then run fstrim on it, I am getting non-0 values for > fstrim when I run it: > > # fstrim -v /mnt/test_crypt_ext4 > /mnt/test_crypt_ext4: 3.9 GiB (4123463680 bytes) trimmed > > So I think something still isn't quite right with F2FS over crypto_LUKS. > > Thanks for the help! _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel