LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ecryptfs: check xattr operation support fix 
@ 2007-02-28 17:05 Dmitriy Monakhov
  2007-02-28 18:51 ` Michael Halcrow
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitriy Monakhov @ 2007-02-28 17:05 UTC (permalink / raw)
  To: LKML; +Cc: mhalcrow


  - 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>
---
 fs/ecryptfs/inode.c |    6 +++---
 fs/ecryptfs/mmap.c  |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 27fd14a..9ccefad 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -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;
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 1e5d2ba..416985f 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -491,7 +491,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;
-- 
1.5.0.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ecryptfs: check xattr operation support fix
  2007-02-28 17:05 [PATCH] ecryptfs: check xattr operation support fix Dmitriy Monakhov
@ 2007-02-28 18:51 ` Michael Halcrow
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Halcrow @ 2007-02-28 18:51 UTC (permalink / raw)
  To: Dmitriy Monakhov; +Cc: LKML, Andrew Morton

On Wed, Feb 28, 2007 at 08:05:16PM +0300, Dmitriy Monakhov wrote:
>   - 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>

> ---
>  fs/ecryptfs/inode.c |    6 +++---
>  fs/ecryptfs/mmap.c  |    3 ++-
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index 27fd14a..9ccefad 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -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;
> diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
> index 1e5d2ba..416985f 100644
> --- a/fs/ecryptfs/mmap.c
> +++ b/fs/ecryptfs/mmap.c
> @@ -491,7 +491,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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-28 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-28 17:05 [PATCH] ecryptfs: check xattr operation support fix Dmitriy Monakhov
2007-02-28 18:51 ` Michael Halcrow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).