mirror of
https://github.com/netdata/netdata.git
synced 2025-04-10 08:07:34 +00:00

* rrdset - in progress * rrdset optimal constructor; rrdset conflict * rrdset final touches * re-organization of rrdset object members * prevent use-after-free * dictionary dfe supports also counting of iterations * rrddim managed by dictionary * rrd.h cleanup * DICTIONARY_ITEM now is referencing actual dictionary items in the code * removed rrdset linked list * Revert "removed rrdset linked list" This reverts commit 690d6a588b4b99619c2c5e10f84e8f868ae6def5. * removed rrdset linked list * added comments * Switch chart uuid to static allocation in rrdset Remove unused functions * rrdset_archive() and friends... * always create rrdfamily * enable ml_free_dimension * rrddim_foreach done with dfe * most custom rrddim loops replaced with rrddim_foreach * removed accesses to rrddim->dimensions * removed locks that are no longer needed * rrdsetvar is now managed by the dictionary * set rrdset is rrdsetvar, fixes https://github.com/netdata/netdata/pull/13646#issuecomment-1242574853 * conflict callback of rrdsetvar now properly checks if it has to reset the variable * dictionary registered callbacks accept as first parameter the DICTIONARY_ITEM * dictionary dfe now uses internal counter to report; avoided excess variables defined with dfe * dictionary walkthrough callbacks get dictionary acquired items * dictionary reference counters that can be dupped from zero * added advanced functions for get and del * rrdvar managed by dictionaries * thread safety for rrdsetvar * faster rrdvar initialization * rrdvar string lengths should match in all add, del, get functions * rrdvar internals hidden from the rest of the world * rrdvar is now acquired throughout netdata * hide the internal structures of rrdsetvar * rrdsetvar is now acquired through out netdata * rrddimvar managed by dictionary; rrddimvar linked list removed; rrddimvar structures hidden from the rest of netdata * better error handling * dont create variables if not initialized for health * dont create variables if not initialized for health again * rrdfamily is now managed by dictionaries; references of it are acquired dictionary items * type checking on acquired objects * rrdcalc renaming of functions * type checking for rrdfamily_acquired * rrdcalc managed by dictionaries * rrdcalc double free fix * host rrdvars is always needed * attempt to fix deadlock 1 * attempt to fix deadlock 2 * Remove unused variable * attempt to fix deadlock 3 * snprintfz * rrdcalc index in rrdset fix * Stop storing active charts and computing chart hashes * Remove store active chart function * Remove compute chart hash function * Remove sql_store_chart_hash function * Remove store_active_dimension function * dictionary delayed destruction * formatting and cleanup * zero dictionary base on rrdsetvar * added internal error to log delayed destructions of dictionaries * typo in rrddimvar * added debugging info to dictionary * debug info * fix for rrdcalc keys being empty * remove forgotten unlock * remove deadlock * Switch to metadata version 5 and drop chart_hash chart_hash_map chart_active dimension_active v_chart_hash * SQL cosmetic changes * do not busy wait while destroying a referenced dictionary * remove deadlock * code cleanup; re-organization; * fast cleanup and flushing of dictionaries * number formatting fixes * do not delete configured alerts when archiving a chart * rrddim obsolete linked list management outside dictionaries * removed duplicate contexts call * fix crash when rrdfamily is not initialized * dont keep rrddimvar referenced * properly cleanup rrdvar * removed some locks * Do not attempt to cleanup chart_hash / chart_hash_map * rrdcalctemplate managed by dictionary * register callbacks on the right dictionary * removed some more locks * rrdcalc secondary index replaced with linked-list; rrdcalc labels updates are now executed by health thread * when looking up for an alarm look using both chart id and chart name * host initialization a bit more modular * init rrdlabels on host update * preparation for dictionary views * improved comment * unused variables without internal checks * service threads isolation and worker info * more worker info in service thread * thread cancelability debugging with internal checks * strings data races addressed; fixes https://github.com/netdata/netdata/issues/13647 * dictionary modularization * Remove unused SQL statement definition * unit-tested thread safety of dictionaries; removed data race conditions on dictionaries and strings; dictionaries now can detect if the caller is holds a write lock and automatically all the calls become their unsafe versions; all direct calls to unsafe version is eliminated * remove worker_is_idle() from the exit of service functions, because we lose the lock time between loops * rewritten dictionary to have 2 separate locks, one for indexing and another for traversal * Update collectors/cgroups.plugin/sys_fs_cgroup.c Co-authored-by: Vladimir Kobal <vlad@prokk.net> * Update collectors/cgroups.plugin/sys_fs_cgroup.c Co-authored-by: Vladimir Kobal <vlad@prokk.net> * Update collectors/proc.plugin/proc_net_dev.c Co-authored-by: Vladimir Kobal <vlad@prokk.net> * fix memory leak in rrdset cache_dir * minor dictionary changes * dont use index locks in single threaded * obsolete dict option * rrddim options and flags separation; rrdset_done() optimization to keep array of reference pointers to rrddim; * fix jump on uninitialized value in dictionary; remove double free of cache_dir * addressed codacy findings * removed debugging code * use the private refcount on dictionaries * make dictionary item desctructors work on dictionary destruction; strictier control on dictionary API; proper cleanup sequence on rrddim; * more dictionary statistics * global statistics about dictionary operations, memory, items, callbacks * dictionary support for views - missing the public API * removed warning about unused parameter * chart and context name for cloud * chart and context name for cloud, again * dictionary statistics fixed; first implementation of dictionary views - not currently used * only the master can globally delete an item * context needs netdata prefix * fix context and chart it of spins * fix for host variables when health is not enabled * run garbage collector on item insert too * Fix info message; remove extra "using" * update dict unittest for new placement of garbage collector * we need RRDHOST->rrdvars for maintaining custom host variables * Health initialization needs the host->host_uuid * split STRING to its own files; no code changes other than that * initialize health unconditionally * unit tests do not pollute the global scope with their variables * Skip initialization when creating archived hosts on startup. When a child connects it will initialize properly Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Co-authored-by: Vladimir Kobal <vlad@prokk.net>
458 lines
15 KiB
C
458 lines
15 KiB
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "plugin_proc.h"
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// taken from gnulib/mountlist.c
|
|
|
|
#ifndef ME_REMOTE
|
|
/* A file system is "remote" if its Fs_name contains a ':'
|
|
or if (it is of type (smbfs or cifs) and its Fs_name starts with '//')
|
|
or Fs_name is equal to "-hosts" (used by autofs to mount remote fs). */
|
|
# define ME_REMOTE(Fs_name, Fs_type) \
|
|
(strchr (Fs_name, ':') != NULL \
|
|
|| ((Fs_name)[0] == '/' \
|
|
&& (Fs_name)[1] == '/' \
|
|
&& (strcmp (Fs_type, "smbfs") == 0 \
|
|
|| strcmp (Fs_type, "cifs") == 0)) \
|
|
|| (strcmp("-hosts", Fs_name) == 0))
|
|
#endif
|
|
|
|
#define ME_DUMMY_0(Fs_name, Fs_type) \
|
|
(strcmp (Fs_type, "autofs") == 0 \
|
|
|| strcmp (Fs_type, "proc") == 0 \
|
|
|| strcmp (Fs_type, "subfs") == 0 \
|
|
/* for Linux 2.6/3.x */ \
|
|
|| strcmp (Fs_type, "debugfs") == 0 \
|
|
|| strcmp (Fs_type, "devpts") == 0 \
|
|
|| strcmp (Fs_type, "fusectl") == 0 \
|
|
|| strcmp (Fs_type, "mqueue") == 0 \
|
|
|| strcmp (Fs_type, "rpc_pipefs") == 0 \
|
|
|| strcmp (Fs_type, "sysfs") == 0 \
|
|
/* FreeBSD, Linux 2.4 */ \
|
|
|| strcmp (Fs_type, "devfs") == 0 \
|
|
/* for NetBSD 3.0 */ \
|
|
|| strcmp (Fs_type, "kernfs") == 0 \
|
|
/* for Irix 6.5 */ \
|
|
|| strcmp (Fs_type, "ignore") == 0)
|
|
|
|
/* Historically, we have marked as "dummy" any file system of type "none",
|
|
but now that programs like du need to know about bind-mounted directories,
|
|
we grant an exception to any with "bind" in its list of mount options.
|
|
I.e., those are *not* dummy entries. */
|
|
# define ME_DUMMY(Fs_name, Fs_type) \
|
|
(ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// find the mount info with the given major:minor
|
|
// in the supplied linked list of mountinfo structures
|
|
struct mountinfo *mountinfo_find(struct mountinfo *root, unsigned long major, unsigned long minor, char *device) {
|
|
struct mountinfo *mi;
|
|
|
|
uint32_t hash = simple_hash(device);
|
|
|
|
for(mi = root; mi ; mi = mi->next)
|
|
if (unlikely(
|
|
mi->major == major &&
|
|
mi->minor == minor &&
|
|
mi->mount_source_name_hash == hash &&
|
|
!strcmp(mi->mount_source_name, device)))
|
|
return mi;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
// find the mount info with the given filesystem and mount_source
|
|
// in the supplied linked list of mountinfo structures
|
|
struct mountinfo *mountinfo_find_by_filesystem_mount_source(struct mountinfo *root, const char *filesystem, const char *mount_source) {
|
|
struct mountinfo *mi;
|
|
uint32_t filesystem_hash = simple_hash(filesystem), mount_source_hash = simple_hash(mount_source);
|
|
|
|
for(mi = root; mi ; mi = mi->next)
|
|
if(unlikely(mi->filesystem
|
|
&& mi->mount_source
|
|
&& mi->filesystem_hash == filesystem_hash
|
|
&& mi->mount_source_hash == mount_source_hash
|
|
&& !strcmp(mi->filesystem, filesystem)
|
|
&& !strcmp(mi->mount_source, mount_source)))
|
|
return mi;
|
|
|
|
return NULL;
|
|
}
|
|
|
|
struct mountinfo *mountinfo_find_by_filesystem_super_option(struct mountinfo *root, const char *filesystem, const char *super_options) {
|
|
struct mountinfo *mi;
|
|
uint32_t filesystem_hash = simple_hash(filesystem);
|
|
|
|
size_t solen = strlen(super_options);
|
|
|
|
for(mi = root; mi ; mi = mi->next)
|
|
if(unlikely(mi->filesystem
|
|
&& mi->super_options
|
|
&& mi->filesystem_hash == filesystem_hash
|
|
&& !strcmp(mi->filesystem, filesystem))) {
|
|
|
|
// super_options is a comma separated list
|
|
char *s = mi->super_options, *e;
|
|
while(*s) {
|
|
e = s + 1;
|
|
while(*e && *e != ',') e++;
|
|
|
|
size_t len = e - s;
|
|
if(unlikely(len == solen && !strncmp(s, super_options, len)))
|
|
return mi;
|
|
|
|
if(*e == ',') s = ++e;
|
|
else s = e;
|
|
}
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
static void mountinfo_free(struct mountinfo *mi) {
|
|
freez(mi->root);
|
|
freez(mi->mount_point);
|
|
freez(mi->mount_options);
|
|
freez(mi->persistent_id);
|
|
/*
|
|
if(mi->optional_fields_count) {
|
|
int i;
|
|
for(i = 0; i < mi->optional_fields_count ; i++)
|
|
free(*mi->optional_fields[i]);
|
|
}
|
|
free(mi->optional_fields);
|
|
*/
|
|
freez(mi->filesystem);
|
|
freez(mi->mount_source);
|
|
freez(mi->mount_source_name);
|
|
freez(mi->super_options);
|
|
freez(mi);
|
|
}
|
|
|
|
// free a linked list of mountinfo structures
|
|
void mountinfo_free_all(struct mountinfo *mi) {
|
|
while(mi) {
|
|
struct mountinfo *t = mi;
|
|
mi = mi->next;
|
|
|
|
mountinfo_free(t);
|
|
}
|
|
}
|
|
|
|
static char *strdupz_decoding_octal(const char *string) {
|
|
char *buffer = strdupz(string);
|
|
|
|
char *d = buffer;
|
|
const char *s = string;
|
|
|
|
while(*s) {
|
|
if(unlikely(*s == '\\')) {
|
|
s++;
|
|
if(likely(isdigit(*s) && isdigit(s[1]) && isdigit(s[2]))) {
|
|
char c = *s++ - '0';
|
|
c <<= 3;
|
|
c |= *s++ - '0';
|
|
c <<= 3;
|
|
c |= *s++ - '0';
|
|
*d++ = c;
|
|
}
|
|
else *d++ = '_';
|
|
}
|
|
else *d++ = *s++;
|
|
}
|
|
*d = '\0';
|
|
|
|
return buffer;
|
|
}
|
|
|
|
static inline int is_read_only(const char *s) {
|
|
if(!s) return 0;
|
|
|
|
size_t len = strlen(s);
|
|
if(len < 2) return 0;
|
|
if(len == 2) {
|
|
if(!strcmp(s, "ro")) return 1;
|
|
return 0;
|
|
}
|
|
if(!strncmp(s, "ro,", 3)) return 1;
|
|
if(!strncmp(&s[len - 3], ",ro", 3)) return 1;
|
|
if(strstr(s, ",ro,")) return 1;
|
|
return 0;
|
|
}
|
|
|
|
// for the full list of protected mount points look at
|
|
// https://github.com/systemd/systemd/blob/1eb3ef78b4df28a9e9f464714208f2682f957e36/src/core/namespace.c#L142-L149
|
|
// https://github.com/systemd/systemd/blob/1eb3ef78b4df28a9e9f464714208f2682f957e36/src/core/namespace.c#L180-L194
|
|
static const char *systemd_protected_mount_points[] = {
|
|
"/home",
|
|
"/root",
|
|
"/usr",
|
|
"/boot",
|
|
"/efi",
|
|
"/etc",
|
|
"/run/user",
|
|
"/lib",
|
|
"/lib64",
|
|
"/bin",
|
|
"/sbin",
|
|
NULL
|
|
};
|
|
|
|
static inline int mount_point_is_protected(char *mount_point)
|
|
{
|
|
for (size_t i = 0; systemd_protected_mount_points[i] != NULL; i++)
|
|
if (!strcmp(mount_point, systemd_protected_mount_points[i]))
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
// read the whole mountinfo into a linked list
|
|
struct mountinfo *mountinfo_read(int do_statvfs) {
|
|
char filename[FILENAME_MAX + 1];
|
|
snprintfz(filename, FILENAME_MAX, "%s/proc/self/mountinfo", netdata_configured_host_prefix);
|
|
procfile *ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
|
|
if(unlikely(!ff)) {
|
|
snprintfz(filename, FILENAME_MAX, "%s/proc/1/mountinfo", netdata_configured_host_prefix);
|
|
ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
|
|
if(unlikely(!ff)) return NULL;
|
|
}
|
|
|
|
ff = procfile_readall(ff);
|
|
if(unlikely(!ff))
|
|
return NULL;
|
|
|
|
struct mountinfo *root = NULL, *last = NULL, *mi = NULL;
|
|
|
|
// create a dictionary to track uniqueness
|
|
DICTIONARY *dict = dictionary_create(
|
|
DICT_OPTION_SINGLE_THREADED | DICT_OPTION_DONT_OVERWRITE_VALUE | DICT_OPTION_NAME_LINK_DONT_CLONE);
|
|
|
|
unsigned long l, lines = procfile_lines(ff);
|
|
for(l = 0; l < lines ;l++) {
|
|
if(unlikely(procfile_linewords(ff, l) < 5))
|
|
continue;
|
|
|
|
// make sure we don't add the same item twice
|
|
char *v = (char *)dictionary_set(dict, procfile_lineword(ff, l, 4), "N", 2);
|
|
if(v) {
|
|
if(*v == 'O') continue;
|
|
*v = 'O';
|
|
}
|
|
|
|
mi = mallocz(sizeof(struct mountinfo));
|
|
|
|
unsigned long w = 0;
|
|
mi->id = str2ul(procfile_lineword(ff, l, w)); w++;
|
|
mi->parentid = str2ul(procfile_lineword(ff, l, w)); w++;
|
|
|
|
char *major = procfile_lineword(ff, l, w), *minor; w++;
|
|
for(minor = major; *minor && *minor != ':' ;minor++) ;
|
|
|
|
if(unlikely(!*minor)) {
|
|
error("Cannot parse major:minor on '%s' at line %lu of '%s'", major, l + 1, filename);
|
|
freez(mi);
|
|
continue;
|
|
}
|
|
|
|
*minor = '\0';
|
|
minor++;
|
|
|
|
mi->flags = 0;
|
|
|
|
mi->major = str2ul(major);
|
|
mi->minor = str2ul(minor);
|
|
|
|
mi->root = strdupz(procfile_lineword(ff, l, w)); w++;
|
|
mi->root_hash = simple_hash(mi->root);
|
|
|
|
mi->mount_point = strdupz_decoding_octal(procfile_lineword(ff, l, w)); w++;
|
|
mi->mount_point_hash = simple_hash(mi->mount_point);
|
|
|
|
mi->persistent_id = strdupz(mi->mount_point);
|
|
netdata_fix_chart_id(mi->persistent_id);
|
|
mi->persistent_id_hash = simple_hash(mi->persistent_id);
|
|
|
|
mi->mount_options = strdupz(procfile_lineword(ff, l, w)); w++;
|
|
|
|
if(unlikely(is_read_only(mi->mount_options)))
|
|
mi->flags |= MOUNTINFO_READONLY;
|
|
|
|
if(unlikely(mount_point_is_protected(mi->mount_point)))
|
|
mi->flags |= MOUNTINFO_IS_IN_SYSD_PROTECTED_LIST;
|
|
|
|
// count the optional fields
|
|
/*
|
|
unsigned long wo = w;
|
|
*/
|
|
mi->optional_fields_count = 0;
|
|
char *s = procfile_lineword(ff, l, w);
|
|
while(*s && *s != '-') {
|
|
w++;
|
|
s = procfile_lineword(ff, l, w);
|
|
mi->optional_fields_count++;
|
|
}
|
|
|
|
/*
|
|
if(unlikely(mi->optional_fields_count)) {
|
|
// we have some optional fields
|
|
// read them into a new array of pointers;
|
|
|
|
mi->optional_fields = mallocz(mi->optional_fields_count * sizeof(char *));
|
|
|
|
int i;
|
|
for(i = 0; i < mi->optional_fields_count ; i++) {
|
|
*mi->optional_fields[wo] = strdupz(procfile_lineword(ff, l, w));
|
|
wo++;
|
|
}
|
|
}
|
|
else
|
|
mi->optional_fields = NULL;
|
|
*/
|
|
|
|
if(likely(*s == '-')) {
|
|
w++;
|
|
|
|
mi->filesystem = strdupz(procfile_lineword(ff, l, w)); w++;
|
|
mi->filesystem_hash = simple_hash(mi->filesystem);
|
|
|
|
mi->mount_source = strdupz_decoding_octal(procfile_lineword(ff, l, w)); w++;
|
|
mi->mount_source_hash = simple_hash(mi->mount_source);
|
|
|
|
mi->mount_source_name = strdupz(basename(mi->mount_source));
|
|
mi->mount_source_name_hash = simple_hash(mi->mount_source_name);
|
|
|
|
mi->super_options = strdupz(procfile_lineword(ff, l, w)); w++;
|
|
|
|
if(unlikely(is_read_only(mi->super_options)))
|
|
mi->flags |= MOUNTINFO_READONLY;
|
|
|
|
if(unlikely(ME_DUMMY(mi->mount_source, mi->filesystem)))
|
|
mi->flags |= MOUNTINFO_IS_DUMMY;
|
|
|
|
if(unlikely(ME_REMOTE(mi->mount_source, mi->filesystem)))
|
|
mi->flags |= MOUNTINFO_IS_REMOTE;
|
|
|
|
// mark as BIND the duplicates (i.e. same filesystem + same source)
|
|
if(do_statvfs) {
|
|
struct stat buf;
|
|
if(unlikely(stat(mi->mount_point, &buf) == -1)) {
|
|
mi->st_dev = 0;
|
|
mi->flags |= MOUNTINFO_NO_STAT;
|
|
}
|
|
else {
|
|
mi->st_dev = buf.st_dev;
|
|
|
|
struct mountinfo *mt;
|
|
for(mt = root; mt; mt = mt->next) {
|
|
if(unlikely(mt->st_dev == mi->st_dev && !(mt->flags & MOUNTINFO_IS_SAME_DEV))) {
|
|
if(strlen(mi->mount_point) < strlen(mt->mount_point))
|
|
mt->flags |= MOUNTINFO_IS_SAME_DEV;
|
|
else
|
|
mi->flags |= MOUNTINFO_IS_SAME_DEV;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
mi->st_dev = 0;
|
|
}
|
|
}
|
|
else {
|
|
mi->filesystem = NULL;
|
|
mi->filesystem_hash = 0;
|
|
|
|
mi->mount_source = NULL;
|
|
mi->mount_source_hash = 0;
|
|
|
|
mi->mount_source_name = NULL;
|
|
mi->mount_source_name_hash = 0;
|
|
|
|
mi->super_options = NULL;
|
|
|
|
mi->st_dev = 0;
|
|
}
|
|
|
|
// check if it has size
|
|
if(do_statvfs && !(mi->flags & MOUNTINFO_IS_DUMMY)) {
|
|
struct statvfs buff_statvfs;
|
|
if(unlikely(statvfs(mi->mount_point, &buff_statvfs) < 0)) {
|
|
mi->flags |= MOUNTINFO_NO_STAT;
|
|
}
|
|
else if(unlikely(!buff_statvfs.f_blocks /* || !buff_statvfs.f_files */)) {
|
|
mi->flags |= MOUNTINFO_NO_SIZE;
|
|
}
|
|
}
|
|
|
|
// link it
|
|
if(unlikely(!root))
|
|
root = mi;
|
|
else
|
|
last->next = mi;
|
|
|
|
last = mi;
|
|
mi->next = NULL;
|
|
|
|
/*
|
|
#ifdef NETDATA_INTERNAL_CHECKS
|
|
fprintf(stderr, "MOUNTINFO: %ld %ld %lu:%lu root '%s', persistent id '%s', mount point '%s', mount options '%s', filesystem '%s', mount source '%s', super options '%s'%s%s%s%s%s%s\n",
|
|
mi->id,
|
|
mi->parentid,
|
|
mi->major,
|
|
mi->minor,
|
|
mi->root,
|
|
mi->persistent_id,
|
|
(mi->mount_point)?mi->mount_point:"",
|
|
(mi->mount_options)?mi->mount_options:"",
|
|
(mi->filesystem)?mi->filesystem:"",
|
|
(mi->mount_source)?mi->mount_source:"",
|
|
(mi->super_options)?mi->super_options:"",
|
|
(mi->flags & MOUNTINFO_IS_DUMMY)?" DUMMY":"",
|
|
(mi->flags & MOUNTINFO_IS_BIND)?" BIND":"",
|
|
(mi->flags & MOUNTINFO_IS_REMOTE)?" REMOTE":"",
|
|
(mi->flags & MOUNTINFO_NO_STAT)?" NOSTAT":"",
|
|
(mi->flags & MOUNTINFO_NO_SIZE)?" NOSIZE":"",
|
|
(mi->flags & MOUNTINFO_IS_SAME_DEV)?" SAMEDEV":""
|
|
);
|
|
#endif
|
|
*/
|
|
}
|
|
|
|
/* find if the mount options have "bind" in them
|
|
{
|
|
FILE *fp = setmntent(MOUNTED, "r");
|
|
if (fp != NULL) {
|
|
struct mntent mntbuf;
|
|
struct mntent *mnt;
|
|
char buf[4096 + 1];
|
|
|
|
while ((mnt = getmntent_r(fp, &mntbuf, buf, 4096))) {
|
|
char *bind = hasmntopt(mnt, "bind");
|
|
if(unlikely(bind)) {
|
|
struct mountinfo *mi;
|
|
for(mi = root; mi ; mi = mi->next) {
|
|
if(unlikely(strcmp(mnt->mnt_dir, mi->mount_point) == 0)) {
|
|
fprintf(stderr, "Mount point '%s' is BIND\n", mi->mount_point);
|
|
mi->flags |= MOUNTINFO_IS_BIND;
|
|
break;
|
|
}
|
|
}
|
|
|
|
#ifdef NETDATA_INTERNAL_CHECKS
|
|
if(unlikely(!mi)) {
|
|
error("Mount point '%s' not found in /proc/self/mountinfo", mnt->mnt_dir);
|
|
}
|
|
#endif
|
|
}
|
|
}
|
|
endmntent(fp);
|
|
}
|
|
}
|
|
*/
|
|
|
|
dictionary_destroy(dict);
|
|
procfile_close(ff);
|
|
return root;
|
|
}
|