[f2fs-dev] [PATCH] f2fs: remove clear SB_INLINECRYPT flag in default_options

2024-03-26 Thread Yunlei He via Linux-f2fs-devel
-f2fs_file_open or f2fs_new_inode -default_options <- clear SB_INLINECRYPT flag -fscrypt_select_encryption_impl -parse_options <- set SB_INLINECRYPT again Signed-off-by: Yunlei He --- fs/f2fs/super.c | 2 --

[f2fs-dev] [PATCH 2/2 v2] f2fs: truncate pages if move file range success

2023-06-25 Thread Yunlei He via Linux-f2fs-devel
If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He --- v2: -truncate pages with filemap invalidate lock -should drop extent cache fs/f2fs/file.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/f2fs/file.c b/fs

[f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-25 Thread Yunlei He via Linux-f2fs-devel
Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode fs/f2fs/file.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

Re: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-22 Thread Yunlei he
On 2023/6/21 21:39, Chao Yu wrote: On 2023/6/21 17:43, Yunlei He wrote: Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode   fs/f2fs/file.c | 14 ++   1 file changed

[f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-22 Thread Yunlei He via Linux-f2fs-devel
Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode fs/f2fs/file.c | 13 + 1 file changed, 13 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success

2023-06-22 Thread Yunlei He via Linux-f2fs-devel
If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e59fc8faa035..4bece7c56656 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c

[f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method

2023-06-21 Thread Yunlei He via Linux-f2fs-devel
Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode fs/f2fs/file.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index

[f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success

2023-06-21 Thread Yunlei He via Linux-f2fs-devel
If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 4adcf62e2665..25ef36f2376a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c

Re: [f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot

2023-06-19 Thread Yunlei he
On 2023/6/20 8:33, Chao Yu wrote: On 2023/6/13 16:52, Yunlei He wrote: File set both cold and hot advise bit is confusion, so return EINVAL to avoid this case. Signed-off-by: Yunlei He ---   fs/f2fs/xattr.c | 3 +++   1 file changed, 3 insertions(+) diff --git a/fs/f2fs/xattr.c b/fs/f2fs

[f2fs-dev] [PATCH v2] f2fs: count mmap write io more accurately

2023-06-19 Thread Yunlei He via Linux-f2fs-devel
This patch count mmap write io more accurately. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f05209a62370..cb42d8464ad9 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -150,11

[f2fs-dev] [PATCH] f2fs: remove unneeded page uptodate check/set

2023-06-19 Thread Yunlei He via Linux-f2fs-devel
This patch remove unneeded page uptodate check/set in f2fs_vm_page_mkwrite, which already done in set_page_dirty. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 147ab24ae579..b3e96bceaef2 100644 --- a/fs

[f2fs-dev] [PATCH] f2fs: count mmap write io more accurately

2023-06-19 Thread Yunlei He via Linux-f2fs-devel
This patch count mmap write io more accurately. Signed-off-by: Yunlei He --- 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 41e7c2b80f31..147ab24ae579 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -152,11 +152,11

[f2fs-dev] [PATCH] f2fs: update mtime and ctime in move file range method

2023-06-19 Thread Yunlei He via Linux-f2fs-devel
Mtime and ctime stay old value without update after move file range ioctl, This patch add time update. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 34a6177c64a4..81e4b85fe805 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH] f2fs: not allowed to set file both cold and hot

2023-06-13 Thread Yunlei He via Linux-f2fs-devel
File set both cold and hot advise bit is confusion, so return EINVAL to avoid this case. Signed-off-by: Yunlei He --- fs/f2fs/xattr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 213805d3592c..917f3ac9f1a1 100644 --- a/fs/f2fs/xattr.c +++ b/fs

[f2fs-dev] [PATCH] f2fs: count mmap write io more accurately

2023-06-12 Thread Yunlei He via Linux-f2fs-devel
This patch count mmap write io more accurately and remove redundant PageUptodate judgement in f2fs_vm_page_mkwrite. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 4dd4e2bd000a..34a6177c64a4

[f2fs-dev] [PATCH] f2fs: fsverity: modify truncation for verity enable failed

2021-03-02 Thread Yunlei He
If file enable verity failed, should truncate anything wrote past i_size, including cache pages. Move the truncation to the end of function, in case of f2fs set xattr failed. Fixes: 95ae251fe828 ("f2fs: add fs-verity support") Cc: # v5.4+ Signed-off-by: Yunlei He --- fs/f2fs/ver

[f2fs-dev] [PATCH v2] f2fs: fsverity: Truncate cache pages if set verity failed

2021-03-01 Thread Yunlei He
If file enable verity failed, should truncate anything wrote past i_size, including cache pages. Fixes: 95ae251fe828 ("f2fs: add fs-verity support") Cc: # v5.4+ Signed-off-by: Yunlei He --- fs/f2fs/verity.c | 47 +-- 1 file changed, 25

[f2fs-dev] [PATCH] f2fs: stop discard thread during fstrim

2018-11-05 Thread Yunlei He
Now, discard thread will issue discards in parallel with fstrim, which will cause problem as below: i. maybe too many discards commands at some point ii. disturb the order of block address, which is continuous in fstrim Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h| 1 + fs/f2fs/segment.c

[f2fs-dev] [PATCH] f2fs: move dir data flush to write checkpoint process

2018-11-05 Thread Yunlei He
<- wait all -f2fs_do_sync_file exit now: -f2fs_do_sync_file enter -write_checkpoint -block_operations <- flush dir & no wait -do_checkpoint <- wait all -f2fs_do_sync_file exit Signed-off-by

[f2fs-dev] [PATCH] f2fs: add a new mount option "errors_mode"

2018-07-24 Thread Yunlei He
This patch add a new mount option "errors_mode" to adjust fs disposing cp error policy. Now supports "panic", "remount-ro", and "continue". Signed-off-by: Yunlei He --- Documentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH] f2fs: fix wrong kernel message when recover fsync data on ro fs

2018-07-19 Thread Yunlei He
This patch fix wrong message info for recover fsync data on readonly fs. Signed-off-by: Yunlei He --- fs/f2fs/recovery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 0d927ae..9832edb 100644 --- a/fs/f2fs/recovery.c +++ b/fs

[f2fs-dev] [PATCH] f2fs: check the right return value of memory alloc function

2018-07-01 Thread Yunlei He
This patch check the right return value of memory alloc function Signed-off-by: Yunlei He --- 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 1af61e0..24b5262 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2794,7

[f2fs-dev] [PATCH v2] f2fs: Allocate and stat mem used by free nid bitmap more accurately

2018-06-27 Thread Yunlei He
This patch used f2fs_bitmap_size macro to calculate mem used by free nid bitmap, and stat used mem including aligned part. Signed-off-by: Yunlei He --- fs/f2fs/debug.c | 3 ++- fs/f2fs/node.c | 2 +- include/linux/f2fs_fs.h | 5 - 3 files changed, 3 insertions(+), 7

[f2fs-dev] [PATCH] f2fs: Allocate and stat mem used by free nid bitmap more accurately

2018-06-26 Thread Yunlei He
This patch used f2fs_bitmap_size macro to calculate mem used by free nid bitmap, and stat used mem including aligned part. Signed-off-by: Yunlei He --- fs/f2fs/debug.c | 2 +- include/linux/f2fs_fs.h | 5 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/f2fs

[f2fs-dev] [PATCH] fsck.f2fs: fix wrong err message of check quota node

2018-06-26 Thread Yunlei He
This patch fix wrong err message of check quota node. Signed-off-by: Yunlei He --- fsck/fsck.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 8145199..f9ed797 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -1663,7 +1663,7 @@ int

[f2fs-dev] [PATCH v3] f2fs: report error if quota off error during umount

2018-06-25 Thread Yunlei He
Now, we depend on fsck to ensure quota file data is ok, so we scan whole partition if checkpoint without umount flag. It's same for quota off error case, which may make quota file data inconsistent. Signed-off-by: Yunlei He --- fs/f2fs/super.c | 17 ++--- 1 file change

[f2fs-dev] [PATCH v2] f2fs: report error if quota off error during umount

2018-06-21 Thread Yunlei He
Now, we depend on fsck to ensure quota file data is ok, so we scan whole partition if checkpoint without umount flag. It's same for quota off error case, which may make quota file data inconsistent. Signed-off-by: Yunlei He --- fs/f2fs/super.c | 17 ++--- 1 file change

[f2fs-dev] [PATCH] f2fs: report error if quota off error during umount

2018-06-21 Thread Yunlei He
Now, we depend on fsck to ensure quota file data is ok, so we scan whole partition if checkpoint without umount flag. It's same for quota off error case, which may make quota file data inconsistent. Signed-off-by: Yunlei He --- fs/f2fs/super.c | 7 +-- 1 file changed, 5 insertions(

[f2fs-dev] [PATCH v2] f2fs: fix a hungtask problem caused by congestion_wait

2018-06-21 Thread Yunlei He
function f2fs_sync_dirty_inodes, and most of cycle will be dropped into congestion_wait() and sleep more than 20ms. Cycles num reduced to 3 with this patch. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/checkpoint.c b

[f2fs-dev] [PATCH] f2fs: check mount option before turn quota on

2018-06-05 Thread Yunlei He
This patch add a mount option check before turn quota on, which is same as ext4 does. BTW, both f2fs and ext4 have no mount options check to enable limits quota on sys file, is there no need to do this? Signed-off-by: Yunlei He --- fs/f2fs/super.c | 3 +++ 1 file changed, 3 insertions(+) diff

[f2fs-dev] [PATCH RFC] Revert "f2fs: avoid cpu lockup"

2018-05-31 Thread Yunlei He
. With my debug info, cycles num will exceed 1000 in function f2fs_sync_dirty_inodes, and most of cycle will be dropped into congestion_wait() and sleep more than 20ms. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/fs/f2fs/checkpoint.c

[f2fs-dev] [PATCH v3] f2fs: build free nid bitmap during flush nat entries

2018-04-25 Thread Yunlei He
This patch introduce free nid bitmap build during flush nat entries in order to reduce synchronous read in the process of build free nids. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: allow ssa journal with nat bits enabled

2018-04-25 Thread Yunlei He
This patch enable ssa journal with nat bits, which is benifit for nat metadata write. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 681552b..220110a 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH v2] f2fs: build free nid bitmap during flush nat entries

2018-04-25 Thread Yunlei He
This patch introduce free nid bitmap build during flush nat entries in order to reduce synchronous read in the process of build free nids. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c

[f2fs-dev] [PATCH] f2fs: build free nid bitmap during flush nat entries

2018-04-24 Thread Yunlei He
This patch introduce free nid bitmap build during flush nat entries in order to reduce synchronous read in the process of build free nids. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c

[f2fs-dev] [PATCH v3] f2fs: move mnt_want_write_file after range check

2018-04-24 Thread Yunlei He
This patch move mnt_want_write_file after range check, it's needless to check arguments with it. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 16dad2b..6b79b8a 100644 --- a/fs

[f2fs-dev] [PATCH v2] f2fs: move mnt_want_write_file after range check

2018-04-23 Thread Yunlei He
This patch move mnt_want_write_file after range check, it's needless to check arguments with it. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 16dad2b..25c5364 100644 --- a/fs

[f2fs-dev] [PATCH v2] f2fs: fix missing clear FI_NO_PREALLOC in some error case

2018-04-23 Thread Yunlei He
This patch fix missing clear FI_NO_PREALLOC in some error case Signed-off-by: Yunlei He --- fs/f2fs/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 16dad2b..2ce6c22 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2923,6 +2923,8 @@ static

[f2fs-dev] [PATCH] f2fs: fix missing clear FI_NO_PREALLOC in some error case

2018-04-22 Thread Yunlei He
This patch clean f2fs_file_write_iter to avoid missing clear FI_NO_PREALLOC in some error case. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 16dad2b

[f2fs-dev] [PATCH] f2fs: move mnt_want_write_file after range check

2018-04-22 Thread Yunlei He
This patch move mnt_want_write_file after range check, it's needless to check arguments with it. Signed-off-by: Yunlei He --- fs/f2fs/file.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 16dad2b..165a60f 100644 ---

[f2fs-dev] [PATCH v2] f2fs: allocate hot_data for atomic write more strictly

2018-04-17 Thread Yunlei He
If a file not set type as hot, has dirty pages more than threshold 64 before starting atomic write, may be lose hot flag. v1->v2: move set FI_ATOMIC_FILE flag behind flush dirty pages too, in case of dirty pages before starting atomic use atomic mode to write back. Signed-off-by: Yunlei

[f2fs-dev] [PATCH] f2fs: allocate hot_data for atomic write more strictly

2018-04-16 Thread Yunlei He
If a file not set type as hot, has dirty pages more than threshold 64 before starting atomic write, may be lose hot flag. Signed-off-by: Yunlei He --- 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 79eeed5..bf61e20

[f2fs-dev] [PATCH v5] f2fs: stop issue discard if something wrong with f2fs

2018-04-12 Thread Yunlei He
is similar to fstrim. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index d923ef5..991d1a2 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -929,6 +929,9 @@ static void __submit_discard_cmd(str

[f2fs-dev] [PATCH] f2fs: introduce a new flag to indicate trun off nat bits temporary

2018-04-12 Thread Yunlei He
accurately. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 3 ++- fs/f2fs/f2fs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 2e23b95..96785ff 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1162,7

[f2fs-dev] [PATCH v5] f2fs: introduce a method to make nat journal more fresh

2018-04-10 Thread Yunlei He
old nat set with same dirty entry number to nat area. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 38 +++--- fs/f2fs/node.h | 4 +++- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 9a99243..88ba4c2 100644

[f2fs-dev] [PATCH v4] f2fs: stop issue discard if something wrong with f2fs

2018-04-09 Thread Yunlei He
This patch stop async thread and umount process to issue discard if something wrong with f2fs, which is similar to fstrim. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 5854cc4..1659985 100644

[f2fs-dev] [PATCH v2] f2fs: use cur_map instead of ckpt_map

2018-04-09 Thread Yunlei He
ard candidates reported by Chao, besides, update commit message. Signed-off-by: Yunlei He --- 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 5854cc4..f5d0499 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -155

[f2fs-dev] [PATCH] f2fs: use cur_map instead of ckpt_map

2018-04-09 Thread Yunlei He
This patch use cur_map instead of ckpt_map for easy to understand, no functional change. Signed-off-by: Yunlei He --- 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 5854cc4..f5d0499 100644 --- a/fs/f2fs/segment.c

[f2fs-dev] [PATCH v3] f2fs: stop issue discard if something wrong with f2fs

2018-04-09 Thread Yunlei He
This patch stop async thread and umount process to issue discard if something wrong with f2fs, which is similar to fstrim. v1->v2: add fs error check in not only discard thread but also umount process v2->v3: remove redundant error message Signed-off-by: Yunlei He --- fs/f2fs/segment

[f2fs-dev] [PATCH v2] f2fs: stop issue discard if something wrong with f2fs

2018-04-08 Thread Yunlei He
This patch stop discard thread to issue discard io if something wrong with f2fs, which is similar to fstrim. v1->v2: add fs error check in not only discard thread but also umount process Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 7 ++- 1 file changed, 6 insertions(+), 1 delet

[f2fs-dev] [PATCH] f2fs: disable nat bits without setting SBI_NEED_FSCK

2018-04-08 Thread Yunlei He
nat bits feature is recover default by fsck, no need to set SBI_NEED_FSCK flag. Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1df7f10..0ffaefc2 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1520,8

[f2fs-dev] [PATCH] fsck.f2fs: recover nat bits feature default by fsck

2018-04-08 Thread Yunlei He
will recover flag and bitmap before next mount. SBI_NEED_FSCK means fs is corrupted, is not suitable for nat bits disabled. This patch try to recover nat bits all by fsck, no need set SBI_NEED_FSCK flag in kernel. Signed-off-by: Yunlei He --- fsck/mount.c | 15 ++- 1 file changed

[f2fs-dev] [PATCH 1/2] f2fs: stop issue discard if something wrong with f2fs

2018-04-08 Thread Yunlei He
This patch stop discard thread to issue discard io if something wrong with f2fs, which is similar to fstrim. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 5854cc4..f75f503 100644 --- a/fs/f2fs

[f2fs-dev] [PATCH 2/2] f2fs: let discard thread wait a little longer if dev is busy

2018-04-08 Thread Yunlei He
6 (no candidates) Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h| 2 ++ fs/f2fs/segment.c | 6 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1df7f10..0a6453b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -184,6 +184,7

[f2fs-dev] [PATCH v2] f2fs: remove nested usage of plug list

2018-04-07 Thread Yunlei He
: Yunlei He --- fs/f2fs/file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6b94f19..977c800 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2894,7 +2894,6 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from

[f2fs-dev] [PATCH] f2fs: remove nested usage of plug list

2018-04-07 Thread Yunlei He
: Yunlei He --- fs/f2fs/file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6b94f19..6ce27ab 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2939,9 +2939,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from

[f2fs-dev] [PATCH] f2fs: issue all big range discards in umount process

2018-04-04 Thread Yunlei He
This patch modify max_requests to UINT_MAX, to issue all big range discards in umount. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 5854cc4..a4b8e3e2 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: Add a segment type check in inplace write

2018-03-26 Thread Yunlei He
This patch add a segment type check in IPU, in case of something wrong with blkadd in dnode. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index f61c77b..c55942c 100644 --- a/fs/f2fs/segment.c +++ b

[f2fs-dev] [PATCH v2] f2fs: rebuild get_node_path function

2018-03-21 Thread Yunlei He
This patch rebuild get_node_path function, no logic changes. v1->v2: '<' has higher priority than '-=' Signed-off-by: Yunlei He --- fs/f2fs/node.c | 28 ++-- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/fs/f2fs/node.c b/fs

[f2fs-dev] [PATCH] f2fs: rebuild get_node_path function

2018-03-21 Thread Yunlei He
This patch rebuild get_node_path function, no logic changes. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 28 ++-- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index c511ef6..33c8554 100644 --- a/fs/f2fs/node.c +++ b/fs

[f2fs-dev] [PATCH v4] f2fs: introduce a method to make nat journal more fresh

2018-03-16 Thread Yunlei He
old nat set with same dirty entry number to nat area. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 39 --- fs/f2fs/node.h | 4 +++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 177c438..c511ef6 100644

[f2fs-dev] [PATCH v3] f2fs: introduce a method to make nat journal more fresh

2018-03-13 Thread Yunlei He
old nat set with same dirty entry number to nat area. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 45 ++--- fs/f2fs/node.h | 4 +++- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 177c438..74f6079

[f2fs-dev] [PATCH v3] f2fs: check blkaddr more accuratly before issue a bio

2018-03-09 Thread Yunlei He
This patch check blkaddr more accuratly before issue a write or read bio. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 2 ++ fs/f2fs/data.c | 5 +++-- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.h| 25 +++-- 4 files changed, 25 insertions(+), 8 deletions

[f2fs-dev] [PATCH v2] f2fs: introduce a method to make nat journal more fresh

2018-03-09 Thread Yunlei He
old nat set with same dirty entry number to nat area. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 40 ++-- fs/f2fs/node.h | 2 ++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 177c438..844bdda 100644

[f2fs-dev] [PATCH v3] f2fs: check blkaddr more accuratly before issue a bio

2018-03-08 Thread Yunlei He
This patch check blkaddr more accuratly before issue a write or read bio. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 2 ++ fs/f2fs/data.c | 5 +++-- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.h| 25 +++-- 4 files changed, 25 insertions(+), 8 deletions

[f2fs-dev] [PATCH] f2fs: Don't overwrite all types of node to keep node chain

2018-03-07 Thread Yunlei He
warm node chain. Signed-off-by: Yunlei He --- 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 f61c77b..570e02d 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1862,7 +1862,7 @@ static void update_sit_

[f2fs-dev] [PATCH v2] dump.f2fs: fix a wrong report for dump an {d, id, did}node

2018-03-06 Thread Yunlei He
16b668d : 23815821] [10][0x 16b668e : 23815822] Invalid (i)node block Signed-off-by: Yunlei He --- fsck/dump.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 23e4f47..9236a43 100644 --- a/fsck

[f2fs-dev] [PATCH] dump.f2fs: fix a wrong report for dump an {d, id, did}node

2018-03-06 Thread Yunlei He
16b668d : 23815821] [10][0x 16b668e : 23815822] Invalid (i)node block Signed-off-by: Yunlei He --- fsck/dump.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index 23e4f47..5abdd6d 100644 --- a/fsck

[f2fs-dev] [PATCH v2] f2fs: check blkaddr more accuratly before issue a bio

2018-03-04 Thread Yunlei He
This patch check blkaddr more accuratly before issue a write or read bio. Signed-off-by: Yunlei He --- fs/f2fs/checkpoint.c | 2 ++ fs/f2fs/data.c | 5 +++-- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.h| 29 + 4 files changed, 31 insertions(+), 6

[f2fs-dev] [PATCH RFC] f2fs: introduce a method to make nat journal more fresh

2018-02-11 Thread Yunlei He
This patch introduce a method to make nat journal more fresh: i. sort set list using entry # plus cp version difference (last modify set cp # and current cp #) ii. if meet with cache hit, update last modify cp # to current cp # Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h | 2 ++ fs/f2fs

[f2fs-dev] [PATCH] f2fs: add bug on back during flush nat entries

2018-02-11 Thread Yunlei He
This patch add two bug on check back during flush nat entries, nat_tree_lock will prevent race from node block allocation in write_begin. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c

[f2fs-dev] [PATCH] f2fs: remove unneed reada during build free nids

2018-02-08 Thread Yunlei He
This patch remove unneed reada during build free nids. If few nids left, three will introduce a lot of no hit read io. Signed-off-by: Yunlei He --- fs/f2fs/node.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 833b46b

[f2fs-dev] [PATCH] f2fs: read ahead nat blocks && flush more continuous nat io

2018-01-30 Thread Yunlei He
: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush nat Signed-off-by: Yunlei He Signed-off-by: Wei Fang --- fs/f2fs/node.c | 60 +- fs/f2fs/node.h | 1 + 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a

[f2fs-dev] [PATCH v3] fsck.f2fs: read ahead xattr & direct node blocks

2018-01-29 Thread Yunlei He
g or encountering error. Signed-off-by: Yunlei He --- fsck/fsck.c | 67 + 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 6c1b9a7..30d5178 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -6

[f2fs-dev] [PATCH v3] fsck.f2fs: reduce mem alloc during read sit block

2018-01-29 Thread Yunlei He
This patch reduce mem alloc during read sit block Signed-off-by: Yunlei He Reviewed-by: Chao Yu --- fsck/fsck.c | 10 +++--- fsck/fsck.h | 4 ++-- fsck/mount.c | 47 --- 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/fsck

[f2fs-dev] [PATCH v2] fsck.f2fs: reduce mem alloc during read sit block

2018-01-28 Thread Yunlei He
This patch reduce mem alloc during read sit block Signed-off-by: Yunlei He --- fsck/fsck.c | 9 ++--- fsck/fsck.h | 4 ++-- fsck/mount.c | 42 +++--- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index

[f2fs-dev] [PATCH] fsck.f2fs: reduce mem alloc during read sit block

2018-01-28 Thread Yunlei He
This patch reduce mem alloc during read sit block Signed-off-by: Yunlei He --- fsck/fsck.c | 9 ++--- fsck/fsck.h | 4 ++-- fsck/mount.c | 45 ++--- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index

[f2fs-dev] [PATCH v2] fsck.f2fs: read ahead xattr & direct node blocks

2018-01-28 Thread Yunlei He
g or encountering error. Signed-off-by: Yunlei He --- fsck/fsck.c | 66 - 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 6c1b9a7..5c33892 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -6

[f2fs-dev] [PATCH] fsck: fix missing endian conversion

2018-01-26 Thread Yunlei He
This patch fix missing endian conversion in function build_nat_area_bitmap Signed-off-by: Yunlei He --- fsck/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index fe0d510..5289a1b 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -2225,7

[f2fs-dev] [PATCH] fsck.f2fs: read ahead xattr & direct node blocks

2018-01-26 Thread Yunlei He
This patch read ahead xattr & direct node blocks Signed-off-by: Yunlei He --- fsck/fsck.c | 59 ++- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 6c1b9a7..29a712c 100644 --- a/fsck/fs

[f2fs-dev] [PATCH v3] f2fs: rebuild sit page from sit info in mem

2018-01-25 Thread Yunlei He
Most sit flush consume no more than 1ms. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 19 +-- fs/f2fs/segment.h | 29 +++-- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e5739ce..e448b75

[f2fs-dev] [PATCH v2] f2fs: rebuild sit page from sit info in mem

2018-01-24 Thread Yunlei He
This patch rebuild sit page from sit info in mem instead of issue a read io. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 19 +-- fs/f2fs/segment.h | 24 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs

[f2fs-dev] [PATCH] f2fs: rebuild sit page from sit info in mem

2018-01-23 Thread Yunlei He
This patch rebuild sit page from sit info in mem instead of issue a read io. Signed-off-by: Yunlei He --- fs/f2fs/segment.c | 53 - fs/f2fs/segment.h | 10 ++ 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/fs/f2fs

[f2fs-dev] [PATCH] fsck.f2fs: use mem nat info directly

2018-01-22 Thread Yunlei He
Use mem nat info directly for we built in fsck init. Signed-off-by: Yunlei He --- fsck/mount.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index 0a5b986..fe0d510 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1591,8 +1591,14 @@ void

[f2fs-dev] [PATCH v2] f2fs: check node page again in write end io

2018-01-10 Thread Yunlei He
Check node page again in write end io in case of data corruption during inflght IO. Signed-off-by: Yunlei He --- fs/f2fs/data.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 72d5d36..3de6c67 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c

[f2fs-dev] [PATCH] f2fs: check node page again in write end io

2018-01-10 Thread Yunlei He
Check node page again in write end io in case of data corruption during inflght IO. Signed-off-by: Yunlei He --- fs/f2fs/data.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 72d5d36..d9246a8 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c

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

2018-01-04 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 --- fs/f2fs/recovery.c | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a

[f2fs-dev] [PATCH] dump.f2fs: Test blkaddr is valid or not in option '-b'

2018-01-03 Thread Yunlei He
Test blkaddr is valid or not in option '-b' Signed-off-by: Yunlei He --- fsck/dump.c | 9 + fsck/mount.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fsck/dump.c b/fsck/dump.c index 9f0993e..7ccb03f 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -58

[f2fs-dev] [PATCH] f2fs: update inode info to inode page for new file

2018-01-03 Thread Yunlei He
e A will be miss and xattr info will be taken as blkaddr index. Signed-off-by: Yunlei He --- fs/f2fs/dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 724304d..d04dcac 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -427,6 +427,8 @@ struct page *ini

[f2fs-dev] [PATCH] f2fs: Search nat_block_bitmap to accelerate free nids built process

2017-12-28 Thread Yunlei He
Search nat_block_bitmap to accelerate free nids built process. Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h | 3 ++- fs/f2fs/node.c | 47 +-- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index

[f2fs-dev] [PATCH 2/2] fsck.f2fs: Remove unused ckpt_valid_map info

2017-12-28 Thread Yunlei He
Remove unused ckpt_valid_map info. Signed-off-by: Yunlei He --- fsck/f2fs.h | 6 -- fsck/mount.c | 12 +++- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/fsck/f2fs.h b/fsck/f2fs.h index 34b2481..58081bc 100644 --- a/fsck/f2fs.h +++ b/fsck/f2fs.h @@ -65,12 +65,6

[f2fs-dev] [PATCH 1/2] dump.f2fs: Retrun directly if blkaddr is not valid

2017-12-28 Thread Yunlei He
Retrun directly if blkaddr is not valid. Signed-off-by: Yunlei He --- fsck/dump.c | 10 ++ fsck/mount.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fsck/dump.c b/fsck/dump.c index 9f0993e..bf79e2f 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -586,6 +586,8

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

2017-12-19 Thread Yunlei He
ror, This patch abandon recovery if node chain is cyclical. Signed-off-by: Yunlei He --- fs/f2fs/recovery.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index d025aa8..a535ec2 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -21

[f2fs-dev] [PATCH] fsck: use free segments if free segments is enough

2017-12-18 Thread Yunlei He
Use free segments if free segments is enough Signed-off-by: Yunlei He --- fsck/mount.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 678eeae..3e25165 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1890,23 +1890,14

[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 --- fs/f2fs/recovery.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a

[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 --- fs/f2fs/node.c | 128 - 1 file changed, 64 insertions(+), 64 deletions(-) diff

[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 --- fs/f2fs/data.c | 5 + fs/f2fs/recovery.c | 23 +++ 2 files changed, 20 insertions(+), 8

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

2017-12-10 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 --- fs/f2fs/f2fs.h | 6 + fs/f2fs/recovery.c | 71 ++ 2

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

2017-12-07 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 --- fs/f2fs/node.h | 8 +--- fs/f2fs/recovery.c | 22 ++ include/linux/f2fs_fs.h

[f2fs-dev] [PATCH] f2fs: no need return value in restore summary process

2017-12-05 Thread Yunlei He
No need return value in restore summary process Signed-off-by: Yunlei He --- fs/f2fs/f2fs.h| 2 +- fs/f2fs/node.c| 3 +-- fs/f2fs/segment.c | 14 +++--- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 82f1dc3..d86fc1d

  1   2   3   >