[f2fs-dev] [PATCH v2] f2fs: fix to correct no_fggc_candidate

2017-10-17 Thread Chao Yu
There may be extreme case as below: For one section contains one segment, and there are total 100 segments with 10% over-privision ratio in f2fs partition, fggc_threshold will be rounded down to 460 instead of 460.8 as below caclulation: sbi->fggc_threshold = div_u64((u64)(main_count -

Re: [f2fs-dev] [PATCH] f2fs: expose some sectors to user in inline data or dentry case

2017-10-17 Thread Chao Yu
On 2017/10/18 6:03, Jaegeuk Kim wrote: > On 10/16, Chao Yu wrote: >> On 2017/10/14 1:31, Jaegeuk Kim wrote: >>> If there's some data written through inline data or dentry, we need to shouw >>> st_blocks. This fixes reporting zero blocks even though there is small >>> written >>> data. >>> >>>

Re: [f2fs-dev] [PATCH] f2fs: return error number for quota_write

2017-10-17 Thread Chao Yu
On 2017/10/18 2:17, Jaegeuk Kim wrote: > On 10/17, Chao Yu wrote: >> >> >> On 2017/10/17 7:04, Jaegeuk Kim wrote: >>> On 10/16, Chao Yu wrote: Hi Jaegeuk, On 2017/10/13 7:15, Jaegeuk Kim wrote: > This patch returns an error number to quota_write in order for quota to >

Re: [f2fs-dev] [PATCH] f2fs: handle error case when adding xattr entry

2017-10-17 Thread Chao Yu
On 2017/10/18 0:41, Jaegeuk Kim wrote: > On 10/17, Chao Yu wrote: >> On 2017/10/17 7:06, Jaegeuk Kim wrote: >>> This patch fixes recovering incomplete xattr entries remaining in inline >>> xattr >>> and xattr block, caused by any kind of errors. >>> >>> Signed-off-by: Jaegeuk Kim

Re: [f2fs-dev] [PATCH] f2fs: expose some sectors to user in inline data or dentry case

2017-10-17 Thread Jaegeuk Kim
On 10/16, Chao Yu wrote: > On 2017/10/14 1:31, Jaegeuk Kim wrote: > > If there's some data written through inline data or dentry, we need to shouw > > st_blocks. This fixes reporting zero blocks even though there is small > > written > > data. > > > > Signed-off-by: Jaegeuk Kim

Re: [f2fs-dev] [PATCH] f2fs: return error number for quota_write

2017-10-17 Thread Jaegeuk Kim
On 10/17, Chao Yu wrote: > > > On 2017/10/17 7:04, Jaegeuk Kim wrote: > > On 10/16, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2017/10/13 7:15, Jaegeuk Kim wrote: > >>> This patch returns an error number to quota_write in order for quota to > >>> handle > >>> it correctly. > >> > >> We should

Re: [f2fs-dev] [PATCH] f2fs: avoid stale fi->gdirty_list pointer

2017-10-17 Thread Jaegeuk Kim
On 10/17, Chao Yu wrote: > On 2017/10/17 7:06, Jaegeuk Kim wrote: > > On 10/16, Chao Yu wrote: > >> On 2017/10/13 10:14, Jaegeuk Kim wrote: > >>> When doing fault injection test, f2fs_evict_inode() didn't remove > >>> gdirty_list > >>> which incurs a kernel panic due to wrong pointer access. >

Re: [f2fs-dev] [PATCH] f2fs: handle error case when adding xattr entry

2017-10-17 Thread Jaegeuk Kim
On 10/17, Chao Yu wrote: > On 2017/10/17 7:06, Jaegeuk Kim wrote: > > This patch fixes recovering incomplete xattr entries remaining in inline > > xattr > > and xattr block, caused by any kind of errors. > > > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/xattr.c | 48

[f2fs-dev] [PATCH] f2fs: fix to correct no_fggc_candidate

2017-10-17 Thread Chao Yu
From: Chao Yu There may be extreme case as below: For one section contains one segment, and there are total 100 segments with 10% over-privision ratio in f2fs partition, fggc_threshold will be rounded down to 460 instead of 460.8 as below caclulation: sbi->fggc_threshold =

Re: [f2fs-dev] [PATCH 1/1] f2fs: simplify the calculation of fggc_threshold

2017-10-17 Thread Chao Yu
On 2017/10/17 20:42, sunqiuyang wrote: > From: Qiuyang Sun > > Do not need to convert segment counts to blocks for this calculation. > > Signed-off-by: Qiuyang Sun Reviewed-by: Chao Yu Thanks, > --- > fs/f2fs/gc.c | 10

Re: [f2fs-dev] [PATCH] f2fs: use extra parenthesis around assignment/condition

2017-10-17 Thread Chao Yu
On 2017/10/17 17:07, Arnd Bergmann wrote: > gcc warns that writing a while() loop with an assignment as the condition > looks suspiciously like a comparison, and suggests a workaround: > > fs/f2fs/checkpoint.c: In function 'sync_meta_pages': > fs/f2fs/checkpoint.c:321:9: error: suggest

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

2017-10-17 Thread Chao Yu
On 2017/10/17 15:03, Yunlei He wrote: > 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()

Re: [f2fs-dev] [PATCH] f2fs: handle error case when adding xattr entry

2017-10-17 Thread Chao Yu
On 2017/10/17 7:06, Jaegeuk Kim wrote: > This patch fixes recovering incomplete xattr entries remaining in inline xattr > and xattr block, caused by any kind of errors. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/xattr.c | 48

Re: [f2fs-dev] [PATCH] f2fs: avoid stale fi->gdirty_list pointer

2017-10-17 Thread Chao Yu
On 2017/10/17 7:06, Jaegeuk Kim wrote: > On 10/16, Chao Yu wrote: >> On 2017/10/13 10:14, Jaegeuk Kim wrote: >>> When doing fault injection test, f2fs_evict_inode() didn't remove >>> gdirty_list >>> which incurs a kernel panic due to wrong pointer access. >>> >>> Signed-off-by: Jaegeuk Kim

Re: [f2fs-dev] [PATCH] f2fs: return error number for quota_write

2017-10-17 Thread Chao Yu
On 2017/10/17 7:04, Jaegeuk Kim wrote: > On 10/16, Chao Yu wrote: >> Hi Jaegeuk, >> >> On 2017/10/13 7:15, Jaegeuk Kim wrote: >>> This patch returns an error number to quota_write in order for quota to >>> handle >>> it correctly. >> >> We should return error number like

[f2fs-dev] [PATCH 1/1] f2fs: simplify the calculation of fggc_threshold

2017-10-17 Thread sunqiuyang
From: Qiuyang Sun Do not need to convert segment counts to blocks for this calculation. Signed-off-by: Qiuyang Sun --- fs/f2fs/gc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index

Re: [f2fs-dev] [PATCH] f2fs: use extra parenthesis around assignment/condition

2017-10-17 Thread Jan Kara
On Tue 17-10-17 11:07:12, Arnd Bergmann wrote: > gcc warns that writing a while() loop with an assignment as the condition > looks suspiciously like a comparison, and suggests a workaround: > > fs/f2fs/checkpoint.c: In function 'sync_meta_pages': > fs/f2fs/checkpoint.c:321:9: error: suggest

[f2fs-dev] [PATCH v2 1/5] f2fs: trace f2fs_lookup

2017-10-17 Thread Chao Yu
This patch adds trace for f2fs_lookup. Signed-off-by: Chao Yu --- v2: - fix warning reported by 0-day project. - report error of d_splice_alias in trace_f2fs_lookup_end. fs/f2fs/namei.c | 49 +-- include/trace/events/f2fs.h |

[f2fs-dev] [PATCH] f2fs: use extra parenthesis around assignment/condition

2017-10-17 Thread Arnd Bergmann
gcc warns that writing a while() loop with an assignment as the condition looks suspiciously like a comparison, and suggests a workaround: fs/f2fs/checkpoint.c: In function 'sync_meta_pages': fs/f2fs/checkpoint.c:321:9: error: suggest parentheses around assignment used as truth value

[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