public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: Log inode exhaustion to dmesg
@ 2017-10-23 12:02 Team Athena
  2017-10-23 12:04 ` Theodore Ts'o
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Team Athena @ 2017-10-23 12:02 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4, linux-kernel

Make a log in dmesg when file creation fails due to no free inodes.
The error code for both "out of disk space" and "out of inode" is the same.
This is misleading to the user. Logging the exact reason helps to find and
correct the issue from the users' side.

Fix bug 197335 - https://bugzilla.kernel.org/show_bug.cgi?id=197335

Signed-off-by: Team Athena <teamathena.nitc@gmail.com>
---
 fs/ext4/namei.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index c1cf020d..c3990d2d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2463,6 +2463,8 @@ static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode,
 		ext4_journal_stop(handle);
 	if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries))
 		goto retry;
+	else if (err == -ENOSPC && printk_ratelimited())
+		printk(pr_warning "ext4: No space on disk, inode usage full");
 	return err;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-23 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 12:02 [PATCH] ext4: Log inode exhaustion to dmesg Team Athena
2017-10-23 12:04 ` Theodore Ts'o
2017-10-23 14:54 ` kbuild test robot
2017-10-23 15:21 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox