mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-28 06:39:14 +00:00
vfs_block: warn only once if sync is not supported
Issue #4825 Issue #4820
This commit is contained in:
parent
6717494c5b
commit
091db48843
@ -68,6 +68,16 @@
|
|||||||
<write at="15" content="123"/>
|
<write at="15" content="123"/>
|
||||||
<expect content="abcdefghIJKLMNO123stuvwxYZABCDEF"/>
|
<expect content="abcdefghIJKLMNO123stuvwxYZABCDEF"/>
|
||||||
</sequence>
|
</sequence>
|
||||||
|
|
||||||
|
<!-- Test write-sync-write-sync-read -->
|
||||||
|
write operation by reading back the content. -->
|
||||||
|
<sequence>
|
||||||
|
<write content="................................"/>
|
||||||
|
<sync/>
|
||||||
|
<write content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
|
||||||
|
<sync/>
|
||||||
|
<expect content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
|
||||||
|
</sequence>
|
||||||
</config>
|
</config>
|
||||||
</start>
|
</start>
|
||||||
</config>
|
</config>
|
||||||
|
@ -194,6 +194,8 @@ class Test::Block_device
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sync() { fsync(_fd.value); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -253,6 +255,12 @@ void Test::Main::_exec_step(Genode::Xml_node step, Block_device &block_device)
|
|||||||
Genode::error("step '", step, "' failed");
|
Genode::error("step '", step, "' failed");
|
||||||
throw Step_failed();
|
throw Step_failed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (step.has_type("sync")) {
|
||||||
|
Genode::log("sync");
|
||||||
|
block_device.sync();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -332,7 +332,12 @@ class Vfs::Block_file_system::Data_file_system : public Single_file_system
|
|||||||
_tx_source->release_packet(p);
|
_tx_source->release_packet(p);
|
||||||
|
|
||||||
if (!p.succeeded()) {
|
if (!p.succeeded()) {
|
||||||
Genode::error("vfs_block: syncing blocks failed");
|
/* only warn once if sync is not supported */
|
||||||
|
static bool print_sync_failed = true;
|
||||||
|
if (print_sync_failed) {
|
||||||
|
Genode::warning("vfs_block: syncing blocks failed");
|
||||||
|
print_sync_failed = false;
|
||||||
|
}
|
||||||
return SYNC_ERR_INVALID;
|
return SYNC_ERR_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user