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=-8.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 AF415C43603 for ; Mon, 9 Dec 2019 22:53: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 7C3A5206D5; Mon, 9 Dec 2019 22:53: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="kLWVu68H"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="VIKY9A6c"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GxPLLO5L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C3A5206D5 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-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1ieRuN-0001QT-0Z; Mon, 09 Dec 2019 22:53:39 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ieRuL-0001QE-Gk for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Dec 2019 22:53: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=ouMnqEeAQP3pgaHkiGan9srP4OuSmXIhNdTOeOXdoD0=; b=kLWVu68HTKQCaXkslR9+FwjshR osbxGHih65L1PKaxgfkzPWzYeVCxVx+spqFNhM4YWOvsGSwLZBtNngSzRYHHIEyNZwrimioxF1fKY /+BdnZ4Q6sJWPmmg+qma2dE88tX9VtXT/ZefHQkIj6hxJf/as7STsKH5m+HlctYb6E3Q=; 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=ouMnqEeAQP3pgaHkiGan9srP4OuSmXIhNdTOeOXdoD0=; b=VIKY9A6cSd1Tx2BqYDt/OLzlW9 LPN1CqQQwZCecKAZVzr52/e8zBjCEhiiKtiOEMY1x/kdE9nUV0XNA5NgwbKj+gIzGwJUgqCRMmar9 4cU7UMqEHOXvdD9Hsm2lvXy/HO/DDvplWGkbtBxF+qGAEJmW6xthzqnYAYwja5Mqzsg8=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1ieRuK-00FkUC-Bp for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Dec 2019 22:53:37 +0000 Received: from gmail.com (unknown [104.132.1.77]) (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 A8626206D5; Mon, 9 Dec 2019 22:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575932010; bh=iVY/LHU59YNkIrKmss+YACySzYJGFP4oy3lehsHNIP0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GxPLLO5LmxtmITVr9gbcIJoUvdBWWtsew49E8i8Z792pfMBZGV4slPXw838nG7zEa tnN31FChr8VKWCVMxRAixj8/YlAnmTY4D04vcXwXvxkHxrylMsgmTdNqiNaOmM81PL zjevy++uZE0YNgQ6Elwtbzpkd8e6m15oeygm7ND4= Date: Mon, 9 Dec 2019 14:53:29 -0800 From: Eric Biggers To: Jaegeuk Kim Message-ID: <20191209225328.GG149190@gmail.com> References: <20191209200055.204040-1-ebiggers@kernel.org> <20191209222828.GA798@jaegeuk-macbookpro.roam.corp.google.com> <20191209224051.GF149190@gmail.com> <20191209224857.GC798@jaegeuk-macbookpro.roam.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191209224857.GC798@jaegeuk-macbookpro.roam.corp.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Headers-End: 1ieRuK-00FkUC-Bp Subject: Re: [f2fs-dev] [PATCH] f2fs: don't keep META_MAPPING pages used for moving verity file blocks 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-fscrypt@vger.kernel.org, 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 Mon, Dec 09, 2019 at 02:48:57PM -0800, Jaegeuk Kim wrote: > On 12/09, Eric Biggers wrote: > > On Mon, Dec 09, 2019 at 02:28:28PM -0800, Jaegeuk Kim wrote: > > > On 12/09, Eric Biggers wrote: > > > > From: Eric Biggers > > > > > > > > META_MAPPING is used to move blocks for both encrypted and verity files. > > > > So the META_MAPPING invalidation condition in do_checkpoint() should > > > > consider verity too, not just encrypt. > > > > > > > > Signed-off-by: Eric Biggers > > > > --- > > > > fs/f2fs/checkpoint.c | 6 +++--- > > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c > > > > index ffdaba0c55d29..44e84ac5c9411 100644 > > > > --- a/fs/f2fs/checkpoint.c > > > > +++ b/fs/f2fs/checkpoint.c > > > > @@ -1509,10 +1509,10 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc) > > > > f2fs_wait_on_all_pages_writeback(sbi); > > > > > > > > /* > > > > - * invalidate intermediate page cache borrowed from meta inode > > > > - * which are used for migration of encrypted inode's blocks. > > > > + * invalidate intermediate page cache borrowed from meta inode which are > > > > + * used for migration of encrypted or verity inode's blocks. > > > > */ > > > > - if (f2fs_sb_has_encrypt(sbi)) > > > > + if (f2fs_sb_has_encrypt(sbi) || f2fs_sb_has_verity(sbi)) > > > > > > Do we need f2fs_post_read_required() aligned to the condition of > > > move_data_block()? > > > > > > > I think you're asking why verity files have to be moved via META_MAPPING? The > > reason is that we have to be super careful not to read pages of a verity file > > into its own address_space without doing the fs-verity data verification, as > > then unverified data would be available to userspace. > > > > In theory, F2FS's garbage collector could do the data verification. But it's > > tricky because ->i_verity_info may not have been set up yet. So it might be > > easiest to continue to treat verity files like encrypted files. > > I meant to ask why not just checking f2fs_post_read_required() here so that we > could sync the check across multiple places. > We can't use f2fs_post_read_required() here because f2fs_post_read_required() deals with a specific inode, but do_checkpoint() is dealing with the entire filesystem. It's checking whether the filesystem might have *any* files that were moved via META_MAPPING. - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel