eCryptfs: convert lookup_one_len() to lookup_one_len_nd()
authorMichael Halcrow <mhalcrow@us.ibm.com>
Fri, 16 Feb 2007 19:09:25 +0000 (14:09 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 13 Jan 2009 01:42:56 +0000 (20:42 -0500)
Call the new lookup_one_len_nd() rather than lookup_one_len().  This fixes an
oops when stacked on NFS.

Note that there are still some issues with eCryptfs on NFS having to do with
directory deletion (I'm not getting an oops, just an -EBUSY).

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/ecryptfs/inode.c

index c92cc1c00aae9a845911011f091480d9cbe4ffca..4a9a44436f979bb247fe384689c6046affbdb15c 100644 (file)
@@ -247,7 +247,9 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
        int rc = 0;
        struct dentry *lower_dir_dentry;
        struct dentry *lower_dentry;
+       struct dentry *dentry_save;
        struct vfsmount *lower_mnt;
+       struct vfsmount *mnt_save;
        char *encoded_name;
        int encoded_namelen;
        struct ecryptfs_crypt_stat *crypt_stat = NULL;
@@ -275,9 +277,13 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
        }
        ecryptfs_printk(KERN_DEBUG, "encoded_name = [%s]; encoded_namelen "
                        "= [%d]\n", encoded_name, encoded_namelen);
-       lower_dentry = lookup_one_len(encoded_name, lower_dir_dentry,
-                                     encoded_namelen - 1);
+       dentry_save = nd->dentry;
+       mnt_save = nd->mnt;
+       lower_dentry = lookup_one_len_nd(encoded_name, lower_dir_dentry,
+                                        (encoded_namelen - 1), nd);
        kfree(encoded_name);
+       nd->mnt = mnt_save;
+       nd->dentry = dentry_save;
        if (IS_ERR(lower_dentry)) {
                ecryptfs_printk(KERN_ERR, "ERR from lower_dentry\n");
                rc = PTR_ERR(lower_dentry);