[PATCH 1/3] f2fs: fix the use of XATTR_NODE_OFFSET

2013-08-08 Thread Jaegeuk Kim
This patch fixes the use of XATTR_NODE_OFFSET. o The offset should not use several MSB bits which are used by marking node blocks. o IS_DNODE should handle XATTR_NODE_OFFSET to avoid potential abnormality during the fsync call. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 12

[PATCH 2/3] f2fs: fix inconsistency between xattr node blocks and its inode

2013-08-08 Thread Jaegeuk Kim
fsync when a file has a modified xattr node block. This approach is able to degrade the performance, but normally the checkpoint overhead is shown at the initial fsync call after the xattr entry changes. Once the checkpoint is done, no additional overhead would be occurred. Signed-off-by: J

Re: [PATCH] f2fs: add the missing delection of orphan inode entry in write_orphan_inodes()

2013-07-22 Thread Jaegeuk Kim
gt; + sbi->n_orphans--; NAK. We should not release them here. Only f2fs_evict_inode can do it. > } > if (!page) > goto end; -- Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message t

Re: [PATCH] f2fs: update file name in the inode block during f2fs_rename

2013-07-22 Thread Jaegeuk Kim
Hi Al, 2013-07-19 (금), 08:49 +0100, Al Viro: > On Fri, Jul 19, 2013 at 12:40:47PM +0900, Kim Jaegeuk wrote: > > Hi, > > > > 2013. 7. 18. 6:22?? "Al Viro" : > > > > > > On Thu, Jul 18, 2013 at 06:11:23PM +0900, Jaegeu

[PATCH] f2fs: fix i_name during f2fs_sync_file

2013-07-23 Thread Jaegeuk Kim
As similar as the i_pino fix, i_name also should be fixed when i_nlink is 1. The errorneous scenario is like this. 1. touch test1 2. link test1 test2 3. unlink test2 4. fsync test1 After this, i_name should be test1. CC: Al Viro Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 10

[PATCH 1/2] f2fs: check the free space first in new_node_page

2013-08-12 Thread Jaegeuk Kim
Let's check the free space in prior to the main process of allocating a new node page. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index bb8fbda..858a333 100644 --- a/fs

[PATCH 2/2] f2fs: should cover i_xattr_nid with its xattr node page lock

2013-08-12 Thread Jaegeuk Kim
' At this moment, the checkpoint stores inconsistent data where the inode has i_xattr_nid but actual xattr node block is not allocated yet. So, we should assign the real i_xattr_nid only after its xattr node block is allocated. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 3 +++ f

Re: [PATCH 1/5] f2fs: change victim segmap test condition in get_victim_by_default

2013-03-02 Thread Jaegeuk Kim
_GC all the time. Thanks, > continue; > if (IS_CURSEC(sbi, GET_SECNO(sbi, segno))) > continue; -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH 3/5] f2fs: move f2fs_balance_fs to correct place in unlink

2013-03-02 Thread Jaegeuk Kim
page. > f2fs_delete_entry(de, page, inode); > > /* In order to evict this inode, we set it dirty */ -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH 4/5] f2fs: align f2fs maximum name length to linux based filesystem

2013-03-02 Thread Jaegeuk Kim
We should not change the on-disk layout. Instead, simply we can deal with it by changing original condition check like below. --- From ccc2546eded1efd2d6ed98f8aee7d7ce247cb4a2 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Sun, 3 Mar 2013 13:58:05 +0900 Subject: [PATCH] f2fs: align f2fs

[PATCH 1/2] f2fs: fix inconsistency of block count during recovery

2013-05-14 Thread Jaegeuk Kim
[] do_notify_resume+0x71/0xb0 [] int_signal+0x12/0x17 Reported-by: Chris Fries Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3df43b4..9641534 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1492,6

[PATCH 2/2] f2fs: fix the inconsistent state of data pages

2013-05-14 Thread Jaegeuk Kim
order to avoid that, this patch fixes the lock order of node and data blocks in which the node block lock is covered by the data block lock. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs

Re: [PATCH 1/2] f2fs: fix inconsistency of block count during recovery

2013-05-14 Thread Jaegeuk Kim
; > inc_valid_inode_count(sbi); > > > > -- > > 1.8.1.3.566.gaa39828 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > > the body of a message to majord...@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH 2/2] f2fs: fix the inconsistent state of data pages

2013-05-14 Thread Jaegeuk Kim
2013-05-15 (수), 13:04 +0900, Namjae Jeon: > 2013/5/15, Jaegeuk Kim : > > In get_lock_data_page, if there is a data race between get_dnode_of_data > > for > > node and grab_cache_page for data, f2fs is able to face with the following > > BUG_ON(dn.data_blkaddr == NEW_A

Re: [PATCH] F2FS: Fix the logic of IS_DNODE()

2013-04-07 Thread Jaegeuk Kim
if (!((long int)ofs % (NIDS_PER_BLOCK + 1))) Great catch! I'll apply this. Thank you. > return false; > } > return true; -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

[PATCH] f2fs: write checkpoint before starting FG_GC

2013-04-08 Thread Jaegeuk Kim
In order to be aware of prefree and free sections during FG_GC, let's start with write_checkpoint(). Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 83cec8f..37b05e1 100644 --- a/fs/f2fs

Re: [PATCH] f2fs: move f2fs_balance_fs from truncate to punch_hole

2013-04-09 Thread Jaegeuk Kim
struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); > + > + f2fs_balance_fs(sbi); > > blk_start = pg_start << PAGE_CACHE_SHIFT; > blk_end = pg_end << PAGE_CACHE_SHIFT; > -- 1.8.0 -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH] f2fs: move f2fs_balance_fs from truncate to punch_hole

2013-04-09 Thread Jaegeuk Kim
Hrycay > Hi, > With the latest commit 9995bf953a83749abd9fa22f72ab2b0be341025a > About introducing the global locking method in ‘f2fs’, > I think we no longer will have a case of deadlock happening in this path. Hi, Namjae. I found that this bug still exists in the new locking model. Please see the v3 patch. :) Thanks, > > Thanks. -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH v3] f2fs: introduce a new global lock scheme

2013-04-09 Thread Jaegeuk Kim
Chang log from v2: o resolve a deadlock path [ilock count][call path] 1 0 f2fs_unlink 0- truncate_hole 0 - try to grab ilock (wait) From 66b15368995b7218a37f589b9ada0c63794c4dc6 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim

Re: [PATCH v3 0/7] f2fs: add tracepoints support in f2fs filesystem

2013-04-09 Thread Jaegeuk Kim
ize) f2fs_write_begin [enter] (dev,ino,pos,len,flags) 7. patch 7/7: write_checkpoint_before_blockop [before block_operations()] (dev,is_mount,"try to block operations") write_checkpoint_after_blockop [after block_operations()] (dev,is_mount,"done block operations") write_checkpoint_exit [exit] (dev,is_mount,"done checkpoint") > > > > > Acked-by: Steven Rostedt > > > > -- Steve > > > > > > -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [PATCH v3] f2fs: use f2fs_iget_nowait again

2013-04-30 Thread Jaegeuk Kim
change log from v2: o slighly change the previous approach From 42e49df33bacafc20434e39fc127c9722c9f8691 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 30 Apr 2013 11:33:27 +0900 Subject: [PATCH] f2fs: avoid deadlock during evict after f2fs_gc Cc: linux-fsde...@vger.kernel.org, linux

Re: [PATCH 4/4] f2fs: optimize build_free_nids()

2013-05-07 Thread Jaegeuk Kim
> 2 * MAX_FREE_NIDS) > + break; Could you explain when this can happen? IMO, this is an unnecessary condition check, since the below condition that includes FREE_NID_PAGES already limits the number of free nids. Thanks, > if (i++ == FREE_NID_

Re: [PATCH 3/4] f2fs: optimize scan_nat_page()

2013-05-07 Thread Jaegeuk Kim
04474c06f319 Mon Sep 17 00:00:00 2001 From: Haicheng Li Date: Mon, 6 May 2013 23:15:43 +0800 Subject: [PATCH] f2fs: optimize scan_nat_page() Cc: linux-fsde...@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-de...@lists.sourceforge.net When nm_i->fcnt > 2 * MAX_FREE_NIDS, stop scanning o

[PATCH 1/2] f2fs: cover free_nid management with spin_lock

2013-05-07 Thread Jaegeuk Kim
, &nm_i->free_nid_list, list). But, this is not covered by free_nid_list_lock, resulting in null pointer bug. This patch moves this checking routine inside add_free_nid() in order not to use the spin_lock. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 34 ++

[PATCH 2/2] f2fs: remove alloc_nid_done/fail for performance

2013-05-07 Thread Jaegeuk Kim
ff-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 2 -- fs/f2fs/namei.c | 15 fs/f2fs/node.c | 76 + fs/f2fs/node.h | 6 - fs/f2fs/xattr.c | 2 -- 5 files changed, 17 insertions(+), 84 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs

Re: [PATCH 2/2] f2fs: remove alloc_nid_done/fail for performance

2013-05-07 Thread Jaegeuk Kim
Sorry, please ignore this patch. 2013-05-08 (수), 09:56 +0900, Jaegeuk Kim: > This mechanism revealed two issues: bug and performance. > > Now, iput() doesn't guarantee that the inode is freed completely due to the > linked f2fs_drop_inode(). > So, in the case of failure on

[GIT PULL] f2fs updates for v3.10

2013-05-07 Thread Jaegeuk Kim
build_free_nids() f2fs: optimize scan_nat_page() Jaegeuk Kim (35): f2fs: fix to unlock node page when it was truncated f2fs: read with READ_SYNC when getting dnode page f2fs: introduce readahead mode of node pages f2fs: align f2fs maximum name length to linux based filesy

Re: [PATCH 4/4] f2fs: optimize build_free_nids()

2013-05-08 Thread Jaegeuk Kim
2013-05-08 (수), 14:24 +0800, Haicheng Li: > On Tue, May 07, 2013 at 07:33:59PM +0900, Jaegeuk Kim wrote: > > 2013-05-06 (월), 23:15 +0800, Haicheng Li: > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > > index 1fe3fe2..3136224 100644 > > > --- a/fs/f2

Re: [GIT PULL v2] f2fs updates for v3.10

2013-05-08 Thread Jaegeuk Kim
ix inconsistent using of NM_WOUT_THRESHOLD f2fs: remove useless #include as we're now using sysfs as debug entry. f2fs: bugfix for alloc_nid_failed() f2fs: code cleanup for scan_nat_page() and build_free_nids() f2fs: optimize scan_nat_page() Jaegeuk Kim (35):

Re: [PATCH 2/2] f2fs: add REQ_META about metadata requests for submit bio

2013-04-24 Thread Jaegeuk Kim
tch as above your comment ? I can handle it. :) Thanks, > > Thanks. > >> > >>> + rw |= REQ_META; > >>> + > >>> if (sbi->bio[btype]) { > >>> struct bio_private *p = sbi->bio[btype]->bi_private; > >>>

[PATCH] f2fs: give a chance to merge IOs by IO scheduler

2013-04-24 Thread Jaegeuk Kim
,16 R () 1521688 + 144 [0] : block_rq_complete: 8,16 R () 1522128 + 192 [0] : block_rq_complete: 8,16 R () 1523256 + 328 [0] ... Note that this issue should be addressed in checkpoint, and some readahead flows too. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 5 + fs/f2fs/d

[PATCH] f2fs: avoid frequent background GC

2013-04-24 Thread Jaegeuk Kim
If there is no victim segments selected by background GC, let's wait a little bit longer time to collect dirty segments. By default, let's give 10 minutes. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.h

Re: [PATCH v2] f2fs: avoid frequent background GC

2013-04-25 Thread Jaegeuk Kim
Hi, Namjae, Agreed. How about this? Chang log from v1: o change timings - min 30s, max 60s, nogc 5 min o remove nonreachable routine o consider NOGC_SLEEP_TIME in increate/decrease_sleep_time From 806e344624414fcf9fc87f6193265859027d51b5 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed

[PATCH 1/3] f2fs: check nid == 0 in add_free_nid

2013-04-25 Thread Jaegeuk Kim
It is more obvious that add_free_nid checks whether the free nid is zero or not. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a0aa044..c8f48d4 100644 --- a/fs/f2fs/node.c +++ b/fs

[PATCH 3/3] f2fs: enhnace alloc_nid and build_free_nids flows

2013-04-25 Thread Jaegeuk Kim
urnal nat entries, and nat cache entries. We should consider carefullly not to serve free nids intermediately made by build_free_nids. We can get stable free nids only after build_free_nids is done. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 2 +- fs/f2fs/node.c

[PATCH 2/3] f2fs: add a tracepoint on f2fs_new_inode

2013-04-25 Thread Jaegeuk Kim
This can help when debugging the free nid allocation flows. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 3 ++- include/trace/events/f2fs.h | 7 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index c57fd18..4aa26e5 100644

Re: [PATCH 1/2] f2fs: reorganize f2fs_vm_page_mkwrite

2013-04-28 Thread Jaegeuk Kim
) << PAGE_CACHE_SHIFT) > i_size_read(inode)) { > @@ -90,7 +88,9 @@ static int f2fs_vm_page_mkwrite(struct vm_area_struct *vma, > set_page_dirty(page); > SetPageUptodate(page); > > - file_update_time(vma->vm_file); > +mapped: > + /* fill the page

[PATCH] f2fs: check truncation of mapping after lock_page

2013-04-29 Thread Jaegeuk Kim
We call lock_page when we need to update a page after readpage. Between grab and lock page, the page can be truncated by other thread. So, we should check the page after lock_page whether it was truncated or not. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 4 fs/f2fs/data.c

[PATCH] f2fs: use f2fs_iget_nowait again

2013-04-29 Thread Jaegeuk Kim
k The above three threads are able to incur deadlock condition. In order to address this issue, let's use f2fs_iget_nowait again in f2fs_gc so that thread 2 doesn't need to wait for inode->i_lock. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 1 + fs/f2fs/gc.c| 2 +- f

[PATCH] f2fs: modify the number of issued pages to merge IOs

2013-04-29 Thread Jaegeuk Kim
bio_get_nr_vecs, so this patch replace it with max_hw_blocks using queue_max_sectors. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c| 6 ++ fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 11 +++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs

Re: [PATCH] f2fs: use f2fs_iget_nowait again

2013-04-29 Thread Jaegeuk Kim
change log from v1: o found another deadlock case, so change the approach From 145b6ee0b2523bad0e28c09f4ac5bb050cd22085 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Tue, 30 Apr 2013 11:33:27 +0900 Subject: [PATCH] f2fs: avoid deadlock during evict after f2fs_gc Cc: linux-fsde

[PATCH 1/2] f2fs: remove unnecessary kmap/kunmap operations

2013-05-19 Thread Jaegeuk Kim
The allocated page used by the recovery is not on HIGHMEM, so that we don't need to use kmap/kunmap. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 774efdb..5f

[PATCH 2/2] f2fs: fix to unlock page before exit

2013-05-19 Thread Jaegeuk Kim
If we got an error after lock_page, we should unlock it before exit. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 5fcdd08..edb89a3 100644 --- a/fs/f2fs/recovery.c +++ b/fs

[PATCH 07/15] f2fs: change get_new_data_page to pass a locked node page

2013-05-19 Thread Jaegeuk Kim
This patch is for passing a locked node page to get_dnode_of_data. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 12 +++- fs/f2fs/dir.c | 4 ++-- fs/f2fs/f2fs.h | 2 +- fs/f2fs/file.c | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs

[PATCH 09/15] f2fs: add debug msgs in the recovery routine

2013-05-19 Thread Jaegeuk Kim
This patch adds some trivial debugging messages in the recovery process. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 1 - fs/f2fs/recovery.c | 44 +--- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs

[PATCH 04/15] f2fs: fix BUG_ON during f2fs_evict_inode(dir)

2013-05-19 Thread Jaegeuk Kim
whole recovery process. And then, write_checkpoint flushes all the dirty dentry blocks, and nicely we can put the stale dir inodes from the dirty_dir_inode_list. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 23 +++ fs/f2fs/f2fs.h | 2 ++ fs/f2fs/recovery.c

[PATCH 08/15] f2fs: update inode page after creation

2013-05-19 Thread Jaegeuk Kim
curs the zero-valued i_pino during the recovery. So, this patch modifies the creation flow to fix the synchronization order of inode page with its inode. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 1 + fs/f2fs/dir.c | 85 +++--- fs/f2fs/f2f

[PATCH 06/15] f2fs: skip get_node_page if locked node page is passed

2013-05-19 Thread Jaegeuk Kim
If get_dnode_of_data gets a locked node page, let's skip redundant get_node_page calls. This is for the futher enhancement. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 96

[PATCH 03/15] f2fs: fix por_doing variable coverage

2013-05-19 Thread Jaegeuk Kim
The reason of using sbi->por_doing is to alleviate data writes during the recovery. The find_fsync_dnodes() produces some dirty dentry pages, so we should cover it too with sbi->por_doing. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH 05/15] f2fs: remove unnecessary por_doing check

2013-05-19 Thread Jaegeuk Kim
This por_doing check is totally not related to the recovery process. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 47abc97..729b285 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c

[PATCH 01/15] f2fs: remove redundant assignment

2013-05-19 Thread Jaegeuk Kim
We don't need to assign a value redundantly. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 60c8a50..2941987 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recov

[PATCH 02/15] f2fs: remove unnecessary flag set

2013-05-19 Thread Jaegeuk Kim
If an inode is recovered with its dentry, it will not invoke __f2fs_add_link, since the recovery routine checks its dentry before calling __f2fs_add_link. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/f2fs

Re: [PATCH 02/15] f2fs: remove unnecessary flag set

2013-05-20 Thread Jaegeuk Kim
Sorry for the noise. This patch should be ignored. Thanks, 2013-05-20 (월), 12:32 +0900, Jaegeuk Kim: > If an inode is recovered with its dentry, it will not invoke __f2fs_add_link, > since the recovery routine checks its dentry before calling __f2fs_add_link. > > Signed-off-by:

[PATCH 1/3] f2fs: avoid RECLAIM_FS-ON-W: deadlock

2013-05-20 Thread Jaegeuk Kim
s_truncate+0x5c/0xa0 [] SyS_truncate+0xe/0x10 [] system_call_fastpath+0x16/0x1b Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 4 ++-- fs/f2fs/inode.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c320f7f..1644fff 100644 ---

[PATCH 3/3] f2fs: fix wrong condition check

2013-05-20 Thread Jaegeuk Kim
sue. Signed-off-by: Jaegeuk Kim --- fs/f2fs/inode.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index a18946e..b44a4c1 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -109,12 +109,6 @@ struct inode *f2fs_iget(struct super_block *sb, unsigned long

[PATCH 2/3] f2fs: add f2fs_readonly()

2013-05-20 Thread Jaegeuk Kim
Introduce a simple macro function for readability. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 5 + fs/f2fs/file.c | 2 +- fs/f2fs/super.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 9182b27..6594ce1 100644 --- a/fs/f2fs

[PATCH 1/2] f2fs: reuse the locked dnode page and its inode

2013-05-21 Thread Jaegeuk Kim
ion check for the reuse of locked direct node pages prior to the get_node_page call. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 1 + fs/f2fs/file.c | 2 +- fs/f2fs/recovery.c | 26 +- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/f2f

[PATCH 2/2] f2fs: fix to handle do_recover_data errors

2013-05-21 Thread Jaegeuk Kim
This patch adds error handling codes of check_index_in_prev_nodes and its caller, do_recover_data. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index

[PATCH 1/2] f2fs: should not make_bad_inode on f2fs_link failure

2013-05-21 Thread Jaegeuk Kim
If -ENOSPC is met during f2fs_link, we should not make the inode as bad. The inode is still alive. Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 729b285..71aa305 100644 --- a/fs/f2fs/namei.c +++ b/fs

[PATCH 2/2] f2fs: use ihold

2013-05-21 Thread Jaegeuk Kim
Use the following helper function committed by Al. commit 7de9c6ee3ecffd99e1628e81a5ea5468f7581a1f Author: Al Viro Date: Sat Oct 23 11:11:40 2010 -0400 new helper: ihold() ... Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH 2/2] f2fs: add sysfs support for controlling the gc_thread

2013-05-26 Thread Jaegeuk Kim
lock[i]); > mutex_init(&sbi->node_write); > sbi->por_doing = 0; > + sbi->forced_fg = 0; > spin_lock_init(&sbi->stat_lock); > init_rwsem(&sbi->bio_sem); > init_sb_info(sbi); > @@ -691,6 +826,14 @@ static int f2fs_fill_super(struct super_block *sb, void > *data, int silent) > "the device does not support discard"); > } > > + sbi->s_kobj.kset = f2fs_kset; > + init_completion(&sbi->s_kobj_unregister); > + err = kobject_init_and_add(&sbi->s_kobj, &f2fs_ktype, NULL, > + "%s", sb->s_id); > + if (err) > + goto fail; > + > + > return 0; > fail: > stop_gc_thread(sbi); > @@ -765,6 +908,9 @@ static int __init init_f2fs_fs(void) > err = create_checkpoint_caches(); > if (err) > goto fail; > + f2fs_kset = kset_create_and_add("f2fs", NULL, fs_kobj); > + if (!f2fs_kset) > + goto fail; > err = register_filesystem(&f2fs_fs_type); > if (err) > goto fail; > @@ -781,6 +927,7 @@ static void __exit exit_f2fs_fs(void) > destroy_gc_caches(); > destroy_node_manager_caches(); > destroy_inodecache(); > + kset_unregister(f2fs_kset); > } > > module_init(init_f2fs_fs) -- Jaegeuk Kim Samsung signature.asc Description: This is a digitally signed message part

Re: [GIT PULL v2] f2fs updates for v3.10

2013-05-26 Thread Jaegeuk Kim
; The most notable one is PostgreSQL pgbench v8.4.11 > Transactions per second: 3032 in kernel 3.9 > down to 832 in kernel 3.10-rc1 > > On Wed, May 8, 2013 at 2:10 PM, Jaegeuk Kim wrote: > > Hi Linus, > > > > I've rebased one of patches, so could you consider the foll

[PATCH 1/3] f2fs: iput only if whole data blocks are flushed

2013-05-27 Thread Jaegeuk Kim
If there remains some unwritten blocks from the recovery, we should not call iput on that directory inode. Otherwise, we can loose some dentry blocks after the recovery. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[PATCH 2/3] f2fs: fix dentry recovery routine

2013-05-27 Thread Jaegeuk Kim
and its inode and then recover newly created dentry. Signed-off-by: Jaegeuk Kim --- fs/f2fs/recovery.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 0dd2ce1..85f5e54 100644 --- a/fs/f2fs/recovery.c +++ b

[PATCH 3/3] f2fs: fix incorrect iputs during the dentry recovery

2013-05-27 Thread Jaegeuk Kim
- write_chekcpoint If *dir*'s i_count is not 1 (i.e., root dir), remove_dirty_dir_inode is called later and then iput is triggered again due to the FI_DELAY_IPUT flag. So, let's unset the flag properly once iput is triggered. Signed-off-by: Jaegeuk Kim --- fs/f2fs/ch

Re: [PATCH 2/2] f2fs: add sysfs support for controlling the gc_thread

2013-05-27 Thread Jaegeuk Kim
Hi, 2013-05-27 (월), 13:45 +0900, Namjae Jeon: > 2013/5/27, Jaegeuk Kim : > > Hi Namjae, > Hi Jaegeuk. > > First, Thanks for your interest. > > > > This is an interesting functionality. > > Could you describe why and when we need to do this? > > What

Re: [PATCH 2/4] f2fs: do not skip writing file meta during fsync

2013-03-26 Thread Jaegeuk Kim
2013-03-26 (화), 09:48 +0900, Namjae Jeon: > 2013/3/25, Jaegeuk Kim : > > This patch removes data_version check flow during the fsync call. > > The original purpose for the use of data_version was to avoid writng inode > > pages redundantly by the fsync calls repeatedly. >

Re: [PATCH 2/4] f2fs: do not skip writing file meta during fsync

2013-03-26 Thread Jaegeuk Kim
2013-03-27 (수), 09:57 +0900, Namjae Jeon: > 2013/3/27, Jaegeuk Kim : > > 2013-03-26 (화), 09:48 +0900, Namjae Jeon: > >> 2013/3/25, Jaegeuk Kim : > >> > This patch removes data_version check flow during the fsync call. > >> > The original purpose for t

[PATCH 2/9] f2fs: introduce TOTAL_SECS macro

2013-03-31 Thread Jaegeuk Kim
Let's use a macro to get the total number of sections. Signed-off-by: Jaegeuk Kim --- fs/f2fs/debug.c | 7 +++ fs/f2fs/segment.c | 19 +-- fs/f2fs/segment.h | 1 + 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c

[PATCH 6/9] f2fs: check completion of foreground GC

2013-03-31 Thread Jaegeuk Kim
The foreground GCs are triggered under not enough free sections. So, we should not skip moving valid blocks in the victim segments. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 46 ++ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/fs

[PATCH 9/9] f2fs: fix the bitmap consistency of dirty segments

2013-03-31 Thread Jaegeuk Kim
. However, the SSR mode selects victims freely from any log types, which can set multiple bits across the various bitmap types. So, this patch eliminates this inconsistency. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions

[PATCH 8/9] f2fs: avoid race for summary information

2013-03-31 Thread Jaegeuk Kim
In order to do GC more reliably, I'd like to lock the vicitm summary page until its GC is completed, and also prevent any checkpoint process. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c| 8 +--- fs/f2fs/node.c | 2 +- fs/f2fs/super.c | 7 +-- 3 files changed, 7 insertions(+

[PATCH 7/9] f2fs: allocate remained free segments in the LFS mode

2013-03-31 Thread Jaegeuk Kim
This patch adds a new condition that allocates free segments in the current active section even if SSR is needed. Otherwise, f2fs cannot allocate remained free segments in the section since SSR finds dirty segments only. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 13 + 1

[PATCH 1/9] f2fs: do not use duplicate names in a macro

2013-03-31 Thread Jaegeuk Kim
A macro should not use duplicate parameter names. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index e399bd4..c0d7740 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs

[PATCH 4/9] f2fs: allocate new segment aligned with sections

2013-03-31 Thread Jaegeuk Kim
When allocating a new segment under the LFS mode, we should keep the section boundary. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 179a13e..b3486f3 100644 --- a/fs/f2fs

[PATCH 5/9] f2fs: change GC bitmaps to apply the section granularity

2013-03-31 Thread Jaegeuk Kim
ground GCs, since there is no need to read victim blocks during foreground GCs. By the fact that the foreground GC reclaims segments in a section unit, it'd be better to manage this bitmap based on the section granularity. Signed-off-by: Jaegeuk Kim --- fs/f2fs/checkpoint.c |

[PATCH 3/9] f2fs: remove redundant lock_page calls

2013-03-31 Thread Jaegeuk Kim
In get_node_page, we do not need to call lock_page all the time. If the node page is cached as uptodate, 1. grab_cache_page locks the page, 2. read_node_page unlocks the page, and 3. lock_page is called for further process. Let's avoid this. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c

Re: [PATCH 3/5] f2fs: move f2fs_balance_fs to correct place in unlink

2013-03-07 Thread Jaegeuk Kim
2013-03-04 (월), 15:10 +0900, Namjae Jeon: > 2013/3/3, Jaegeuk Kim : > > 2013-03-02 (토), 12:41 +0900, Namjae Jeon: > >> From: Namjae Jeon > >> > >> Actual dirty of pages will occur in f2fs_delete_entry so move the > >> f2fs_balance_fs just before d

Re: [PATCH 4/5] f2fs: align f2fs maximum name length to linux based filesystem

2013-03-07 Thread Jaegeuk Kim
2013-03-04 (월), 15:25 +0900, Namjae Jeon: > 2013/3/3, Jaegeuk Kim : > > We should not change the on-disk layout. > > Instead, simply we can deal with it by changing original condition check > > like below. > > Even though the changes you suggested are ok. But there is o

Re: [bug report] f2fs: off by one in garbage collection functions

2013-01-20 Thread Jaegeuk Kim
Hi, 2013-01-18 (금), 16:29 +0300, Dan Carpenter: > Hello Jaegeuk Kim, > > The patch 7bc0900347e0: "f2fs: add garbage collection functions" from > Nov 2, 2012, has an off-by-one bug. > >429 block_t start_bidx_of_node(unsigned int node_ofs) >430 {

Re: [patch] f2fs: use _safe() version of list_for_each

2013-01-21 Thread Jaegeuk Kim
n. And also, as a cleanup, I've converted it to use > > list_for_each_entry instead of list_for_each. > > > > Signed-off-by: Dan Carpenter > > --- > > Static analysis stuff. Untested. Please review carefully. > > Makes sense to me. > > Revi

[GIT PULL] f2fs fixes for v3.8-rc5

2013-01-21 Thread Jaegeuk Kim
e cleanups Dan Carpenter (1): f2fs: use _safe() version of list_for_each Huajun Li (2): f2fs: update f2fs document to reflect SIT/NAT layout correctly f2fs: update f2fs partition info about SIT/NAT layout Jaegeuk Kim (10): f2fs: initialize newly allocated dnode

RE: [PATCH 00/16] f2fs: introduce flash-friendly file system

2012-10-12 Thread Jaegeuk Kim
2012-10-12 (금), 16:30 +0400, Vyacheslav Dubeyko: > On Wed, 2012-10-10 at 18:43 +0900, Jaegeuk Kim wrote: > > [snip] > > > > How about the following scenario? > > > > 1. data "a" is newly written. > > > > 2. checkpoint "A" is done. &g

Re: [PATCH 03/16] f2fs: add superblock and major in-memory structures

2012-10-12 Thread Jaegeuk Kim
]); > ckpt->alloc_type[i + CURSEG_HOT_NODE] = > curseg_alloc_type(sbi, i + CURSEG_HOT_NODE); > } > > which will take and drop that same lock 3 times in quick succession, and then > do it again for 3 other locks (And th

Re: [PATCH 07/16] f2fs: add segment operations

2012-10-12 Thread Jaegeuk Kim
hat when that last block is written and so calls >complete(p->wait); > then all the blocks have been written. > I don't think that is a valid assumption in general. Various things can > re-order blocks. Back when we had BIO_BARRIER, a barrier request would force &g

Re: [PATCH 05/16] f2fs: add checkpoint operations

2012-10-12 Thread Jaegeuk Kim
a summaries. Note that this scenario is not from the umount procedure. Basically f2fs writes three data summary blocks for current active logs inside the checkpoint pack. And NAT and SIT journal entries are stored in hot and cold data summary blocks. So, if the CP_COMPACT_SUM_FLAG is not set, f2fs

Re: [PATCH 06/16] f2fs: add node operations

2012-10-12 Thread Jaegeuk Kim
nm_i, ne); > > + } > > + write_unlock(&nm_i->nat_tree_lock); > > + return nr_shrink; > > +} > > > This code looks wrong to me, in a small way. > The return value is only ever tested for whether it is zero or not. > For that last 'retu

Re: [PATCH 02/16] f2fs: add on-disk layout

2012-10-13 Thread Jaegeuk Kim
message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 00/16] f2fs: introduce flash-friendly file system

2012-10-13 Thread Jaegeuk Kim
e enhanced by cooperating with a readahead mechanism in VFS. Thanks, > > Thanks. -- Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 01/16] f2fs: add document

2012-10-13 Thread Jaegeuk Kim
S > > +manages a bitmap. Each bit represents the validity of a block, and the > > bitmap is > > +composed of a bit stream covering whole blocks in main area. > > Do you take the type of data into account in the cleaner? In particular, do > you > try to group blocks

Re: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-13 Thread Jaegeuk Kim
time from the same defaults, but with the option of overriding it > using > a debugfs tool. > Good point! I'll think about a user-made list. Thanks, > Arnd > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the bo

Re: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-14 Thread Jaegeuk Kim
nd the line "unsubscribe linux-kernel" in > > the body of a message to majord...@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Please read the FAQ at http://www.tux.org/lkml/ > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Jaegeuk Kim Samsung -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

RE: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-15 Thread Jaegeuk Kim
> On Sun, Oct 14, 2012 at 03:19:37PM +, Arnd Bergmann wrote: > > On Sunday 14 October 2012, Vyacheslav Dubeyko wrote: > > > On Oct 14, 2012, at 11:09 AM, Jaegeuk Kim wrote: > > > > 2012-10-14 (일), 02:21 +0400, Vyacheslav Dubeyko: > > > Extended attribut

RE: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-15 Thread Jaegeuk Kim
> On Monday 15 October 2012, Changman Lee wrote: > > 2012년 10월 15일 월요일에 Arnd Bergmann님이 작성: > > > It is only a performance hint though, so it is not a correctness issue the > > > file system gets it wrong. In order to do efficient garbage collection, a > > > log > > > structured file system should

Re: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-16 Thread Jaegeuk Kim
2012-10-16 (화), 11:38 +, Arnd Bergmann: > On Tuesday 16 October 2012, Jaegeuk Kim wrote: > > On Monday 15 October 2012, Dave Chinner wrote: > > > On Sun, Oct 14, 2012 at 03:19:37PM +, Arnd Bergmann wrote: > > > > On Sunday 14 October 2012, Vyacheslav Dube

Re: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-16 Thread Jaegeuk Kim
2012-10-16 (화), 16:14 +, Arnd Bergmann: > On Tuesday 16 October 2012, Jaegeuk Kim wrote: > > Thank you for a lot of points to be addressed. :) > > Maybe it's time to summarize them. > > Please let me know what I misunderstood. > > > > [In v2] >

Re: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-16 Thread Jaegeuk Kim
's why > xattrs have different namespaces like "system", "security" and > "user". Only user attributes are truly for user data > - the rest are for communicating information to the kernel > I agree that "system" is used

RE: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-16 Thread Jaegeuk Kim
> On Wed, Oct 17, 2012 at 07:30:21AM +0900, Jaegeuk Kim wrote: > > > > > OTOH, I think xattr itself is for users, not for communicating > > > > > between file system and users. > > > > > > > > No, you are mistaken in that point, as Dave exp

RE: [PATCH 11/16] f2fs: add inode operations for special inodes

2012-10-16 Thread Jaegeuk Kim
> 2012-10-16 (화), 16:14 +, Arnd Bergmann: > > On Tuesday 16 October 2012, Jaegeuk Kim wrote: > > > Thank you for a lot of points to be addressed. :) > > > Maybe it's time to summarize them. > > > Please let me know what I misunderstood. > > > &

[RESEND] Request f2fs filesystem inclusion in linux-next

2012-11-22 Thread Jaegeuk Kim
ranch f2fs 3. Contact Jaegeuk Kim 4. Short log Greg Kroah-Hartman (1): f2fs: move proc files to debugfs Jaegeuk Kim (16): f2fs: add document f2fs: add on-disk layout f2fs: add superblock and major in-memory structure f2fs: add super block operations f2fs: add checkpoint operations

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