aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/dir.c5
-rw-r--r--fs/ceph/super.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 562f9884a4d9..6bfaa6a4ec47 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -60,6 +60,7 @@ int ceph_init_dentry(struct dentry *dentry)
60 } 60 }
61 di->dentry = dentry; 61 di->dentry = dentry;
62 di->lease_session = NULL; 62 di->lease_session = NULL;
63 di->parent_inode = igrab(dentry->d_parent->d_inode);
63 dentry->d_fsdata = di; 64 dentry->d_fsdata = di;
64 dentry->d_time = jiffies; 65 dentry->d_time = jiffies;
65 ceph_dentry_lru_add(dentry); 66 ceph_dentry_lru_add(dentry);
@@ -1025,7 +1026,7 @@ static void ceph_dentry_release(struct dentry *dentry)
1025 u64 snapid = CEPH_NOSNAP; 1026 u64 snapid = CEPH_NOSNAP;
1026 1027
1027 if (!IS_ROOT(dentry)) { 1028 if (!IS_ROOT(dentry)) {
1028 parent_inode = dentry->d_parent->d_inode; 1029 parent_inode = di->parent_inode;
1029 if (parent_inode) 1030 if (parent_inode)
1030 snapid = ceph_snap(parent_inode); 1031 snapid = ceph_snap(parent_inode);
1031 } 1032 }
@@ -1050,6 +1051,8 @@ static void ceph_dentry_release(struct dentry *dentry)
1050 kmem_cache_free(ceph_dentry_cachep, di); 1051 kmem_cache_free(ceph_dentry_cachep, di);
1051 dentry->d_fsdata = NULL; 1052 dentry->d_fsdata = NULL;
1052 } 1053 }
1054 if (parent_inode)
1055 iput(parent_inode);
1053} 1056}
1054 1057
1055static int ceph_snapdir_d_revalidate(struct dentry *dentry, 1058static int ceph_snapdir_d_revalidate(struct dentry *dentry,
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 6e0826695112..c01aa646b407 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -207,6 +207,7 @@ struct ceph_dentry_info {
207 struct dentry *dentry; 207 struct dentry *dentry;
208 u64 time; 208 u64 time;
209 u64 offset; 209 u64 offset;
210 struct inode *parent_inode;
210}; 211};
211 212
212struct ceph_inode_xattrs_info { 213struct ceph_inode_xattrs_info {