From patchwork Sat Feb 13 02:56:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 8299351 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 90E819F1C5 for ; Sat, 13 Feb 2016 02:57:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA7C4204E3 for ; Sat, 13 Feb 2016 02:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCFBB204EB for ; Sat, 13 Feb 2016 02:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbcBMC5A (ORCPT ); Fri, 12 Feb 2016 21:57:00 -0500 Received: from mail.kernel.org ([198.145.29.136]:46192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbcBMC4k (ORCPT ); Fri, 12 Feb 2016 21:56:40 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99A79204F6; Sat, 13 Feb 2016 02:56:39 +0000 (UTC) Received: from localhost (107-1-141-74-ip-static.hfc.comcastbusiness.net [107.1.141.74]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B749204EC; Sat, 13 Feb 2016 02:56:38 +0000 (UTC) From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/3] f2fs crypto: sync with ext4's fname padding Date: Fri, 12 Feb 2016 18:56:34 -0800 Message-Id: <1455332195-76333-2-git-send-email-jaegeuk@kernel.org> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1455332195-76333-1-git-send-email-jaegeuk@kernel.org> References: <1455332195-76333-1-git-send-email-jaegeuk@kernel.org> X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes wrong adoption on fname padding. Signed-off-by: Jaegeuk Kim --- fs/f2fs/crypto_fname.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/crypto_fname.c b/fs/f2fs/crypto_fname.c index 905c065..73741fb 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)