[Unionfs] crash on rm -rf

Erez Zadok ezk at cs.sunysb.edu
Wed Sep 10 23:21:29 EDT 2008


In message <20080824133941.389f8fa7 at speedy>, Stephen Hemminger writes:
> The following sequence of commands causes a kernel panic when
> run on 2.6.26.3 + unionfs 2.4.  It also crashes on 2.6.25
> 
> --------------
> 
> rm -rf /tmp/active /tmp/changes /tmp/config
> mkdir /tmp/active
> mkdir /tmp/changes
> mkdir /tmp/config
> 
> mkdir -p /tmp/active/system/login/user/test1
> mkdir -p /tmp/active/system/login/user/test2/password
> echo bar >/tmp/active/system/login/user/test2/password/node.val
> 
> mount -t unionfs -o dirs=/tmp/changes=rw:/tmp/active=ro unionfs /tmp/config
> 
> rm -fr /tmp/config/system/login/user/test2
> _______________________________________________
> unionfs mailing list: http://unionfs.filesystems.org/
> unionfs at mail.fsl.cs.sunysb.edu
> http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Stephen et al: Thanks for the bug report.  I was able to reproduce and fix
the bug.  This small patch below should take care of it (tested on
2.6.26.3).

Cheers,
Erez.


Unionfs: update parent mnt on unlink

Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>
diff --git a/fs/unionfs/unlink.c b/fs/unionfs/unlink.c
index 623f68d..fb236cd 100644
--- a/fs/unionfs/unlink.c
+++ b/fs/unionfs/unlink.c
@@ -146,6 +146,7 @@ int unionfs_unlink(struct inode *dir, struct dentry *dentry)
 	/* call d_drop so the system "forgets" about us */
 	if (!err) {
 		unionfs_postcopyup_release(dentry);
+		unionfs_postcopyup_setmnt(dentry->d_parent);
 		if (inode->i_nlink == 0) /* drop lower inodes */
 			iput_lowers_all(inode, false);
 		d_drop(dentry);


More information about the unionfs mailing list