]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/rbm: reset stream_index_to_open in NVMeBlockDevice at close()
authormyoungwon oh <ohmyoungwon@gmail.com>
Mon, 13 Feb 2023 02:44:02 +0000 (11:44 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 25 Feb 2023 03:10:07 +0000 (12:10 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/random_block_manager/nvme_block_device.cc

index 6d5f5294d9a22d4070b07e78e235e972e8e316cb..4dc65963056c64dbf2319db2ed246b1374007ee0 100644 (file)
@@ -186,6 +186,7 @@ open_ertr::future<> NVMeBlockDevice::open_for_io(
   return seastar::do_for_each(io_device, [=, this](auto &target_device) {
     return seastar::open_file_dma(in_path, mode).then([this](
       auto file) {
+      assert(io_device.size() > stream_index_to_open);
       io_device[stream_index_to_open] = file;
       return io_device[stream_index_to_open].fcntl(
         F_SET_FILE_RW_HINT,
@@ -318,6 +319,7 @@ write_ertr::future<> NVMeBlockDevice::writev(
 
 Device::close_ertr::future<> NVMeBlockDevice::close() {
   logger().debug(" close ");
+  stream_index_to_open = WRITE_LIFE_NOT_SET;
   return device.close().then([this]() {
     return seastar::do_for_each(io_device, [](auto target_device) {
       return target_device.close();