View | Details | Raw Unified
Collapse All | Expand All

(-) unionfs-1.1.3.old/copyup.c (+16 lines)
 Lines 64-70    Link Here 
	name_list_orig = name_list;
	name_list_orig = name_list;
	while (*name_list) {
	while (*name_list) {
		ssize_t size;
		ssize_t size;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&old_hidden_dentry->d_inode->i_mutex);
#else
		down(&old_hidden_dentry->d_inode->i_sem);
		down(&old_hidden_dentry->d_inode->i_sem);
#endif
		err = security_inode_getxattr(old_hidden_dentry, name_list);
		err = security_inode_getxattr(old_hidden_dentry, name_list);
		if (err)
		if (err)
			size = err;
			size = err;
 Lines 73-79    Link Here 
			    old_hidden_dentry->d_inode->i_op->
			    old_hidden_dentry->d_inode->i_op->
			    getxattr(old_hidden_dentry, name_list, attr_value,
			    getxattr(old_hidden_dentry, name_list, attr_value,
				     XATTR_SIZE_MAX);
				     XATTR_SIZE_MAX);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&old_hidden_dentry->d_inode->i_mutex);
#else
		up(&old_hidden_dentry->d_inode->i_sem);
		up(&old_hidden_dentry->d_inode->i_sem);
#endif		
		if (size < 0) {
		if (size < 0) {
			err = size;
			err = size;
			goto out;
			goto out;
 Lines 84-90    Link Here 
			goto out;
			goto out;
		}
		}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&new_hidden_dentry->d_inode->i_mutex);
#else
		down(&new_hidden_dentry->d_inode->i_sem);
		down(&new_hidden_dentry->d_inode->i_sem);
#endif
		err =
		err =
		    security_inode_setxattr(old_hidden_dentry, name_list,
		    security_inode_setxattr(old_hidden_dentry, name_list,
 Lines 101-107    Link Here 
							     attr_value, size,
							     attr_value, size,
							     0);
							     0);
		}
		}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&new_hidden_dentry->d_inode->i_mutex);
#else
		up(&new_hidden_dentry->d_inode->i_sem);
		up(&new_hidden_dentry->d_inode->i_sem);
#endif
		if (err < 0)
		if (err < 0)
			goto out;
			goto out;
(-) unionfs-1.1.3.old/dentry.c (+9 lines)
 Lines 108-114    Link Here 
		interpose_flag = INTERPOSE_REVAL_NEG;
		interpose_flag = INTERPOSE_REVAL_NEG;
		if (positive) {
		if (positive) {
			interpose_flag = INTERPOSE_REVAL;
			interpose_flag = INTERPOSE_REVAL;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_lock(&dentry->d_inode->i_mutex);
#else
			down(&dentry->d_inode->i_sem);
			down(&dentry->d_inode->i_sem);
#endif
			bstart = ibstart(dentry->d_inode);
			bstart = ibstart(dentry->d_inode);
			bend = ibend(dentry->d_inode);
			bend = ibend(dentry->d_inode);
			if (bstart >= 0) {
			if (bstart >= 0) {
 Lines 126-132    Link Here 
			itohi_ptr(dentry->d_inode) = NULL;
			itohi_ptr(dentry->d_inode) = NULL;
			ibstart(dentry->d_inode) = -1;
			ibstart(dentry->d_inode) = -1;
			ibend(dentry->d_inode) = -1;
			ibend(dentry->d_inode) = -1;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_unlock(&dentry->d_inode->i_mutex);
#else
			up(&dentry->d_inode->i_sem);
			up(&dentry->d_inode->i_sem);
#endif
		}
		}
		result = unionfs_lookup_backend(dentry, interpose_flag);
		result = unionfs_lookup_backend(dentry, interpose_flag);
(-) unionfs-1.1.3.old/dirhelper.c (-1 / +9 lines)
 Lines 78-88    Link Here 
				continue;
				continue;
			}
			}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_lock(&hidden_dir_dentry->d_inode->i_mutex);
#else
			down(&hidden_dir_dentry->d_inode->i_sem);
			down(&hidden_dir_dentry->d_inode->i_sem);
#endif
			err =
			err =
			    vfs_unlink(hidden_dir_dentry->d_inode,
			    vfs_unlink(hidden_dir_dentry->d_inode,
				       hidden_dentry);
				       hidden_dentry);
			up(&hidden_dir_dentry->d_inode->i_sem);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_unlock(&hidden_dir_dentry->d_inode->i_mutex);
#else
			down(&hidden_dir_dentry->d_inode->i_sem);
#endif
			DPUT(hidden_dentry);
			DPUT(hidden_dentry);
			if (err && !IS_COPYUP_ERR(err))
			if (err && !IS_COPYUP_ERR(err))
(-) unionfs-1.1.3.old/file.c (+8 lines)
 Lines 264-273    Link Here 
	if (!hidden_file->f_op || !hidden_file->f_op->fsync)
	if (!hidden_file->f_op || !hidden_file->f_op->fsync)
		goto out;
		goto out;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_lock(&hidden_file->f_dentry->d_inode->i_mutex);
#else
	down(&hidden_file->f_dentry->d_inode->i_sem);
	down(&hidden_file->f_dentry->d_inode->i_sem);
#endif
	err = hidden_file->f_op->fsync(hidden_file, hidden_file->f_dentry,
	err = hidden_file->f_op->fsync(hidden_file, hidden_file->f_dentry,
				       datasync);
				       datasync);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_unlock(&hidden_file->f_dentry->d_inode->i_mutex);
#else
	up(&hidden_file->f_dentry->d_inode->i_sem);
	up(&hidden_file->f_dentry->d_inode->i_sem);
#endif
      out:
      out:
	print_exit_status(err);
	print_exit_status(err);
(-) unionfs-1.1.3.old/inode.c (+18 lines)
 Lines 81-87    Link Here 
		struct dentry *hidden_dir_dentry;
		struct dentry *hidden_dir_dentry;
		struct iattr newattrs;
		struct iattr newattrs;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&whiteout_dentry->d_inode->i_mutex);
#else
		down(&whiteout_dentry->d_inode->i_sem);
		down(&whiteout_dentry->d_inode->i_sem);
#endif
		newattrs.ia_valid = ATTR_CTIME | ATTR_MODE | ATTR_ATIME
		newattrs.ia_valid = ATTR_CTIME | ATTR_MODE | ATTR_ATIME
		    | ATTR_MTIME | ATTR_UID | ATTR_GID | ATTR_FORCE
		    | ATTR_MTIME | ATTR_UID | ATTR_GID | ATTR_FORCE
		    | ATTR_KILL_SUID | ATTR_KILL_SGID;
		    | ATTR_KILL_SUID | ATTR_KILL_SGID;
 Lines 97-103    Link Here 
		err = notify_change(whiteout_dentry, &newattrs);
		err = notify_change(whiteout_dentry, &newattrs);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&whiteout_dentry->d_inode->i_mutex);
#else
		up(&whiteout_dentry->d_inode->i_sem);
		up(&whiteout_dentry->d_inode->i_sem);
#endif
		if (err)
		if (err)
			printk(KERN_WARNING
			printk(KERN_WARNING
 Lines 594-603    Link Here 
				err = PTR_ERR(whiteout_dentry);
				err = PTR_ERR(whiteout_dentry);
				goto out;
				goto out;
			}
			}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_lock(&hidden_dentry->d_inode->i_mutex);
#else
			down(&hidden_dentry->d_inode->i_sem);
			down(&hidden_dentry->d_inode->i_sem);
#endif
			err = vfs_create(hidden_dentry->d_inode,
			err = vfs_create(hidden_dentry->d_inode,
					 whiteout_dentry, 0600, NULL);
					 whiteout_dentry, 0600, NULL);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
			mutex_unlock(&hidden_dentry->d_inode->i_mutex);
#else
			up(&hidden_dentry->d_inode->i_sem);
			up(&hidden_dentry->d_inode->i_sem);
#endif
			DPUT(whiteout_dentry);
			DPUT(whiteout_dentry);
			if (err) {
			if (err) {
(-) unionfs-1.1.3.old/main.c (+9 lines)
 Lines 103-109    Link Here 
		}
		}
	}
	}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_lock(&inode->i_mutex);
#else
	down(&inode->i_sem);
	down(&inode->i_sem);
#endif
	if (atomic_read(&inode->i_count) > 1)
	if (atomic_read(&inode->i_count) > 1)
		goto skip;
		goto skip;
 Lines 172-178    Link Here 
	fist_print_dentry("Leaving unionfs_interpose", dentry);
	fist_print_dentry("Leaving unionfs_interpose", dentry);
	fist_print_inode("Leaving unionfs_interpose", inode);
	fist_print_inode("Leaving unionfs_interpose", inode);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_unlock(&inode->i_mutex);
#else
	up(&inode->i_sem);
	up(&inode->i_sem);
#endif
      out:
      out:
	print_exit_status(err);
	print_exit_status(err);
(-) unionfs-1.1.3.old/unionfs.h (+9 lines)
 Lines 776-788    Link Here 
{
{
	struct dentry *dir = DGET(dentry->d_parent);
	struct dentry *dir = DGET(dentry->d_parent);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_lock(&dir->d_inode->i_mutex);
#else
	down(&dir->d_inode->i_sem);
	down(&dir->d_inode->i_sem);
#endif
	return dir;
	return dir;
}
}
static inline void unlock_dir(struct dentry *dir)
static inline void unlock_dir(struct dentry *dir)
{
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
	mutex_unlock(&dir->d_inode->i_mutex);
#else
	up(&dir->d_inode->i_sem);
	up(&dir->d_inode->i_sem);
#endif
	DPUT(dir);
	DPUT(dir);
}
}
(-) unionfs-1.1.3.old/xattr.c (+32 lines)
 Lines 77-90    Link Here 
		encoded_value = (char *)value;
		encoded_value = (char *)value;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
#else
		down(&hidden_dentry->d_inode->i_sem);
		down(&hidden_dentry->d_inode->i_sem);
#endif
		/* lock_kernel() already done by caller. */
		/* lock_kernel() already done by caller. */
		err =
		err =
		    hidden_dentry->d_inode->i_op->getxattr(hidden_dentry,
		    hidden_dentry->d_inode->i_op->getxattr(hidden_dentry,
							   encoded_name,
							   encoded_name,
							   encoded_value, size);
							   encoded_value, size);
		/* unlock_kernel() will be done by caller. */
		/* unlock_kernel() will be done by caller. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
#else
		up(&hidden_dentry->d_inode->i_sem);
		up(&hidden_dentry->d_inode->i_sem);
#endif
	}
	}
 Lines 112-123    Link Here 
		    name, (unsigned long)size, flags);
		    name, (unsigned long)size, flags);
	if (hidden_dentry->d_inode->i_op->setxattr) {
	if (hidden_dentry->d_inode->i_op->setxattr) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
#else
		down(&hidden_dentry->d_inode->i_sem);
		down(&hidden_dentry->d_inode->i_sem);
#endif
		/* lock_kernel() already done by caller. */
		/* lock_kernel() already done by caller. */
		err = hidden_dentry->d_inode->i_op->
		err = hidden_dentry->d_inode->i_op->
		    setxattr(hidden_dentry, name, value, size, flags);
		    setxattr(hidden_dentry, name, value, size, flags);
		/* unlock_kernel() will be done by caller. */
		/* unlock_kernel() will be done by caller. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
#else
		up(&hidden_dentry->d_inode->i_sem);
		up(&hidden_dentry->d_inode->i_sem);
#endif
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);
 Lines 143-155    Link Here 
	if (hidden_dentry->d_inode->i_op->removexattr) {
	if (hidden_dentry->d_inode->i_op->removexattr) {
		encoded_name = (char *)name;
		encoded_name = (char *)name;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
#else
		down(&hidden_dentry->d_inode->i_sem);
		down(&hidden_dentry->d_inode->i_sem);
#endif
		/* lock_kernel() already done by caller. */
		/* lock_kernel() already done by caller. */
		err =
		err =
		    hidden_dentry->d_inode->i_op->removexattr(hidden_dentry,
		    hidden_dentry->d_inode->i_op->removexattr(hidden_dentry,
							      encoded_name);
							      encoded_name);
		/* unlock_kernel() will be done by caller. */
		/* unlock_kernel() will be done by caller. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
#else
		up(&hidden_dentry->d_inode->i_sem);
		up(&hidden_dentry->d_inode->i_sem);
#endif
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);
 Lines 173-185    Link Here 
	if (hidden_dentry->d_inode->i_op->listxattr) {
	if (hidden_dentry->d_inode->i_op->listxattr) {
		encoded_list = list;
		encoded_list = list;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
#else
		down(&hidden_dentry->d_inode->i_sem);
		down(&hidden_dentry->d_inode->i_sem);
#endif
		/* lock_kernel() already done by caller. */
		/* lock_kernel() already done by caller. */
		err =
		err =
		    hidden_dentry->d_inode->i_op->listxattr(hidden_dentry,
		    hidden_dentry->d_inode->i_op->listxattr(hidden_dentry,
							    encoded_list, size);
							    encoded_list, size);
		/* unlock_kernel() will be done by caller. */
		/* unlock_kernel() will be done by caller. */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
#else
		up(&hidden_dentry->d_inode->i_sem);
		up(&hidden_dentry->d_inode->i_sem);
#endif
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);