summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorJeffle Xu <jefflexu@linux.alibaba.com>2021-08-23 14:13:58 +0800
committerTheodore Ts'o <tytso@mit.edu>2021-10-01 00:03:41 -0400
commit6fed83957f21eff11c8496e9f24253b03d2bc1dc (patch)
treea5de186d8a1d5748f1e663ac7c7c9939e2731d23 /ipc
parenta2c2f0826e2b75560b31daf1cd9a755ab93cf4c6 (diff)
downloadlinux-6fed83957f21eff11c8496e9f24253b03d2bc1dc.tar.gz
linux-6fed83957f21eff11c8496e9f24253b03d2bc1dc.tar.bz2
linux-6fed83957f21eff11c8496e9f24253b03d2bc1dc.zip
ext4: fix reserved space counter leakage
When ext4_insert_delayed block receives and recovers from an error from ext4_es_insert_delayed_block(), e.g., ENOMEM, it does not release the space it has reserved for that block insertion as it should. One effect of this bug is that s_dirtyclusters_counter is not decremented and remains incorrectly elevated until the file system has been unmounted. This can result in premature ENOSPC returns and apparent loss of free space. Another effect of this bug is that /sys/fs/ext4/<dev>/delayed_allocation_blocks can remain non-zero even after syncfs has been executed on the filesystem. Besides, add check for s_dirtyclusters_counter when inode is going to be evicted and freed. s_dirtyclusters_counter can still keep non-zero until inode is written back in .evict_inode(), and thus the check is delayed to .destroy_inode(). Fixes: 51865fda28e5 ("ext4: let ext4 maintain extent status tree") Cc: stable@kernel.org Suggested-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com> Reviewed-by: Eric Whitney <enwlinux@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Link: https://lore.kernel.org/r/20210823061358.84473-1-jefflexu@linux.alibaba.com
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions