diff options
author | Milind Changire <mchangir@users.noreply.github.com> | 2025-01-16 10:08:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-16 10:08:39 +0100 |
commit | b43bf5308a5d613ca8151ba8b1f9ab3222707d9c (patch) | |
tree | 7adf1b3ebac9091dbdddf962ce24ab56efd55140 | |
parent | Merge pull request #61218 from dmick/wip-containerfile-ceph-version (diff) | |
parent | mds: Fix invalid access of mdr->dn[0].back() (diff) | |
download | ceph-b43bf5308a5d613ca8151ba8b1f9ab3222707d9c.tar.xz ceph-b43bf5308a5d613ca8151ba8b1f9ab3222707d9c.zip |
Merge pull request #60889 from anoopcs9/fix-invalid-access-mds
mds: Fix invalid access of mdr->dn[0].back()
-rw-r--r-- | src/mds/Server.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 5874a3dce56..e66b5aa08c7 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -4167,7 +4167,7 @@ void Server::handle_client_getattr(const MDRequestRef& mdr, bool is_lookup) if (r < 0) { // fall-thru. let rdlock_path_pin_ref() check again. - } else if (is_lookup) { + } else if (is_lookup && mdr->dn[0].size()) { CDentry* dn = mdr->dn[0].back(); mdr->pin(dn); auto em = dn->batch_ops.emplace(std::piecewise_construct, std::forward_as_tuple(mask), std::forward_as_tuple()); @@ -4274,7 +4274,7 @@ void Server::handle_client_getattr(const MDRequestRef& mdr, bool is_lookup) // reply dout(10) << "reply to stat on " << *req << dendl; mdr->tracei = ref; - if (is_lookup) + if (is_lookup && mdr->dn[0].size()) mdr->tracedn = mdr->dn[0].back(); respond_to_request(mdr, 0); } |