#
5ec4e49f |
| 30-Mar-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: change GC bitmaps to apply the section granularity
This patch removes a bitmap for victim segments selected by foreground GC, and modifies the other bitmap for victim segments selected by back
f2fs: change GC bitmaps to apply the section granularity
This patch removes a bitmap for victim segments selected by foreground GC, and modifies the other bitmap for victim segments selected by background GC.
1) foreground GC bitmap : We don't need to manage this, since we just only one previous victim section number instead of the whole victim history. The f2fs uses the victim section number in order not to allocate currently GC'ed section to current active logs.
2) background GC bitmap : This bitmap is used to avoid selecting victims repeatedly by background GCs. In addition, the victims are able to be selected by foreground 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.
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
953a3e27 |
| 21-Mar-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix to give correct parent inode number for roll forward
When we recover fsync'ed data after power-off-recovery, we should guarantee that any parent inode number should be correct for each dir
f2fs: fix to give correct parent inode number for roll forward
When we recover fsync'ed data after power-off-recovery, we should guarantee that any parent inode number should be correct for each direct inode blocks.
So, let's make the following rules.
- The fsync should do checkpoint to all the inodes that were experienced hard links.
- So, the only normal files can be recovered by roll-forward.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
0ff153a2 |
| 20-Mar-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: do not skip writing file meta during fsync
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 re
f2fs: do not skip writing file meta during fsync
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. However, when user can modify file meta and then call fsync, we should not skip fsync procedure. So, let's remove this condition check and hope that user triggers in right manner.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
6ead1142 |
| 20-Mar-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix the recovery flow to handle errors correctly
We should handle errors during the recovery flow correctly. For example, if we get -ENOMEM, we should report a mount failure instead of conduct
f2fs: fix the recovery flow to handle errors correctly
We should handle errors during the recovery flow correctly. For example, if we get -ENOMEM, we should report a mount failure instead of conducting the remained mount procedure.
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
111d2495 |
| 18-Mar-2013 |
Masanari Iida <standby24x7@gmail.com> |
f2fs: fix typo in comments
Correct spelling typo in comments
Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk
f2fs: fix typo in comments
Correct spelling typo in comments
Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
064e0823 |
| 17-Mar-2013 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: avoid BUG_ON from check_nid_range and update return path in do_read_inode
In function check_nid_range, there is no need to trigger BUG_ON and make kernel stop. Instead it could just check and
f2fs: avoid BUG_ON from check_nid_range and update return path in do_read_inode
In function check_nid_range, there is no need to trigger BUG_ON and make kernel stop. Instead it could just check and indicate the inode number to be EINVAL. Update the return path in do_read_inode to use the return from check_nid_range.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> [Jaegeuk: replace BUG_ON with WARN_ON] Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
266e97a8 |
| 25-Feb-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: introduce readahead mode of node pages
Previously, f2fs reads several node pages ahead when get_dnode_of_data is called with RDONLY_NODE flag. And, this flag is set by the following functions.
f2fs: introduce readahead mode of node pages
Previously, f2fs reads several node pages ahead when get_dnode_of_data is called with RDONLY_NODE flag. And, this flag is set by the following functions. - get_data_block_ro - get_lock_data_page - do_write_data_page - truncate_blocks - truncate_hole
However, this readahead mechanism is initially introduced for the use of get_data_block_ro to enhance the sequential read performance.
So, let's clarify all the cases with the additional modes as follows.
enum { ALLOC_NODE, /* allocate a new node page if needed */ LOOKUP_NODE, /* look up a node without readahead */ LOOKUP_NODE_RA, /* * look up a node with readahead called * by get_datablock_ro. */ }
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
show more ...
|
#
e9750824 |
| 04-Feb-2013 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: add compat_ioctl to provide backward compatability
adding compat_ioctl to provide support for backward comptability - 32bit binary execution on 64bit kernel.
Signed-off-by: Namjae Jeon <namja
f2fs: add compat_ioctl to provide backward compatability
adding compat_ioctl to provide support for backward comptability - 32bit binary execution on 64bit kernel.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
43727527 |
| 04-Feb-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: clarify and enhance the f2fs_gc flow
This patch makes clearer the ambiguous f2fs_gc flow as follows.
1. Remove intermediate checkpoint condition during f2fs_gc (i.e., should_do_checkpoint()
f2fs: clarify and enhance the f2fs_gc flow
This patch makes clearer the ambiguous f2fs_gc flow as follows.
1. Remove intermediate checkpoint condition during f2fs_gc (i.e., should_do_checkpoint() and GC_BLOCKED)
2. Remove unnecessary return values of f2fs_gc because of #1. (i.e., GC_NODE, GC_OK, etc)
3. Simplify write_checkpoint() because of #2.
4. Clarify the main f2fs_gc flow. o monitor how many freed sections during one iteration of do_garbage_collect(). o do GC more without checkpoints if we can't get enough free sections. o do checkpoint once we've got enough free sections through forground GCs.
5. Adopt thread-logging (Slack-Space-Recycle) scheme more aggressively on data log types. See. get_ssr_segement()
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
5ac206cf |
| 02-Feb-2013 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: make an accessor to get sections for particular block type
Introduce accessor to get the sections based upon the block type (node,dents...) and modify the functions : should_do_checkpoint, has
f2fs: make an accessor to get sections for particular block type
Introduce accessor to get the sections based upon the block type (node,dents...) and modify the functions : should_do_checkpoint, has_not_enough_free_secs to use this accessor function to get the node sections and dent sections.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
d4686d56 |
| 31-Jan-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: avoid balanc_fs during evict_inode
1. Background
Previously, if f2fs tries to move data blocks of an *evicting* inode during the cleaning process, it stops the process incompletely and then r
f2fs: avoid balanc_fs during evict_inode
1. Background
Previously, if f2fs tries to move data blocks of an *evicting* inode during the cleaning process, it stops the process incompletely and then restarts the whole process, since it needs a locked inode to grab victim data pages in its address space. In order to get a locked inode, iget_locked() by f2fs_iget() is normally used, but, it waits if the inode is on freeing.
So, here is a deadlock scenario. 1. f2fs_evict_inode() <- inode "A" 2. f2fs_balance_fs() 3. f2fs_gc() 4. gc_data_segment() 5. f2fs_iget() <- inode "A" too!
If step #1 and #5 treat a same inode "A", step #5 would fall into deadlock since the inode "A" is on freeing. In order to resolve this, f2fs_iget_nowait() which skips __wait_on_freeing_inode() was introduced in step #5, and stops f2fs_gc() to complete f2fs_evict_inode().
1. f2fs_evict_inode() <- inode "A" 2. f2fs_balance_fs() 3. f2fs_gc() 4. gc_data_segment() 5. f2fs_iget_nowait() <- inode "A", then stop f2fs_gc() w/ -ENOENT
2. Problem and Solution
In the above scenario, however, f2fs cannot finish f2fs_evict_inode() only if: o there are not enough free sections, and o f2fs_gc() tries to move data blocks of the *evicting* inode repeatedly.
So, the final solution is to use f2fs_iget() and remove f2fs_balance_fs() in f2fs_evict_inode(). The f2fs_evict_inode() actually truncates all the data and node blocks, which means that it doesn't produce any dirty node pages accordingly. So, we don't need to do f2fs_balance_fs() in practical.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
324ddc70 |
| 30-Jan-2013 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: fix typo mistake for data_version description
In f2fs_inode_info structure, the description for data_version has a typo mistake. It should be latest instead of lastes. So, correcting that.
Si
f2fs: fix typo mistake for data_version description
In f2fs_inode_info structure, the description for data_version has a typo mistake. It should be latest instead of lastes. So, correcting that.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
577e3495 |
| 24-Jan-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: prevent checkpoint once any IO failure is detected
This patch enhances the checkpoint routine to cope with IO errors.
Basically f2fs detects IO errors from end_io_write, and the errors are ab
f2fs: prevent checkpoint once any IO failure is detected
This patch enhances the checkpoint routine to cope with IO errors.
Basically f2fs detects IO errors from end_io_write, and the errors are able to be occurred during one of data, node, and meta page writes.
In the previous code, when an IO error is occurred during writes, f2fs sets a flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written to disk. Afterwards, write_checkpoint() will check the flag and remount f2fs as a read-only (ro) mode.
However, even once f2fs is remounted as a ro mode, dirty checkpoint pages are freely able to be written to disk by flusher or kswapd in background. In such a case, after cold reboot, f2fs would restore the checkpoint data having CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f2fs as a ro mode again.
Therefore, let's prevent any checkpoint page (meta) writes once an IO error is occurred, and remount f2fs as a ro mode right away at that moment.
Reported-by: Oliver Winker <oliver@oli1170.net> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
show more ...
|
#
b7f7a5e0 |
| 25-Jan-2013 |
Al Viro <viro@zeniv.linux.org.uk> |
f2fs: get rid of fake on-stack dentries
those should never be used for a lot of reasons...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
c004363d |
| 25-Jan-2013 |
Al Viro <viro@zeniv.linux.org.uk> |
f2fs: switch new_inode_page() from dentry to qstr
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
#
53dc9a67 |
| 25-Jan-2013 |
Al Viro <viro@zeniv.linux.org.uk> |
f2fs: init_dent_inode() should take qstr
for one thing, it doesn't (and shouldn't) use anything else from dentry; for another, on some call chains the dentry is fake and should be eliminated complet
f2fs: init_dent_inode() should take qstr
for one thing, it doesn't (and shouldn't) use anything else from dentry; for another, on some call chains the dentry is fake and should be eliminated completely.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
6e6093a8 |
| 16-Jan-2013 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: add __init to functions in init_f2fs_fs
Add __init to functions in init_f2fs_fs for code consistency.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahr
f2fs: add __init to functions in init_f2fs_fs
Add __init to functions in init_f2fs_fs for code consistency.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
4589d25d |
| 15-Jan-2013 |
Namjae Jeon <linkinjeon@gmail.com> |
f2fs: fix the debugfs entry creation path
As the "status" debugfs entry will be maintained for entire F2FS filesystem irrespective of the number of partitions. So, we can move the initialization to
f2fs: fix the debugfs entry creation path
As the "status" debugfs entry will be maintained for entire F2FS filesystem irrespective of the number of partitions. So, we can move the initialization to the init part of the f2fs and destroy will be done from exit part. After making changes, for individual partition mount - entry creation code will not be executed.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
408e9375 |
| 03-Jan-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: revisit the f2fs_gc flow
I'd like to revisit the f2fs_gc flow and rewrite as follows.
1. In practical, the nGC parameter of f2fs_gc is meaningless. So, let's remove it. 2. Background GC mar
f2fs: revisit the f2fs_gc flow
I'd like to revisit the f2fs_gc flow and rewrite as follows.
1. In practical, the nGC parameter of f2fs_gc is meaningless. So, let's remove it. 2. Background GC marks victim blocks as dirty one at a time. 3. Foreground GC should do cleaning job until acquiring enough free sections. Afterwards, it needs to do checkpoint.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
d66d1f76 |
| 02-Jan-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: initialize newly allocated dnode structure
This patch resolves Coverity #753112.
In practical, the existing code flow does not fall into the reported errorneous path. But, anyway, let's avoid
f2fs: initialize newly allocated dnode structure
This patch resolves Coverity #753112.
In practical, the existing code flow does not fall into the reported errorneous path. But, anyway, let's avoid this for future.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
a07ef784 |
| 29-Dec-2012 |
Namjae Jeon <namjae.jeon@samsung.com> |
f2fs: introduce f2fs_msg to ease adding information prints
Introduced f2fs_msg function to differentiate f2fs specific messages in the log. And, added few informative prints in the mount path, to co
f2fs: introduce f2fs_msg to ease adding information prints
Introduced f2fs_msg function to differentiate f2fs specific messages in the log. And, added few informative prints in the mount path, to convey proper error in case of mount failure.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
9836b8b9 |
| 27-Dec-2012 |
Leon Romanovsky <leon@leon.nu> |
f2fs: unify string length declarations and usage
This patch is intended to unify string length declarations and usage. There are number of calls to strlen which return size_t object. The size of thi
f2fs: unify string length declarations and usage
This patch is intended to unify string length declarations and usage. There are number of calls to strlen which return size_t object. The size of this object depends on compiler if it will be bigger, equal or even smaller than an unsigned int
Signed-off-by: Leon Romanovsky <leon@leon.nu> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
6666e6aa |
| 10-Dec-2012 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix tracking parent inode number
Previously, f2fs didn't track the parent inode number correctly which is stored in each f2fs_inode. In the case of the following scenario, a bug can be occured
f2fs: fix tracking parent inode number
Previously, f2fs didn't track the parent inode number correctly which is stored in each f2fs_inode. In the case of the following scenario, a bug can be occured.
Let's suppose there are one directory, "/b", and two files, "/a" and "/b/a". - pino of "/a" is ROOT_INO. - pino of "/b/a" is DIR_B_INO.
Then, # sync : The inode pages of "/a" and "/b/a" contain the parent inode numbers as ROOT_INO and DIR_B_INO respectively. # mv /a /b/a : The parent inode number of "/a" should be changed to DIR_B_INO, but f2fs didn't do that. Ref. f2fs_set_link().
In order to fix this clearly, I added i_pino in f2fs_inode_info, and whenever it needs to be changed like in f2fs_add_link() and f2fs_set_link(), it is updated temporarily in f2fs_inode_info.
And later, f2fs_write_inode() stores the latest information to the inode pages. For power-off-recovery, f2fs_sync_file() triggers simply f2fs_write_inode().
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
3cd8a239 |
| 09-Dec-2012 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: cleanup the f2fs_bio_alloc routine
Do cleanup more for better code readability.
- Change the parameter set of f2fs_bio_alloc() This function should allocate a bio only since it is not somet
f2fs: cleanup the f2fs_bio_alloc routine
Do cleanup more for better code readability.
- Change the parameter set of f2fs_bio_alloc() This function should allocate a bio only since it is not something like f2fs_bio_init(). Instead, the caller should initialize the allocated bio.
- Introduce SECTOR_FROM_BLOCK This macro translates a block address to its sector address.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
show more ...
|
#
0a8165d7 |
| 28-Nov-2012 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: adjust kernel coding style
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment blocks. Instead, just use "/*".
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.co
f2fs: adjust kernel coding style
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment blocks. Instead, just use "/*".
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|