提交 ad5f1196 编写于 作者: D Dmitriy Monakhov 提交者: Linus Torvalds

[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: NMonakhov Dmitriy <dmonakhov@openvz.org>
Acked-by: NMichael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 58e0543e
...@@ -168,9 +168,9 @@ static int grow_file(struct dentry *ecryptfs_dentry, struct file *lower_file, ...@@ -168,9 +168,9 @@ static int grow_file(struct dentry *ecryptfs_dentry, struct file *lower_file,
goto out; goto out;
} }
i_size_write(inode, 0); i_size_write(inode, 0);
ecryptfs_write_inode_size_to_metadata(lower_file, lower_inode, inode, rc = ecryptfs_write_inode_size_to_metadata(lower_file, lower_inode,
ecryptfs_dentry, inode, ecryptfs_dentry,
ECRYPTFS_LOWER_I_MUTEX_NOT_HELD); ECRYPTFS_LOWER_I_MUTEX_NOT_HELD);
ecryptfs_inode_to_private(inode)->crypt_stat.flags |= ECRYPTFS_NEW_FILE; ecryptfs_inode_to_private(inode)->crypt_stat.flags |= ECRYPTFS_NEW_FILE;
out: out:
return rc; return rc;
......
...@@ -502,7 +502,8 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *lower_inode, ...@@ -502,7 +502,8 @@ static int ecryptfs_write_inode_size_to_xattr(struct inode *lower_inode,
goto out; goto out;
} }
lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); 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 printk(KERN_WARNING
"No support for setting xattr in lower filesystem\n"); "No support for setting xattr in lower filesystem\n");
rc = -ENOSYS; rc = -ENOSYS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册