1 From: Tony Jones <tonyj@suse.de>
2 Subject: Add a struct vfsmount parameter to vfs_removexattr()
4 The vfsmount will be passed down to the LSM hook so that LSMs can compute
7 Signed-off-by: Tony Jones <tonyj@suse.de>
8 Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
9 Signed-off-by: John Johansen <jjohansen@suse.de>
12 fs/nfsd/vfs.c | 11 ++++++-----
13 fs/xattr.c | 12 ++++++------
14 include/linux/xattr.h | 2 +-
15 3 files changed, 13 insertions(+), 12 deletions(-)
17 --- linux-2.6.27.orig/fs/nfsd/vfs.c
18 +++ linux-2.6.27/fs/nfsd/vfs.c
19 @@ -2095,6 +2095,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
21 nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
23 + struct vfsmount *mnt;
24 struct inode *inode = fhp->fh_dentry->d_inode;
27 @@ -2127,22 +2128,22 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
31 - error = mnt_want_write(fhp->fh_export->ex_path.mnt);
32 + mnt = fhp->fh_export->ex_path.mnt;
33 + error = mnt_want_write(mnt);
37 - error = vfs_setxattr(fhp->fh_dentry, fhp->fh_export->ex_path.mnt,
38 - name, value, size,0);
39 + error = vfs_setxattr(fhp->fh_dentry, mnt, name, value, size,0);
41 if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
44 - error = vfs_removexattr(fhp->fh_dentry, name);
45 + error = vfs_removexattr(fhp->fh_dentry, mnt, name);
46 if (error == -ENODATA)
50 - mnt_drop_write(fhp->fh_export->ex_path.mnt);
51 + mnt_drop_write(mnt);
55 --- linux-2.6.27.orig/fs/xattr.c
56 +++ linux-2.6.27/fs/xattr.c
57 @@ -190,7 +190,7 @@ vfs_listxattr(struct dentry *dentry, str
58 EXPORT_SYMBOL_GPL(vfs_listxattr);
61 -vfs_removexattr(struct dentry *dentry, const char *name)
62 +vfs_removexattr(struct dentry *dentry, struct vfsmount *mnt, const char *name)
64 struct inode *inode = dentry->d_inode;
66 @@ -471,7 +471,7 @@ SYSCALL_DEFINE3(flistxattr, int, fd, cha
67 * Extended attribute REMOVE operations
70 -removexattr(struct dentry *d, const char __user *name)
71 +removexattr(struct dentry *dentry, struct vfsmount *mnt, const char __user *name)
74 char kname[XATTR_NAME_MAX + 1];
75 @@ -482,7 +482,7 @@ removexattr(struct dentry *d, const char
79 - return vfs_removexattr(d, kname);
80 + return vfs_removexattr(dentry, mnt, kname);
83 SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
84 @@ -496,7 +496,7 @@ SYSCALL_DEFINE2(removexattr, const char
86 error = mnt_want_write(path.mnt);
88 - error = removexattr(path.dentry, name);
89 + error = removexattr(path.dentry, path.mnt, name);
90 mnt_drop_write(path.mnt);
93 @@ -514,7 +514,7 @@ SYSCALL_DEFINE2(lremovexattr, const char
95 error = mnt_want_write(path.mnt);
97 - error = removexattr(path.dentry, name);
98 + error = removexattr(path.dentry, path.mnt, name);
99 mnt_drop_write(path.mnt);
102 @@ -534,7 +534,7 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, c
103 audit_inode(NULL, dentry);
104 error = mnt_want_write_file(f->f_path.mnt, f);
106 - error = removexattr(dentry, name);
107 + error = removexattr(dentry, f->f_path.mnt, name);
108 mnt_drop_write(f->f_path.mnt);
111 --- linux-2.6.27.orig/include/linux/xattr.h
112 +++ linux-2.6.27/include/linux/xattr.h
113 @@ -51,7 +51,7 @@ ssize_t xattr_getsecurity(struct inode *
114 ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, const char *, void *, size_t);
115 ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, size_t size);
116 int vfs_setxattr(struct dentry *, struct vfsmount *, const char *, const void *, size_t, int);
117 -int vfs_removexattr(struct dentry *, const char *);
118 +int vfs_removexattr(struct dentry *, struct vfsmount *mnt, const char *);
120 ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
121 ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);