[PATCH] ecryptfs: check xattr operation support fix
authorDmitriy Monakhov <dmonakhov@sw.ru>
Mon, 5 Mar 2007 08:30:12 +0000 (00:30 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 5 Mar 2007 15:57:50 +0000 (07:57 -0800)
  - 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: Monakhov Dmitriy <dmonakhov@openvz.org>
Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ecryptfs/inode.c
fs/ecryptfs/mmap.c

index 0cfff4fefa9ea0b235f14d627b8c9010bceaf8c3..e62f3fc7241edcb9f03ce1e87812e3c9fe0b9bd6 100644 (file)
@@ -168,9 +168,9 @@ 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,
-                                             ECRYPTFS_LOWER_I_MUTEX_NOT_HELD);
+       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:
        return rc;
index 7be8e91b5ba08cd93c70ffe30a074ad6e4a93fc4..7def4be83e61640902b5939e4bd5aca804ec1870 100644 (file)
@@ -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;