]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use non-static dirent for thread-safety 36511/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 21:04:57 +0000 (14:04 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 7 Aug 2020 04:53:38 +0000 (21:53 -0700)
Fixes: https://tracker.ceph.com/issues/46832
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 9b00083489d1d4777519da38f3003cf164dae480)

src/client/Client.cc
src/client/Client.h

index 48e40e36a0d3c43438e4f08b551ace1f10172ff1..77c35e564e58ec22063863372dea5725fcb2e6e2 100755 (executable)
@@ -8380,7 +8380,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 0747baab918633cdfcb5bd17039090fd922a4044..9c4f02c04473c2ba643ed1d4bfe867bb236a2f55 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 {