Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3789065pxu; Mon, 30 Nov 2020 10:14:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmBTeuFMwHCSwwQS07SbN1oM4PgUjP+jZiY839crU5Hid9+al9QsU/5MRAkx+bQhrp0dQG X-Received: by 2002:a17:906:40c1:: with SMTP id a1mr7234988ejk.520.1606760094955; Mon, 30 Nov 2020 10:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606760094; cv=none; d=google.com; s=arc-20160816; b=uiwNutHc7SnbxuROdj/d83bpS3UMmdtn1w0mYLnOMPevxCbtcp60mK09EgSsjxC9Bf 1tESVrolSs0GjrZ422aRnpm+0B87msRGe71A/cm69kXDPPQfshw0k4iNXsGFKvEAiPc8 MJl6by2P0l6d2A/Zr8QhWhH7oTtVBT7zTVLzh5n38yH9s1gPV1nCVuy/MpKm/f2RvpEG aCvj9Svu/a5Xb2Kgw+kjwkL4ksACkPLs9BhCFCkqBO6YYmG0eyF2XEVL0snad6Udq13L 5eZszasRJjjiyTIUSSnotKo5ylS+gMjSGjq53SEtkuN0fEhMHiOPhcZr7dHJRz0GthXe fXrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7OtMU+UNidH4YhcAm3GVJIkABsCgtvT60Z/FlJlIpbU=; b=UUXGfKmacUwebAoixPAs4zA5A/KBdXy2ta/JvuS7RObPjQ7SwXCkNCOUJ9F/b+TIMK 5u128tzyIvN5SCt0LCEZ6FSmbtuCBvEeoU0Bt8cgjuuzXOzuxxPNZIJoLlMXHd1QKJEO aRNrxZ1g/Js7sd6r6stDeGAzAcBiyZOIS6gcWUEyorZBk8Yw/AalBtdlE3TQIevhORYx tZ9nIs3jgfEDzzVJoeFZIFg/oK7IJPV+AVSlO9tUfadfRTM/sn2zzEsiBjimcvyws+v7 HKBr+dblCG/4NUV//z7FKRM3lNlc6/kWmjWRoYbmocQqcLsFgnkQaHSSlKehWEpQ5Tp7 3Twg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KhG2M4cf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn5si12696311ejc.533.2020.11.30.10.14.31; Mon, 30 Nov 2020 10:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KhG2M4cf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729435AbgK3SMI (ORCPT + 99 others); Mon, 30 Nov 2020 13:12:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:56110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbgK3SMI (ORCPT ); Mon, 30 Nov 2020 13:12:08 -0500 Received: from sol.localdomain (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (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 2EC1E20789; Mon, 30 Nov 2020 18:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606759887; bh=7e7+SBM2J+NolPFM4F9UZ//nzhmt92jdOSBYye2Blxg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KhG2M4cfdNTD8JPugl1EYr7EV8BoXU3K+ZSBNZ0irt7OsAH4vPmbELGk04Pi75ZSs lRXADg3NNZnZ24u3CK7vHXASbHPT9iQm2fi99eyvAB8a64eSYBq6xRxFHkt0iFT2X6 qu59WKuEIuShOAkWomSA2oag6biAtaouIRFleD6E= Date: Mon, 30 Nov 2020 10:11:25 -0800 From: Eric Biggers To: Chao Yu Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH v2] f2fs: compress: add compress_inode to cache compressed blocks Message-ID: References: <20201126103709.80006-1-yuchao0@huawei.com> <7ecb947e-2f8c-abd7-c116-c82c474fded7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7ecb947e-2f8c-abd7-c116-c82c474fded7@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2020 at 09:01:47AM +0800, Chao Yu wrote: > On 2020/11/27 1:55, Eric Biggers wrote: > > On Thu, Nov 26, 2020 at 06:37:09PM +0800, Chao Yu wrote: > > > Support to use address space of inner inode to cache compressed block, > > > in order to improve cache hit ratio of random read. > > > > > > Signed-off-by: Chao Yu > > > > If the file is also encrypted, are the compressed pages that are cached still > > encrypted, or are they decrypted? > > In current implementation, they are decrypted in cache. > One of the things the FS_IOC_REMOVE_ENCRYPTION key ioctl is supposed to accomplish is evicting all the pagecache pages for all encrypted files that were using a particular key. This happens as a consequence of the ioctl evicting the inodes that were using that key. If the user is also using the init_on_free=1 kernel command-line option to enable automatic zeroing of all freed memory, that should cause those inode's pagecache pages (which contain decrypted data) to be zeroed, so that they can't be compromised later by an online attack. This new filesystem-wide cache containing decrypted pages might break that. It sounds like when an inode is evicted, its cached pages won't necessarily be evicted from this new filesystem-wide cache. Can you ensure that pages get evicted from this new cache when the inode to which they belong is evicted? - Eric