A friend of mine who likes programming in the Linux environment, but doesn't know much about the administration of Linux recently ran into a problem where his OS (Ubuntu) was reporting out of disk space on XXX volume. But when he went to check the volume, there was still 700 GB left. After much time wasted, he was eventually able to figure out that he was out of inodes. (He was storing lots of little incremental updates from a backup system on this volume and burned thru all his inodes.)He asked me why the Linux kernel reported the error message (out of disk space) instead of properly reporting (out of inodes). I didn't know, so I figured I would ask StackExchange.Anyone know why this happens? and why it hasn't been fixed after all these years? (I remember a different friend telling me about this problem in 1995.)
Why does the Linux kernel report out of disk space when in reality it is out of i-nodes
filesystems;linux kernel;inode
A single error number, ENOSPC, is used to report both situations, hence the same error message.To keep compliance with the ISO C and POSIX standards, the kernel developers have no choice but to use a single error number for both events. Adding a new error number would break existing programs.However, as sticking to traditional error messages is not AFAIK mandatory, nothing should forbid a developer to make the single message clearer, like for example out of disk/inode space Technically, whether being out of inode space or out of data space is the same, i.e. it means there is not enough free disk space for the system call to succeed.I guess you weren't going to complain if your disk is reported as full while there are still free inodes slots.Note that file systems like JFS, XFS, ZFS and btrfs allocate inodes dynamically so do no exhibit this issue anymore.