]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: use non-static dirent for thread-safety
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 21:04:57 +0000 (14:04 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 21:04:57 +0000 (14:04 -0700)
Fixes: https://tracker.ceph.com/issues/46832
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/client/Client.cc
src/client/Client.h

index 8a2db48552600c1875e8554e1d0c828dc7c5d5df..7dccc705a9d1cbfcc8aaf8fdd59616ff81a332b4 100755 (executable)
@@ -8512,7 +8512,7 @@ static int _readdir_single_dirent_cb(void *p, struct dirent *de,
 struct dirent *Client::readdir(dir_result_t *d)
 {
   int ret;
-  static struct dirent de;
+  auto& de = d->de;
   single_readdir sr;
   sr.de = &de;
   sr.stx = NULL;
index f1057e8465d32229aa88f840019d79a473a5445b..78266feb70c2b06b0ddbea5f8fc2ff60418f3dbd 100644 (file)
@@ -222,6 +222,7 @@ struct dir_result_t {
   frag_t buffer_frag;
 
   vector<dentry> buffer;
+  struct dirent de;
 };
 
 class Client : public Dispatcher, public md_config_obs_t {