提交 5b484a51 编写于 作者: J Jeff Layton 提交者: Ilya Dryomov

ceph: clear d_fsinfo pointer under d_lock

To check for a valid dentry lease, we need to get at the
ceph_dentry_info. Under rcuwalk though, we may end up with a dentry that
is on its way to destruction. Since we need to take the d_lock in
dentry_lease_is_valid already, we can just ensure that we clear the
d_fsinfo pointer out under the same lock before destroying it.
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Reviewed-by: NYan, Zheng <zyan@redhat.com>
上级 8aa152c7
...@@ -1286,10 +1286,14 @@ static void ceph_d_release(struct dentry *dentry) ...@@ -1286,10 +1286,14 @@ static void ceph_d_release(struct dentry *dentry)
dout("d_release %p\n", dentry); dout("d_release %p\n", dentry);
ceph_dentry_lru_del(dentry); ceph_dentry_lru_del(dentry);
spin_lock(&dentry->d_lock);
dentry->d_fsdata = NULL;
spin_unlock(&dentry->d_lock);
if (di->lease_session) if (di->lease_session)
ceph_put_mds_session(di->lease_session); ceph_put_mds_session(di->lease_session);
kmem_cache_free(ceph_dentry_cachep, di); kmem_cache_free(ceph_dentry_cachep, di);
dentry->d_fsdata = NULL;
} }
static int ceph_snapdir_d_revalidate(struct dentry *dentry, static int ceph_snapdir_d_revalidate(struct dentry *dentry,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册