Bug 197335 - Inode exhaustion should be logged to dmesg
Summary: Inode exhaustion should be logged to dmesg
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: fs_ext4@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-20 19:11 UTC by Team Athena
Modified: 2017-10-31 15:25 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.14.0-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Make a log in dmesg when file creation fails due to no free inode (1.18 KB, patch)
2017-10-31 15:25 UTC, Team Athena
Details | Diff

Description Team Athena 2017-10-20 19:11:30 UTC
Problem: If the system runs out of inodes, the error messages show "No space on disk". This is misleading to the user as the disk may still have space. Logging to dmesg can help the user correctly identify the problem.

Bug #1665833 from https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1665833


My server just became unusable, because it ran out of inodes (something that shouldn't happen on a relatively normal installation). The root-cause was a misbehaving CRM program creating way too many session files and never deleting them. However, while debugging, it would have been really really helpful if there were something in the logfiles. But it just failed silently: the lack of any error message makes diagnosing this error condition 100x harder than it should be. We get messages about being out of disk-space, but that's not helpful, especially when "df -h" shows it not to be true.

So, the bug report/feature request is this: when the kernel cannot create a new file due to a shortage of inodes, it should emit a message to that effect, at least in dmesg (and ideally also to syslog).

[For anyone else who chances upon this bug report, you can tell if you have run out of inodes with "df -i", and you can find the offending directories with: "find / -xdev -size +100k -type d" ]
Comment 1 Team Athena 2017-10-20 19:21:08 UTC
I would like to patch this fairly small bug as a learning exercise.
Comment 2 Team Athena 2017-10-31 15:25:52 UTC
Created attachment 260449 [details]
Make a log in dmesg when file creation fails due to no free inode

Uses a ext4_warning to log to dmesg

Note You need to log in before you can comment on or make changes to this bug.