]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/rbm: do not set block_size in open()
authormyoungwon oh <ohmyoungwon@gmail.com>
Mon, 20 Feb 2023 02:49:54 +0000 (11:49 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 25 Feb 2023 03:08:35 +0000 (12:08 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/random_block_manager/nvme_block_device.cc
src/crimson/os/seastore/random_block_manager/rbm_device.h
src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc

index d74cd20041263aabbf36305ab057351f4b2c3915..adfc5e4c6f4a3c1180eb65615950944770f1ec2d 100644 (file)
@@ -134,7 +134,6 @@ open_ertr::future<> NVMeBlockDevice::open(
   seastar::open_flags mode) {
   return seastar::do_with(in_path, [this, mode](auto& in_path) {
     return seastar::file_stat(in_path).then([this, mode, in_path](auto stat) {
-      super.block_size = stat.block_size;
       return seastar::open_file_dma(in_path, mode).then([=, this](auto file) {
         device = file;
         logger().debug("open");
index acd8baee446a4886b4662a0fbdfcdad87bfe53f9..91b877e23ae38a1b7fe6b24e172904373dab8c1a 100644 (file)
@@ -175,6 +175,10 @@ public:
   void set_journal_size(uint64_t size) {
     super.journal_size = size;
   }
+
+  void set_block_size(size_t size) {
+    super.block_size = size;
+  }
 };
 using RBMDeviceRef = std::unique_ptr<RBMDevice>;
 
index faa7cfa140b3b9b5adca586b0f5278804dfb417c..74ea2aab8cfd1a1036545e930a98ae187936220a 100644 (file)
@@ -57,6 +57,7 @@ TEST_F(nvdev_test_t, write_and_verify_test)
   run_async([this] {
     device.reset(new random_block_device::nvme::NVMeBlockDevice(""));
     device->open(dev_path, seastar::open_flags::rw).unsafe_get();
+    device->set_block_size(BLK_SIZE);
     nvdev_test_block_t original_data;
     std::minstd_rand0 generator;
     uint8_t value = generator();