[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190314171559.27584-2-richard@nod.at>
Date: Thu, 14 Mar 2019 18:15:56 +0100
From: Richard Weinberger <richard@....at>
To: linux-mtd@...ts.infradead.org
Cc: linux-fscrypt@...r.kernel.org, jaegeuk@...nel.org, tytso@....edu,
linux-unionfs@...r.kernel.org, miklos@...redi.hu,
amir73il@...il.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, paullawrence@...gle.com,
Richard Weinberger <richard@....at>
Subject: [PATCH 1/4] fscrypt: Implement FS_CFLG_OWN_D_OPS
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@....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
Powered by blists - more mailing lists