summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-02-10 13:23:16 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2016-02-22 16:07:23 -0800
commita263669fa18f77981d8b4fa7a095ed8dfd17e354 (patch)
tree7c10d79f83114bbbd0ec0029c55ac7d4257782a3 /fs/f2fs
parent60b286c442c75b1b9752bf773e92bfb00a0625e4 (diff)
f2fs crypto: sync with ext4's fname padding
This patch fixes wrong adoption on fname padding. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/crypto_fname.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/crypto_fname.c b/fs/f2fs/crypto_fname.c
index 905c06535c2a..73741fb65069 100644
--- a/fs/f2fs/crypto_fname.c
+++ b/fs/f2fs/crypto_fname.c
@@ -267,13 +267,13 @@ int f2fs_fname_crypto_alloc_buffer(struct inode *inode,
u32 ilen, struct f2fs_str *crypto_str)
{
unsigned int olen;
- int padding = 16;
+ int padding = 32;
struct f2fs_crypt_info *ci = F2FS_I(inode)->i_crypt_info;
if (ci)
padding = 4 << (ci->ci_flags & F2FS_POLICY_FLAGS_PAD_MASK);
- if (padding < F2FS_CRYPTO_BLOCK_SIZE)
- padding = F2FS_CRYPTO_BLOCK_SIZE;
+ if (ilen < F2FS_CRYPTO_BLOCK_SIZE)
+ ilen = F2FS_CRYPTO_BLOCK_SIZE;
olen = f2fs_fname_crypto_round_up(ilen, padding);
crypto_str->len = olen;
if (olen < F2FS_FNAME_CRYPTO_DIGEST_SIZE * 2)