[Unionfs] segfault when moving symlinks, and mono
Erez Zadok
ezk at cs.sunysb.edu
Sun Jul 8 20:56:05 EDT 2007
In message <200707061328.48531.ruben at trisquel.uvigo.es>, =?iso-8859-1?q?Rub=E9n_Rodr=EDguez_P=E9rez?= writes:
>
> Hi. I'm a developer of trisquel GNU/Linux. We are working in a live cd using
> linux 2.6.21.5 and unionfs rc2-u3. Trisquel is based on debian testing and
> uses live-initramfs for the live environment.
>
> I'm getting a segfault when moving a symlink, but only if it already exists
> the r-o branch. Filesystem access becomes unavailable after the crash. My
Ruben, you're right. I was able to reproduce and fix your bug, which will
appear in the next set of releases. In the mean time, apply this on top of
the latest 2.6.21.5 unionfs patch.
Erez.
==============================================================================
diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
index 64bb5ef..6ae2e56 100644
--- a/fs/unionfs/copyup.c
+++ b/fs/unionfs/copyup.c
@@ -385,7 +385,7 @@ int copyup_dentry(struct inode *dir, struct dentry *dentry, int bstart,
(char __user *)symbuf,
PATH_MAX);
set_fs(oldfs);
- if (err) {
+ if (err < 0) {
__clear(dentry, old_lower_dentry,
old_bstart, old_bend,
new_lower_dentry, new_bindex);
@@ -466,7 +466,8 @@ out_free:
* functions we call above which operate on regular files.
*/
if (old_lower_dentry && old_lower_dentry->d_inode &&
- S_ISDIR(old_lower_dentry->d_inode->i_mode))
+ (S_ISDIR(old_lower_dentry->d_inode->i_mode) ||
+ S_ISLNK(old_lower_dentry->d_inode->i_mode)))
dput(old_lower_dentry);
kfree(symbuf);
More information about the unionfs
mailing list