Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad5f1196 authored by Dmitriy Monakhov's avatar Dmitriy Monakhov Committed by Linus Torvalds
Browse files

[PATCH] ecryptfs: check xattr operation support fix



  - ecryptfs_write_inode_size_to_metadata() error code was ignored.
  - i_op->setxattr() must be supported by lower fs because used below.

Signed-off-by: default avatarMonakhov Dmitriy <dmonakhov@openvz.org>
Acked-by: default avatarMichael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 58e0543e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -168,8 +168,8 @@ static int grow_file(struct dentry *ecryptfs_dentry, struct file *lower_file,
		goto out;
	}
	i_size_write(inode, 0);
	ecryptfs_write_inode_size_to_metadata(lower_file, lower_inode, inode,
					      ecryptfs_dentry,
	rc = ecryptfs_write_inode_size_to_metadata(lower_file, lower_inode,
			inode, ecryptfs_dentry,
			ECRYPTFS_LOWER_I_MUTEX_NOT_HELD);
	ecryptfs_inode_to_private(inode)->crypt_stat.flags |= ECRYPTFS_NEW_FILE;
out:
+2 −1
Original line number Diff line number Diff line
@@ -502,7 +502,8 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *lower_inode,
		goto out;
	}
	lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
	if (!lower_dentry->d_inode->i_op->getxattr) {
	if (!lower_dentry->d_inode->i_op->getxattr ||
			!lower_dentry->d_inode->i_op->setxattr) {
		printk(KERN_WARNING
		       "No support for setting xattr in lower filesystem\n");
		rc = -ENOSYS;