ext4: avoid ENOSPC when avoiding to reuse recently deleted inodes
authorJan Kara <jack@suse.cz>
Wed, 18 Mar 2020 12:13:17 +0000 (13:13 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 26 Mar 2020 14:55:00 +0000 (10:55 -0400)
commitd05466b27b19af8e148376590ed54d289b607f0a
tree904b8e026266797c5292283fb1ddfffb9e8f2185
parent5e47868fb94b63c7068dcfd2469d99fba06bae9d
ext4: avoid ENOSPC when avoiding to reuse recently deleted inodes

When ext4 is running on a filesystem without a journal, it tries not to
reuse recently deleted inodes to provide better chances for filesystem
recovery in case of crash. However this logic forbids reuse of freed
inodes for up to 5 minutes and especially for filesystems with smaller
number of inodes can lead to ENOSPC errors returned when allocating new
inodes.

Fix the problem by allowing to reuse recently deleted inode if there's
no other inode free in the scanned range.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200318121317.31941-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ialloc.c