linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] f2fs crypto: check dir entry just for directory
@ 2015-05-25 10:08 Chao Yu
  2015-05-27  7:27 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2015-05-25 10:08 UTC (permalink / raw)
  To: Jaegeuk Kim, Changman Lee; +Cc: linux-kernel, linux-f2fs-devel

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@samsung.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



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-27  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-25 10:08 [PATCH 2/3] f2fs crypto: check dir entry just for directory Chao Yu
2015-05-27  7:27 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).