diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-07-08 18:24:38 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-04 14:09:57 -0700 |
commit | 90d4388ac2cec0c83cad7315d3cd0065553430e1 (patch) | |
tree | d379deec3b4d39511f733e90d2705b394700beaf /fs/f2fs/data.c | |
parent | 7023a1ad17f4e21acb74167ab647cd123d9eb801 (diff) | |
download | op-kernel-dev-90d4388ac2cec0c83cad7315d3cd0065553430e1.zip op-kernel-dev-90d4388ac2cec0c83cad7315d3cd0065553430e1.tar.gz |
f2fs: fix to update page flag
This patch fixes to update page flag (e.g. Uptodate/cold flag) in
->write_begin.
Otherwise, page will be non-uptodate when we try to write entire
page, and cold data flag in page will not be clean when gced page
is being rewritten.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c9d0f8b..de55c08 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1790,8 +1790,10 @@ put_next: f2fs_put_dnode(&dn); f2fs_unlock_op(sbi); - if ((len == PAGE_CACHE_SIZE) || PageUptodate(page)) - return 0; + if (len == PAGE_CACHE_SIZE) + goto out_update; + if (PageUptodate(page)) + goto out_clear; f2fs_wait_on_page_writeback(page, DATA); @@ -1801,7 +1803,7 @@ put_next: /* Reading beyond i_size is simple: memset to zero */ zero_user_segments(page, 0, start, end, PAGE_CACHE_SIZE); - goto out; + goto out_update; } if (dn.data_blkaddr == NEW_ADDR) { @@ -1839,8 +1841,9 @@ put_next: } } } -out: +out_update: SetPageUptodate(page); +out_clear: clear_cold_data(page); return 0; |