diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2019-11-27 09:42:30 +0000 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-11-27 09:42:30 +0000 |
commit | 28c22270f8b2bd1d65245d0417ec941a1dd6b1ec (patch) | |
tree | e6877f21d259577135c9c2911dd0b84a4fe64422 | |
parent | 8822b60d9dbd9907065e7999f616b11ddce6d584 (diff) | |
download | sshfs-28c22270f8b2bd1d65245d0417ec941a1dd6b1ec.tar sshfs-28c22270f8b2bd1d65245d0417ec941a1dd6b1ec.tar.gz sshfs-28c22270f8b2bd1d65245d0417ec941a1dd6b1ec.tar.bz2 sshfs-28c22270f8b2bd1d65245d0417ec941a1dd6b1ec.zip |
Add missing mutex lock/unlocks when accessing conntab
(problem introduced in parent commit).
-rw-r--r-- | sshfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2499,11 +2499,13 @@ static int sshfs_rename(const char *from, const char *to, unsigned int flags) err = -EXDEV; if (!err && sshfs.max_conns > 1) { + pthread_mutex_lock(&sshfs.lock); void *conn = g_hash_table_lookup(sshfs.conntab, from); if (conn != NULL) { g_hash_table_replace(sshfs.conntab, g_strdup(to), conn); g_hash_table_remove(sshfs.conntab, from); } + pthread_mutex_unlock(&sshfs.lock); } return err; @@ -2849,6 +2851,7 @@ static int sshfs_release(const char *path, struct fuse_file_info *fi) buf_free(handle); chunk_put_locked(sf->readahead); if (sshfs.max_conns > 1) { + pthread_mutex_lock(&sshfs.lock); sf->conn->file_count--; if(!sf->conn->file_count) g_hash_table_remove(sshfs.conntab, path); |