]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blk: log is_valid_io() parameters when unsuccessful. 38240/head
authorIgor Fedotov <ifedotov@suse.com>
Mon, 23 Nov 2020 12:29:32 +0000 (15:29 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Mon, 23 Nov 2020 12:29:32 +0000 (15:29 +0300)
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/blk/BlockDevice.cc
src/blk/BlockDevice.h

index 345d51fdb09f5def7574560a259db154423434da..6804ee50cbcaa0f08af053d272c568a0edcabf88 100644 (file)
@@ -196,3 +196,20 @@ void BlockDevice::reap_ioc()
     --ioc_reap_count;
   }
 }
+
+bool BlockDevice::is_valid_io(uint64_t off, uint64_t len) const {
+  bool ret = (off % block_size == 0 &&
+    len % block_size == 0 &&
+    len > 0 &&
+    off < size &&
+    off + len <= size);
+
+  if (!ret) {
+    derr << __func__ << " " << std::hex
+         << off << "~" << len
+         << " block_size " << block_size
+         << " size " << size
+         << std::dec << dendl;
+  }
+  return ret;
+}
index 8ed53e69266c76102dce6e51c5519b7f13d287cb..191eb8ec908af8ebd0c32a5dbf8d96c0e8545add 100644 (file)
@@ -272,13 +272,7 @@ public:
   virtual void close() = 0;
 
 protected:
-  bool is_valid_io(uint64_t off, uint64_t len) const {
-    return (off % block_size == 0 &&
-            len % block_size == 0 &&
-            len > 0 &&
-            off < size &&
-            off + len <= size);
-  }
+  bool is_valid_io(uint64_t off, uint64_t len) const;
 };
 
 #endif //CEPH_BLK_BLOCKDEVICE_H