Whamcloud - gitweb
e2fsck: update quota when deallocating a bad inode
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Fri, 5 Apr 2024 14:24:03 +0000 (15:24 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 16 Apr 2024 03:59:35 +0000 (23:59 -0400)
commiteb0680deb908d7da399dd331b7aa35cc1a4dfa2d
treefa316bc798aebd0d3d012623251fbc957c62494c
parenteb782652045e67a5379dd319613b0d3d924901dd
e2fsck: update quota when deallocating a bad inode

If a bad inode is found it will be deallocated.  However, if the filesystem has
quota enabled, the quota information isn't being updated accordingly.  This
issue was detected by running fstest ext4/019.

This patch fixes the issue by decreasing the inode count from the
quota and, if blocks are also being released, also subtract them as well.

While there, and as suggested by Andreas Dilger, the deallocate_inode()
function documentation is also updated by this patch to make it clear what
that function really does.

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Link: https://lore.kernel.org/r/20240405142405.12312-3-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass2.c