]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix leak of quota reservations
authorJan Kara <jack@suse.cz>
Fri, 8 Nov 2019 11:45:11 +0000 (12:45 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 15 Nov 2019 00:25:47 +0000 (19:25 -0500)
commit6f0763cf7c230c3fae991cdb410abaa9dace79b4
tree74df82e7064ee04b40d44b7eadcd1b7308e14274
parent1155e708468b377aa6b5f2b1c65633d059f85e0d
ext4: fix leak of quota reservations

Commit bf22beb2017a ("ext4: rework reserved cluster accounting when
invalidating pages") moved freeing of delayed allocation reservations
from dirty page invalidation time to time when we evict corresponding
status extent from extent status tree. For inodes which don't have any
blocks allocated this may actually happen only in ext4_clear_blocks()
which is after we've dropped references to quota structures from the
inode. Thus reservation of quota leaked. Fix the problem by clearing
quota information from the inode only after evicting extent status tree
in ext4_clear_inode().

Link: https://lore.kernel.org/r/20191108115420.GI20863@quack2.suse.cz
Reported-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: bf22beb2017a ("ext4: rework reserved cluster accounting when invalidating pages")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ialloc.c
fs/ext4/super.c