mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 12:30:46 +01:00
btrfs: close btrfs.FS handle after use
Despite being quite hard to provoke (< 10% in my testing), the btrfs collector would occasionally leave stale FDs relating to btrfs mountpoints, making the filesystems unable to be unmounted. Fixes: #2772. Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
This commit is contained in:
parent
f2b274350a
commit
381f32b1c5
@ -135,6 +135,7 @@ func (c *btrfsCollector) getIoctlStats() (map[string]*btrfsIoctlFsStats, error)
|
||||
"err", err)
|
||||
continue
|
||||
}
|
||||
defer fs.Close()
|
||||
|
||||
fsInfo, err := fs.Info()
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user