[f2fs-dev] [PATCH] fsck.f2fs: fix incorrect block_addr of node/meta

2016-03-02 Thread Junling Zheng
Fix incorrect block_addr of node or meta inode into 0x1 during build_nat_area_bitmap(). Signed-off-by: Junling Zheng Signed-off-by: Liu Xue Signed-off-by: Sheng Yong --- fsck/mount.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fsck/mount.c b/fsck/mount.c index 4

[f2fs-dev] [PATCH v2] f2fs: Use cryptoapi crc32 functions

2016-03-02 Thread Keith Mok
From: Keith Mok The crc function is done bit by bit. Optimize this by use cryptoapi crc32 function which is backed by h/w acceleration. Signed-off-by: Keith Mok --- fs/f2fs/Kconfig | 2 ++ fs/f2fs/checkpoint.c | 6 +++--- fs/f2fs/f2fs.h | 48 +++

Re: [f2fs-dev] [PATCH] f2fs: Use crypto crc32 functions

2016-03-02 Thread Keith Mok
Will update the first BUG_ON by using SHASH_DESC_ON_STACK. 2016-03-02 10:21 GMT-08:00 Jaegeuk Kim : > Hi Keith, > >> +static inline __u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void >> *address, >> +unsigned int length) >> +{ >> + struct { >> + struct

[f2fs-dev] [PATCH 09/10] f2fs crypto: sync ext4_lookup and ext4_file_open

2016-03-02 Thread Jaegeuk Kim
This patch tries to catch up with lookup and open policies in ext4. Signed-off-by: Jaegeuk Kim --- fs/f2fs/dir.c | 2 +- fs/f2fs/file.c | 4 fs/f2fs/namei.c | 23 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index

[f2fs-dev] [PATCH 06/10] fs crypto: add Makefile and Kconfig

2016-03-02 Thread Jaegeuk Kim
This patch adds a facility to enable per-file encryption. Arnd fixes a missing CONFIG_BLOCK check in the original patch. "The newly added generic crypto abstraction for file systems operates on 'struct bio' objects, which do not exist when CONFIG_BLOCK is disabled: fs/crypto/crypto.c: In function

[f2fs-dev] [PATCH 03/10] fs crypto: add policy.c to handle contexts

2016-03-02 Thread Jaegeuk Kim
This patch adds policy.c supporting context management. 1. For ioctls: - fscrypt_process_policy - fscrypt_get_policy 2. For context permission - fscrypt_has_permitted_context - fscrypt_inherit_context Signed-off-by: Michael Halcrow Signed-off-by: Theodore Ts'o Signed-off-by: Ildar Muslukho

[f2fs-dev] [PATCH 04/10] fs crypto: add keyinfo.c to handle permissions

2016-03-02 Thread Jaegeuk Kim
This patch adds keyinfo.c supporting key management. - fscrypt_get_encryption_info - fscrypt_free_encryption_info Signed-off-by: Michael Halcrow Signed-off-by: Ildar Muslukhov Signed-off-by: Theodore Ts'o Signed-off-by: Jaegeuk Kim --- fs/crypto/keyinfo.c | 278 +++

[f2fs-dev] [PATCH 10/10] ext4 crypto: migrate into vfs's crypto engine

2016-03-02 Thread Jaegeuk Kim
This patch removes the most parts of internal crypto codes. And then, it modifies and adds some ext4-specific crypt codes to use the generic facility. Signed-off-by: Jaegeuk Kim --- fs/ext4/Kconfig | 12 +- fs/ext4/Makefile| 2 - fs/ext4/crypto.c| 525 -

[f2fs-dev] [PATCH v3 00/10] File-level Encryption Support by VFS

2016-03-02 Thread Jaegeuk Kim
Change log from v2: - add missing Kconfig - support module compilation - change some data types to u8 Jaegeuk Kim (10): fs crypto: add basic definitions for per-file encryption fs crypto: add crypto.c for encrypt/decrypt functions fs crypto: add policy.c to handle contexts fs crypto: ad

[f2fs-dev] [PATCH 08/10] f2fs crypto: migrate into vfs's crypto engine

2016-03-02 Thread Jaegeuk Kim
This patch removes the most parts of internal crypto codes. And then, it modifies some f2fs-specific crypt codes to use the generic facility. Signed-off-by: Jaegeuk Kim --- fs/f2fs/Kconfig | 10 +- fs/f2fs/Makefile| 2 - fs/f2fs/crypto.c| 473 --

[f2fs-dev] [PATCH 01/10] fs crypto: add basic definitions for per-file encryption

2016-03-02 Thread Jaegeuk Kim
This patch adds definitions for per-file encryption used by ext4 and f2fs. Signed-off-by: Jaegeuk Kim --- include/linux/fs.h | 8 ++ include/linux/fscrypto.h | 239 +++ include/uapi/linux/fs.h | 18 3 files changed, 265 insertions(+) cr

[f2fs-dev] [PATCH 02/10] fs crypto: add crypto.c for encrypt/decrypt functions

2016-03-02 Thread Jaegeuk Kim
This patch adds crypto.c supporting encrypting and decrypting functions. 1. IO preparation: - fscrypt_get_ctx / fscrypt_release_ctx 2. before IOs: - fscrypt_encrypt_page - fscrypt_decrypt_page - fscrypt_zeroout_range 3. after IOs: - fscrypt_decrypt_bio_pages - fscrypt_pullback_bio_pa

[f2fs-dev] [PATCH 07/10] fs crypto: add dentry revalidation facility in crypto

2016-03-02 Thread Jaegeuk Kim
This patch is to support the following ext4 crypto change. commit 28b4c263961c47da84ed8b5be0b5116bad1133eb Author: Theodore Ts'o Date: Sun Feb 7 19:35:05 2016 -0500 ext4 crypto: revalidate dentry after adding or removing the key Cc: Theodore Ts'o Cc: Al Viro Signed-off-by: Jaegeuk Kim

[f2fs-dev] [PATCH 05/10] fs crypto: add fname.c to support filename encryption

2016-03-02 Thread Jaegeuk Kim
This patch adds fname.c supporting filename encryption. 1. general wrapper functions - fscrypt_fname_disk_to_usr - fscrypt_fname_usr_to_disk - fscrypt_setup_filename - fscrypt_free_filename 2. specific filename handling functions - fscrypt_fname_alloc_buffer - fscrypt_fname_free_buffer Sig

Re: [f2fs-dev] [PATCH] f2fs: Use crypto crc32 functions

2016-03-02 Thread Jaegeuk Kim
Hi Keith, > +static inline __u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address, > +unsigned int length) > +{ > + struct { > + struct shash_desc shash; > + char ctx[4]; > + } desc; > + int err; > + > + BUG_ON(crypto_shash_de