Compare commits
2 Commits
4f99f78430
...
fc83e3821c
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | fc83e3821c | |
Vitaliy Filippov | 0d707fc83b |
|
@ -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);
|
printf("Restoring %lx:%lx version: v%lu -> v%lu\n", op->oid.inode, op->oid.stripe, op->version, PRIV(op)->real_version);
|
||||||
#endif
|
#endif
|
||||||
auto prev_it = dirty_it;
|
auto prev_it = dirty_it;
|
||||||
prev_it--;
|
if (prev_it != dirty_db.begin())
|
||||||
if (prev_it->first.oid == op->oid && prev_it->first.version >= PRIV(op)->real_version)
|
|
||||||
{
|
{
|
||||||
// Original version is still invalid
|
prev_it--;
|
||||||
// All subsequent writes to the same object must be canceled too
|
if (prev_it->first.oid == op->oid && prev_it->first.version >= PRIV(op)->real_version)
|
||||||
cancel_all_writes(op, dirty_it, -EEXIST);
|
{
|
||||||
return 2;
|
// 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;
|
op->version = PRIV(op)->real_version;
|
||||||
PRIV(op)->real_version = 0;
|
PRIV(op)->real_version = 0;
|
||||||
|
|
|
@ -174,7 +174,7 @@ resume_1:
|
||||||
{ "size", 0 },
|
{ "size", 0 },
|
||||||
{ "readonly", false },
|
{ "readonly", false },
|
||||||
{ "pool_id", (uint64_t)INODE_POOL(inode_num) },
|
{ "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) : "?" },
|
? (pool_it->second.name == "" ? "<Unnamed>" : pool_it->second.name) : "?" },
|
||||||
{ "inode_num", INODE_NO_POOL(inode_num) },
|
{ "inode_num", INODE_NO_POOL(inode_num) },
|
||||||
{ "inode_id", inode_num },
|
{ "inode_id", inode_num },
|
||||||
|
|
Loading…
Reference in New Issue