[Unionfs] crash on rm -rf
Ian Kent
raven at themaw.net
Wed Sep 10 23:55:25 EDT 2008
On Wed, 2008-09-10 at 23:21 -0400, Erez Zadok wrote:
> 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);
Seems a strange place to set the vfsmount, what were your findings here?
Should this have been set somewhere in the lookup or revalidate?
Could this also be related to the panic Stephen has just reported?
In that trace the call to ->unlink() hasn't been reached yet.
> if (inode->i_nlink == 0) /* drop lower inodes */
> iput_lowers_all(inode, false);
> d_drop(dentry);
> _______________________________________________
> unionfs mailing list: http://unionfs.filesystems.org/
> unionfs at mail.fsl.cs.sunysb.edu
> http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs
More information about the unionfs
mailing list