From 28c22270f8b2bd1d65245d0417ec941a1dd6b1ec Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Wed, 27 Nov 2019 09:42:30 +0000 Subject: Add missing mutex lock/unlocks when accessing conntab (problem introduced in parent commit). --- sshfs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index 8cd89d3..b9602cb 100644 --- a/sshfs.c +++ b/sshfs.c @@ -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); -- cgit v1.2.3