commit 0cba0e777b2bc0b09b422c25f74605bc364264ec
Author: Rachita Kothiyal <[EMAIL PROTECTED]>
Date: Sun May 18 03:19:33 2008 -0400
Unionfs ODF: Move around locking order in unions_readdir()
Signed-off-by: Rachita Kothiyal <[EMAIL PROTECTED]>
diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
index ca49ad1..3926972 100644
--- a/fs/unionfs/dirfops.c
+++ b/fs/unionfs/dirfops.c
@@ -38,7 +38,7 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
err = unionfs_file_revalidate(file, false);
if (unlikely(err))
- goto out;
+ goto out_unlock;
inode = dentry->d_inode;
@@ -48,7 +48,7 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
if (IS_ERR(odf_cache)) {
err = PTR_ERR(odf_cache);
odf_cache = NULL;
- goto out;
+ goto out_unlock;
}
/* check if cached dir does not exist */
@@ -61,7 +61,7 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
err = odf_cache_dir(file->f_path.dentry, odf_cache,
&file->f_path.dentry->d_inode->i_mtime);
if (err)
- goto out;
+ goto out_unlock;
/*
* Reset file position, since an operation like rm *
@@ -71,6 +71,7 @@ static int unionfs_readdir(struct file *file, void *dirent,
filldir_t filldir)
*/
file->f_pos = 0;
}
+ unionfs_unlock_dentry(dentry);
dget(odf_cache);
mntget(UNIONFS_SB(file->f_path.dentry->d_sb)->odf.path.mnt);
@@ -123,12 +124,15 @@ static int unionfs_readdir(struct file *file, void
*dirent, filldir_t filldir)
if (file->f_pos >= size)
file->f_pos = DIREOF;
+ goto out;
+
+out_unlock:
+ unionfs_unlock_dentry(dentry);
out:
kfree(name);
if (odf_file)
filp_close(odf_file, NULL);
dput(odf_cache);
- unionfs_unlock_dentry(dentry);
unionfs_read_unlock(dentry->d_sb);
return err;
}
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs