]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: use non-static dirent for thread-safety 37351/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 21:04:57 +0000 (14:04 -0700)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Sep 2020 12:01:00 +0000 (14:01 +0200)
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 52e818482a04ac6cf1b26c0d005b7555d2c9df09..8f1f57dc2c122945f875a8f52d8dda89f3cd912b 100755 (executable)
@@ -8432,7 +8432,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 1b85421c92317aea7bd5e396b4d5e6857a606ae2..c8ea7aa5f0ad8104998c73c0850c4c2782689212 100644 (file)
@@ -221,6 +221,7 @@ struct dir_result_t {
   frag_t buffer_frag;
 
   vector<dentry> buffer;
+  struct dirent de;
 };
 
 class Client : public Dispatcher, public md_config_obs_t {