Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[COMMIT seastar master] io_tester: ensure that file object is valid when closing it

2 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Jun 28, 2024, 10:17:57 AM6/28/24
to seastar-dev@googlegroups.com, Patryk Wrobel
From: Patryk Wrobel <patryk...@scylladb.com>
Committer: Pavel Emelyanov <xe...@scylladb.com>
Branch: master

io_tester: ensure that file object is valid when closing it

In the case of unlink workloads they create and fill
files and close them right away.

This change ensures that the file object is valid until
close() finishes.

Signed-off-by: Patryk Wrobel <patryk...@scylladb.com>

Closes scylladb/seastar#2307

---
diff --git a/apps/io_tester/io_tester.cc b/apps/io_tester/io_tester.cc
--- a/apps/io_tester/io_tester.cc
+++ b/apps/io_tester/io_tester.cc
@@ -784,7 +784,9 @@ class unlink_class_data : public class_data {
options.append_is_unlikely = true;

return create_and_fill_file(fname, fsize, flags, options).then([](std::pair<file, uint64_t> p) {
- return p.first.close();
+ return do_with(std::move(p.first), [] (auto& f) {
+ return f.close();
+ });
});
});
}
Reply all
Reply to author
Forward
0 new messages