From: Samuel Just Date: Wed, 15 Sep 2021 21:23:29 +0000 (+0000) Subject: crimson/os/seastore/cache: Cache::get_root check for invalid X-Git-Tag: v17.1.0~868^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43178%2Fhead;p=ceph.git crimson/os/seastore/cache: Cache::get_root check for invalid As with Cache::get_extent, we need to check that the ref is still valid after wait_io since it's not in the read set yet. Fixes: https://tracker.ceph.com/issues/52623 Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 500c327ee1746..f0a598f5f88bb 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -1171,12 +1171,18 @@ Cache::get_root_ret Cache::get_root(Transaction &t) } else { auto ret = root; DEBUGT("waiting root {}", t, *ret); - return ret->wait_io().then([FNAME, ret, &t] { + return ret->wait_io().then([this, FNAME, ret, &t] { DEBUGT("got root read {}", t, *ret); - t.root = ret; - t.add_to_read_set(ret); - return get_root_iertr::make_ready_future( - ret); + if (!ret->is_valid()) { + DEBUGT("root became invalid: {}", t, *ret); + mark_transaction_conflicted(t, *ret); + return get_root_iertr::make_ready_future(); + } else { + t.root = ret; + t.add_to_read_set(ret); + return get_root_iertr::make_ready_future( + ret); + } }); } }