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();
+ });
});
});
}