diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2006-11-16 04:19:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-16 14:43:38 -0500 |
commit | ae56fb16337c882c52806508f93ead4034004c7a (patch) | |
tree | f2bb551db8d2d9b92c90b5f5462a3617457771bd | |
parent | 31be8309532a6743f301cb2e83bd12ca07988b09 (diff) |
[PATCH] eCryptfs: CIFS nlink fixes
When CIFS is the lower filesystem, the old lower dentry needs to be explicitly
dropped from inside eCryptfs to force a revalidate. In addition, when CIFS is
the lower filesystem, the inode attributes need to be copied back up from the
lower inode to the eCryptfs inode on an eCryptfs revalidate.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/ecryptfs/dentry.c | 6 | ||||
-rw-r--r-- | fs/ecryptfs/inode.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 0b9992ab990f..52d1e36dc746 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
@@ -57,6 +57,12 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
57 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); | 57 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); |
58 | nd->dentry = dentry_save; | 58 | nd->dentry = dentry_save; |
59 | nd->mnt = vfsmount_save; | 59 | nd->mnt = vfsmount_save; |
60 | if (dentry->d_inode) { | ||
61 | struct inode *lower_inode = | ||
62 | ecryptfs_inode_to_lower(dentry->d_inode); | ||
63 | |||
64 | ecryptfs_copy_attr_all(dentry->d_inode, lower_inode); | ||
65 | } | ||
60 | out: | 66 | out: |
61 | return rc; | 67 | return rc; |
62 | } | 68 | } |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index ebec8cfc189b..dfcc68484f47 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -470,6 +470,7 @@ out_lock: | |||
470 | unlock_dir(lower_dir_dentry); | 470 | unlock_dir(lower_dir_dentry); |
471 | dput(lower_new_dentry); | 471 | dput(lower_new_dentry); |
472 | dput(lower_old_dentry); | 472 | dput(lower_old_dentry); |
473 | d_drop(lower_old_dentry); | ||
473 | d_drop(new_dentry); | 474 | d_drop(new_dentry); |
474 | d_drop(old_dentry); | 475 | d_drop(old_dentry); |
475 | return rc; | 476 | return rc; |
@@ -484,7 +485,7 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry) | |||
484 | lock_parent(lower_dentry); | 485 | lock_parent(lower_dentry); |
485 | rc = vfs_unlink(lower_dir_inode, lower_dentry); | 486 | rc = vfs_unlink(lower_dir_inode, lower_dentry); |
486 | if (rc) { | 487 | if (rc) { |
487 | ecryptfs_printk(KERN_ERR, "Error in vfs_unlink\n"); | 488 | printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc); |
488 | goto out_unlock; | 489 | goto out_unlock; |
489 | } | 490 | } |
490 | ecryptfs_copy_attr_times(dir, lower_dir_inode); | 491 | ecryptfs_copy_attr_times(dir, lower_dir_inode); |