Re: [BUG] ECRYPT_FS

From: Christoph Hellwig
Date: Thu Jan 13 2011 - 15:46:37 EST


On Thu, Jan 13, 2011 at 09:23:01PM +0100, Eric Dumazet wrote:
> Hi Al
>
> FYI, current linux-2.6 is broken for CONFIG_ECRYPT_FS

The patch below fixes it:

Index: linux-2.6/fs/ecryptfs/main.c
===================================================================
--- linux-2.6.orig/fs/ecryptfs/main.c 2011-01-13 21:35:02.742004281 +0100
+++ linux-2.6/fs/ecryptfs/main.c 2011-01-13 21:42:05.032254595 +0100
@@ -141,13 +141,12 @@ int ecryptfs_init_persistent_file(struct
return rc;
}

-static inode *ecryptfs_get_inode(struct inode *lower_inode,
+static struct inode *ecryptfs_get_inode(struct inode *lower_inode,
struct super_block *sb)
{
struct inode *inode;
int rc = 0;

- lower_inode = lower_dentry->d_inode;
if (lower_inode->i_sb != ecryptfs_superblock_to_lower(sb)) {
rc = -EXDEV;
goto out;
@@ -202,7 +201,8 @@ int ecryptfs_interpose(struct dentry *lo
{
struct inode *lower_inode = lower_dentry->d_inode;
struct inode *inode = ecryptfs_get_inode(lower_inode, sb);
- if (IS_ERR(inode)
+
+ if (IS_ERR(inode))
return PTR_ERR(inode);
if (flags & ECRYPTFS_INTERPOSE_FLAG_D_ADD)
d_add(dentry, inode);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/