lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ecryptfs: add rename flag support
Date
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
\
 
 \ /
  Last update: 2021-02-26 22:03    [W:0.088 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site