lkml.org 
[lkml]   [2019]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] fscrypt: Implement FS_CFLG_OWN_D_OPS
Date
If a filesystem sets FS_CFLG_OWN_D_OPS it manages dentry operations
itself and fscrypt is not allowed to set them.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
fs/crypto/hooks.c | 4 +++-
include/linux/fscrypt.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c
index 56debb1fcf5e..3ec925405fbe 100644
--- a/fs/crypto/hooks.c
+++ b/fs/crypto/hooks.c
@@ -107,7 +107,9 @@ int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry)
spin_unlock(&dentry->d_lock);
}

- d_set_d_op(dentry, &fscrypt_d_ops);
+ if ((dir->i_sb->s_cop->flags & FS_CFLG_OWN_D_OPS) == 0)
+ d_set_d_op(dentry, &fscrypt_d_ops);
+
return 0;
}
EXPORT_SYMBOL_GPL(__fscrypt_prepare_lookup);
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index e5194fc3983e..7139a110ac4f 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -48,6 +48,7 @@ struct fscrypt_name {
* fscrypt superblock flags
*/
#define FS_CFLG_OWN_PAGES (1U << 1)
+#define FS_CFLG_OWN_D_OPS (1U << 2)

/*
* crypto operations for filesystems
--
2.21.0
\
 
 \ /
  Last update: 2019-03-14 18:25    [W:0.093 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site