Adjust unionfs after commit 745ca2475a6ac596e3d8d37c2759c0fbe2586227 ("CRED: Pass credentials through dentry_open()") in Linux 2.6.29 Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> --- fs/unionfs/commonfops.c | 12 ++++++++---- fs/unionfs/copyup.c | 6 ++++-- fs/unionfs/dirhelper.c | 2 +- fs/unionfs/super.c | 2 +- fs/unionfs/unionfs.h | 7 ++++--- 5 files changed, 18 insertions(+), 11 deletions(-) diff -p -up linux-2.6.28/fs/unionfs/commonfops.c.orig linux-2.6.28/fs/unionfs/commonfops.c --- linux-2.6.28/fs/unionfs/commonfops.c.orig 2009-02-12 07:27:39.000000000 -0500 +++ linux-2.6.28/fs/unionfs/commonfops.c 2009-02-12 07:30:41.000000000 -0500 @@ -234,7 +234,8 @@ int unionfs_file_revalidate(struct file hidden_file = DENTRY_OPEN(hidden_dentry, stohiddenmnt_index(sb, bindex), - file->f_flags); + file->f_flags, + current_cred()); if (IS_ERR(hidden_file)) { err = PTR_ERR(hidden_file); goto out; @@ -278,7 +279,8 @@ int unionfs_file_revalidate(struct file hidden_file = DENTRY_OPEN(hidden_dentry, stohiddenmnt_index(sb, bstart), - file->f_flags); + file->f_flags, + current_cred()); if (IS_ERR(hidden_file)) { err = PTR_ERR(hidden_file); goto out; @@ -404,7 +406,8 @@ int unionfs_open(struct inode *inode, st hidden_file = DENTRY_OPEN(hidden_dentry, stohiddenmnt_index(inode->i_sb, bindex), - hidden_flags); + hidden_flags, + current_cred()); if (IS_ERR(hidden_file)) { err = PTR_ERR(hidden_file); goto out; @@ -453,7 +456,8 @@ int unionfs_open(struct inode *inode, st hidden_file = DENTRY_OPEN(hidden_dentry, stohiddenmnt_index(inode->i_sb, bstart), - hidden_flags); + hidden_flags, + current_cred()); if (IS_ERR(hidden_file)) { err = PTR_ERR(hidden_file); goto out; diff -p -up linux-2.6.28/fs/unionfs/copyup.c.orig linux-2.6.28/fs/unionfs/copyup.c --- linux-2.6.28/fs/unionfs/copyup.c.orig 2009-02-12 07:19:19.000000000 -0500 +++ linux-2.6.28/fs/unionfs/copyup.c 2009-02-12 07:31:33.000000000 -0500 @@ -277,7 +277,8 @@ int copyup_named_dentry(struct inode *di input_file = DENTRY_OPEN(old_hidden_dentry, stohiddenmnt_index(sb, old_bindex), - O_RDONLY | O_LARGEFILE); + O_RDONLY | O_LARGEFILE, + current_cred()); if (IS_ERR(input_file)) { err = PTR_ERR(input_file); goto out_dir; @@ -295,7 +296,8 @@ int copyup_named_dentry(struct inode *di output_file = DENTRY_OPEN(new_hidden_dentry, stohiddenmnt_index(sb, new_bindex), - O_WRONLY | O_LARGEFILE); + O_WRONLY | O_LARGEFILE, + current_cred()); if (IS_ERR(output_file)) { err = PTR_ERR(output_file); goto out_dir; diff -p -up linux-2.6.28/fs/unionfs/dirhelper.c.orig linux-2.6.28/fs/unionfs/dirhelper.c --- linux-2.6.28/fs/unionfs/dirhelper.c.orig 2009-02-12 07:31:42.000000000 -0500 +++ linux-2.6.28/fs/unionfs/dirhelper.c 2009-02-12 07:32:11.000000000 -0500 @@ -252,7 +252,7 @@ int check_empty(struct dentry *dentry, s branchget(sb, bindex); hidden_file = DENTRY_OPEN(hidden_dentry, stohiddenmnt_index(sb, bindex), - O_RDONLY); + O_RDONLY, current_cred()); if (IS_ERR(hidden_file)) { err = PTR_ERR(hidden_file); DPUT(hidden_dentry); diff -p -up linux-2.6.28/fs/unionfs/super.c.orig linux-2.6.28/fs/unionfs/super.c --- linux-2.6.28/fs/unionfs/super.c.orig 2009-02-12 07:32:17.000000000 -0500 +++ linux-2.6.28/fs/unionfs/super.c 2009-02-12 07:32:36.000000000 -0500 @@ -539,7 +539,7 @@ static struct dentry *do_get_dentry(stru branchget(sb, bindex); hidden_file = DENTRY_OPEN(DGET(hidden_parent), NULL, - open_flags); + open_flags, current_cred()); if (IS_ERR(hidden_file)) { dentry = (void *)hidden_file; DPUT(hidden_parent); diff -p -up linux-2.6.28/fs/unionfs/unionfs.h.orig linux-2.6.28/fs/unionfs/unionfs.h --- linux-2.6.28/fs/unionfs/unionfs.h.orig 2009-02-12 07:23:22.000000000 -0500 +++ linux-2.6.28/fs/unionfs/unionfs.h 2009-02-12 07:34:58.000000000 -0500 @@ -255,7 +255,8 @@ extern struct dentry *unionfs_lookup_one void record_path_lookup(struct nameidata *nd, int line, const char *file); void record_path_release(struct nameidata *nd, int line, const char *file); struct file *unionfs_dentry_open(struct dentry *ptr, struct vfsmount *mnt, - int flags, int line, const char *file); + int flags, const struct cred *cred, int line, + const char *file); void record_set(struct dentry *upper, int index, struct dentry *ptr, struct dentry *old, int line, const char *file); @@ -273,7 +274,7 @@ void record_set(struct dentry *upper, in * if the file is closed. If it isn't then the mount will be busy and * you can't unmount. */ -# define DENTRY_OPEN(d,m,f) unionfs_dentry_open((d),(m),(f),__LINE__,__FILE__) +# define DENTRY_OPEN(d,m,f,c) unionfs_dentry_open((d),(m),(f),(c),__LINE__,__FILE__) # define GET_PARENT(dentry) unionfs_dget_parent((dentry),__LINE__,__FILE__) #else /* not FIST_MALLOC_DEBUG */ # define KZALLOC(a,b) kzalloc((a),(b)) @@ -286,7 +287,7 @@ void record_set(struct dentry *upper, in # define LOOKUP_ONE_LEN(a,b,c) lookup_one_len((a),(b),(c)) # define RECORD_PATH_LOOKUP(a) # define RECORD_PATH_RELEASE(a) -# define DENTRY_OPEN(d,m,f) dentry_open((d),(m),(f)) +# define DENTRY_OPEN(d,m,f,c) dentry_open((d),(m),(f),(c)) # define GET_PARENT(d) dget_parent(d) #endif /* not FIST_MALLOC_DEBUG */