commit 545b95c7dd8b7487efcca246ed2a85ac5eff702d
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Sat Feb 24 17:04:00 2007 -0500
locking
diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index a1a27ed..fe6c9a4 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -752,6 +752,8 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf, struct timespec
goto out;
}
+ /* lock to prevent concurrent writes */
+ odf_lock(UNIONFS_D(d_upper)->odf_info);
/* Process the hidden directories with rdutil_callback as a filldir. */
for (bindex = bstart; bindex <= bend; bindex++) {
hidden_dentry = unionfs_lower_dentry_idx(d_upper, bindex);
@@ -761,7 +763,6 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf, struct timespec
continue;
if (!S_ISDIR(hidden_dentry->d_inode->i_mode))
continue;
-
dget(hidden_dentry);
mntget(unionfs_lower_mnt_idx(d_upper, bindex));
branchget(sb, bindex);
@@ -772,7 +773,7 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf, struct timespec
err = PTR_ERR(hidden_file);
dput(hidden_dentry);
branchput(sb, bindex);
- goto out;
+ goto out_unlock;
}
do {
@@ -791,13 +792,18 @@ int odf_cache_dir(struct dentry *d_upper, struct dentry
*d_odf, struct timespec
branchput(sb, bindex);
if (err < 0)
- goto out;
+ goto out_unlock;
}
+ odf_unlock(UNIONFS_D(d_upper)->odf_info);
/* set mtime of odf file to that of higher file */
attr.ia_mtime = *mtime;//d_upper->d_inode->i_mtime;
attr.ia_valid = ATTR_MTIME | ATTR_MTIME_SET | ATTR_FORCE;
err = notify_change(d_odf, &attr);
+ goto out;
+
+out_unlock:
+ odf_unlock(UNIONFS_D(d_upper)->odf_info);
out:
if (buf && buf->rdstate)
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 90e1c2f..7e61a66 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -1417,12 +1417,13 @@ struct odf_dentry_info *odf_ic_dir(struct dentry *dir)
odi_ret = NULL;
goto out;
}
-
out:
for (i = 0; i < 4; i++)
odf_put_info(odis[i]);
+
if (err)
return ERR_PTR(err);
+
return odi_ret;
}
/*
@@ -1565,13 +1566,16 @@ int odf_purge_dir_cache(struct dentry *dentry)
odi = NULL;
goto out;
}
-
+
/* truncate */
+/*
if (dentry->d_inode) {
attr.ia_size = 0;
attr.ia_valid = ATTR_SIZE | ATTR_FORCE;
err = notify_change(odi->dentry, &attr);
}
+*/
+ err = vfs_unlink(odi->dentry->d_parent->d_inode, odi->dentry);
out:
odf_put_info(odi);
return err;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs