1
Add a struct vfsmount parameter to vfs_symlink()
3
Signed-off-by: Tony Jones <tonyj@suse.de>
4
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
6
Index: b/fs/ecryptfs/inode.c
7
===================================================================
8
--- a/fs/ecryptfs/inode.c
9
+++ b/fs/ecryptfs/inode.c
10
@@ -473,6 +473,7 @@ static int ecryptfs_symlink(struct inode
13
struct dentry *lower_dentry;
14
+ struct vfsmount *lower_mnt;
15
struct dentry *lower_dir_dentry;
17
char *encoded_symname;
18
@@ -481,6 +482,7 @@ static int ecryptfs_symlink(struct inode
20
lower_dentry = ecryptfs_dentry_to_lower(dentry);
22
+ lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
23
lower_dir_dentry = lock_parent(lower_dentry);
25
encoded_symlen = ecryptfs_encode_filename(crypt_stat, symname,
26
@@ -490,7 +492,7 @@ static int ecryptfs_symlink(struct inode
30
- rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
31
+ rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry, lower_mnt,
32
encoded_symname, mode);
33
kfree(encoded_symname);
34
if (rc || !lower_dentry->d_inode)
36
===================================================================
39
@@ -2185,7 +2185,8 @@ asmlinkage long sys_unlink(const char __
40
return do_unlinkat(AT_FDCWD, pathname);
43
-int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
44
+int vfs_symlink(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt,
45
+ const char *oldname, int mode)
47
int error = may_create(dir, dentry, NULL);
49
@@ -2231,7 +2232,8 @@ asmlinkage long sys_symlinkat(const char
53
- error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO);
54
+ error = vfs_symlink(nd.dentry->d_inode, dentry, nd.mnt, from,
58
mutex_unlock(&nd.dentry->d_inode->i_mutex);
59
Index: b/fs/nfsd/vfs.c
60
===================================================================
63
@@ -1432,6 +1432,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
66
struct dentry *dentry, *dnew;
67
+ struct vfsmount *mnt;
71
@@ -1458,6 +1459,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
72
if (iap && (iap->ia_valid & ATTR_MODE))
73
mode = iap->ia_mode & S_IALLUGO;
75
+ mnt = fhp->fh_export->ex_mnt;
76
if (unlikely(path[plen] != 0)) {
77
char *path_alloced = kmalloc(plen+1, GFP_KERNEL);
78
if (path_alloced == NULL)
79
@@ -1465,11 +1467,12 @@ nfsd_symlink(struct svc_rqst *rqstp, str
81
strncpy(path_alloced, path, plen);
82
path_alloced[plen] = 0;
83
- host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
84
+ host_err = vfs_symlink(dentry->d_inode, dnew, mnt,
85
+ path_alloced, mode);
89
- host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
90
+ host_err = vfs_symlink(dentry->d_inode, dnew, mnt, path, mode);
93
if (EX_ISSYNC(fhp->fh_export))
94
Index: b/include/linux/fs.h
95
===================================================================
96
--- a/include/linux/fs.h
97
+++ b/include/linux/fs.h
98
@@ -982,7 +982,7 @@ extern int vfs_permission(struct nameida
99
extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
100
extern int vfs_mkdir(struct inode *, struct dentry *, struct vfsmount *, int);
101
extern int vfs_mknod(struct inode *, struct dentry *, struct vfsmount *, int, dev_t);
102
-extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
103
+extern int vfs_symlink(struct inode *, struct dentry *, struct vfsmount *, const char *, int);
104
extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
105
extern int vfs_rmdir(struct inode *, struct dentry *);
106
extern int vfs_unlink(struct inode *, struct dentry *);