mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
102 lines
3.9 KiB
Diff
102 lines
3.9 KiB
Diff
![]() |
Add a struct vfsmount parameter to vfs_rmdir()
|
||
|
|
||
|
Signed-off-by: Tony Jones <tonyj@suse.de>
|
||
|
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
|
||
|
|
||
|
Index: linux-2.6.19/fs/ecryptfs/inode.c
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/fs/ecryptfs/inode.c
|
||
|
+++ linux-2.6.19/fs/ecryptfs/inode.c
|
||
|
@@ -572,14 +572,16 @@ out:
|
||
|
static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
|
||
|
{
|
||
|
struct dentry *lower_dentry;
|
||
|
+ struct vfsmount *lower_mnt;
|
||
|
struct dentry *lower_dir_dentry;
|
||
|
int rc;
|
||
|
|
||
|
lower_dentry = ecryptfs_dentry_to_lower(dentry);
|
||
|
+ lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
|
||
|
dget(dentry);
|
||
|
lower_dir_dentry = lock_parent(lower_dentry);
|
||
|
dget(lower_dentry);
|
||
|
- rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
|
||
|
+ rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_mnt, lower_dentry);
|
||
|
dput(lower_dentry);
|
||
|
if (!rc)
|
||
|
d_delete(lower_dentry);
|
||
|
Index: linux-2.6.19/fs/namei.c
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/fs/namei.c
|
||
|
+++ linux-2.6.19/fs/namei.c
|
||
|
@@ -2010,7 +2010,7 @@ void dentry_unhash(struct dentry *dentry
|
||
|
spin_unlock(&dcache_lock);
|
||
|
}
|
||
|
|
||
|
-int vfs_rmdir(struct inode *dir, struct dentry *dentry)
|
||
|
+int vfs_rmdir(struct inode *dir, struct vfsmount *mnt, struct dentry *dentry)
|
||
|
{
|
||
|
int error = may_delete(dir, dentry, 1);
|
||
|
|
||
|
@@ -2074,7 +2074,7 @@ static long do_rmdir(int dfd, const char
|
||
|
error = PTR_ERR(dentry);
|
||
|
if (IS_ERR(dentry))
|
||
|
goto exit2;
|
||
|
- error = vfs_rmdir(nd.dentry->d_inode, dentry);
|
||
|
+ error = vfs_rmdir(nd.dentry->d_inode, nd.mnt, dentry);
|
||
|
dput(dentry);
|
||
|
exit2:
|
||
|
mutex_unlock(&nd.dentry->d_inode->i_mutex);
|
||
|
Index: linux-2.6.19/fs/nfsd/nfs4recover.c
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/fs/nfsd/nfs4recover.c
|
||
|
+++ linux-2.6.19/fs/nfsd/nfs4recover.c
|
||
|
@@ -275,7 +275,7 @@ nfsd4_clear_clid_dir(struct dentry *dir,
|
||
|
* a kernel from the future.... */
|
||
|
nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
|
||
|
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
|
||
|
- status = vfs_rmdir(dir->d_inode, dentry);
|
||
|
+ status = vfs_rmdir(dir->d_inode, NULL, dentry);
|
||
|
mutex_unlock(&dir->d_inode->i_mutex);
|
||
|
return status;
|
||
|
}
|
||
|
Index: linux-2.6.19/fs/nfsd/vfs.c
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/fs/nfsd/vfs.c
|
||
|
+++ linux-2.6.19/fs/nfsd/vfs.c
|
||
|
@@ -1705,7 +1705,7 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
|
||
|
#endif
|
||
|
host_err = vfs_unlink(dirp, rdentry);
|
||
|
} else { /* It's RMDIR */
|
||
|
- host_err = vfs_rmdir(dirp, rdentry);
|
||
|
+ host_err = vfs_rmdir(dirp, NULL, rdentry);
|
||
|
}
|
||
|
|
||
|
dput(rdentry);
|
||
|
Index: linux-2.6.19/fs/reiserfs/xattr.c
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/fs/reiserfs/xattr.c
|
||
|
+++ linux-2.6.19/fs/reiserfs/xattr.c
|
||
|
@@ -823,7 +823,7 @@ int reiserfs_delete_xattrs(struct inode
|
||
|
if (dir->d_inode->i_nlink <= 2) {
|
||
|
root = get_xa_root(inode->i_sb);
|
||
|
reiserfs_write_lock_xattrs(inode->i_sb);
|
||
|
- err = vfs_rmdir(root->d_inode, dir);
|
||
|
+ err = vfs_rmdir(root->d_inode, NULL, dir);
|
||
|
reiserfs_write_unlock_xattrs(inode->i_sb);
|
||
|
dput(root);
|
||
|
} else {
|
||
|
Index: linux-2.6.19/include/linux/fs.h
|
||
|
===================================================================
|
||
|
--- linux-2.6.19.orig/include/linux/fs.h
|
||
|
+++ linux-2.6.19/include/linux/fs.h
|
||
|
@@ -1017,7 +1017,7 @@ extern int vfs_mkdir(struct inode *, str
|
||
|
extern int vfs_mknod(struct inode *, struct vfsmount *, struct dentry *, int, dev_t);
|
||
|
extern int vfs_symlink(struct inode *, struct vfsmount *, struct dentry *, const char *, int);
|
||
|
extern int vfs_link(struct vfsmount *, struct dentry *, struct inode *, struct vfsmount *, struct dentry *);
|
||
|
-extern int vfs_rmdir(struct inode *, struct dentry *);
|
||
|
+extern int vfs_rmdir(struct inode *, struct vfsmount *, struct dentry *);
|
||
|
extern int vfs_unlink(struct inode *, struct dentry *);
|
||
|
extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
|
||
|
|