diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2024-01-14 13:31:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-14 13:31:37 +0200 |
commit | 5ada3cc7103bd7b5c460a3519a221a96278324e7 (patch) | |
tree | 1b2712d69628da4454337f21af77cafa05424b3e /collectors | |
parent | fd55512a4e7bf531804638261b6c37abe9608198 (diff) |
diskspace missing mutex use (#16784)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/diskspace.plugin/plugin_diskspace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c index fc9efb68f2..1d6e5e5212 100644 --- a/collectors/diskspace.plugin/plugin_diskspace.c +++ b/collectors/diskspace.plugin/plugin_diskspace.c @@ -637,6 +637,8 @@ static void diskspace_main_cleanup(void *ptr) { #endif int diskspace_function_mount_points(BUFFER *wb, const char *function __maybe_unused) { + netdata_mutex_lock(&slow_mountinfo_mutex); + buffer_flush(wb); wb->content_type = CT_APPLICATION_JSON; buffer_json_initialize(wb, "\"", "\"", 0, true, BUFFER_JSON_OPTIONS_DEFAULT); @@ -840,6 +842,7 @@ int diskspace_function_mount_points(BUFFER *wb, const char *function __maybe_unu buffer_json_member_add_time_t(wb, "expires", now_realtime_sec() + 1); buffer_json_finalize(wb); + netdata_mutex_unlock(&slow_mountinfo_mutex); return HTTP_RESP_OK; } |