[f2fs-dev] [PATCH] f2fs: add default mount options to remount

2015-05-07 Thread Yunlei He
default_options in super.c. It do some default setting, and both mount and remount operations will call this function to complete default setting. Signed-off-by: Yunlei He heyun...@huawei.com --- fs/f2fs/super.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff

[f2fs-dev] [PATCH] f2fs: add default mount options to remount

2015-05-07 Thread Yunlei He
default_options in super.c. It do some default setting, and both mount and remount operations will call this function to complete default setting. Signed-off-by: Yunlei He heyun...@huawei.com --- fs/f2fs/super.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff

[f2fs-dev] [PATCH] f2fs: initialize both two copies of NAT and SIT area

2015-07-22 Thread Yunlei He
In the process of formatting, we zero out only one copy of NAT and SIT area, but we use both of them when the filesystem is sucessfully mounted. So I change the code to initialize both of two copies in mkfs. Signed-off-by: Yunlei He heyun...@huawei.com --- mkfs/f2fs_format.c | 6 +++--- 1 file

[f2fs-dev] [PATCH] fsck.f2fs: add segment type in sit_dump

2015-07-15 Thread Yunlei He
like CURSEG_XXX_TYPE. Signed-off-by: Yunlei He heyun...@huawei.com --- fsck/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/dump.c b/fsck/dump.c index 8698b28..81a39c8 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -45,7 +45,7 @@ void sit_dump(struct f2fs_sb_info *sbi

[f2fs-dev] [PATCH] f2fs: upset segment_info repair

2015-08-31 Thread Yunlei He
4|0 0|166 5|39 4|101 0|111 Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index cfe3f95..f794781 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -693,7

[f2fs-dev] [PATCH] f2fs: add a judgment in add_discard_addrs

2015-09-08 Thread Yunlei He
CP_DISCARD traverse all segments in fstrim_range to add small discards, it is better to select entry->len bigger than trim_minlen. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segme

[f2fs-dev] [PATCH] back-up raw_super in sbi

2015-12-08 Thread Yunlei He
write_checkpoint() tries to get cp_blkaddr from superblock buffer, if the buffer happen to be destroied by something else, it may bring in unpredictable effect on f2fs. this patch fix it by back-up a raw_super copy. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.

[f2fs-dev] [PATCH] mkfs.f2fs: introduce zone align for main area

2016-01-07 Thread Yunlei He
This patch calculate main area begin from a new zone, avoid misalign if segments per zone is not 1. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Shuoran Liu <liushuo...@huawei.com> --- mkfs/f2fs_format.c | 20 ++-- 1 file changed, 10 insertions(+),

[f2fs-dev] [PATCH] f2fs: add a max block count for f2fs_map_blocks

2015-12-25 Thread Yunlei He
This patch adds a max block count for f2fs_map_blocks Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Xue Liu <liuxueliu@huawei.com> --- fs/f2fs/data.c | 4 fs/f2fs/f2fs.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c i

[f2fs-dev] [PATCH] f2fs: add a segment and section num check in sanity_check_raw_super

2015-12-25 Thread Yunlei He
This patch add a mismatch check between segment and section in sanity_check_raw_super. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/super.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index c3070c1..b51a690 100644 --- a/f

[f2fs-dev] [PATCH v2] f2fs: add a segment and section num check in sanity_check_raw_super

2015-12-28 Thread Yunlei He
This patch add a mismatch check between segment and section in sanity_check_raw_super. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/super.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index c3070c1..e88af5a 100644 --- a/f

[f2fs-dev] [PATCH v2] f2fs: add a max block check for get_data_block_bmap

2015-12-28 Thread Yunlei He
This patch adds a max block check for get_data_block_bmap. Trinity test program will send a block number as parameter into ioctl_fibmap, which will be used in get_node_path(), when the block number large than f2fs max blocks, it will trigger kernel bug. Signed-off-by: Yunlei He <he

[f2fs-dev] [PATCH] f2fs: init variable total_zombie_tree

2015-12-30 Thread Yunlei He
This patch init total_zombie_tree in init_extent_cache_info. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 23e7c82..b37184f 100644 --- a/fs/f2fs/extent_c

[f2fs-dev] [f2fs-linux 3.10][PATCH] f2fs: Fix a system panic caused by f2fs_follow_link

2015-11-27 Thread Yunlei He
In linux 3.10, we can not make sure the return value of nd_get_link function is valid. So this patch add a check before use it. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Shuoran Liu <liushuo...@huawei.com> --- fs/f2fs/namei.c | 7 ++- 1 file changed, 6 inse

[f2fs-dev] [PATCH] fsck.f2fs: modify sit dump && add nat dump

2016-06-04 Thread Yunlei He
ck:2 nid:57076 ino:57076 offset:0blkaddr: 2071232 pack:2 nid:57118 ino:57118 offset:0blkaddr: 2071233 pack:2 Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/dump.c | 122 ---

[f2fs-dev] [PATCH] fsck.f2fs: avoid fix ssa in some case

2016-01-28 Thread Yunlei He
In some case, we need confirm node or data blkaddr is ok at first, and then fix the conflict in ssa block. If the node blkaddr happen to locate in data type segment caused by something error, may be we 'd better ignore it, and it's same with data blkaddr. Signed-off-by: Yunlei He <he

[f2fs-dev] [PATCH] f2fs: fix missing skip pages info

2016-02-04 Thread Yunlei He
fix missing skip pages info in f2fs_writepages trace event. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 5 +++-- fs/f2fs/data.c | 5 +++-- fs/f2fs/node.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/checkpoint.

[f2fs-dev] [PATCH v2] fsck.f2fs: avoid fix ssa in some case

2016-01-29 Thread Yunlei He
In some case, we need confirm node or data blkaddr is ok at first, and then fix the conflict in ssa block. If the node blkaddr happen to locate in data type segment caused by something error, may be we 'd better ignore it, and it's same with data blkaddr. Signed-off-by: Yunlei He <he

[f2fs-dev] [PATCH v2] f2fs: delete unnecessary wait for page writeback

2016-02-02 Thread Yunlei He
no need to wait inline file page writeback for no one use it, so this patch delete unnecessary wait. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/inline.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index f

[f2fs-dev] [PATCH] f2fs: avoid hungtask problem caused by f2fs_balance_fs

2016-02-25 Thread Yunlei He
we should do GC or end up with checkpoint, if there are so many dirty dir/node pages without enough free segments. But should all theads wait for gc if the condition is not satisfied? Maybe if someone is gcing, they can by pass it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- f

[f2fs-dev] [PATCH] f2fs: delete unnecessary wait for page writeback

2016-02-02 Thread Yunlei He
no need to wait inline file page writeback for no one use it, so this patch delete unnecessary wait. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/inline.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index fc4d298..ec44640 100644 --

[f2fs-dev] [PATCH] f2fs: no need inc dirty pages under inode lock

2016-05-13 Thread Yunlei He
No need inc dirty pages under inode lock Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 6402e93..3da6499 100644 --- a/fs/f2fs/checkpoint.c +++ b/f

[f2fs-dev] [PATCH] fsck.f2fs: check sector size if formatted from a regular file

2016-05-18 Thread Yunlei He
This patch check sector size if formatted from a regular file, write the sector info to superblock from device info. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/mount.c | 36 1 file changed, 36 insertions(+) diff --git a/fsck/mount.c

[f2fs-dev] [PATCH] f2fs: not allow to write illegal blkaddr

2016-07-27 Thread Yunlei He
:1710] nid[0x171e] addr[0xbd4e25d0] ino[0x77c34c09] One nat block may be stepped by a data block, so this patch forbid to write if the blkaddr is illegal Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[f2fs-dev] [PATCH] f2fs: get victim segment again after new cp

2016-07-21 Thread Yunlei He
previous segment selected may become free after write_checkpoint, so here, we select victim again. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index de6c41c..704e2e1

[f2fs-dev] [PATCH] f2fs: avoid mismatching block range for discard

2016-07-06 Thread Yunlei He
This patch skip discard block range smaller than trim_minlen, and can not be merged by neighbour Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6d16ecf..9e13db0

[f2fs-dev] [PATCH v2] f2fs: get victim segment again after new cp

2016-07-22 Thread Yunlei He
type during reset_curseg. So, we check segment is stale or not, and select a new victim to avoid this. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index de6c41c..e

[f2fs-dev] [PATCH] f2fs: no need lock_op in f2fs_write_inline_data

2017-02-23 Thread Yunlei He
Similar as f2fs_write_inode, f2fs_write_inline_data just mark inode page dirty, so it's no need to write inline data under read lock of cp_rwsem. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/da

[f2fs-dev] [PATCH] f2fs: replace rw semaphore extent_tree_lock with mutex lock

2017-02-23 Thread Yunlei He
This patch replace rw semaphore extent_tree_lock with mutex lock for no read cases with this lock. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 22 +++--- fs/f2fs/f2fs.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff

[f2fs-dev] [PATCH 2/2] f2fs: remove unnecessary wait in write_begin

2017-02-17 Thread Yunlei He
It has already waited page stable in grab_cache_page_write_begin, so we remove this unnecessary wait. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/data.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 8c61fa7..1201949 100644 --- a/f

[f2fs-dev] [PATCH 1/2] f2fs: replace __get_victim by dirty_segments in FG_GC

2017-02-17 Thread Yunlei He
: victim 26425 : valid blocks # 3 143.181872: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 244 Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 6 ++

[f2fs-dev] [PATCH] f2fs: remove redundant set_page_dirty()

2017-02-27 Thread Yunlei He
This patch remove redundant set_page_dirty in truncate_blocks Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 36c1565..c6ca00c 100644 --- a/fs/f2fs/file.c +++ b/f

[f2fs-dev] [PATCH] f2fs: fix an error return value in truncate_partial_data_page

2017-02-28 Thread Yunlei He
This patch fix a error return value in truncate_partial_data_page Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c6ca00c..c186d75 100644 --- a/fs/f2fs/file.c +++ b/f

[f2fs-dev] [PATCH v2] f2fs: add a punch discard command function

2017-03-01 Thread Yunlei He
This patch add a function to punch discard command if one segment reuse before discard. Split this segment from multi-segments discard range, and discard the left bigger range. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 18 +- 1 file chang

[f2fs-dev] [PATCH] f2fs: add a modify discard command function

2017-02-26 Thread Yunlei He
This patch add a function to modify discard command if one segment reuse before discard. Split this segment from multi-segments discard range, and discard the left bigger range. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 18 +- 1 file chang

[f2fs-dev] [PATCH] f2fs: walk around a panic caused by nrpages is not zero in clear_inode

2016-09-05 Thread Yunlei He
-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/file.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 37c24be..7d1c3f3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -561,6 +561,12 @@ static int truncate_partial_data_page(struct inode

[f2fs-dev] [PATCH] f2fs: remove redundant value definition

2016-09-23 Thread Yunlei He
This patch remove redundant value definition in build_sit_entries Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e78501c..fbcc172 100644 --- a/f

[f2fs-dev] [PATCH] f2fs: No need to wait for data page writeback by force

2016-09-21 Thread Yunlei He
No need to wait for data page writeback, wait or not can be decided by device. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e78501c..71e4a0f 100644 --

[f2fs-dev] [RFC PATCH v2] f2fs: preallocate blocks for encrypted file

2016-09-17 Thread Yunlei He
This patch allow preallocates data blocks for buffered aio writes in encrypted file. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/data.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 3e0ef2d..932166e 100644 --

[f2fs-dev] [PATCH] f2fs: continue to do fg_gc even if beyond max_victim_search

2016-09-21 Thread Yunlei He
For forground gc, if can't find a victim in one max_victim_search, try it again. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 24acbbb..19e51a5

[f2fs-dev] [PATCH] f2fs: skip new checkpoint when doing fstrim without fs change

2016-08-18 Thread Yunlei He
This patch enables to do fstrim without checkpoint, if there is no fs change. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 11 +++ fs/f2fs/debug.c | 10 -- fs/f2fs/f2fs.h | 7 ++- 3 files changed, 25 insertions(+), 3 deletions(-)

[f2fs-dev] [PATCH 1/2] f2fs: add discard info to sys entry of f2fs status

2016-08-18 Thread Yunlei He
This patch add discard block count to sys entry of f2fs status Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/debug.c | 10 -- fs/f2fs/f2fs.h | 7 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index b

[f2fs-dev] [PATCH 2/2] f2fs: skip new checkpoint when doing fstrim without fs change

2016-08-18 Thread Yunlei He
This patch enables to do fstrim without checkpoint, if there is no fs change. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index be1c54b..1207b91

[f2fs-dev] [PATCH v4] f2fs:return directly if block has been removed from the victim

2016-11-07 Thread Yunlei He
If one block has been to written to a new place, just return in move data process. This patch check it again with holding page lock. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/f2f

[f2fs-dev] [PATCH] resize.f2fs: modify condition for resize

2016-11-07 Thread Yunlei He
it better to decide resize or not by sector num. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/main.c | 4 ++-- fsck/resize.c | 5 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index 7e8fdf3..64537cc 100644 --- a/fsck/main.c +++

[f2fs-dev] [PATCH] resize.f2fs: fix an error in migrate_ssa

2016-11-23 Thread Yunlei He
This patch fix an error in migrate_ssa when resize with condition that offset is not zero && new_sum_blkaddr > old_sum_blkaddr + offset Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/resize.c | 37 +++-- 1 file changed, 27 insertions

[f2fs-dev] [PATCH] f2fs: fix an infinite loop when flush nodes in cp

2016-11-16 Thread Yunlei He
to finish, so it seems a deadlock between cp and fsync path. This patch add a wait on page write back before set node page dirty to avoid this problem. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Pengyang Hou <houpengy...@huawei.com> --- fs/f2fs/node.c | 1 + 1 fil

[f2fs-dev] [PATCH 1/2] fsck.f2fs add a simple check orphan inodes in -p 1 mode

2016-11-19 Thread Yunlei He
This patch add a simple check orphan inodes in -p 1 mode Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/fsck.c | 21 +++-- fsck/fsck.h | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 0009ea4..fd28d94

[f2fs-dev] [PATCH 2/2] dump.f2fs: fix an error in dump nat pack num

2016-11-19 Thread Yunlei He
This patch fix an error in dump nat pack num Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 8e7c85c..5d0d3d9 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -34,7 +34,7 @

[f2fs-dev] [PATCH v2] f2fs:return directly if block has been removed from the victim

2016-11-02 Thread Yunlei He
If one block has been to written to a new place, just return in move data process. This patch check it again with holding page lock. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/f2f

[f2fs-dev] [PATCH v3] f2fs:return directly if block has been removed from the victim

2016-11-02 Thread Yunlei He
If one block has been to written to a new place, just return in move data process. This patch check it again with holding page lock. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fs/f2f

[f2fs-dev] [PATCH 2/2] fsck.f2fs: Add a judgment after calloc

2016-11-04 Thread Yunlei He
This patch add a judgment after calloc avoid memory alloc failure Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/mount.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index f2055e4..e4adb0e 100644 --- a/fsck/m

[f2fs-dev] [PATCH 1/2] fsck.f2fs: No need to write a new cp if nothing to flush

2016-11-04 Thread Yunlei He
This patch avoid to write a new cp if no journal info Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/mount.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index dd7a081..f2055e4 100644 --- a/fsck/mount.c +++

[f2fs-dev] [PATCH] f2fs: fix a missing size change in f2fs_setattr

2016-12-10 Thread Yunlei He
This patch fix a missing size change in f2fs_setattr Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/file.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 4c87261..383b5c2 100644 --- a/fs/f2fs/file.c +++ b/f

[f2fs-dev] [PATCH 2/2] f2fs: add a case of no need to read a page in write begin

2016-12-16 Thread Yunlei He
If the range we write cover the whole valid data in the last page, we do not need to read it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/data.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b90fb01..d9f7339 100644 --- a/f

[f2fs-dev] [PATCH 1/2] f2fs: fix a missing discard prefree segments

2016-12-16 Thread Yunlei He
If userspace issue a fstrim with a range not involve prefree segments, it will reuse these segments without discard. This patch fix it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/f

[f2fs-dev] [PATCH] f2fs: remove unused values in recover_fsync_data

2016-12-13 Thread Yunlei He
This patch remove unused values in function recover_fsync_data Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/recovery.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 981a958..4fb4471 100644 --- a/fs/f2fs/recovery.c +++ b/f

[f2fs-dev] [PATCH 1/2 v2] f2fs: fix a missing discard prefree segments

2016-12-19 Thread Yunlei He
If userspace issue a fstrim with a range not involve prefree segments, it will reuse these segments without discard. This patch fix it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/seg

[f2fs-dev] [PATCH v3] f2fs: fix a missing discard prefree segments

2016-12-21 Thread Yunlei He
If userspace issue a fstrim with a range not involve prefree segments, it will reuse these segments without discard. This patch fix it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/f

[f2fs-dev] [PATCH] f2fs: skip read if page has been uptodate

2016-12-26 Thread Yunlei He
This patch add a judgement before read, if the page has been uptodate, move the block directly. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 88bfc3d..40776b4 100644 --- a/fs/f2f

[f2fs-dev] [PATCH v4] f2fs: fix a missing discard prefree segments

2016-12-21 Thread Yunlei He
If userspace issue a fstrim with a range not involve prefree segments, it will reuse these segments without discard. This patch fix it. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/f

[f2fs-dev] [PATCH] f2fs: fix a problem of using memory after free

2016-12-19 Thread Yunlei He
This patch fix a problem of using memory after free in the function __try_merge_extent_node. Fixes: a03f01f2673 ("f2fs: reconstruct the code to free an extent_node") Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 5 +++-- 1 file changed, 3 insertions

[f2fs-dev] [PATCH v2] f2fs: fix a problem of using memory after free

2016-12-19 Thread Yunlei He
This patch fix a problem of using memory after free in function __try_merge_extent_node. Fixes: 0f825ee6e873 ("f2fs: add new interfaces for extent tree") Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 de

[f2fs-dev] [PATCH] f2fs: fix a infinite loop in gc_node_segment

2017-03-31 Thread Yunlei He
Similar as this problem: f2fs: relax node version check for victim data in gc But this patch fix wrong SSA nid. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c

[f2fs-dev] [PATCH] f2fs: fix a problem of a truncated inmem page

2017-03-15 Thread Yunlei He
-start atomic write -set_page_dirty -register_inmem_page <--- truncate or punch hole -commit atomic write Here, may cause memory reclaim painc for page->mapping is null, but private is -1. Signed-off-by: Yunlei He <heyun...@huawei.com

[f2fs-dev] [PATCH] f2fs: fix a last_victim overflow problem

2017-03-21 Thread Yunlei He
This patch fix a last_victim overflow problem Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 418fd98..3b5e799a 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -361,6 +361,8 @@ stat

[f2fs-dev] [PATCH 2/2] f2fs: use set_page_private marcro in f2fs_trace_pid

2017-03-21 Thread Yunlei He
Use set_page_private marcro instead of operte page struct directly Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/trace.c b/fs/f2fs/trace.c index c82ab40..bccbbf2 100644 --- a/fs/f2fs/trace.c ++

[f2fs-dev] [PATCH 1/2] f2fs: add a bug_on in is_alive

2017-03-21 Thread Yunlei He
This patch add a bug_on in is_alive in case of infinite loop. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 418fd98..c01168c 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -550,6

[f2fs-dev] [PATCH] f2fs: update max_orphans inode number

2017-04-05 Thread Yunlei He
This patch update max_orphans inode number, remove nat bits blocks Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 9aba0bb..64dd429 100644 --

[f2fs-dev] [PATCH] f2fs: add a rb tree for discard command

2017-04-06 Thread Yunlei He
This patch add a rb tree for discard command. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/f2fs.h| 2 ++ fs/f2fs/segment.c | 35 ++- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 5

[f2fs-dev] [PATCH] f2fs: seperate read nat page from nat_tree_lock

2017-04-22 Thread Yunlei He
her threads modify this nid concurrently. So we just obtain current_nat_addr under nat_tree_lock, node info is always same in both nat pack. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/node.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/f2fs

[f2fs-dev] [dev-test][PATCH 1/2] f2fs: add a missing truncate_inode_pages_final

2017-03-10 Thread Yunlei He
This patch add a missing truncate_inode_pages_final Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index cfb40d3..7ad2606 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@

[f2fs-dev] [PATCH 2/2] f2fs: avoid move encrypted block in BG_GC if it has been in memory

2017-03-10 Thread Yunlei He
If an encrypted block has been read to memory, we just dirty it and return directly. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 418fd98..ca94518 100644 --

[f2fs-dev] [PATCH v2] f2fs: allow write page cache when writting cp

2017-03-13 Thread Yunlei He
This patch allow write data to normal file when writting new checkpoint. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 26 +- fs/f2fs/data.c | 23 --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 1 + 4

[f2fs-dev] [PATCH] resize.f2fs: fix a resize fail for sector size mismatch

2017-03-08 Thread Yunlei He
This patch fix a resize faill for sector size mismatch. The initial fs comes from an image file, with sector size 512KB, and the block device sector size is equal to block size. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 del

[f2fs-dev] [PATCH RFC] f2fs: allow write page cache when writting cp

2017-03-07 Thread Yunlei He
This patch allow write data to normal file when writting new checkpoint. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 4 +++- fs/f2fs/data.c | 23 --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 1 + 4 files changed, 21 inse

[f2fs-dev] [PATCH] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Yunlei He
Skip writeback meta pages if cp_mutex lock acquire failed, cp will flush dirty pages instead. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH v2] f2fs: skip writeback meta pages if cp_mutex acquire failed

2017-03-01 Thread Yunlei He
Skip writeback meta pages if cp_mutex lock acquire failed, cp will flush dirty pages instead. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH] f2fs: allow write page cache when writting cp

2017-03-07 Thread Yunlei He
This patch allow write data to normal file when writting new checkpoint. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/checkpoint.c | 4 +++- fs/f2fs/data.c | 23 --- fs/f2fs/f2fs.h | 1 + fs/f2fs/super.c | 1 + 4 files changed, 21 inse

[f2fs-dev] [PATCH 1/2] f2fs: remove unused input parameter

2017-07-17 Thread Yunlei He
This patch remove unused input parameter in function new_node_page. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed-off-by: Yong Sheng <shengyo...@huawei.com> --- fs/f2fs/f2fs.h | 3 +-- fs/f2fs/node.c | 7 +++ fs/f2fs/xattr.c | 2 +- 3 files changed, 5 insertions(+),

[f2fs-dev] [PATCH 2/2] f2fs: alloc new nids for xattr block in recovery

2017-07-17 Thread Yunlei He
); --->bug_on for nid has been used by file A In recovery process, new allocated node blocks may "reuse" xattr block nids, this patch alloc new nids for xattr blocks in recovery process to avoid this problem. Signed-off-by: Yunlei He <heyun...@huawei.com> Signed

[f2fs-dev] [PATCH v2] f2fs: alloc new nids for xattr block in recovery

2017-07-17 Thread Yunlei He
); --->bug_on for nid has been used by file A In recovery process, new allocated node blocks may "reuse" xattr block nids, this patch alloc new nids for xattr blocks in recovery process to avoid this problem. Signed-off-by: Yunlei He <heyun...@huawei.com> ---

[f2fs-dev] [PATCH] f2fs: fix a mount fail for wrong next_scan_nid

2017-04-26 Thread Yunlei He
-write_checkpoint -do_checkpoint -next_free_nid<--- something wrong with next free nid -f2fs_fill_super -build_node_manager -build_free_nids -get_current_nat_page -__get_meta_page <--- attempt to access beyond end of device Signed-off-by: Yun

[f2fs-dev] [PATCH] fsck.f2fs: write back last cp block in the end

2017-08-22 Thread Yunlei He
Write back last cp block in the end in case of sudden power off during fsck process Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/mount.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index a0b0bea..700a4ff 100644 ---

[f2fs-dev] [PATCH] f2fs: combine huge num of discard rb tree consistence checks

2017-05-15 Thread Yunlei He
Came across a hungtask caused by huge number of rb tree traversing during adding discard addrs in cp. This patch combine these consistence checks and move it to discard thread. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 8 ++-- 1 file changed, 2 insertions

[f2fs-dev] [PATCH] f2fs: fix a bug caused by NULL extent tree

2017-05-17 Thread Yunlei He
-- -f2fs_map_blocks -f2fs_lookup_extent_tree -f2fs_bug_on(sbi, !et); The same problem with f2fs_new_inode. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 3 +++ 1 file chan

[f2fs-dev] [PATCH] f2fs: add a new function get_ssr_cost

2017-05-17 Thread Yunlei He
This patch add a new method get_ssr_cost to select SSR segment more accurately. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/gc.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 14c71ac..8139297 100644 --- a/f

[f2fs-dev] [PATCH] f2fs: fix a panic caused by NULL flush_cmd_control

2017-06-01 Thread Yunlei He
rn ret; } Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/segment.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a8f4c81..029b5ea 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -566,6 +

[f2fs-dev] [PATCH v2] f2fs: fix a bug caused by NULL extent tree

2017-05-19 Thread Yunlei He
-- -f2fs_map_blocks -f2fs_lookup_extent_tree -f2fs_bug_on(sbi, !et); The same problem with f2fs_new_inode. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/extent_cache.c | 12 ++

[f2fs-dev] [PATCH] fsck: introduce generic function f2fs_fsync_device

2017-10-17 Thread Yunlei He
We use f2fs_finalize_device to fsync previous data in checkpoint area before write last CP pack, in order to avoid cp corruption in sudden-power-off case. But this function will close the device, so this patch introduce a function to call fsync() only. Signed-off-by: Yunlei He <he

[f2fs-dev] [PATCH v2] f2fs: avoid race in between read xattr & write xattr

2017-09-05 Thread Yunlei He
int ... ... -alloc_nid <- nid reuse -get_node_page -f2fs_bug_on <- nid != node_footer->nid It's need a rw_sem to avoid the race Signed-off-by: Yunlei He <heyun...@huawei.co

[f2fs-dev] [PATCH v3] f2fs: avoid race in between read xattr & write xattr

2017-09-06 Thread Yunlei He
int ... ... -alloc_nid <- nid reuse -get_node_page -f2fs_bug_on <- nid != node_footer->nid It's need a rw_sem to avoid the race Signed-off-by: Yunlei He <heyun...@huawei.co

[f2fs-dev] [PATCH] dump.f2fs: check block is valid or not before dump block info

2017-08-22 Thread Yunlei He
This patch add a block validate check in dump.f2fs Signed-off-by: Yunlei He <heyun...@huawei.com> --- fsck/dump.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 22e2265..a33969c 100644 --- a/fsck/dump.c +++ b/fsck/

[f2fs-dev] [PATCH] f2fs: fix a infinite loop in writting checkpoint

2017-08-25 Thread Yunlei He
age -read_node_page < here return -ENOENT This patch walk around this cause. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 2654c91..ec7a0e0 100644 -

[f2fs-dev] [PATCH] f2fs: avoid race in between read xattr & write xattr

2017-09-05 Thread Yunlei He
int ... ... -alloc_nid <- nid reuse -get_node_page -f2fs_bug_on <- nid != node_footer->nid It's need a rw_sem to avoid the race Signed-off-by: Yunlei He <heyun...@huawei.co

[f2fs-dev] [PATCH] f2fs: modify for accurate fggc node io stat

2017-10-24 Thread Yunlei He
modify for accurate fggc node io stat Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index f44d837..daa9086 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1259,7 +

[f2fs-dev] [PATCH RFC] f2fs: fix an error case of missing update inode page

2017-12-04 Thread Yunlei He
update will lost. wb_writeback is same with fsync. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/f2fs.h | 4 ++-- fs/f2fs/inode.c | 15 +++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 82f1dc3..38f9324 100644 --

[f2fs-dev] [PATCH v4] f2fs: avoid dead loop in function find_fsync_dnodes

2017-12-15 Thread Yunlei He
=13597698 .. Mount process will block in dead loop and fsck can do nothing with this error, This patch abandon recovery if node chain is cyclical. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/recovery.c | 27 +++ 1 file changed, 19 insertions

[f2fs-dev] [PATCH] f2fs: uses the same naming scheme for struct nat_entry and f2fs_nat_entry

2017-12-13 Thread Yunlei He
Uses the same naming scheme for struct nat_entry and f2fs_nat_entry as in function __flush_nat_entry_set. No functional change. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/node.c | 128 - 1 file changed, 64 insertions(

[f2fs-dev] [PATCH v3] f2fs: avoid dead loop in function find_fsync_dnodes

2017-12-13 Thread Yunlei He
=13597698 .. Mount process will block in dead loop and fsck can do nothing with this error, This patch abandon recovery if node chain is cyclical. Signed-off-by: Yunlei He <heyun...@huawei.com> --- fs/f2fs/data.c | 5 + fs/f2fs/recovery.c | 23 +++ 2 files c

  1   2   3   >