]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/os/filestore/FileStore.cc
import ceph 15.2.13
[ceph.git] / ceph / src / os / filestore / FileStore.cc
index d6aceafda17670109d3c2af4fe9a38ef98fe2b87..487298575a03b3cec63697f0d228503ddc865566 100644 (file)
@@ -4966,7 +4966,17 @@ int FileStore::list_collections(vector<coll_t>& ls, bool include_temp)
   }
 
   struct dirent *de = nullptr;
-  while ((de = ::readdir(dir))) {
+  while (true) {
+    errno = 0;
+    de = ::readdir(dir);
+    if (de == nullptr) {
+      if (errno != 0) {
+        r = -errno;
+        derr << "readdir failed " << fn << ": " << cpp_strerror(-r) << dendl;
+        if (r == -EIO && m_filestore_fail_eio) handle_eio();
+      }
+      break;
+    }
     if (de->d_type == DT_UNKNOWN) {
       // d_type not supported (non-ext[234], btrfs), must stat
       struct stat sb;