GithubHelp home page GithubHelp logo

Comments (6)

SamK avatar SamK commented on June 10, 2024 1

The commit fixes the issue. Thank you.
I'm taking the liberty to close the issue.
Best regards.

from awesome-prometheus-alerts.

samber avatar samber commented on June 10, 2024

Can you develop please? I'm mostly a linux+macos user. In what situation is msdosfs used?

from awesome-prometheus-alerts.

AnderssonPeter avatar AnderssonPeter commented on June 10, 2024

I have this exact issue on my OPNSense firewall that is freebsd based.

from awesome-prometheus-alerts.

SamK avatar SamK commented on June 10, 2024

The FAT16 file system is used for the EFI partition.
FAT file systems do not have such thing as inodes. However FreeBSD returns a value of 512 inodes for FAT16. This is a behaviour explained in their mailing list, described by @stesser:

[...] there is no limit on the number of files (reported as inodes) in the root directory of a FAT32 file system, but such a limit does exist in FAT12/FAT16 and the default value happens to be 512 in case of FAT16.

My partition is indeed FAT16 and I am victim of this bug. ifree below should not be 0.

# df -i /boot/efi
Filesystem        1K-blocks Used  Avail Capacity iused ifree %iused  Mounted on
/dev/gpt/efiboot0    266176 1872 264304     1%     512     0  100%   /boot/efi
# file -s /dev/gpt/efiboot0
/dev/gpt/efiboot0: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "BSD4.4  ", sectors/cluster 32, root entries 512, sectors/FAT 65, sectors/track 63, heads 16, sectors 532480 (volumes > 32 MB), serial number 0xf08b1618, unlabeled, FAT (16 bit)
  • The bug is fixed in FreeBSD 13.3.
  • As of today, OPNSense 24.1 is based on FreeBSD 13.2.
  • The OPNSense roadmap has not yet scheduled to use FreeBSD 13.3.

I hope this explains the situation.

@samber, this bug will be auto-fixed in an unknown future. In the meantime a PR can easily fix it today. As the maintainer of this project it's up to you to choose what decision to take.

from awesome-prometheus-alerts.

stesser avatar stesser commented on June 10, 2024

The MSDOSFS code in 13.3. could be backported to 13.2, but a simpler work-around would be to just return 0 for the total number of inodes (f_files). The value 0 is typically used for synthetic file systems (procfs, devfs, ...) to indicate that they do not actually use inodes (and AFAIK, monitoring systems understand this signal and ignore the inode stats).

diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index d7efa103581b..ba73a1f18ce4 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -950,8 +950,8 @@ msdosfs_statfs(struct mount *mp, struct statfs *sbp)
        sbp->f_blocks = pmp->pm_maxcluster + 1;
        sbp->f_bfree = pmp->pm_freeclustercount;
        sbp->f_bavail = pmp->pm_freeclustercount;
-       sbp->f_files = pmp->pm_RootDirEnts;     /* XXX */
-       sbp->f_ffree = 0;       /* what to put in here? */
+       sbp->f_files = 0;
+       sbp->f_ffree = 0;
        return (0);
 }

If this simple patch was applied to OPNSense, the "out of inodes" issue should be resolved.

(A similar patch should be applied to all synthetic file systems, some of which also reported 100% inodes used. This is fixed in 13.3 and later versions, too.)

from awesome-prometheus-alerts.

samber avatar samber commented on June 10, 2024

I just made a fix and prepared a revert for 2025.

from awesome-prometheus-alerts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.