[f2fs-dev] [PATCH 3/6] f2fs crypto: use slab caches

2015-05-12 Thread Jaegeuk Kim
This patch integrates the below patch into f2fs. ext4 crypto: use slab caches Use slab caches the ext4_crypto_ctx and ext4_crypt_info structures for slighly better memory efficiency and debuggability. Signed-off-by: Theodore Ts'o ty...@mit.edu Signed-off-by: Jaegeuk Kim jaeg...@kernel.org

[f2fs-dev] [PATCH 1/6] f2fs crypto: free encryption_info at f2fs_evict_inode

2015-05-12 Thread Jaegeuk Kim
This patch fixes not calling freeing encryption info when f2fs_evict_inode was called. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/inode.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 13936f9..ea6ba3b 100644 --- a/fs/f2fs/inode.c

Re: [f2fs-dev] [PATCH] f2fs crypto: use inode number for xts_tweak

2015-05-12 Thread Jaegeuk Kim
On Tue, May 12, 2015 at 07:35:57PM -0400, Theodore Ts'o wrote: On Mon, May 11, 2015 at 08:51:03PM -0700, Jaegeuk Kim wrote: Previoulsy when making xts_tweak, page-index was used. But, when it supports fcollapse, the block address was moved, so that we can lose the original page-index, which

Re: [f2fs-dev] Space leak in f2fs

2015-05-13 Thread Jaegeuk Kim
Hi Hu, Found a bug in the previous patch. Could you check this out? Thanks, --- fs/f2fs/super.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 19438f2..647591b 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -431,8

Re: [f2fs-dev] [PATCH] f2fs: fix building on 32-bit architectures

2015-05-13 Thread Jaegeuk Kim
Hi Arnd, Thank you for the patch. Merged and pushed to -next. :) Thanks, On Wed, May 13, 2015 at 10:49:58PM +0200, Arnd Bergmann wrote: A bug fix to the debug output extended the type of some local variables to 64-bit, which now causes the kernel to fail building because of missing 64-bit

Re: [f2fs-dev] Space leak in f2fs

2015-05-14 Thread Jaegeuk Kim
Hi Hu, I've been rethinking about whole this issue differently. And, now I'm starting to test with the below patch instead of previous one. Thanks, Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/checkpoint.c | 19 +++ fs/f2fs/data.c | 4 fs/f2fs/f2fs.h

Re: [f2fs-dev] [PATCH 03/18] f2fs crypto: declare some definitions for f2fs encryption feature

2015-05-15 Thread Jaegeuk Kim
. But, this per-file encryption supports only 1 to 1 4KB mapping, so that it could be quite a simple implementation. Could you elaborate on your approach or design? Or, codes? Whatever, IMO, it needs to implement it by any filesystem first. Thanks, On 05/13/2015 06:56 PM, Jaegeuk Kim wrote: On Thu, May

Re: [f2fs-dev] Space leak in f2fs

2015-05-15 Thread Jaegeuk Kim
Hi Chao, On Fri, May 15, 2015 at 04:31:43PM +0800, Chao Yu wrote: Hi Jaegeuk, [snip] + /* if orphan inode, we don't need to write its data */ + if (is_orphan_inode(sbi, inode-i_ino)) + goto out; When user create a temp file by invoking open with O_TMPFILE flag, in

[f2fs-dev] [PATCH] f2fs crypto: split f2fs_crypto_init/exit with two parts

2015-05-15 Thread Jaegeuk Kim
This patch splits f2fs_crypto_init/exit with two parts: base initialization and memory allocation. Firstly, f2fs module declares the base encryption memory pointers. Then, allocating internal memories is done at the first encrypted inode access. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org

Re: [f2fs-dev] Space leak in f2fs

2015-05-17 Thread Jaegeuk Kim
Hi Chao, On Mon, May 18, 2015 at 10:43:14AM +0800, Chao Yu wrote: Hi Jaegeuk, -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Saturday, May 16, 2015 8:56 AM To: Chao Yu Cc: 'hujianyang'; linux-fsde...@vger.kernel.org; linux-f2fs-devel

Re: [f2fs-dev] Space leak in f2fs

2015-05-13 Thread Jaegeuk Kim
a formal stress test next week. Will you push this patch to f2fs-dev branch? If you have other modification to this fix, please let me know. Thanks very much! Hu On 2015/5/14 8:24, Jaegeuk Kim wrote: Hi Hu, Found a bug in the previous patch. Could you check this out? Thanks

Re: [f2fs-dev] [PATCH 03/18] f2fs crypto: declare some definitions for f2fs encryption feature

2015-05-13 Thread Jaegeuk Kim
On Thu, May 14, 2015 at 10:37:21AM +1000, Dave Chinner wrote: On Tue, May 12, 2015 at 11:48:02PM -0700, Jaegeuk Kim wrote: On Wed, May 13, 2015 at 12:02:08PM +1000, Dave Chinner wrote: On Fri, May 08, 2015 at 09:20:38PM -0700, Jaegeuk Kim wrote: This definitions will be used by inode

Re: [f2fs-dev] Space leak in f2fs

2015-05-13 Thread Jaegeuk Kim
Hi Hu, Thank you for the report. When I tried to reproduce this, it seems that this can occur under somewhat stressful condition. I could't reach out to this problem. Nevertheless, I think this is a possible scenario, so I wrote a patch for this. Could you test this patch? Thanks, ---

Re: [f2fs-dev] [PATCH 1/2] f2fs: support RENAME_WHITEOUT

2015-05-18 Thread Jaegeuk Kim
Hi Chao, On Mon, May 18, 2015 at 01:54:22PM +0800, Chao Yu wrote: As the description of rename in manual, RENAME_WHITEOUT is a special operation that only makes sense for overlay/union type filesystem. When performing rename with RENAME_WHITEOUT, dst will be replace with src, and meanwhile,

[f2fs-dev] [PATCH] f2fs crypto: add rwsem to avoid data races

2015-05-18 Thread Jaegeuk Kim
Previoulsy, fi-i_crypt_info was not covered by any lock, resulting in memory leak. This patch adds a rwsem to avoid leaking objects on i_crypt_info. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/crypto_key.c | 29 ++--- fs/f2fs/f2fs.h | 1 + fs/f2fs

[f2fs-dev] [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm

2015-05-18 Thread Jaegeuk Kim
] bdi_writeback_workfn+0x148/0x980 [810a74a2] process_one_work+0x1e2/0x840 [810a7c21] worker_thread+0x121/0x470 [810ae268] kthread+0xf8/0x110 [8180b9a2] ret_from_fork+0x42/0x70 Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- arch/x86/crypto/aesni-intel_glue.c | 2

Re: [f2fs-dev] [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm

2015-05-19 Thread Jaegeuk Kim
On Tue, May 19, 2015 at 01:49:45PM +0800, Herbert Xu wrote: On Mon, May 18, 2015 at 10:46:56PM -0700, Jaegeuk Kim wrote: This patch adds a parameter, gfp_t, for __crypto_alloc_tfm. Now EXT4 and F2FS use the crypto engine to encrypt a page when writing it to the disk. That happens

Re: [f2fs-dev] [PATCH v2] crypto: allow to assign gfp_t for __crypto_alloc_tfm

2015-05-19 Thread Jaegeuk Kim
] wb_writeback+0x121/0x850 [81273398] bdi_writeback_workfn+0x148/0x980 [810a74a2] process_one_work+0x1e2/0x840 [810a7c21] worker_thread+0x121/0x470 [810ae268] kthread+0xf8/0x110 [8180b9a2] ret_from_fork+0x42/0x70 Signed-off-by: Jaegeuk Kim jaeg

Re: [f2fs-dev] [PATCH] crypto: allow to assign gfp_t for __crypto_alloc_tfm

2015-05-19 Thread Jaegeuk Kim
On Tue, May 19, 2015 at 03:30:12PM +0800, Herbert Xu wrote: On Tue, May 19, 2015 at 12:27:40AM -0700, Jaegeuk Kim wrote: So, IMHO, it can consume memory too much, since tfm should be allocated for every inodes and be alive until inode eviction. Are you sure this is a real problem? Have

Re: [f2fs-dev] [PATCH 03/18] f2fs crypto: declare some definitions for f2fs encryption feature

2015-05-13 Thread Jaegeuk Kim
On Wed, May 13, 2015 at 12:02:08PM +1000, Dave Chinner wrote: On Fri, May 08, 2015 at 09:20:38PM -0700, Jaegeuk Kim wrote: This definitions will be used by inode and superblock for encyption. How much of this crypto stuff is common with or only slightly modified from the ext4 code

Re: [f2fs-dev] [PATCH 03/18] f2fs crypto: declare some definitions for f2fs encryption feature

2015-05-18 Thread Jaegeuk Kim
On Fri, May 15, 2015 at 09:47:05PM -0700, Tom Marshall wrote: On Fri, May 15, 2015 at 06:14:24PM -0700, Jaegeuk Kim wrote: On Thu, May 14, 2015 at 09:50:44AM -0700, Tom Marshall wrote: Please keep in mind that I'm also working on transparent compression. I'm watching this thread closely

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

2015-04-16 Thread Jaegeuk Kim
that, if 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 jaeg...@kernel.org --- fs/f2fs/namei.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index

[f2fs-dev] [PATCH] fsck.f2fs: show ckeckpoint version info

2015-04-16 Thread Jaegeuk Kim
This patch shows the valid checkpoint version number. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/mount.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index f900dd7..1c55f40 100644 --- a/fsck/mount.c +++ b/fsck/mount.c

[f2fs-dev] [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 jaeg...@kernel.org --- fs/f2fs/checkpoint.c| 6 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/recovery.c | 2 +- include

[f2fs-dev] [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 jaeg...@kernel.org --- 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-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel

Re: [f2fs-dev] [PATCH] f2fs: remove duplicated code in the f2fs_lookup()

2015-04-16 Thread Jaegeuk Kim
Hi Taehee, On Thu, Apr 16, 2015 at 05:42:43PM +0900, Taehee Yoo wrote: in the f2fs_lookup(), checks that inode isn't null but d_splice_alias() has same routine at first line. so i remove this routine. In the latest f2fs, we cannot merge this patch. Since some inline_dots codes were added with

[f2fs-dev] [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 block

Re: [f2fs-dev] [PATCH] F2FS support

2015-04-03 Thread Jaegeuk Kim
Hi Andrei, On Sat, Mar 28, 2015 at 10:31:55AM +0300, Andrei Borzenkov wrote: В Tue, 24 Mar 2015 01:19:00 -0700 Jaegeuk Kim jaeg...@kernel.org пишет: ... +/* byte-size offset */ +#define F2FS_SUPER_OFFSET 1024 + +/* 12 bits for 4096 bytes */ +#define

[f2fs-dev] [PATCH] Revert mkfs.f2fs: 512 UTF-16 characters for label

2015-04-03 Thread Jaegeuk Kim
The mkfs.f2fs gets 512 characters, which will be recorded as UTF-16 characters. This reverts commit fb5eef1d7e4060d9c5a913514c49b260c29d3ed2. --- mkfs/f2fs_format_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c

[f2fs-dev] [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 jaeg...@kernel.org --- 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

[f2fs-dev] [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 jaeg...@kernel.org --- fs/f2fs/dir.c | 50 ++--- fs/f2fs

[f2fs-dev] [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 jaeg...@kernel.org --- fs/f2fs/recovery.c | 48 +++- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/fs

[f2fs-dev] [PATCH 1/8] fsck.f2fs: return summary block pointer and types

2015-04-02 Thread Jaegeuk Kim
This patch adds to return summry_block pointer to callers, which will be used when fixing them. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/dump.c | 16 +++- fsck/f2fs.h | 1 + fsck/fsck.h | 4 ++-- fsck/mount.c | 45 ++--- 4

[f2fs-dev] [PATCH 7/8] fsck.f2fs: fix missing dentries

2015-04-02 Thread Jaegeuk Kim
If a directory has no dot and dotdot dentries, fsck.f2fs sets inline_dots for the inode so that f2fs module can handle that properly. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 42 +++--- fsck/fsck.h | 1 + include/f2fs_fs.h

[f2fs-dev] [PATCH 2/8] fsck.f2fs: fix summary block

2015-04-02 Thread Jaegeuk Kim
Previously, if data and node summary was corrupted, the block was deallocated. But, this patch fixes their summary first, so that we can keep their blocks. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 166 ++-- 1 file

[f2fs-dev] [PATCH 4/8] fsck.f2fs: count child directories correctly for i_links

2015-04-02 Thread Jaegeuk Kim
If some of children including directories are corrupted, we should not include them into i_links of their parent. This patch fixes that. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fsck

[f2fs-dev] [PATCH 6/8] fsck.f2fs: clean up child information

2015-04-02 Thread Jaegeuk Kim
This patch adds a child_info data structure to clean up dirty parameters. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 71 +++-- fsck/fsck.h | 22 --- fsck/main.c | 2 +- 3 files changed, 46 insertions

[f2fs-dev] [PATCH 8/8] fsck.f2fs: fix orphan inode's link count

2015-04-02 Thread Jaegeuk Kim
This patch fixes orphan inode's link count as 0. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 8211159..f3fbdfa 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -493,7

[f2fs-dev] [PATCH 5/8] fsck.f2fs: fix missing i_links

2015-04-02 Thread Jaegeuk Kim
If a child is a directory, we should increase parent's i_links. Previously, it counts direct dentry blocks excluding indirect blocks. This patch fixes to count child_cnt correctly in order to get precise i_links. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 34

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

2015-05-19 Thread Jaegeuk Kim
On Wed, May 20, 2015 at 12:46:04AM -0400, Theodore Ts'o wrote: On Tue, May 19, 2015 at 05:43:25PM -0700, Jaegeuk Kim wrote: This patch adds to check encryption for tmpfile in early stage. Don't you also need a call to ext4_inherit_context(dir, inode) here? (I need to fix this for ext4

[f2fs-dev] [PATCH 1/4] f2fs crypto: preallocate a tfm for the data path

2015-05-19 Thread Jaegeuk Kim
, f2fs_crypto_ctx will be used to allocate pages for actual crypto stuffs. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/crypto.c | 126 -- fs/f2fs/f2fs.h| 1 + fs/f2fs/f2fs_crypto.h | 2 - fs/f2fs/file.c| 20

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

2015-05-19 Thread Jaegeuk Kim
This patch adds to check encryption for tmpfile in early stage. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/namei.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index dded2b0..47066b0 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c

[f2fs-dev] [PATCH 2/4] f2fs crypto: add two spinlocks to avoid data races

2015-05-19 Thread Jaegeuk Kim
] f2fs_evict_inode+0x15a/0x460 [f2fs] evict+0xb8/0x190 iput+0x30e/0x3f0 d_delete+0x178/0x1b0 vfs_rmdir+0x122/0x140 do_rmdir+0x1fb/0x220 SyS_rmdir+0x16/0x20 system_call_fastpath+0x16/0x7a This patch adds one rwlock and one spinlock to avoid leaking objects. Signed-off-by: Jaegeuk Kim jaeg

Re: [f2fs-dev] [PATCH] f2fs crypto: add rwsem to avoid data races

2015-05-19 Thread Jaegeuk Kim
On Wed, May 20, 2015 at 12:35:18AM -0400, Theodore Ts'o wrote: On Tue, May 19, 2015 at 05:38:59PM -0700, Jaegeuk Kim wrote: What I'm saying is writer vs writer actually. This is a rough draft of what I had in mind. This fixes the tfm allocation issue in the writepage path, as well

Re: [f2fs-dev] [PATCH] f2fs crypto: add rwsem to avoid data races

2015-05-19 Thread Jaegeuk Kim
On Tue, May 19, 2015 at 10:35:30AM -0400, nick wrote: On 2015-05-19 10:29 AM, Theodore Ts'o wrote: On Mon, May 18, 2015 at 10:36:41PM -0700, Jaegeuk Kim wrote: Previoulsy, fi-i_crypt_info was not covered by any lock, resulting in memory leak. This patch adds a rwsem to avoid leaking

[f2fs-dev] [PATCH 4/4] f2fs crypto: assign GFP_KERNEL for f2fs_derive_key_aes

2015-05-19 Thread Jaegeuk Kim
The f2fs_derive_key_aes is called not from data path, so we can use GFP_KERNEL. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/crypto_key.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/crypto_key.c b/fs/f2fs/crypto_key.c index 2f5a45b..49f9e31 100644

Re: [f2fs-dev] [PATCH RFC] f2fs: recovering broken superblock during mount

2015-05-20 Thread Jaegeuk Kim
Hi Hu, On Wed, May 20, 2015 at 03:01:04PM +0800, hujianyang wrote: Hi Jaegeuk, There are two superblocks in f2fs. I wrapped one of them by 'dd' in a reliability test. After this, the polluted f2fs partition can be mounted with an error message: F2FS-fs (sdd3): Magic Mismatch,

[f2fs-dev] [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 jaeg...@kernel.org --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b

[f2fs-dev] [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 jaeg...@kernel.org --- 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

Re: [f2fs-dev] [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 jaeg...@kernel.org wrote: New features are: o per-file encryption (e.g., ext4) The new encrypted symlinks needed

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

2015-06-25 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, though. Also, agreed

[f2fs-dev] [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 jaeg...@kernel.org --- 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

[f2fs-dev] [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 jaeg...@kernel.org --- 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

Re: [f2fs-dev] [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. Otherwise inheritance of parent's

Re: [f2fs-dev] Dwrite with non-aligned offset and size

2015-06-01 Thread Jaegeuk Kim
On Mon, Jun 01, 2015 at 07:55:08PM +0800, He YunLei wrote: Hi Jaegeuk, We run ltp testcase with f2fs and obtain a TFAIL in diotest4, the result in detail is as fallow: dio04 test_start tag=dio04 stime=1432278894 cmdline=diotest4 contacts= analysis=exit test_output diotest41

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-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel

Re: [f2fs-dev] [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. In order to avoid that, let's reuse

[f2fs-dev] [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 jaeg...@kernel.org --- 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

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

2015-05-29 Thread Jaegeuk Kim
-by: Jaegeuk Kim jaeg...@kernel.org --- 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

Re: [f2fs-dev] Not use inline_data after file shrink

2015-05-29 Thread Jaegeuk Kim
Hi Chao, [snip] We can see that file still uses 16 Blocks How do we deal with such situation? Now, f2fs does not convert non-inline inode to inline one for these potential inodes with small size. So, once inline inode is converted, there is no procedure to revert it. it's

Re: [f2fs-dev] [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 jaeg...@kernel.org Date: Wed, 20 May 2015 19:12:30 -0700 Subject: [PATCH] f2fs crypto: introduce a mempool

[f2fs-dev] [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 jaeg...@kernel.org

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-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel

Re: [f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents

2015-06-30 Thread Jaegeuk Kim
On Tue, Jun 30, 2015 at 11:00:13AM +0800, Chao Yu wrote: Hi Jaegeuk, -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Tuesday, June 30, 2015 2:39 AM To: linux-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 08/12] f2fs: introduce a shrinker for mounted fs

2015-06-30 Thread Jaegeuk Kim
On Tue, Jun 30, 2015 at 11:43:29AM +0800, Chao Yu wrote: -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Tuesday, June 30, 2015 2:40 AM To: linux-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim

Re: [f2fs-dev] [PATCH] f2fs:Make the function check_dnode have a return type of bool

2015-06-30 Thread Jaegeuk Kim
Hi, On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote: This makes the function check_dnode have a return type of bool due to this particular function only ever returning either one or zero as its return value. Signed-off-by: Nicholas Krause xerofo...@gmail.com ---

Re: [f2fs-dev] [PATCH 2/2] f2fs: move extent cache codes to extent_cache.c

2015-06-30 Thread Jaegeuk Kim
) 2015 Motorola Mobility + * Copyright (c) 2015 Samsung Electronics + * Authors: Jaegeuk Kim jaeg...@kernel.org + * Chao Yu chao2...@samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version

Re: [f2fs-dev] [RFC] maintain stable and dev code separately

2015-06-30 Thread Jaegeuk Kim
On Wed, Jul 01, 2015 at 10:00:52AM +0800, Chao Yu wrote: Hi Jaegeuk, Now in our f2fs git repository, we have only one major 'dev' branch for collecting last reviewed and tested patches. And in merge window of Linux, we do not update dev branch with last patches, so in this period of two

Re: [f2fs-dev] [PATCH] f2fs:Make the function check_dnode have a return type of bool

2015-06-30 Thread Jaegeuk Kim
On Tue, Jun 30, 2015 at 08:56:17PM -0400, nick wrote: On 2015-06-30 08:50 PM, Jaegeuk Kim wrote: Hi, On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote: This makes the function check_dnode have a return type of bool due to this particular function only ever returning

Re: [f2fs-dev] [PATCH 1/2] f2fs: refactor shrink flow for extent cache

2015-06-30 Thread Jaegeuk Kim
Hi Chao, On Tue, Jun 30, 2015 at 06:42:09PM +0800, Chao Yu wrote: For now, in extent cache, we have a global lru list which links all extent node in the cache, and the list is protected by a global spinlock. If we want to shrink extent cache, we will: 1. delete all target extent node from

[f2fs-dev] [PATCH 2/2] f2fs: shrink unreferenced extent_caches first

2015-06-30 Thread Jaegeuk Kim
If an extent_tree entry has a zero reference count, we can drop it from the cache in higher priority rather than currently referencing entries. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/data.c | 51 +-- 1 file changed, 41 insertions

[f2fs-dev] [PATCH 1/2] f2fs: check the largest extent at look-up time

2015-06-30 Thread Jaegeuk Kim
Because of the extent shrinker or other -ENOMEM scenarios, it cannot guarantee that the largest extent would be cached in the tree all the time. Instead of relying on extent_tree, we can simply check the cached one in extent tree accordingly. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs

Re: [f2fs-dev] [PATCH 11/12] f2fs: add noextent_cache mount option

2015-07-03 Thread Jaegeuk Kim
On Thu, Jul 02, 2015 at 08:35:34PM +0800, Chao Yu wrote: -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Tuesday, June 30, 2015 2:40 AM To: linux-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim

Re: [f2fs-dev] [PATCH] f2fs: reduce lock overhead of extent node releasing

2015-07-04 Thread Jaegeuk Kim
On Thu, Jul 02, 2015 at 08:40:12PM +0800, Chao Yu wrote: From e5c6600d01c4462c4e1ee0c70ec1d9319862077d Mon Sep 17 00:00:00 2001 From: Chao Yu chao2...@samsung.com Date: Thu, 2 Jul 2015 18:52:46 +0800 Subject: [PATCH] f2fs: reduce lock overhead of extent node releasing Open and close

[f2fs-dev] [PATCH 2/2] fsck.f2fs: drop extent_info to avoid potential wrong access

2015-07-06 Thread Jaegeuk Kim
This patch avoids wrong extent information modified by fixing block addresses. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fsck/fsck.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fsck/fsck.c b/fsck/fsck.c index bbd4cab..70efce6 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -722,6

[f2fs-dev] [PATCH 12/12] f2fs: use extent_cache by default

2015-06-29 Thread Jaegeuk Kim
We don't need to handle the duplicate extent infot showrmation. The integrated rule is: - update on-disk extent with largest one tracked by in-memory extent_cache - destroy extent_tree for the truncation case - drop per-inode extent_cache by shrinker Signed-off-by: Jaegeuk Kim jaeg

[f2fs-dev] [PATCH 11/12] f2fs: add noextent_cache mount option

2015-06-29 Thread Jaegeuk Kim
This patch adds noextent_cache mount option. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/super.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 2e8645e..a9db896 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -65,6 +65,7

[f2fs-dev] [PATCH 03/12] f2fs: convert inline_data for various fallocate

2015-06-29 Thread Jaegeuk Kim
For newly added fallocate types, it should convert inline_data before handling block swapping. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/file.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index ada2a3d..1b67215 100644

[f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents

2015-06-29 Thread Jaegeuk Kim
this. Instead, we can do __try_back_merge only when there exists a den pointer. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/data.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9bedfa8..7817167 100644 --- a/fs/f2fs/data.c +++ b

[f2fs-dev] [PATCH 08/12] f2fs: introduce a shrinker for mounted fs

2015-06-29 Thread Jaegeuk Kim
implementation was copied from fs/btrfs/shrinker.c Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/Makefile | 1 + fs/f2fs/f2fs.h | 13 +++ fs/f2fs/shrinker.c | 104 + fs/f2fs/super.c| 24 + 4 files changed, 142

[f2fs-dev] [PATCH 07/12] f2fs: set cached_en after checking finally

2015-06-29 Thread Jaegeuk Kim
This patch relocates cached_en not only to be covered by spin_lock, but also to set once after checking out completely. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/data.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c

Re: [f2fs-dev] [PATCH RFC] f2fs: recovering broken superblock during mount

2015-05-21 Thread Jaegeuk Kim
/21 9:07, Jaegeuk Kim wrote: Hi Hu, On Wed, May 20, 2015 at 03:01:04PM +0800, hujianyang wrote: Hi Jaegeuk, There are two superblocks in f2fs. I wrapped one of them by 'dd' in a reliability test. After this, the polluted f2fs partition can be mounted with an error message: F2FS

[f2fs-dev] [PATCH 3/3] f2fs crypto: preallocate BIO_MAX_PAGES for writeback

2015-05-21 Thread Jaegeuk Kim
This patch changes the number of preallocated pages to BIO_MAX_PAGES to prepare writeback encryption. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c index 2ceee68..cfe5a04

[f2fs-dev] [PATCH 1/3] f2fs crypto: use per-inode tfm structure

2015-05-21 Thread Jaegeuk Kim
for that inode, since the tfm can be used by multiple crypto requests in parallel. Also use cmpxchg() to avoid races that could result in crypt_info structure getting doubly allocated or doubly freed. Signed-off-by: Theodore Ts'o ty...@mit.edu Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs

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

2015-05-21 Thread Jaegeuk Kim
If a lot of write streams are triggered, alloc_page and __free_page are costly called, resulting in high memory pressure. In order to avoid that, let's reuse mempool pages for writeback pages. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/crypto.c | 16 1 file

Re: [f2fs-dev] [PATCH 1/2] f2fs: avoid duplicated code by reusing f2fs_read_end_io

2015-05-19 Thread Jaegeuk Kim
Hi Chao, On Tue, May 19, 2015 at 05:38:56PM +0800, Chao Yu wrote: This patch tries to clean up code as part code of f2fs_read_end_io and mpage_end_io are the same, so it's better to merge and reuse them. Signed-off-by: Chao Yu chao2...@samsung.com --- fs/f2fs/data.c | 35

Re: [f2fs-dev] [PATCH 2/2 v3] f2fs: skip checkpoint if there is no dirty segments

2015-08-12 Thread Jaegeuk Kim
Change log from v2: - consider omitting current dirty segments From 181cb245f6a406e89c00976f65a5727956a72942 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim jaeg...@kernel.org Date: Tue, 11 Aug 2015 21:59:49 -0700 Subject: [PATCH] f2fs: skip checkpoint if there is no dirty and prefree segments We

[f2fs-dev] [PATCH 2/5] f2fs: fix to cover lock_op for update_inode_page

2015-08-18 Thread Jaegeuk Kim
Previously, update_inode_page is not called under f2fs_lock_op. Instead we should call with f2fs_write_inode. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 016ed3b

[f2fs-dev] [PATCH 5/5] f2fs: check the node block address of newly allocated nid

2015-08-18 Thread Jaegeuk Kim
allocation as the last chance. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/node.c | 9 + 1 file changed, 9 insertions(+) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3cc32b8..6bef5a2 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1573,6 +1573,8 @@ retry: /* We

[f2fs-dev] [PATCH 4/5] f2fs: go out for insert_inode_locked failure

2015-08-18 Thread Jaegeuk Kim
We should not call unlock_new_inode when insert_inode_locked failed. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/namei.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 97e97c4..a680bf3 100644 --- a/fs/f2fs/namei.c

Re: [f2fs-dev] [PATCH 2/9] f2fs: avoid unneeded initializing when converting inline dentry

2015-08-20 Thread Jaegeuk Kim
Hi Chao, On Wed, Aug 19, 2015 at 07:10:19PM +0800, Chao Yu wrote: When converting inline dentry, we will zero out target dentry page before duplicating data of inline dentry into target page, it become overhead since inline dentry size is not small. So this patch tries to remove unneeded

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix to release inode correctly

2015-08-24 Thread Jaegeuk Kim
On Mon, Aug 24, 2015 at 05:40:45PM +0800, Chao Yu wrote: In following call stack, if unfortunately we lose all chances to truncate inode page in remove_inode_page, eventually we will add the nid allocated previously into free nid cache, this nid is with NID_NEW status and with NEW_ADDR in its

Re: [f2fs-dev] [PATCH 9/9] f2fs: update extent tree in batches

2015-08-20 Thread Jaegeuk Kim
Hi Chao, On Wed, Aug 19, 2015 at 07:21:48PM +0800, Chao Yu wrote: This patch introduce a new helper f2fs_update_extent_tree_range which can update extent nodes in extent tree in batches. Now, we use the function to invalidate blocks in batches instead of invalidating them one by one when

Re: [f2fs-dev] [PATCH 1/2] f2fs: handle failed bio allocation

2015-08-23 Thread Jaegeuk Kim
2001 From: Jaegeuk Kim jaeg...@kernel.org Date: Thu, 20 Aug 2015 08:51:56 -0700 Subject: [PATCH] f2fs: use __GFP_NOFAIL to avoid infinite loop __GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and bio_alloc. Suggested-by: Chao Yu chao2...@samsung.com Signed-off

Re: [f2fs-dev] [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry

2015-08-23 Thread Jaegeuk Kim
Hi Zhang, On Mon, Aug 24, 2015 at 11:39:55AM +0800, Zhang Zhen wrote: __add_ino_entry is looping around the allocation request and minics __GFP_NOFAIL behavior without any allocation fallback strategy. Here remove the open coded loop and replace it with __GFP_NOFAIL. Signed-off-by: Zhang

Re: [f2fs-dev] [PATCH 1/2] f2fs: handle failed bio allocation

2015-08-20 Thread Jaegeuk Kim
On Thu, Aug 20, 2015 at 05:08:24PM +0800, Chao Yu wrote: Hi Jaegeuk, -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Saturday, August 15, 2015 7:09 AM To: linux-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net

Re: [f2fs-dev] [PATCH 1/2] f2fs: call set_page_dirty to attach i_wb for cgroup

2015-07-28 Thread Jaegeuk Kim
On Tue, Jul 28, 2015 at 06:29:38PM +0800, Chao Yu wrote: Hi Jaegeuk, -Original Message- From: Jaegeuk Kim [mailto:jaeg...@kernel.org] Sent: Sunday, July 26, 2015 8:21 AM To: linux-ker...@vger.kernel.org; linux-fsde...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net

[f2fs-dev] [PATCH] f2fs: do not assing a new segment for dio under space shortage

2015-08-11 Thread Jaegeuk Kim
If there is not enough free segment, we should not assign a new segment explicitly. Otherwise, we can run out of free segment. Signed-off-by: Jaegeuk Kim jaeg...@kernel.org --- fs/f2fs/segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs

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