Skip to contentSkip to conversation

ECRYPT_FS

BUG Eric Dumazet 3 participants 3 messages Jan 13, 2011 Ecrypt file system

lore
Share & tools
lore
#0 lore raw

Hi Al

FYI, current linux-2.6 is broken for CONFIG_ECRYPT_FS

commit 66cb76666d69502fe982990b2cff5b6d607fd3b1

Author: Al Viro <[email protected]>
Date:   Wed Jan 12 20:04:37 2011 -0500

CC fs/ecryptfs/main.o
fs/ecryptfs/main.c:144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token fs/ecryptfs/main.c: In function ‘ecryptfs_interpose’:
fs/ecryptfs/main.c:204: error: implicit declaration of function ‘ecryptfs_get_inode’ fs/ecryptfs/main.c:204: warning: initialization makes pointer from integer without a cast fs/ecryptfs/main.c:206: error: expected ‘)’ before ‘return’ fs/ecryptfs/main.c:212: error: expected expression before ‘}’ token fs/ecryptfs/main.c: In function ‘ecryptfs_mount’:
fs/ecryptfs/main.c:569: warning: assignment makes pointer from integer without a cast

#1 lore raw
Quoted 3 lines · Eric Dumazet

Hi Al

FYI, current linux-2.6 is broken for CONFIG_ECRYPT_FS

The patch below fixes it:

fs/ecryptfs/main.c +3 -3
Index: linux-2.6/fs/ecryptfs/main.c
===================================================================
@@ -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);
#2 lore raw
In reply to Eric Dumazet
Quoted 7 lines · Eric Dumazet

Hi Al

FYI, current linux-2.6 is broken for CONFIG_ECRYPT_FS

commit 66cb76666d69502fe982990b2cff5b6d607fd3b1

Author: Al Viro <[email protected]>
Date:   Wed Jan 12 20:04:37 2011 -0500

Ugh... Unfolded compile fix lost in branch reordering. My apologies ;-/

From: Al Viro <[email protected]>
Date: Wed, 12 Jan 2011 20:32:19 -0500
Subject: foldme

---
 fs/ecryptfs/main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
fs/ecryptfs/main.c +2 -3
index 9ed4769..d3b28ab 100644
@@ -141,13 +141,12 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
 	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,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
 {
 	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);