Compare commits

..

2 Commits

Author SHA1 Message Date
Vitaliy Filippov fc83e3821c Fix write-over-delete failing for the very first entry in dirty_db
Test / test_minsize_1 (push) Successful in 17s Details
Test / test_rm (push) Successful in 14s Details
Test / test_move_reappear (push) Successful in 19s Details
Test / test_snapshot_down (push) Successful in 25s Details
Test / test_snapshot_down_ec (push) Successful in 26s Details
Test / test_splitbrain (push) Successful in 18s Details
Test / test_snapshot_chain (push) Successful in 2m2s Details
Test / test_snapshot_chain_ec (push) Successful in 2m42s Details
Test / test_rebalance_verify (push) Successful in 3m1s Details
Test / test_rebalance_verify_imm (push) Successful in 3m0s Details
Test / test_write (push) Successful in 33s Details
Test / test_etcd_fail (push) Failing after 10m8s Details
Test / test_rebalance_verify_ec (push) Successful in 3m17s Details
Test / test_write_no_same (push) Successful in 18s Details
Test / test_write_xor (push) Successful in 1m0s Details
Test / test_heal_pg_size_2 (push) Successful in 4m54s Details
Test / test_rebalance_verify_ec_imm (push) Successful in 6m59s Details
Test / test_heal_csum_32k_dmj (push) Successful in 5m29s Details
Test / test_heal_ec (push) Successful in 5m58s Details
Test / test_heal_csum_32k_dj (push) Successful in 5m29s Details
Test / test_heal_csum_32k (push) Successful in 6m12s Details
Test / test_heal_csum_4k_dmj (push) Successful in 6m30s Details
Test / test_heal_csum_4k_dj (push) Successful in 6m33s Details
Test / test_scrub (push) Successful in 1m19s Details
Test / test_scrub_zero_osd_2 (push) Successful in 57s Details
Test / test_scrub_xor (push) Successful in 47s Details
Test / test_scrub_pg_size_3 (push) Successful in 1m19s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 48s Details
Test / test_scrub_ec (push) Successful in 47s Details
Test / test_heal_csum_4k (push) Successful in 5m18s Details
2023-10-21 17:08:32 +03:00
Vitaliy Filippov 0d707fc83b Fix possible segfault in vitastor-cli ls -l 2023-10-21 17:08:32 +03:00
2 changed files with 12 additions and 7 deletions

View File

@ -286,13 +286,18 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
printf("Restoring %lx:%lx version: v%lu -> v%lu\n", op->oid.inode, op->oid.stripe, op->version, PRIV(op)->real_version);
#endif
auto prev_it = dirty_it;
prev_it--;
if (prev_it->first.oid == op->oid && prev_it->first.version >= PRIV(op)->real_version)
if (prev_it != dirty_db.begin())
{
// Original version is still invalid
// All subsequent writes to the same object must be canceled too
cancel_all_writes(op, dirty_it, -EEXIST);
return 2;
prev_it--;
if (prev_it->first.oid == op->oid && prev_it->first.version >= PRIV(op)->real_version)
{
// Original version is still invalid
// All subsequent writes to the same object must be canceled too
printf("Tried to write %lx:%lx v%lu after delete (old version v%lu), but already have v%lu\n",
op->oid.inode, op->oid.stripe, PRIV(op)->real_version, op->version, prev_it->first.version);
cancel_all_writes(op, dirty_it, -EEXIST);
return 2;
}
}
op->version = PRIV(op)->real_version;
PRIV(op)->real_version = 0;

View File

@ -174,7 +174,7 @@ resume_1:
{ "size", 0 },
{ "readonly", false },
{ "pool_id", (uint64_t)INODE_POOL(inode_num) },
{ "pool_name", pool_it == parent->cli->st_cli.pool_config.end()
{ "pool_name", pool_it != parent->cli->st_cli.pool_config.end()
? (pool_it->second.name == "" ? "<Unnamed>" : pool_it->second.name) : "?" },
{ "inode_num", INODE_NO_POOL(inode_num) },
{ "inode_id", inode_num },