[PATCH 1/5] f2fs: fix mismatching lock and unlock pages for roll-forward recovery

2015-04-02 Thread Jaegeuk Kim
Previously, inode page is not correctly locked and unlocked in pair during the roll-forward recovery. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs

[PATCH 4/5] f2fs: do not increase link count during recovery

2015-04-02 Thread Jaegeuk Kim
inode blocks having same inode number with different directory paths. But, current f2fs doesn't replay all of path changes and only recover its dentry for the last fsynced inode block. So, there is no reason to do this. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 11 +++ 1 file

[PATCH 2/5] f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries

2015-04-02 Thread Jaegeuk Kim
f2fs_add_link with proper inode numbers and their dot and dotdot names. 3. Once f2fs recovers the directory without errors, it removes F2FS_INLINE_DOTS finally. Signed-off-by: Jaegeuk Kim --- fs/f2fs/dir.c | 50 ++--- fs/f2fs/f2fs.h

[PATCH 3/5] f2fs: assign parent's i_mode for empty dir

2015-04-02 Thread Jaegeuk Kim
When assigning i_mode for dotdot, it needs to assign parent's i_mode. Signed-off-by: Jaegeuk Kim --- fs/f2fs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index b2970fb..60a2a41 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -

[PATCH 5/5] f2fs: do not recover wrong data index

2015-04-02 Thread Jaegeuk Kim
, segno); --> out-of-range segno. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 63b720b..4b742c9 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f

Re: performance changes on 78373b73: -46.6% fsmark.files_per_sec, and few more

2015-04-21 Thread Jaegeuk Kim
abdf15050af5b1632c4c8b8b398f33 > > Author: Jaegeuk Kim > > AuthorDate: Fri Mar 13 21:44:36 2015 -0700 > > Commit: Jaegeuk Kim > > CommitDate: Fri Apr 10 15:08:45 2015 -0700 > > > > f2fs: enhance multi

[PATCH] f2fs: fix wrong error hanlder in f2fs_follow_link

2015-04-22 Thread Jaegeuk Kim
The page_follow_link_light returns NULL and its error pointer was remained in nd->path. Reported-by: Dan Carpenter Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 407dde3..1350

[PATCH] f2fs: export more enums for tracepoint

2015-04-22 Thread Jaegeuk Kim
This patch exports newly added enums to userspace. Signed-off-by: Jaegeuk Kim --- include/trace/events/f2fs.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index f18c83a..04856a2 100644 --- a/include/trace/events/f2fs.h +++ b

[PATCH 3/3] f2fs: pass checkpoint reason on roll-forward recovery

2015-04-16 Thread Jaegeuk Kim
This patch adds CP_RECOVERY to remain recovery information for checkpoint. And, it makes sure writing checkpoint in this case. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c| 6 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 2 +- include/trace/events

[PATCH 1/3] f2fs: flush symlink path to avoid broken symlink after POR

2015-04-16 Thread Jaegeuk Kim
user wants to keep this file atomically, it needs to trigger dir->fsync. And, there is still a hole to produce broken symlink. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 8055e30..5d99

[PATCH 2/3] f2fs: avoid abnormal behavior on broken symlink

2015-04-16 Thread Jaegeuk Kim
When f2fs_symlink was triggered and checkpoint was done before syncing its link path, f2fs can get broken symlink like "xxx -> \0\0\0". This incurs abnormal path_walk by VFS. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 20 +++- 1 file changed, 19 insertions(+

Re: [f2fs-dev] [PATCH 1/3] f2fs: flush symlink path to avoid broken symlink after POR

2015-04-16 Thread Jaegeuk Kim
Hi Chao, On Thu, Apr 16, 2015 at 06:33:29PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > > -Original Message- > > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > > Sent: Thursday, April 16, 2015 3:31 PM > > To: linux-kernel@vger.kernel.org; linux-fsde...@vger

Re: [PATCH 1/2] f2fs: support FALLOC_FL_COLLAPSE_RANGE

2015-04-29 Thread Jaegeuk Kim
Hi Chao, On Sat, Apr 18, 2015 at 06:00:36PM +0800, Chao Yu wrote: > Now, FALLOC_FL_COLLAPSE_RANGE flag in ->fallocate is supported in ext4/xfs. > > In commit, the semantics of this flag is descripted as following: > "1) It collapses the range lying between offset and length by removing any > dat

Re: [PATCH v2 1/3] f2fs: introduce replace_block() for reuse

2015-04-30 Thread Jaegeuk Kim
Hi Chao, On Thu, Apr 30, 2015 at 06:11:35PM +0800, Chao Yu wrote: > Introduce a generic function replace_block base on recover_data_page, > and export it. So wit it we can operate file's meta data which is in > CP/SSA area when we invoke fallocate with FALLOC_FL_COLLAPSE_RANGE flag. > > Signed-of

[GIT PULL] f2fs updates for v4.1

2015-04-17 Thread Jaegeuk Kim
in f2fs_xattr_advise_get f2fs: persist system.advise into on-disk inode f2fs: limit b_size of mapped bh in f2fs_map_bh Jaegeuk Kim (24): f2fs: remove obsolete code f2fs: avoid wrong error during recovery f2fs: support fs shutdown f2fs: clear page's up-to-date if b

Re: [f2fs-dev] [PATCH 2/3] f2fs crypto: use bounce pages from mempool first

2015-05-27 Thread Jaegeuk Kim
Hi Chao, On Mon, May 25, 2015 at 06:00:47PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > > -Original Message- > > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > > Sent: Friday, May 22, 2015 8:40 AM > > To: linux-kernel@vger.kernel.org; linux-fsde...@vger

Re: [PATCH 2/3] f2fs crypto: use bounce pages from mempool first

2015-05-27 Thread Jaegeuk Kim
On Mon, May 25, 2015 at 03:55:51PM -0400, Theodore Ts'o wrote: > On Thu, May 21, 2015 at 05:40:24PM -0700, Jaegeuk Kim wrote: > > If a lot of write streams are triggered, alloc_page and __free_page are > > costly called, resulting in high memory pressure. > > > &g

Re: [PATCH 2/3 v2] f2fs crypto: use bounce pages from mempool first

2015-05-27 Thread Jaegeuk Kim
Change log from v1: o remain the existing emergecy mempool o add a new mempool for writeback pages >From ab8c49a79c4a6cd0ca1093d5e42cb93b55b35bfd Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 20 May 2015 19:12:30 -0700 Subject: [PATCH] f2fs crypto: introduce a mempool for bounce pa

[PATCH] f2fs crypto: avoid f2fs_inherit_context for symlink

2015-05-27 Thread Jaegeuk Kim
This patch fixes to call f2fs_inherit_context twice for newly created symlink. The original one is called by f2fs_add_link(), which invokes f2fs_setxattr. If the second one is called again, f2fs_setxattr is triggered again with same encryption index. Signed-off-by: Jaegeuk Kim --- fs/f2fs

Re: [f2fs-dev] [PATCH 3/4] f2fs crypto: check encryption for tmpfile

2015-05-28 Thread Jaegeuk Kim
Hi Chao, On Thu, May 28, 2015 at 06:20:05PM +0800, Chao Yu wrote: > Hi Jaegeuk, > > > -Original Message- > > From: Jaegeuk Kim [mailto:jaeg...@kernel.org] > > Sent: Wednesday, May 20, 2015 8:43 AM > > To: linux-kernel@vger.kernel.org; linux-fsde...@vger

Re: [PATCH 1/3] f2fs crypto: check context consistent for rename2

2015-05-28 Thread Jaegeuk Kim
Hi Chao, On Mon, May 25, 2015 at 06:07:02PM +0800, Chao Yu wrote: > For exchange rename, we should check context consistent of encryption > between new_dir and old_inode or old_dir and new_inode. Otherwise > inheritance of parent's encryption context will be broken. > > Signed-off-by: Chao Yu >

Re: [f2fs-dev] [PATCH 1/3] f2fs crypto: check context consistent for rename2

2015-05-28 Thread Jaegeuk Kim
On Thu, May 28, 2015 at 10:07:26AM -0700, Jaegeuk Kim wrote: > Hi Chao, > > On Mon, May 25, 2015 at 06:07:02PM +0800, Chao Yu wrote: > > For exchange rename, we should check context consistent of encryption > > between new_dir and old_inode or old_dir and new_inode. Otherwi

[PATCH 1/2] f2fs crypto: fix to handle errors likewise ext4

2015-06-11 Thread Jaegeuk Kim
This patch makes some error handling policies same with ext4. Signed-off-by: Jaegeuk Kim --- fs/f2fs/crypto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c index be6af18..75d62ff 100644 --- a/fs/f2fs/crypto.c +++ b/fs/f2fs/crypto.c

[PATCH 2/2] f2fs crypto: add alloc_bounce_page

2015-06-11 Thread Jaegeuk Kim
This patch adds alloc_bounce_page likewise ext4. Signed-off-by: Jaegeuk Kim --- fs/f2fs/crypto.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c index 75d62ff..4a62ef1 100644 --- a/fs/f2fs/crypto.c +++ b/fs/f2fs

Re: [f2fs-dev] [PATCH v2] f2fs: do not trim preallocated blocks when truncating after i_size

2015-06-11 Thread Jaegeuk Kim
On Fri, Jun 12, 2015 at 08:30:09AM +0800, Chao Yu wrote: > Hi Jaegeuk, > > > -Original Message- > > From: Chao Yu [mailto:chao2...@samsung.com] > > Sent: Tuesday, June 09, 2015 10:28 AM > > To: Jaegeuk Kim; Changman Lee > > Cc: linux-k

[GIT PULL] f2fs updates for v4.2

2015-06-24 Thread Jaegeuk Kim
isable the discard option when device doesn't support Dan Carpenter (1): f2fs: cleanup a confusing indent Jaegeuk Kim (54): f2fs: export more enums for tracepoint f2fs: add missing version info in superblock f2fs: move existing definitions into f2fs.h f2fs: add feat

Re: [GIT PULL] f2fs updates for v4.2

2015-06-24 Thread Jaegeuk Kim
On Thu, Jun 25, 2015 at 05:33:34AM +0100, Al Viro wrote: > On Wed, Jun 24, 2015 at 08:42:02PM -0700, Linus Torvalds wrote: > > On Wed, Jun 24, 2015 at 1:25 PM, Jaegeuk Kim wrote: > > > > > > New features are: > > > o per-file encryption (e.g., ext4) > &

Re: [GIT PULL] f2fs updates for v4.2

2015-06-24 Thread Jaegeuk Kim
On Thu, Jun 25, 2015 at 07:32:36AM +0100, Al Viro wrote: > On Wed, Jun 24, 2015 at 10:50:10PM -0700, Jaegeuk Kim wrote: > > > Right, I missed merging the fix-up patch in linux-next into my pull-request. > > At a glance, I think there is no problem; except 80 column width, tho

Re: [PATCH] f2fs: do not trim preallocated blocks when truncating after i_size

2015-06-08 Thread Jaegeuk Kim
On Fri, Jun 05, 2015 at 06:34:02PM +0800, Chao Yu wrote: > When we perform generic/092 in xfstests, output is like below: > > XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > 0: [0..10239]: data > 0: [0..10239]: data > -1: [10240..20479]: unwritten > +1: [10240..

[PATCH] f2fs: fix to return exact trimmed size

2015-06-04 Thread Jaegeuk Kim
Now, we add all the candidates for trim commands and then finally issue discard commands. So, we should count the trimmed size in back-end. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c

[PATCH 1/2] f2fs crypto: clean up error handling in f2fs_fname_setup_filename

2015-05-29 Thread Jaegeuk Kim
Sync with: ext4 crypto: clean up error handling in ext4_fname_setup_filename Signed-off-by: Jaegeuk Kim --- fs/f2fs/crypto_fname.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/crypto_fname.c b/fs/f2fs/crypto_fname.c index 81852cc

[PATCH 2/2] f2fs: fix a deadlock for summary page lock vs. sentry_lock

2015-05-29 Thread Jaegeuk Kim
-by: Jaegeuk Kim --- 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 43354cb..e1e7361 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -750,6 +750,15 @@ static void do_garbage_collect(struct f2fs_sb_info *sbi, unsigned

[PATCH] f2fs: drop the volatile_write flag only

2015-06-10 Thread Jaegeuk Kim
When aborting volatile_writes, let's drop its flag and give up any further volatile_writes. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 096e08c..53c1b74 100644 --- a/fs/f2fs/f

[PATCH] f2fs: do gc in greedy mode for whole range if gc_urgent mode is set

2018-02-27 Thread Jaegeuk Kim
Otherwise, f2fs conducts GC on 8GB range only based on slow cost-benefit. Signed-off-by: Jaegeuk Kim --- 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 bc9420ce2275..bfb7a4a3a929 100644 --- a/fs/f2fs/gc.c +++ b/fs

Re: [PATCH 1/5 v2] f2fs: add mount option for segment allocation policy

2018-02-27 Thread Jaegeuk Kim
be useful for small-sized eMMC parts. Signed-off-by: Jaegeuk Kim --- Documentation/filesystems/f2fs.txt | 2 ++ fs/f2fs/f2fs.h | 8 fs/f2fs/segment.c | 5 + fs/f2fs/super.c| 24 4 files cha

Re: [f2fs-dev] [PATCH] f2fs: handle quota for orphan inodes

2018-02-27 Thread Jaegeuk Kim
On 02/27, Chao Yu wrote: > Ping, > > On 2018/2/13 22:33, Chao Yu wrote: > > On 2018/2/10 10:28, Jaegeuk Kim wrote: > >> This is to fix missing dquot_initialize for orphan inodes. > > > > IMO, we don't need to call dquot_initialize as we have call the func

Re: [PATCH 2/2] f2fs: support {d,id,did,x}node checksum

2018-02-27 Thread Jaegeuk Kim
On 02/27, Chao Yu wrote: > Ping, > > On 2018/2/13 15:34, Chao Yu wrote: > > Hi Jaegeuk, > > > > On 2018/2/10 10:52, Chao Yu wrote: > >> On 2018/2/10 9:41, Jaegeuk Kim wrote: > >>> On 02/01, Chao Yu wrote: > >>>> > >>>&g

Re: [PATCH v4] Revert "f2fs crypto: avoid unneeded memory allocation in ->readdir"

2018-02-27 Thread Jaegeuk Kim
Hi Yunlong, As Eric pointed out, how do you think using nohighmem for directory likewise ext4, which looks like more efficient? Actually, we don't need to do this in most of recent kernels, right? Thanks, On 02/28, Yunlong Song wrote: > This reverts commit e06f86e61d7a67fe6e826010f57aa39c674f4b1

Re: [PATCH 4/5] f2fs: issue discard aggressively in the gc_urgent mode

2018-02-28 Thread Jaegeuk Kim
Change log from v1: - relax more to issue discard commands This patch avoids to skip discard commands when user sets gc_urgent mode. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/f2fs

Re: [PATCH] f2fs: fix to restore whint_mode in ->remount_fs

2018-02-28 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > From: Chao Yu > > If we fail in ->remount_fs, it needs to restore old whint_mode as other > mount options. > > Fixes: e25afe01822f ("f2fs: support passing down write hints given by users > to block layer") Hi Chao, It was not merged, so please allow me to integrate

Re: [PATCH v4] Revert "f2fs crypto: avoid unneeded memory allocation in ->readdir"

2018-02-28 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > Hi Jaegeuk, > > On 2018/2/28 13:48, Jaegeuk Kim wrote: > > Hi Yunlong, > > > > As Eric pointed out, how do you think using nohighmem for directory likewise > > I'd like to ask, at the beginning, why we choose to use highmem fo

Re: [f2fs-dev] [PATCH 1/5 v2] f2fs: add mount option for segment allocation policy

2018-02-28 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > On 2018/2/28 13:09, Jaegeuk Kim wrote: > > Change log from v1: > > - add doc :) > > > > This patch adds an mount option, "alloc_mode=%s" having two options, > > "default" > > and "reuse". > >

Re: [PATCH v2] f2fs: remain written times to update inode during fsync

2018-04-03 Thread Jaegeuk Kim
On 04/03, Chao Yu wrote: > On 2018/4/3 13:23, Jaegeuk Kim wrote: > > On 04/03, Chao Yu wrote: > >> On 2018/3/31 0:30, Jaegeuk Kim wrote: > >>> Change log from v1: > >>> - add more description > >>> > >>> This fixes xfstests/

[GIT PULL] f2fs update for 4.17-rc1

2018-04-04 Thread Jaegeuk Kim
'whint_mode' mount option to f2fs documentation f2fs: add nowait aio support Jaegeuk Kim (11): f2fs: handle quota for orphan inodes f2fs: don't stop GC if GC is contended f2fs: add mount option for segment allocation policy f2fs: add auto tuning for small

Re: [PATCH] f2fs: fix to show encrypt flag in FS_IOC_GETFLAGS

2018-04-04 Thread Jaegeuk Kim
On 04/03, Chao Yu wrote: > On 2018/4/3 4:21, Jaegeuk Kim wrote: > > On 04/02, Chao Yu wrote: > >> This patch fixes to show encrypt flag in FS_IOC_GETFLAGS like ext4 does. > > > > Actually, we have to show internal flags owned by f2fs, not generic ones. > &g

Re: [PATCH] f2fs: enlarge block plug coverage

2018-04-04 Thread Jaegeuk Kim
On 04/04, Chao Yu wrote: > This patch enlarges block plug coverage in __issue_discard_cmd, in > order to collect more pending bios before issuing them, to avoid > being disturbed by previous discard I/O in IO aware discard mode. Hmm, then we need to wait for huge discard IO for over 10 secs, which

Re: [PATCH] f2fs: clear page_error for all the writebacking pages

2018-04-26 Thread Jaegeuk Kim
On 04/24, Chao Yu wrote: > Hi Jaegeuk, > > On 2018/4/24 6:49, Jaegeuk Kim wrote: > > This patch clear page_error bit, if the page is going to be writebacked. > > This patch is similar to previous patch ("f2fs: clear PageError on > writepage"), > only covera

Re: [f2fs-dev] [PATCH 1/5] f2fs: give message and set need_fsck given broken node id

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > On 2018/4/25 13:46, Jaegeuk Kim wrote: > > syzbot hit the following crash on upstream commit > > 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri Apr 20 17:56:32 2018 +) > > Merge branch 'fixes' of > > git://git.kernel.org/pub/sc

Re: [f2fs-dev] [PATCH 4/5] f2fs: sanity check for total valid blocks

2018-04-26 Thread Jaegeuk Kim
e_count, which works for syzbot case as well. > > Thanks, > > On 2018/4/25 13:46, Jaegeuk Kim wrote: > > This patch enhances sanity check for SIT entries. > > > > syzbot hit the following crash on upstream commit > > 83beed7b2b26f232d782127792dd0cd4362fdc41 (Fri

Re: [f2fs-dev] [PATCH 4/5 v2] f2fs: sanity check for total valid blocks

2018-04-26 Thread Jaegeuk Kim
-tested-by: syzbot+0a725420475916460...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- Change log from v1: - check valid node count fs/f2fs/segment.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 20250b88bf51..c60f87822

Re: [f2fs-dev] [PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > On 2018/4/25 13:46, Jaegeuk Kim wrote: > > This is to give a option for user to be able to recover B/foo in the below > > case. > > > > mkdir A > > sync() > > rename(A, B) > > creat (B/foo) > > fsync (B/foo) > >

Re: [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Jaegeuk Kim
On 04/26, Chao Yu wrote: > Thread A Thread B > - f2fs_ioc_commit_atomic_write > - commit_inmem_pages > - f2fs_submit_merged_write_cond > : write data > - write_checkpoint >- do_checkpoint

Re: [PATCH v2] f2fs: avoid stucking GC due to atomic write

2018-04-26 Thread Jaegeuk Kim
On 04/24, Chao Yu wrote: > f2fs doesn't allow abuse on atomic write class interface, so except > limiting in-mem pages' total memory usage capacity, we need to limit > atomic-write usage as well when filesystem is seriously fragmented, > otherwise we may run into infinite loop during foreground GC

Re: [PATCH v2] f2fs: fix to avoid race during access gc_thread pointer

2018-04-26 Thread Jaegeuk Kim
On 04/24, Chao Yu wrote: > Thread A Thread BThread C > - f2fs_remount > - stop_gc_thread > - f2fs_sbi_store > - issue_discard_thread >sbi->gc_thread = NULL; >

Re: [PATCH 3/3] f2fs: maintain discard interface separately

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > This patch adds a new file discard.c to maintain discard related > function separately. I don't think we need this at all. Thanks, > > BTW, fix below checkpatch errors: > > ERROR: space required before the open brace '{' > + } else if (issued == -1){ > >

Re: [PATCH 2/3] f2fs: introduce {create,destroy}_discard_caches for cleanup

2018-04-26 Thread Jaegeuk Kim
On 04/25, Chao Yu wrote: > Split discard slab cache related initial/release codes into separated > function {create,destroy}_discard_caches, later we can maintain those > independent functions in separated discard.c No need this as well. > > Signed-off-by: Chao Yu > --- > fs/f2fs/f2fs.h|

Re: [PATCH] f2fs: fix to wait IO writeback in __revoke_inmem_pages()

2018-04-26 Thread Jaegeuk Kim
On 04/26, Chao Yu wrote: > On 2018/4/26 23:48, Jaegeuk Kim wrote: > > On 04/26, Chao Yu wrote: > >> Thread A Thread B > >> - f2fs_ioc_commit_atomic_write > >> - commit_inmem_pages > >> - f2fs

Re: [PATCH v2] f2fs: avoid stucking GC due to atomic write

2018-04-27 Thread Jaegeuk Kim
On 04/27, Chao Yu wrote: > On 2018/4/26 23:54, Jaegeuk Kim wrote: > > On 04/24, Chao Yu wrote: > >> f2fs doesn't allow abuse on atomic write class interface, so except > >> limiting in-mem pages' total memory usage capacity, we need to limit > >>

Re: [PATCH v2] f2fs: fix to avoid race during access gc_thread pointer

2018-04-27 Thread Jaegeuk Kim
On 04/27, Chao Yu wrote: > On 2018/4/27 0:03, Jaegeuk Kim wrote: > > On 04/24, Chao Yu wrote: > >> Thread A Thread BThread C > >> - f2fs_remount > >> - stop_gc_thread > >>

Re: [PATCH v2] f2fs: fix to avoid race during access gc_thread pointer

2018-04-27 Thread Jaegeuk Kim
On 04/27, Chao Yu wrote: > On 2018/4/27 10:04, Chao Yu wrote: > > On 2018/4/27 0:03, Jaegeuk Kim wrote: > >> On 04/24, Chao Yu wrote: > >>> Thread A Thread BThread C > >>> - f2fs_remount > >>> - stop_gc_t

[PATCH] f2fs: avoid bug_on on corrupted inode

2018-04-24 Thread Jaegeuk Kim
c:238 [inline] RSP: 8801c44a70e8 RIP: f2fs_iget+0x3307/0x3ca0 fs/f2fs/inode.c:313 RSP: 8801c44a70e8 invalid opcode: [#2] SMP KASAN ---[ end trace 1cbcbec2156680bc ]--- Reported-and-tested-by: syzbot+41a1b341571f0952b...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- fs/f2fs/in

[PATCH 1/5] f2fs: give message and set need_fsck given broken node id

2018-04-24 Thread Jaegeuk Kim
000 RIP: __get_node_page+0xb68/0x16e0 fs/f2fs/node.c:1185 RSP: 8801d960e820 ---[ end trace 4edbeb71f002bb76 ]--- Reported-and-tested-by: syzbot+d154ec99402c6f628...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 13 + fs/f2fs/inode.c | 13 ++-

[PATCH 5/5] f2fs: enforce fsync_mode=strict for renamed directory

2018-04-24 Thread Jaegeuk Kim
This is to give a option for user to be able to recover B/foo in the below case. mkdir A sync() rename(A, B) creat (B/foo) fsync (B/foo) ---crash--- Sugessted-by: Velayudhan Pillai Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH 3/5] f2fs: sanity check on sit entry

2018-04-24 Thread Jaegeuk Kim
- Reported-and-tested-by: syzbot+83699adeb2d13579c...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e4e8bdd645ee..20250b88bf51 100644 --- a/fs/f2fs/segment.c +++ b/fs

[PATCH 4/5] f2fs: sanity check for total valid blocks

2018-04-24 Thread Jaegeuk Kim
-tested-by: syzbot+0a725420475916460...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 13 + 1 file changed, 13 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 20250b88bf51..a55647f61232 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs

[PATCH 2/5] f2fs: avoid bug_on on corrupted inode

2018-04-24 Thread Jaegeuk Kim
c:238 [inline] RSP: 8801c44a70e8 RIP: f2fs_iget+0x3307/0x3ca0 fs/f2fs/inode.c:313 RSP: 8801c44a70e8 invalid opcode: [#2] SMP KASAN ---[ end trace 1cbcbec2156680bc ]--- Reported-and-tested-by: syzbot+41a1b341571f0952b...@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim --- fs/f2fs/in

Re: [PATCH v3] f2fs: rebuild nat_bits during umount

2019-03-01 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > Ping, > > Could you please try this new version? It's in the queue, and I'll test this after the next pull request. > > On 2019/2/17 6:26, Chao Yu wrote: > > From: Chao Yu > > > > If all free_nat_bitmap are available, we can rebuild nat_bits from > > free_nat_bitmap

Re: [PATCH v4] f2fs: add bio cache for IPU

2019-03-01 Thread Jaegeuk Kim
On 02/28, Chao Yu wrote: > Ping, Ditto. > > On 2019/2/19 16:15, Chao Yu wrote: > > SQLite in Wal mode may trigger sequential IPU write in db-wal file, after > > commit d1b3e72d5490 ("f2fs: submit bio of in-place-update pages"), we > > lost the chance of merging page in inner managed bio cache, r

Re: linux-next: build warning after merge of the block tree

2019-04-17 Thread Jaegeuk Kim
On 04/17, Chao Yu wrote: > Hi Jaegeuk, > > On 2019/4/17 10:31, Stephen Rothwell wrote: > > Hi all, > > > > After merging the block tree, today's linux-next build (x86_64 > > allmodconfig) produced this warning: > > > > fs/f2fs/node.c: In function 'f2fs_remove_inode_page': > > fs/f2fs/node.c:1193

Re: linux-next: build warning after merge of the block tree

2019-04-18 Thread Jaegeuk Kim
On 04/18, Chao Yu wrote: > On 2019/4/17 22:03, Jaegeuk Kim wrote: > > On 04/17, Chao Yu wrote: > >> Hi Jaegeuk, > >> > >> On 2019/4/17 10:31, Stephen Rothwell wrote: > >>> Hi all, > >>> > >>> After merging the block tree, to

[PATCH] f2fs: give random value to i_generation

2019-02-26 Thread Jaegeuk Kim
This follows to give random number to i_generation along with commit 232530680290b ("ext4: improve smp scalability for inode generation") This can be used for DUN for UFS HW encryption. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 2 -- fs/f2fs/namei.c | 3 ++- fs/f2fs/super.

Re: [f2fs-dev] [PATCH] f2fs: don't clear CP_QUOTA_NEED_FSCK_FLAG

2019-02-26 Thread Jaegeuk Kim
On 02/22, Chao Yu wrote: > On 2019/2/22 10:40, Jaegeuk Kim wrote: > > On 02/20, Chao Yu wrote: > >> On 2019/2/20 15:25, Chao Yu wrote: > >>> On 2019/2/20 15:08, Jaegeuk Kim wrote: > >>>> On 02/18, Chao Yu wrote: > >>>>> On 2019/

[PATCH] f2fs: give a warning only for readonly partition

2021-02-12 Thread Jaegeuk Kim
Let's allow mounting readonly partition. We're able to recovery later once we have it as read-write back. Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 4aa533cb4340..30

[GIT PULL] f2fs update for 5.12-rc1

2021-02-17 Thread Jaegeuk Kim
f2fs: clean up post-read processing libfs: unexport generic_ci_d_compare() and generic_ci_d_hash() Jack Qiu (1): f2fs: remove unused stat_{inc, dec}_atomic_write Jaegeuk Kim (5): f2fs: handle unallocated section and zone on pinned/atgc f2fs: deprecate f2fs_trace_

Re: [f2fs-dev] [PATCH v3 1/5] f2fs: compress: add compress_inode to cache compressed blocks

2021-01-28 Thread Jaegeuk Kim
On 01/28, Chao Yu wrote: > On 2021/1/22 10:17, Chao Yu wrote: > > > No, it seems this is not the case. > > Oops, could you please help to remove all below codes and do the test again > > to check whether they are the buggy codes? as I doubt there is > > use-after-free > > bug. > > Any test result

Re: [PATCH v2] f2fs: fix to keep isolation of atomic write

2021-01-28 Thread Jaegeuk Kim
On 01/20, Chao Yu wrote: > On 2021/1/20 3:06, Jaegeuk Kim wrote: > > On 01/15, Chao Yu wrote: > > > On 2021/1/15 5:53, Jaegeuk Kim wrote: > > > > On 12/30, Chao Yu wrote: > > > > > ThreadA ThreadB > > &g

Re: [f2fs-dev] [PATCH] f2fs: fix checkpoint mount option wrong combination

2021-02-01 Thread Jaegeuk Kim
On 02/01, Daeho Jeong wrote: > Actually, I think we need to select one among them, disable, enable > and merge. I realized my previous understanding about that was wrong. > In that case of "checkpoint=merge,checkpoint=enable", the last option > will override the ones before that. > This is how the

Re: [PATCH] f2fs: prevent setting ioprio of thread not in merge mode

2021-02-01 Thread Jaegeuk Kim
Thanks. Merged into the original patch. On 02/01, Daeho Jeong wrote: > From: Daeho Jeong > > It causes a crash to change the ioprio of checkpoint thread not in > checkpoint=merge. I fixed that to prevent setting the ioprio of the > thread when checkpoint=merge is not enabled. > > Signed-off-by:

Re: [f2fs-dev] [PATCH v2] f2fs: rename checkpoint=merge mount option to checkpoint_merge

2021-02-01 Thread Jaegeuk Kim
On 02/02, Daeho Jeong wrote: > From: Daeho Jeong > > As checkpoint=merge comes in, mount option setting related to checkpoint > had been mixed up and it became hard to understand. So, I separated > this option from "checkpoint=" and made another mount option > "checkpoint_merge" for this. Thanks

[PATCH] f2fs: don't grab superblock freeze for flush/ckpt thread

2021-02-08 Thread Jaegeuk Kim
__percpu_down_read+0x56/0x70 issue_checkpoint_thread+0x12c/0x160 [f2fs] ? wait_woken+0x80/0x80 kthread+0x114/0x150 ? __checkpoint_and_complete_reqs+0x110/0x110 [f2fs] ? kthread_park+0x90/0x90 ret_from_fork+0x22/0x30 Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 4 fs/f2fs

Re: [PATCH] Revert "f2fs: fix quota_sync failure due to f2fs_lock_op"

2020-05-30 Thread Jaegeuk Kim
On 05/30, Chao Yu wrote: > On 2020/5/30 9:49, Jaegeuk Kim wrote: > > On 05/30, Chao Yu wrote: > >> On 2020/5/30 6:34, Jaegeuk Kim wrote: > >>> On 05/29, Chao Yu wrote: > >>>> Under heavy fsstress, we may triggle panic while issuing discard, > >&g

Re: [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint

2020-07-29 Thread Jaegeuk Kim
On 07/29, Chao Yu wrote: > On 2020-7-29 15:02, Jaegeuk Kim wrote: > > f2fs_write_data_pages(quota_mapping) > > __f2fs_write_data_pages f2fs_write_checkpoint > > * blk_start_plug(&plug); > > * add bio in write_io[DATA] > >

[GIT PULL] f2fs update for 5.9-rc1

2020-08-10 Thread Jaegeuk Kim
ic names for generic ioctls Jack Qiu (4): f2fs: get the right gc victim section when section has several segments f2fs: space related cleanup f2fs: correct comment of f2fs_exist_written_data f2fs: use macro instead of f2fs verity version Jaegeuk Kim (5): f2fs: avoid c

[PATCH] scsi: ufs: should not override buffer lengh

2021-01-10 Thread Jaegeuk Kim
From: Jaegeuk Kim Kernel stack violation when getting unit_descriptor/wb_buf_alloc_units from rpmb lun. The reason is the unit descriptor length is different per LU. The lengh of Normal LU is 45, while the one of rpmb LU is 35. int ufshcd_read_desc_param(struct ufs_hba *hba

Re: [PATCH] scsi: ufs: should not override buffer lengh

2021-01-11 Thread Jaegeuk Kim
On 01/11, Can Guo wrote: > On 2021-01-11 16:15, Avri Altman wrote: > > > > > > Sorry, typo corrected. > > > > > > Hi Jaegeuk, > > > > > > I think the problem is that func ufshcd_read_desc_param() is not > > > expecting > > > one access unsupported descriptors on RPMB LU. > > Correct. > > This is

[PATCH v2] scsi: ufs: WB is not allowed in RPMB_LUN

2021-01-11 Thread Jaegeuk Kim
From: Jaegeuk Kim Kernel stack violation when getting unit_descriptor/wb_buf_alloc_units from rpmb lun. The reason is the unit descriptor length is different per LU. The lengh of Normal LU is 45, while the one of rpmb LU is 35. int ufshcd_read_desc_param(struct ufs_hba *hba

Re: [f2fs-dev] [PATCH 1/2] f2fs: introduce checkpoint=merge mount option

2021-01-11 Thread Jaegeuk Kim
On 01/11, Daeho Jeong wrote: > From: Daeho Jeong > > We've added a new mount option "checkpoint=merge", which creates a > kernel daemon and makes it to merge concurrent checkpoint requests as > much as possible to eliminate redundant checkpoint issues. Plus, we > can eliminate the sluggish issue

Re: [PATCH v3 1/5] f2fs: compress: add compress_inode to cache compressed blocks

2021-01-11 Thread Jaegeuk Kim
Hi Chao, After quick test of fsstress w/ fault injection, it gave wrong block address errors. Could you please run the test a bit? Thanks, On 01/07, Chao Yu wrote: > Support to use address space of inner inode to cache compressed block, > in order to improve cache hit ratio of random read. > >

Re: [f2fs-dev] [PATCH 1/2] f2fs: introduce checkpoint=merge mount option

2021-01-11 Thread Jaegeuk Kim
On 01/11, Daeho Jeong wrote: > From: Daeho Jeong > > We've added a new mount option "checkpoint=merge", which creates a > kernel daemon and makes it to merge concurrent checkpoint requests as > much as possible to eliminate redundant checkpoint issues. Plus, we > can eliminate the sluggish issue

Re: [PATCH v2] scsi: ufs: WB is not allowed in RPMB_LUN

2021-01-11 Thread Jaegeuk Kim
On 01/11, Avri Altman wrote: > > static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info > > *dev_info, > > - u8 lun) > > + u8 lun, u8 param_offset) > > { > > if (!dev_info || !dev_info->max_lu_supported) { > > pr_err("Max General LU

[PATCH v3] scsi: ufs: WB is only available on LUN #0 to #7

2021-01-11 Thread Jaegeuk Kim
From: Jaegeuk Kim Kernel stack violation when getting unit_descriptor/wb_buf_alloc_units from rpmb lun. The reason is the unit descriptor length is different per LU. The lengh of Normal LU is 45, while the one of rpmb LU is 35. int ufshcd_read_desc_param(struct ufs_hba *hba

Re: [f2fs-dev] [PATCH v2] f2fs: fix to keep isolation of atomic write

2021-01-11 Thread Jaegeuk Kim
On 01/06, Jaegeuk Kim wrote: > On 01/06, Jaegeuk Kim wrote: > > Hi Chao, > > > > With a quick test, this patch causes down_write failure resulting in > > blocking > > process. I didn't dig in the bug so, please check the code again. :P > > nvm. I c

Re: [f2fs-dev] [PATCH v3 1/5] f2fs: compress: add compress_inode to cache compressed blocks

2021-01-11 Thread Jaegeuk Kim
On 01/12, Chao Yu wrote: > On 2021/1/11 19:45, Chao Yu wrote: > > On 2021/1/11 18:31, Chao Yu wrote: > > > On 2021/1/11 17:48, Jaegeuk Kim wrote: > > > > Hi Chao, > > > > > > > > After quick test of fsstress w/ fault injection, it gave wrong b

Re: [f2fs-dev] [PATCH v3 2/3] f2fs-tools:sload.f2fs compression support

2020-12-10 Thread Jaegeuk Kim
On 12/10, 徐瑞斌 wrote: > Hi, Jaegeuk, > > I comment here the patch your provided (3 parts, since the patch contains 3 > fixes): > 1. + dn->data_blkaddr = blkaddr; > ret = reserve_new_block(sbi, &dn->data_blkaddr, &sum, type, 0); > > We cannot assign dn->data_blkaddr here. The old on

Re: [f2fs-dev] [PATCH v3 2/3] f2fs-tools:sload.f2fs compression support

2020-12-10 Thread Jaegeuk Kim
Chao and Robin, I refactored the patch to modify the names and structures. Please take a look at this. https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?h=dev&id=5cd8e5fcc79611c0692f18c7e7e13d6b4742d3c0 On 12/10, Jaegeuk Kim wrote: > On 12/10, 徐瑞斌 wrote:

Re: [f2fs-dev] [PATCH] fs: f2fs: fix potential shift-out-of-bounds error in sanity_check_raw_super()

2020-12-10 Thread Jaegeuk Kim
On 12/10, Chao Yu wrote: > Jaegeuk, > > Could you please help to add signed-off of Anant manually in > > f2fs: fix shift-out-of-bounds in sanity_check_raw_super() Done. Thank you guys. :) > > Thanks, > > On 2020/12/10 10:14, Anant Thazhemadam wrote: > > > > On 10/12/20 7:40 am, Chao Yu wrote

Re: [PATCH RFC] f2fs: compress: add compress_flag in struct f2fs_comp_option

2020-12-10 Thread Jaegeuk Kim
On 12/10, Chao Yu wrote: > Add a extra field compress_flag to get/set more compress option from/to > compressed inode. > > Signed-off-by: Chao Yu > --- > > Daeho, Jaegeuk, > > Could you please check whether we could add this new field to struct > f2fs_comp_option? so we can expand to allow user

[PATCH] scsi: ufs: fix memory boundary check for UFS 3.0

2020-12-11 Thread Jaegeuk Kim
From: Jaegeuk Kim If param_offset is greater than what UFS supports, it'll give kernel panic. Signed-off-by: Jaegeuk Kim Change-Id: I48ea6f3f3074bd42abf4ecf8be87806732f3e6a3 --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshc

Re: [PATCH] scsi: ufs: fix memory boundary check for UFS 3.0

2020-12-11 Thread Jaegeuk Kim
On 12/11, Eric Biggers wrote: > On Fri, Dec 11, 2020 at 11:38:14AM -0800, Jaegeuk Kim wrote: > > From: Jaegeuk Kim > > > > If param_offset is greater than what UFS supports, it'll give kernel panic. > > > > Signed-off-by: Jaegeuk Kim > > Change-I

Re: [PATCH] scsi: ufs: fix livelock of ufshcd_clear_ua_wluns

2020-12-21 Thread Jaegeuk Kim
On 12/21, Can Guo wrote: > On 2020-12-18 11:31, Jaegeuk Kim wrote: > > When gate_work/ungate_work gets an error during hibern8_enter or exit, > > ufshcd_err_handler() > >ufshcd_scsi_block_requests() > >ufshcd_reset_and_restore() > >

<    2   3   4   5   6   7   8   9   10   11   >