]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: reset onode in 'SeaStore::repeat_with_onode' before the transact... 44345/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Fri, 17 Dec 2021 05:20:35 +0000 (13:20 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Fri, 17 Dec 2021 06:06:09 +0000 (14:06 +0800)
Onodes hold references to the onode tree extents. And if it's referencing the root extent, that root
extent is cached in the onode trees root_tracker which caches onode tree roots by transaction address.
Than root_tracker entry only gets removed when the onode(or the corresponding "super") is destroyed.
On the other hand, two non-concurrent transactions can occupy the same address. So if an onode gets destroyed
after its transaction is destroyed, there will be a chance that another transaction occupying the same
address get that not-yet-destroyed and may-be-outdated onode.

BTW, Since we already cache extents in transactions, might want to drop onode tree root_tracker later?

Fixes: https://tracker.ceph.com/issues/53651
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/seastore.h

index 4e3929ba690a60fc5627596723bba483b9ec4e8a..d5a79a3fdb84c150e0644c2dab92e481ad10d476 100644 (file)
@@ -254,7 +254,8 @@ private:
           ).si_then([&](auto onode_ret) {
             onode = std::move(onode_ret);
             return f(t, *onode);
-          }).si_then([&ret](auto _ret) {
+          }).si_then([&ret, &onode](auto _ret) {
+           onode.reset();
             ret = _ret;
           });
         });