]> git.ipfire.org Git - people/ms/linux.git/commit - fs/ext4/ext4.h
ext4: fix reserved cluster accounting at delayed write time
authorEric Whitney <enwlinux@gmail.com>
Mon, 1 Oct 2018 18:19:37 +0000 (14:19 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 1 Oct 2018 18:19:37 +0000 (14:19 -0400)
commit0b02f4c0d6d9e2c611dfbdd4317193e9dca740e6
treea07c3e6aaad97caccc4e91214e8779b0a06bd901
parent1dc0aa46e74a3366e12f426b7caaca477853e9c3
ext4: fix reserved cluster accounting at delayed write time

The code in ext4_da_map_blocks sometimes reserves space for more
delayed allocated clusters than it should, resulting in premature
ENOSPC, exceeded quota, and inaccurate free space reporting.

Fix this by checking for written and unwritten blocks shared in the
same cluster with the newly delayed allocated block.  A cluster
reservation should not be made for a cluster for which physical space
has already been allocated.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/extents_status.c
fs/ext4/extents_status.h
fs/ext4/inode.c
include/trace/events/ext4.h