summaryrefslogtreecommitdiff
path: root/fs/ecryptfs/dentry.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-03-04 10:40:22 +0100
committerIngo Molnar <mingo@elte.hu>2011-03-04 10:40:25 +0100
commit888a8a3e9d79cbb9d83e53955f684998248580ec (patch)
tree3dbf548438c77d89c8696a9a79c4129cdc2f3d3e /fs/ecryptfs/dentry.c
parentcfff2d909cbdaf8c467bd321aa0502a548ec8f7e (diff)
parentb06b3d49699a52e8f9ca056c4f96e81b1987d78e (diff)
downloadlinux-next-888a8a3e9d79cbb9d83e53955f684998248580ec.tar.gz
Merge branch 'perf/urgent' into perf/core
Merge reason: Pick up updates before queueing up dependent patches. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ecryptfs/dentry.c')
-rw-r--r--fs/ecryptfs/dentry.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c
index 6fc4f319b550..534c1d46e69e 100644
--- a/fs/ecryptfs/dentry.c
+++ b/fs/ecryptfs/dentry.c
@@ -46,24 +46,28 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
{
struct dentry *lower_dentry;
struct vfsmount *lower_mnt;
- struct dentry *dentry_save;
- struct vfsmount *vfsmount_save;
+ struct dentry *dentry_save = NULL;
+ struct vfsmount *vfsmount_save = NULL;
int rc = 1;
- if (nd->flags & LOOKUP_RCU)
+ if (nd && nd->flags & LOOKUP_RCU)
return -ECHILD;
lower_dentry = ecryptfs_dentry_to_lower(dentry);
lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate)
goto out;
- dentry_save = nd->path.dentry;
- vfsmount_save = nd->path.mnt;
- nd->path.dentry = lower_dentry;
- nd->path.mnt = lower_mnt;
+ if (nd) {
+ dentry_save = nd->path.dentry;
+ vfsmount_save = nd->path.mnt;
+ nd->path.dentry = lower_dentry;
+ nd->path.mnt = lower_mnt;
+ }
rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd);
- nd->path.dentry = dentry_save;
- nd->path.mnt = vfsmount_save;
+ if (nd) {
+ nd->path.dentry = dentry_save;
+ nd->path.mnt = vfsmount_save;
+ }
if (dentry->d_inode) {
struct inode *lower_inode =
ecryptfs_inode_to_lower(dentry->d_inode);