#
4081363f |
| 02-Sep-2014 |
Jaegeuk Kim <jaegeuk@kernel.org> |
f2fs: introduce F2FS_I_SB, F2FS_M_SB, and F2FS_P_SB
This patch adds three inline functions to clean up dirty casting codes.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
Revision tags: v3.17-rc3, v3.17-rc2, v3.17-rc1 |
|
#
764aa3e9 |
| 14-Aug-2014 |
Jaegeuk Kim <jaegeuk@kernel.org> |
f2fs: avoid double lock in truncate_blocks
The init_inode_metadata calls truncate_blocks when error is occurred. The callers holds f2fs_lock_op, so we should not call it again in truncate_blocks.
S
f2fs: avoid double lock in truncate_blocks
The init_inode_metadata calls truncate_blocks when error is occurred. The callers holds f2fs_lock_op, so we should not call it again in truncate_blocks.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
#
e1c42045 |
| 06-Aug-2014 |
arter97 <qkrwngud825@gmail.com> |
f2fs: fix typo
Fix typo and some grammatical errors.
The words "filesystem" and "readahead" are being used without the space treewide.
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Signed-o
f2fs: fix typo
Fix typo and some grammatical errors.
The words "filesystem" and "readahead" are being used without the space treewide.
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
Revision tags: v3.16, v3.16-rc7, v3.16-rc6, v3.16-rc5 |
|
#
81e366f8 |
| 09-Jul-2014 |
Chao Yu <chao2.yu@samsung.com> |
f2fs: check name_len of dir entry to prevent from deadloop
We assume that modification of some special application could result in zeroed name_len, or it is consciously made by somebody. We will dea
f2fs: check name_len of dir entry to prevent from deadloop
We assume that modification of some special application could result in zeroed name_len, or it is consciously made by somebody. We will deadloop in find_in_block when name_len of dir entry is zero.
This patch is added for preventing deadloop in above scenario.
change log from v1: o use f2fs_bug_on rather than break out from searching dir entry suggested by Jaegeuk Kim.
Jaegeuk describe: "Well, IMO, it would be good to add f2fs_bug_on() here with a specific comment. In the current phase of f2fs, it is more important to investigate the file system bugs, rather than workarounds for any corrupted images. And, definitely it needs to stop the kernel if any corrupted image was mounted, so that we can figure out where the bugs are occurred."
Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
Revision tags: v3.16-rc4, v3.16-rc3 |
|
#
eee6160f |
| 24-Jun-2014 |
Gu Zheng <guz.fnst@cn.fujitsu.com> |
f2fs: arguments cleanup of finding file flow functions
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
#
1c3bb978 |
| 27-Jun-2014 |
Gu Zheng <guz.fnst@cn.fujitsu.com> |
f2fs: remove the needless point-cast
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
Revision tags: v3.16-rc2 |
|
#
a014e037 |
| 20-Jun-2014 |
Jaegeuk Kim <jaegeuk@kernel.org> |
f2fs: clean up an unused parameter and assignment
This patch cleans up simple unnecessary codes.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
|
#
b97a9b5d |
| 20-Jun-2014 |
Jaegeuk Kim <jaegeuk@kernel.org> |
f2fs: introduce f2fs_do_tmpfile for code consistency
This patch adds f2fs_do_tmpfile to eliminate the redundant init_inode_metadata flow. Throught this, we can provide the consistent lock usage, e.g
f2fs: introduce f2fs_do_tmpfile for code consistency
This patch adds f2fs_do_tmpfile to eliminate the redundant init_inode_metadata flow. Throught this, we can provide the consistent lock usage, e.g., fi->i_sem, and this will enable better debugging stuffs.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
#
50732df0 |
| 19-Jun-2014 |
Chao Yu <chao2.yu@samsung.com> |
f2fs: support ->tmpfile()
Add function f2fs_tmpfile() to support O_TMPFILE file creation, and modify logic of init_inode_metadata to enable linkat temp file.
Signed-off-by: Chao Yu <chao2.yu@samsun
f2fs: support ->tmpfile()
Add function f2fs_tmpfile() to support O_TMPFILE file creation, and modify logic of init_inode_metadata to enable linkat temp file.
Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
#
90d72459 |
| 23-Jun-2014 |
Chao Yu <chao2.yu@samsung.com> |
f2fs: fix error path in init_inode_metadata
If we fail in this path: ->init_inode_metadata ->make_empty_dir ->get_new_data_page ->grab_cache_page return -ENOMEM
We will bug on in error
f2fs: fix error path in init_inode_metadata
If we fail in this path: ->init_inode_metadata ->make_empty_dir ->get_new_data_page ->grab_cache_page return -ENOMEM
We will bug on in error path of init_inode_metadata when call remove_inode_page because i_block = 2 (one inode block will be released later & one dentry block).
We should release the dentry block in init_inode_metadata to avoid this BUG_ON, and avoid leak of dentry block resource, because we never have second chance to release that block in ->evict_inode as in upper error path we make this inode 'bad'.
Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
Revision tags: v3.16-rc1, v3.15, v3.15-rc8 |
|
#
bfec07d0 |
| 27-May-2014 |
Chao Yu <chao2.yu@samsung.com> |
f2fs: avoid overflow when large directory feathure is enabled
When large directory feathure is enable, We have one case which could cause overflow in dir_buckets() as following: special case: level
f2fs: avoid overflow when large directory feathure is enabled
When large directory feathure is enable, We have one case which could cause overflow in dir_buckets() as following: special case: level + dir_level >= 32 and level < MAX_DIR_HASH_DEPTH / 2.
Here we define MAX_DIR_BUCKETS to limit the return value when the condition could trigger potential overflow.
Changes from V1 o modify description of calculation in f2fs.txt suggested by Changman Lee.
Suggested-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
show more ...
|
Revision tags: v3.15-rc7, v3.15-rc6, v3.15-rc5, v3.15-rc4 |
|
#
54b591df |
| 29-Apr-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: split grab_cache_page and wait_on_page_writeback for node pages
This patch splits grab_cache_page_write_begin into grab_cache_page and wait_on_page_writeback for node pages.
This patch intend
f2fs: split grab_cache_page and wait_on_page_writeback for node pages
This patch splits grab_cache_page_write_begin into grab_cache_page and wait_on_page_writeback for node pages.
This patch intends to enhance the latency to get node pages by alleviating unnecessary wait_on_page_writeback.
Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
817202d9 |
| 28-Apr-2014 |
Chao Yu <chao2.yu@samsung.com> |
f2fs: readahead multi pages of directory for performance
We have no so such readahead mechanism in ->iterate() path as the one in ->read() path, it cause low performance when we read large directory
f2fs: readahead multi pages of directory for performance
We have no so such readahead mechanism in ->iterate() path as the one in ->read() path, it cause low performance when we read large directory. This patch add readahead in f2fs_readdir() for better performance.
Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.15-rc3, v3.15-rc2, v3.15-rc1, v3.14, v3.14-rc8 |
|
#
d928bfbf |
| 20-Mar-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: introduce fi->i_sem to protect fi's info
This patch introduces fi->i_sem to protect fi's info that includes xattr_ver, pino, i_nlink. This enables to remove i_mutex during f2fs_sync_file, resu
f2fs: introduce fi->i_sem to protect fi's info
This patch introduces fi->i_sem to protect fi's info that includes xattr_ver, pino, i_nlink. This enables to remove i_mutex during f2fs_sync_file, resulting in performance improvement when a number of fsync calls are triggered from many concurrent threads.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
3cb5ad15 |
| 17-Mar-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: call f2fs_wait_on_page_writeback instead of native function
If a page is on writeback, f2fs can face with deadlock due to under writepages. This is caused by merging IOs inside f2fs, so if it
f2fs: call f2fs_wait_on_page_writeback instead of native function
If a page is on writeback, f2fs can face with deadlock due to under writepages. This is caused by merging IOs inside f2fs, so if it comes to detect, let's throw merged IOs, which is implemented by f2fs_wait_on_page_writeback.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.14-rc7, v3.14-rc6 |
|
#
20f70751 |
| 04-Mar-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix wrong kernel coding style
This patch includes a simple fix to adjust coding style.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
Revision tags: v3.14-rc5 |
|
#
38431545 |
| 27-Feb-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: introduce large directory support
This patch introduces an i_dir_level field to support large directory.
Previously, f2fs maintains multi-level hash tables to find a dentry quickly from a bun
f2fs: introduce large directory support
This patch introduces an i_dir_level field to support large directory.
Previously, f2fs maintains multi-level hash tables to find a dentry quickly from a bunch of chiild dentries in a directory, and the hash tables consist of the following tree structure as below.
In Documentation/filesystems/f2fs.txt,
---------------------- A : bucket B : block N : MAX_DIR_HASH_DEPTH ----------------------
level #0 | A(2B) | level #1 | A(2B) - A(2B) | level #2 | A(2B) - A(2B) - A(2B) - A(2B) . | . . . . level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B) . | . . . . level #N | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
But, if we can guess that a directory will handle a number of child files, we don't need to traverse the tree from level #0 to #N all the time. Since the lower level tables contain relatively small number of dentries, the miss ratio of the target dentry is likely to be high.
In order to avoid that, we can configure the hash tables sparsely from level #0 like this.
level #0 | A(2B) - A(2B) - A(2B) - A(2B)
level #1 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B) . | . . . . level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B) . | . . . . level #N | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
With this structure, we can skip the ineffective tree searches in lower level hash tables.
This patch adds just a facility for this by introducing i_dir_level in f2fs_inode.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
5d0c6671 |
| 26-Feb-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: remove costly bit operations for f2fs_find_entry
It turns out that a bit operation like find_next_bit is not always fast enough for f2fs_find_entry. Instead, it is pretty much simple and fast
f2fs: remove costly bit operations for f2fs_find_entry
It turns out that a bit operation like find_next_bit is not always fast enough for f2fs_find_entry. Instead, it is pretty much simple and fast to traverse each dentries.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.14-rc4, v3.14-rc3, v3.14-rc2 |
|
#
1fe54f9d |
| 06-Feb-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: clean up redundant function call
This patch integrates inode_[inc|dec]_dirty_dents with inc_page_count to remove redundant calls.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
#
bd859c65 |
| 04-Feb-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix to truncate dentry pages in the error case
When a new directory is allocated, if an error is occurred, we should truncate preallocated dentry pages too.
This bug was reported by Andrey Ts
f2fs: fix to truncate dentry pages in the error case
When a new directory is allocated, if an error is occurred, we should truncate preallocated dentry pages too.
This bug was reported by Andrey Tsyvarev after a while as follows.
mkdir()-> f2fs_add_link()-> init_inode_metadata()-> f2fs_init_acl()-> f2fs_get_acl()-> f2fs_getxattr()-> read_all_xattrs() fails.
Also there was a BUG_ON triggered after the fault in mkdir()-> f2fs_add_link()-> init_inode_metadata()-> remove_inode_page() -> f2fs_bug_on(inode->i_blocks != 0 && inode->i_blocks != 1);
But, previous patch wasn't perfect to resolve that bug, so the following bug report was also submitted.
kernel BUG at fs/f2fs/inode.c:274! Call Trace: [<ffffffff811fde03>] evict+0xa3/0x1a0 [<ffffffff811fe615>] iput+0xf5/0x180 [<ffffffffa01c7f63>] f2fs_mkdir+0xf3/0x150 [f2fs] [<ffffffff811f2a77>] vfs_mkdir+0xb7/0x160 [<ffffffff811f36bf>] SyS_mkdir+0x5f/0xc0 [<ffffffff81680769>] system_call_fastpath+0x16/0x1b
Finally, this patch resolves all the issues like below.
If an error is occurred after make_empty_dir(), 1. truncate_inode_pages() The make_bad_inode() prior to iput() will change i_mode to S_IFREG, which means that f2fs will not decrement fi->dirty_dents during f2fs_evict_inode. But, by calling it here, we can do that.
2. truncate_blocks() Preallocated dentry pages are trucated here to sync i_blocks.
3. remove_dirty_dir_inode() Remove this directory inode from the list.
Reported-and-Tested-by: Andrey Tsyvarev <tsyvarev@ispras.ru> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
#
924a2ddb |
| 03-Feb-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: fix the potential mismatch between dir's i_size and i_blocks
This is the erroneous scenario.
i_size on-disk i_size i_blocks __f2fs_add_link() 40
f2fs: fix the potential mismatch between dir's i_size and i_blocks
This is the erroneous scenario.
i_size on-disk i_size i_blocks __f2fs_add_link() 4096 4096 2 get_new_data_page 8192 4096 3 -ENOSPC = init_inode_metadata checkpoint - 4096 3 POR and reboot
__f2fs_add_link() 4096 4096 3 page = get_new_data_page (page->index = 1 by NEW_ADDR) add a dentry to the page successfully
f2fs_rmdir() f2fs_empty_dir() 4096 4096 3 f2fs_unlink() goes, since there is no valid dentry due to i_size = 4096. But, still there is one dentry in page->index = 1.
So this patch moves the code to write dir->i_size into on-disk i_size in order to sync dir's i_size, on-disk i_size, and its i_blocks.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.14-rc1 |
|
#
e8dae604 |
| 21-Jan-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: move a branch for code redability
This patch moves a function in f2fs_delete_entry for code readability.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
|
#
a18ff063 |
| 20-Jan-2014 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: call mark_inode_dirty to flush dirty pages
If a dentry page is updated, we should call mark_inode_dirty to add the inode into the dirty list, so that its dentry pages are flushed to the disk.
f2fs: call mark_inode_dirty to flush dirty pages
If a dentry page is updated, we should call mark_inode_dirty to add the inode into the dirty list, so that its dentry pages are flushed to the disk. Otherwise, the inode can be evicted without flush.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.13 |
|
#
6c311ec6 |
| 17-Jan-2014 |
Chris Fries <cfries@motorola.com> |
f2fs: clean checkpatch warnings
Fixed a variety of trivial checkpatch warnings. The only delta should be some minor formatting on log strings that were split / too long.
Signed-off-by: Chris Fries
f2fs: clean checkpatch warnings
Fixed a variety of trivial checkpatch warnings. The only delta should be some minor formatting on log strings that were split / too long.
Signed-off-by: Chris Fries <cfries@motorola.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|
Revision tags: v3.13-rc8, v3.13-rc7, v3.13-rc6 |
|
#
a8865372 |
| 27-Dec-2013 |
Jaegeuk Kim <jaegeuk.kim@samsung.com> |
f2fs: handle errors correctly during f2fs_reserve_block
The get_dnode_of_data nullifies inode and node page when error is occurred.
There are two cases that passes inode page into get_dnode_of_data
f2fs: handle errors correctly during f2fs_reserve_block
The get_dnode_of_data nullifies inode and node page when error is occurred.
There are two cases that passes inode page into get_dnode_of_data().
1. make_empty_dir() -> get_new_data_page() -> f2fs_reserve_block(ipage) -> get_dnode_of_data()
2. f2fs_convert_inline_data() -> __f2fs_convert_inline_data() -> f2fs_reserve_block(ipage) -> get_dnode_of_data()
This patch adds correct error handling codes when get_dnode_of_data() returns an error.
At first, f2fs_reserve_block() calls f2fs_put_dnode() whenever reserve_new_block returns an error. So, the rule of f2fs_reserve_block() is to nullify inode page when there is any error internally.
Finally, two callers of f2fs_reserve_block() should call f2fs_put_dnode() appropriately if they got an error since successful f2fs_reserve_block().
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
show more ...
|