linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Chao Yu <chao@kernel.org>, Yunlong Song <yunlong.song@huawei.com>,
	<jaegeuk@kernel.org>, <yunlong.song@icloud.com>
Cc: <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: [PATCH] f2fs: avoid GC causing encrypted file corrupted
Date: Tue, 13 Nov 2018 11:16:24 +0800	[thread overview]
Message-ID: <5c3d6053-e03a-8c61-0a07-07d0090ba349@huawei.com> (raw)
In-Reply-To: <19e63fa7-1a48-c1de-eef5-cde242e8300d@kernel.org>

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 <yunlong.song@huawei.com>
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>

I've reviewed this patch, could you add missing tag in the patch located in
dev-test branch?

Thanks,

> 
> Thanks,
> 
> .
> 


  reply	other threads:[~2018-11-13  3:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 12:39 [PATCH] f2fs: avoid GC causing encrypted file corrupted Yunlong Song
2018-09-18 13:21 ` Chao Yu
2018-11-13  3:16   ` Chao Yu [this message]
2018-11-14 21:54     ` Jaegeuk Kim
2018-09-18 18:17 ` Jaegeuk Kim
2018-09-19  2:37   ` Yunlong Song
2018-09-21 14:20   ` Chao Yu
2018-10-24  8:07 ` Yunlong Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c3d6053-e03a-8c61-0a07-07d0090ba349@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=bintian.wang@huawei.com \
    --cc=chao@kernel.org \
    --cc=heyunlei@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=shengyong1@huawei.com \
    --cc=yunlong.song@huawei.com \
    --cc=yunlong.song@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).