ceph: keep reference to parent inode on ceph_dentry

When creating a new dentry we now hold a reference to the parent
inode in the ceph_dentry. This is required due to the new RCU
changes from 949854d0, which set dentry->d_parent to NULL in d_kill before
calling the ->release() callback. If/when that behavior is changed, we can
revert this hack.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>

authored by Yehuda Sadeh and committed by Sage Weil 97d79b40 e8e1ba96

+5 -1
+4 -1
fs/ceph/dir.c
··· 60 60 } 61 61 di->dentry = dentry; 62 62 di->lease_session = NULL; 63 + di->parent_inode = igrab(dentry->d_parent->d_inode); 63 64 dentry->d_fsdata = di; 64 65 dentry->d_time = jiffies; 65 66 ceph_dentry_lru_add(dentry); ··· 1026 1025 u64 snapid = CEPH_NOSNAP; 1027 1026 1028 1027 if (!IS_ROOT(dentry)) { 1029 - parent_inode = dentry->d_parent->d_inode; 1028 + parent_inode = di->parent_inode; 1030 1029 if (parent_inode) 1031 1030 snapid = ceph_snap(parent_inode); 1032 1031 } ··· 1051 1050 kmem_cache_free(ceph_dentry_cachep, di); 1052 1051 dentry->d_fsdata = NULL; 1053 1052 } 1053 + if (parent_inode) 1054 + iput(parent_inode); 1054 1055 } 1055 1056 1056 1057 static int ceph_snapdir_d_revalidate(struct dentry *dentry,
+1
fs/ceph/super.h
··· 207 207 struct dentry *dentry; 208 208 u64 time; 209 209 u64 offset; 210 + struct inode *parent_inode; 210 211 }; 211 212 212 213 struct ceph_inode_xattrs_info {