View | Details | Raw Unified
Collapse All | Expand All

(-) unionfs-1.1.3/copyup.c (-4 / +4 lines)
 Lines 64-70   static int copyup_xattrs(struct dentry * Link Here 
	name_list_orig = name_list;
	name_list_orig = name_list;
	while (*name_list) {
	while (*name_list) {
		ssize_t size;
		ssize_t size;
		down(&old_hidden_dentry->d_inode->i_sem);
		mutex_lock(&old_hidden_dentry->d_inode->i_mutex);
		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   static int copyup_xattrs(struct dentry * 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);
		up(&old_hidden_dentry->d_inode->i_sem);
		mutex_unlock(&old_hidden_dentry->d_inode->i_mutex);
		if (size < 0) {
		if (size < 0) {
			err = size;
			err = size;
			goto out;
			goto out;
 Lines 84-90   static int copyup_xattrs(struct dentry * Link Here 
			goto out;
			goto out;
		}
		}
		down(&new_hidden_dentry->d_inode->i_sem);
		mutex_lock(&new_hidden_dentry->d_inode->i_mutex);
		err =
		err =
		    security_inode_setxattr(old_hidden_dentry, name_list,
		    security_inode_setxattr(old_hidden_dentry, name_list,
 Lines 101-107   static int copyup_xattrs(struct dentry * Link Here 
							     attr_value, size,
							     attr_value, size,
							     0);
							     0);
		}
		}
		up(&new_hidden_dentry->d_inode->i_sem);
		mutex_unlock(&new_hidden_dentry->d_inode->i_mutex);
		if (err < 0)
		if (err < 0)
			goto out;
			goto out;
(-) unionfs-1.1.3/dentry.c (-2 / +2 lines)
 Lines 108-114   int unionfs_d_revalidate(struct dentry * Link Here 
		interpose_flag = INTERPOSE_REVAL_NEG;
		interpose_flag = INTERPOSE_REVAL_NEG;
		if (positive) {
		if (positive) {
			interpose_flag = INTERPOSE_REVAL;
			interpose_flag = INTERPOSE_REVAL;
			down(&dentry->d_inode->i_sem);
			mutex_lock(&dentry->d_inode->i_mutex);
			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   int unionfs_d_revalidate(struct dentry * 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;
			up(&dentry->d_inode->i_sem);
			mutex_unlock(&dentry->d_inode->i_mutex);
		}
		}
		result = unionfs_lookup_backend(dentry, interpose_flag);
		result = unionfs_lookup_backend(dentry, interpose_flag);
(-) unionfs-1.1.3/dirhelper.c (-2 / +2 lines)
 Lines 78-88   int delete_whiteouts(struct dentry *dent Link Here 
				continue;
				continue;
			}
			}
			down(&hidden_dir_dentry->d_inode->i_sem);
			mutex_lock(&hidden_dir_dentry->d_inode->i_mutex);
			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);
			mutex_unlock(&hidden_dir_dentry->d_inode->i_mutex);
			DPUT(hidden_dentry);
			DPUT(hidden_dentry);
			if (err && !IS_COPYUP_ERR(err))
			if (err && !IS_COPYUP_ERR(err))
(-) unionfs-1.1.3/file.c (-2 / +2 lines)
 Lines 264-273   static int unionfs_fsync(struct file *fi 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;
	down(&hidden_file->f_dentry->d_inode->i_sem);
	mutex_lock(&hidden_file->f_dentry->d_inode->i_mutex);
	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);
	up(&hidden_file->f_dentry->d_inode->i_sem);
	mutex_unlock(&hidden_file->f_dentry->d_inode->i_mutex);
      out:
      out:
	print_exit_status(err);
	print_exit_status(err);
(-) unionfs-1.1.3/inode.c (-4 / +4 lines)
 Lines 81-87   static int unionfs_create(struct inode * Link Here 
		struct dentry *hidden_dir_dentry;
		struct dentry *hidden_dir_dentry;
		struct iattr newattrs;
		struct iattr newattrs;
		down(&whiteout_dentry->d_inode->i_sem);
		mutex_lock(&whiteout_dentry->d_inode->i_mutex);
		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   static int unionfs_create(struct inode * Link Here 
		err = notify_change(whiteout_dentry, &newattrs);
		err = notify_change(whiteout_dentry, &newattrs);
		up(&whiteout_dentry->d_inode->i_sem);
		mutex_unlock(&whiteout_dentry->d_inode->i_mutex);
		if (err)
		if (err)
			printk(KERN_WARNING
			printk(KERN_WARNING
 Lines 594-603   static int unionfs_mkdir(struct inode *p Link Here 
				err = PTR_ERR(whiteout_dentry);
				err = PTR_ERR(whiteout_dentry);
				goto out;
				goto out;
			}
			}
			down(&hidden_dentry->d_inode->i_sem);
			mutex_lock(&hidden_dentry->d_inode->i_mutex);
			err = vfs_create(hidden_dentry->d_inode,
			err = vfs_create(hidden_dentry->d_inode,
					 whiteout_dentry, 0600, NULL);
					 whiteout_dentry, 0600, NULL);
			up(&hidden_dentry->d_inode->i_sem);
			mutex_unlock(&hidden_dentry->d_inode->i_mutex);
			DPUT(whiteout_dentry);
			DPUT(whiteout_dentry);
			if (err) {
			if (err) {
(-) unionfs-1.1.3/main.c (-2 / +2 lines)
 Lines 103-109   int unionfs_interpose(struct dentry *den Link Here 
		}
		}
	}
	}
	down(&inode->i_sem);
	mutex_lock(&inode->i_mutex);
	if (atomic_read(&inode->i_count) > 1)
	if (atomic_read(&inode->i_count) > 1)
		goto skip;
		goto skip;
 Lines 172-178   int unionfs_interpose(struct dentry *den 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);
	up(&inode->i_sem);
	mutex_unlock(&inode->i_mutex);
      out:
      out:
	print_exit_status(err);
	print_exit_status(err);
(-) unionfs-1.1.3/unionfs.h (-2 / +2 lines)
 Lines 776-788   static inline struct dentry *lock_parent Link Here 
{
{
	struct dentry *dir = DGET(dentry->d_parent);
	struct dentry *dir = DGET(dentry->d_parent);
	down(&dir->d_inode->i_sem);
	mutex_lock(&dir->d_inode->i_mutex);
	return dir;
	return dir;
}
}
static inline void unlock_dir(struct dentry *dir)
static inline void unlock_dir(struct dentry *dir)
{
{
	up(&dir->d_inode->i_sem);
	mutex_unlock(&dir->d_inode->i_mutex);
	DPUT(dir);
	DPUT(dir);
}
}
(-) unionfs-1.1.3/xattr.c (-8 / +8 lines)
 Lines 77-90   ssize_t unionfs_getxattr(struct dentry * Link Here 
		encoded_value = (char *)value;
		encoded_value = (char *)value;
		down(&hidden_dentry->d_inode->i_sem);
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
		/* 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. */
		up(&hidden_dentry->d_inode->i_sem);
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
	}
	}
 Lines 112-123   unionfs_setxattr(struct dentry *dentry, 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) {
		down(&hidden_dentry->d_inode->i_sem);
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
		/* 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. */
		up(&hidden_dentry->d_inode->i_sem);
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);
 Lines 143-155   int unionfs_removexattr(struct dentry *d 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;
		down(&hidden_dentry->d_inode->i_sem);
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
		/* 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. */
		up(&hidden_dentry->d_inode->i_sem);
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);
 Lines 173-185   ssize_t unionfs_listxattr(struct dentry Link Here 
	if (hidden_dentry->d_inode->i_op->listxattr) {
	if (hidden_dentry->d_inode->i_op->listxattr) {
		encoded_list = list;
		encoded_list = list;
		down(&hidden_dentry->d_inode->i_sem);
		mutex_lock(&hidden_dentry->d_inode->i_mutex);
		/* 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. */
		up(&hidden_dentry->d_inode->i_sem);
		mutex_unlock(&hidden_dentry->d_inode->i_mutex);
	}
	}
	unlock_dentry(dentry);
	unlock_dentry(dentry);