commit 7be1e37ca97f6a11d95a17b82eff546b62e50a8e
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date: Mon May 28 19:18:45 2007 -0400
bug fix: get lower mnt from root dentry instead of lower dentry
While copying-up a file, the union object hasn't been fully formed yet, so
we don't have all the lower dentries/mnts to use (the caller will have them
later on). Therefore, we should use the sb->s_root's lower mnt here. This
fixes a "NULL mnt" warning message that came from unionfs_mntget.
Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>
diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
index 373679b..18eacad 100644
--- a/fs/unionfs/copyup.c
+++ b/fs/unionfs/copyup.c
@@ -184,6 +184,7 @@ static int __copyup_reg_data(struct dentry *dentry,
struct super_block *sb = dentry->d_sb;
struct file *input_file;
struct file *output_file;
+ struct vfsmount *output_mnt;
mm_segment_t old_fs;
char *buf = NULL;
ssize_t read_bytes, write_bytes;
@@ -211,12 +212,11 @@ static int __copyup_reg_data(struct dentry *dentry,
/* open new file */
dget(new_hidden_dentry);
- unionfs_mntget(dentry, new_bindex);
+ output_mnt = unionfs_mntget(sb->s_root, new_bindex);
unionfs_read_lock(sb);
branchget(sb, new_bindex);
unionfs_read_unlock(sb);
- output_file = dentry_open(new_hidden_dentry,
- unionfs_lower_mnt_idx(dentry, new_bindex),
+ output_file = dentry_open(new_hidden_dentry, output_mnt,
O_WRONLY | O_LARGEFILE);
if (IS_ERR(output_file)) {
err = PTR_ERR(output_file);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs