commit a1d81d6bf3da724104324f5ea646567b61ef3f21
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Sat Mar 24 20:16:41 2007 -0400
fixed a bug in readdir and added a coupled of stuff that I shouldn't had
left out during rebasing
diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
index b533507..8991ca3 100644
--- a/fs/unionfs/dirfops.c
+++ b/fs/unionfs/dirfops.c
@@ -31,6 +31,7 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
int namelen;
unsigned int d_type;
+ unionfs_read_lock(file->f_dentry->d_sb);
if ((err = unionfs_file_revalidate(file, 0)))
goto out;
@@ -47,7 +48,11 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
/* check if cached dir does not exist */
if (!odi->dentry->d_inode || !odi->dentry->d_inode->i_size) {
+
+ /* odf cache dir calls partial lookup wich expects a locked
dentry */
+ unionfs_lock_dentry(file->f_dentry);
err = odf_cache_dir(file->f_dentry, odi->dentry,
&file->f_dentry->d_inode->i_mtime);
+ unionfs_unlock_dentry(file->f_dentry);
if (err)
goto out;
@@ -96,6 +101,7 @@ out:
if (odf_file)
filp_close(odf_file, NULL);
odf_put_info(odi);
+ unionfs_read_unlock(file->f_dentry->d_sb);
return err;
}
@@ -103,10 +109,14 @@ static loff_t unionfs_dir_llseek(struct file *file,
loff_t offset, int origin)
{
loff_t err;
+ unionfs_read_lock(file->f_dentry->d_sb);
if ((err = unionfs_file_revalidate(file, 0)))
- return err;
+ goto out;
- return generic_file_llseek(file, offset, origin);
+ err = generic_file_llseek(file, offset, origin);
+out:
+ unionfs_read_unlock(file->f_dentry->d_sb);
+ return err;
}
/* Trimmed directory options, we shouldn't pass everything down since
diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 222dcab..e964c2d 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -25,6 +25,7 @@ static int unionfs_create(struct inode *parent, struct dentry
*dentry,
struct dentry *hidden_dentry = NULL;
struct dentry *hidden_parent_dentry = NULL;
int bstart;
+ int valid = 0;
/*
* We have to read-lock the superblock rwsem, and we have to
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index cd8820e..17d37da 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -320,8 +320,6 @@ int unionfs_partial_lookup(struct dentry *dentry)
if (err)
return err;
BUG_ON(!UNIONFS_D(dentry)->odf_info);
- if (UNIONFS_D(dentry)->odf_info->whiteout)
- printk("%s is wh\n",
dentry->d_name.name);
}
}
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs