[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <00d501d096d2$cdd373f0$697a5bd0$@samsung.com>
Date: Mon, 25 May 2015 18:08:08 +0800
From: Chao Yu <chao2.yu@...sung.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>,
Changman Lee <cm224.lee@...sung.com>
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] f2fs crypto: check dir entry just for directory
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 <chao2.yu@...sung.com>
---
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists