linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ecryptfs: add rename flag support
@ 2021-02-26 21:01 Jeffrey Mitchell
  0 siblings, 0 replies; only message in thread
From: Jeffrey Mitchell @ 2021-02-26 21:01 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: ecryptfs, linux-kernel, Jeffrey Mitchell

Currently, ecryptfs_rename() returns EINVAL if any flags are passed in.
However, if the lower filesystem has support for those flags, it doesn't
require any additional complexity to take advantage of it in eCryptfs.

Add flag support to ecryptfs_rename() by passing them through to the lower
filesystem

Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
---
 fs/ecryptfs/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 18e9285fbb4c..647afc2fd754 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -601,9 +601,6 @@ ecryptfs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
 	struct inode *target_inode;
 	struct renamedata rd = {};
 
-	if (flags)
-		return -EINVAL;
-
 	lower_old_dir_dentry = ecryptfs_dentry_to_lower(old_dentry->d_parent);
 	lower_new_dir_dentry = ecryptfs_dentry_to_lower(new_dentry->d_parent);
 
@@ -636,6 +633,7 @@ ecryptfs_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
 	rd.new_mnt_userns	= &init_user_ns;
 	rd.new_dir		= d_inode(lower_new_dir_dentry);
 	rd.new_dentry		= lower_new_dentry;
+	rd.flags		= flags;
 	rc = vfs_rename(&rd);
 	if (rc)
 		goto out_lock;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-26 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 21:01 [PATCH] ecryptfs: add rename flag support Jeffrey Mitchell

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).