Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752565AbbEYKJK (ORCPT ); Mon, 25 May 2015 06:09:10 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:58991 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbbEYKIz (ORCPT ); Mon, 25 May 2015 06:08:55 -0400 X-AuditID: cbfee61a-f79516d000006302-ed-5562f4b53e6b From: Chao Yu To: Jaegeuk Kim , Changman Lee Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] f2fs crypto: check dir entry just for directory Date: Mon, 25 May 2015 18:08:08 +0800 Message-id: <00d501d096d2$cdd373f0$697a5bd0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdCW0fECSEJCgYH4S0C/OnJdHsgr4Q== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t9jQd1tX5JCDX5oWFzb18hk8WT9LGaL S4vcLS7vmsPmwOKxaVUnm8fuBZ+ZPPq2rGL0+LxJLoAlissmJTUnsyy1SN8ugSvj86zdrAU3 2Cp+TfzM3MB4jLWLkZNDQsBEYtuqRYwQtpjEhXvr2boYuTiEBKYzSkzc/pAFJCEk8IpR4sQx MJtNQEViecd/JhBbRMBLYtL+E2BxZgEPicaO72BDhQVcJJ4vWQ40lIODRUBVoutGKkiYV8BS 4vu87SwQtqDEj8n3oFq1JNbvPM4EYctLbF7zlhniHgWJHWdfM0Ks0pPY8ROmXlxi45FbLBMY BWYhGTULyahZSEbNQtKygJFlFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkZwOD+T2sG4ssHi EKMAB6MSD29ERlKoEGtiWXFl7iFGCQ5mJRHekI9AId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwn 831ChQTSE0tSs1NTC1KLYLJMHJxSDYwTXB99tH8fsGBSrFOh0f1VwusyN63x0yv/4DP/ofPS vZ56OZIpK+bffHtPsvFS7pv/szJ4ZTUEDnUZOS+es1JQqL1+4tt15V8knV4E+TY9m+iwfqtG nfPR6O9u7DWudScTfv49zZ3Kc2hz1CvmxuwNHsfM/WLXvWhwOn31xfYPHrNXb02p2celxFKc kWioxVxUnAgAcACFn2MCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1074 Lines: 32 This patch fixes to add a judgement condition to verify type of the target inode before empty directory verification. So wrong verification could be avoided for non-directory inode. Signed-off-by: Chao Yu --- fs/f2fs/crypto_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/crypto_policy.c b/fs/f2fs/crypto_policy.c index bef254b..56b2ac0 100644 --- a/fs/f2fs/crypto_policy.c +++ b/fs/f2fs/crypto_policy.c @@ -93,7 +93,7 @@ int f2fs_process_policy(const struct f2fs_encryption_policy *policy, return -EINVAL; if (!f2fs_inode_has_encryption_context(inode)) { - if (!f2fs_empty_dir(inode)) + if (S_ISDIR(inode->i_mode) && !f2fs_empty_dir(inode)) return -ENOTEMPTY; return f2fs_create_encryption_context_from_policy(inode, policy); -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/