diff options
author | Anoop C S <anoopcs@cryptolab.net> | 2024-11-29 19:52:30 +0100 |
---|---|---|
committer | Anoop C S <anoopcs@cryptolab.net> | 2024-11-29 20:00:28 +0100 |
commit | d2386e80bb25bd70c864c0954ce84718019ab955 (patch) | |
tree | 80557a9d794827add7781a0ad646c04e0e53fc10 | |
parent | Merge pull request #60560 from ivoalmeida/carbon-tree-component (diff) | |
download | ceph-d2386e80bb25bd70c864c0954ce84718019ab955.tar.xz ceph-d2386e80bb25bd70c864c0954ce84718019ab955.zip |
mds: Fix invalid access of mdr->dn[0].back()
See https://github.com/ceph/ceph/pull/31534 for a similar fix.
Fixes: https://tracker.ceph.com/issues/69059
Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
-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); } |