From: Erez_Zadok Date: Sun, 8 Jul 2007 01:31:28 +0000 (-0400) Subject: Unionfs: bugfix when renaming symlinks on readonly branches X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=65a36364e730cd1677db1aeab33651ecefe26956;p=unionfs-3.14.y.git Unionfs: bugfix when renaming symlinks on readonly branches Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c index 64bb5ef3c3f0..6ae2e5692842 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);