From: redickwang Date: Tue, 22 Sep 2020 06:15:51 +0000 (+0800) Subject: mds: assert when inode has no parent directory X-Git-Tag: v16.1.0~815^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a080f2ab0470e2bbdcdf4281c0f9be225a5ee886;p=ceph.git mds: assert when inode has no parent directory assert(in->get_parent_dir()) when open_undef_inodes_dirfrags. Elements in fetch_queue maybe NULL for unexpected situation, it's better fail at the beginning Fixes: https://tracker.ceph.com/issues/47571 Signed-off-by: redickwang --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 860c39f4a5cd..8556793962d2 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6058,6 +6058,7 @@ bool MDCache::open_undef_inodes_dirfrags() ++p) { CInode *in = *p; ceph_assert(!in->is_base()); + ceph_assert(in->get_parent_dir()); fetch_queue.insert(in->get_parent_dir()); }