Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7264236imu; Wed, 14 Nov 2018 14:29:28 -0800 (PST) X-Google-Smtp-Source: AJdET5dKx1EwlnR/PlLlDRAbwO9aRONPdOCcf/1EH8/Yd9/XGk71YcmFJn1GPXMXCk4UdKdtqzNq X-Received: by 2002:a63:c141:: with SMTP id p1mr3450939pgi.424.1542234568575; Wed, 14 Nov 2018 14:29:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542234568; cv=none; d=google.com; s=arc-20160816; b=WH6mGyk6IDW0/LlJdkMQh3cYUoSpko9kb9EfIyhFjq5LkNX0/UdDqw3suvm9bvogD9 mVbGsEEKaPfO7zRcaw91hwz+6wWoqip5WbdD3eWxEzZC9cxOIN7TheBxnVVNJJktBRlY Rv5NuZ/YPSsmAponjPEbMKsPEMSZsnbu3CDBRTt7YRdLz3JpouCJ3YC1SgLwdJtpnnH7 eJ4qVt8svnJ84nOE3povqte784y/oYftD/AzmH4lg8XjiKHGPgWBqIEtiXbLCojTzqcs ptgRujzW+LBFPsXVWO5uyTUEwg9jlJY50jYRCrHL6GQtm9TKiDPdTpgylscAsvaz+1oy 5dWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QpXObWF6FSL9pvtUBanfUXg57dlWMMtYOuqzgmmH4YU=; b=WnhHjX3MzxSm0h1N+upKU3TmlE7GOLZ+HPWTLva41yBLTPF61gq8lSQ0vwcd4jPJ2+ GIGZU7Su/T61M7XLDfdH63QD2uxpq4JRUh9lq3SfFbcTv1ufW/3u57QNEUrt+Wsy6MU0 RSV0fY3csZqPvGtvyywMaxGMEJyxWCFIde94zUKjf7VxAZHaiWBq7fWLQP9G7FnzfaUi TExyW/eL94sSNww+jdHT8p6KBMX4Q1Xf9mQN/VzD4bsQSSrbRu6pvAWSRKRrB441iaK1 d4iY7MI9aVA/7XAivYXfYEDs1tmyIfrpvnMse3o5V0nCqRZqdN+Itorl/KQMHPaXV/Gs XBmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uTdIQtZN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 71-v6si26483656plc.230.2018.11.14.14.29.14; Wed, 14 Nov 2018 14:29:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uTdIQtZN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2388969AbeKOIcj (ORCPT + 99 others); Thu, 15 Nov 2018 03:32:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:39382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388219AbeKOIci (ORCPT ); Thu, 15 Nov 2018 03:32:38 -0500 Received: from localhost (unknown [64.114.255.97]) (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 37B3222419; Wed, 14 Nov 2018 21:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542232480; bh=ku/m8oJ/yMjnlDfVTMOykKrf4v5YJCtFLWLT0/11K2w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uTdIQtZNXYWr9pzGTAlw0oUye0lBiJKPjtvtlsd5Jx+Ti4Q+3gjFVP1ro48HxbpMg pbrp5IUX0WT5sY08acZHNIEROzjsLQDGRB9qVh1S26q/jq4BQQvGWxZdJj2CChHcoW XG2T+Ut1j7aUTtzkr/eFPAQ9CrEQ8WpiwWWwWAzU= Date: Wed, 14 Nov 2018 13:54:39 -0800 From: Jaegeuk Kim To: Chao Yu Cc: Chao Yu , Yunlong Song , yunlong.song@icloud.com, miaoxie@huawei.com, bintian.wang@huawei.com, shengyong1@huawei.com, heyunlei@huawei.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: avoid GC causing encrypted file corrupted Message-ID: <20181114215439.GA45824@jaegeuk-macbookpro.roam.corp.google.com> References: <1537274393-78441-1-git-send-email-yunlong.song@huawei.com> <19e63fa7-1a48-c1de-eef5-cde242e8300d@kernel.org> <5c3d6053-e03a-8c61-0a07-07d0090ba349@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c3d6053-e03a-8c61-0a07-07d0090ba349@huawei.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13, Chao Yu wrote: > Jaegeuk, > > On 2018/9/18 21:21, Chao Yu wrote: > > On 2018/9/18 20:39, Yunlong Song wrote: > >> The encrypted file may be corrupted by GC in following case: > >> > >> Time 1: | segment 1 blkaddr = A | GC -> | segment 2 blkaddr = B | > >> Encrypted block 1 is moved from blkaddr A of segment 1 to blkaddr B of > >> segment 2, > >> > >> Time 2: | segment 1 blkaddr = B | GC -> | segment 3 blkaddr = C | > >> > >> Before page 1 is written back and if segment 2 become a victim, then > >> page 1 is moved from blkaddr B of segment 2 to blkaddr Cof segment 3, > >> during the GC process of Time 2, f2fs should wait for page 1 written back > >> before reading it, or move_data_block will read a garbage block from > >> blkaddr B since page is not written back to blkaddr B yet. > >> > >> Commit 6aa58d8a ("f2fs: readahead encrypted block during GC") introduce > >> ra_data_block to read encrypted block, but it forgets to add > >> f2fs_wait_on_page_writeback to avoid racing between GC and flush. > >> > >> Signed-off-by: Yunlong Song > > > > Reviewed-by: Chao Yu > > I've reviewed this patch, could you add missing tag in the patch located in > dev-test branch? Sorry, done. > > Thanks, > > > > > Thanks, > > > > . > >