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 Index: linux-2.6.27/fs/nfsd/vfs.c
18 ===================================================================
19 --- linux-2.6.27.orig/fs/nfsd/vfs.c
20 +++ linux-2.6.27/fs/nfsd/vfs.c
21 @@ -2095,6 +2095,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
23 nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
25 + struct vfsmount *mnt;
26 struct inode *inode = fhp->fh_dentry->d_inode;
29 @@ -2127,22 +2128,22 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
33 - error = mnt_want_write(fhp->fh_export->ex_path.mnt);
34 + mnt = fhp->fh_export->ex_path.mnt;
35 + error = mnt_want_write(mnt);
39 - error = vfs_setxattr(fhp->fh_dentry, fhp->fh_export->ex_path.mnt,
40 - name, value, size,0);
41 + error = vfs_setxattr(fhp->fh_dentry, mnt, name, value, size,0);
43 if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
46 - error = vfs_removexattr(fhp->fh_dentry, name);
47 + error = vfs_removexattr(fhp->fh_dentry, mnt, name);
48 if (error == -ENODATA)
52 - mnt_drop_write(fhp->fh_export->ex_path.mnt);
53 + mnt_drop_write(mnt);
57 Index: linux-2.6.27/fs/xattr.c
58 ===================================================================
59 --- linux-2.6.27.orig/fs/xattr.c
60 +++ linux-2.6.27/fs/xattr.c
61 @@ -190,7 +190,7 @@ vfs_listxattr(struct dentry *dentry, str
62 EXPORT_SYMBOL_GPL(vfs_listxattr);
65 -vfs_removexattr(struct dentry *dentry, const char *name)
66 +vfs_removexattr(struct dentry *dentry, struct vfsmount *mnt, const char *name)
68 struct inode *inode = dentry->d_inode;
70 @@ -471,7 +471,7 @@ SYSCALL_DEFINE3(flistxattr, int, fd, cha
71 * Extended attribute REMOVE operations
74 -removexattr(struct dentry *d, const char __user *name)
75 +removexattr(struct dentry *dentry, struct vfsmount *mnt, const char __user *name)
78 char kname[XATTR_NAME_MAX + 1];
79 @@ -482,7 +482,7 @@ removexattr(struct dentry *d, const char
83 - return vfs_removexattr(d, kname);
84 + return vfs_removexattr(dentry, mnt, kname);
87 SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
88 @@ -496,7 +496,7 @@ SYSCALL_DEFINE2(removexattr, const char
90 error = mnt_want_write(path.mnt);
92 - error = removexattr(path.dentry, name);
93 + error = removexattr(path.dentry, path.mnt, name);
94 mnt_drop_write(path.mnt);
97 @@ -514,7 +514,7 @@ SYSCALL_DEFINE2(lremovexattr, const char
99 error = mnt_want_write(path.mnt);
101 - error = removexattr(path.dentry, name);
102 + error = removexattr(path.dentry, path.mnt, name);
103 mnt_drop_write(path.mnt);
106 @@ -534,7 +534,7 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, c
107 audit_inode(NULL, dentry);
108 error = mnt_want_write_file(f->f_path.mnt, f);
110 - error = removexattr(dentry, name);
111 + error = removexattr(dentry, f->f_path.mnt, name);
112 mnt_drop_write(f->f_path.mnt);
115 Index: linux-2.6.27/include/linux/xattr.h
116 ===================================================================
117 --- linux-2.6.27.orig/include/linux/xattr.h
118 +++ linux-2.6.27/include/linux/xattr.h
119 @@ -51,7 +51,7 @@ ssize_t xattr_getsecurity(struct inode *
120 ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, const char *, void *, size_t);
121 ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, size_t size);
122 int vfs_setxattr(struct dentry *, struct vfsmount *, const char *, const void *, size_t, int);
123 -int vfs_removexattr(struct dentry *, const char *);
124 +int vfs_removexattr(struct dentry *, struct vfsmount *mnt, const char *);
126 ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
127 ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);