> When the file moves under another directory, unionfs rename(2) creates
> whiteout under new parent incorrectly.
:::
> The root cause is in d_move() called in vfs_rename_other(). It changes
> parent directory of old_dentry(f_src) as new_dentry's parent(e_dst).
> Currently, unionfs rename creates whiteout after vfs_rename().
> We should create whiteout before calling vfs_rename(), or create a
> temporally dentry at creating whiteout.
> Does anyone have another idea?
I have tried addressing this problem. Here is a patch for it.
This patch restores hidden_old_dentry.
Any opnion or advice are welcomed.
Junjiro Okajima
--- unionfs-20050929-0844/rename.cO 2005-09-29 21:44:03.000000000 +0900
+++ unionfs-20050929-0844/rename.c 2005-10-02 18:03:44.000000000 +0900
@@ -124,6 +124,20 @@
double_unlock(hidden_old_dir_dentry, hidden_new_dir_dentry);
DPUT(hidden_old_dentry);
+ /*
+ * restore old_dentry's parent, in order to create whiteout later.
+ * -jro
+ */
+ if (!err && hidden_old_dir_dentry != hidden_new_dir_dentry) {
+ ASSERT(hidden_old_dentry->d_parent == hidden_new_dir_dentry);
+ DPUT(hidden_old_dentry);
+ hidden_old_dentry = LOOKUP_ONE_LEN(old_dentry->d_name.name,
+ hidden_old_dir_dentry,
+ old_dentry->d_name.len);
+ BUG_ON(IS_ERR(hidden_old_dentry));
+ set_dtohd_index(old_dentry, bindex, hidden_old_dentry);
+ }
+
out:
if (!err) {
/* Fixup the newdentry. */
_______________________________________________
unionfs mailing list
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs