]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: zoned: wait for existing extents before truncating
authorNaohiro Aota <naohiro.aota@wdc.com>
Thu, 4 Feb 2021 10:22:09 +0000 (19:22 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 9 Feb 2021 01:46:07 +0000 (02:46 +0100)
commit0c8d6bbcfcae63055d404a99ccf908c7daae6693
tree7e4c3fd7ccf227e6ea245e1be6320b95cbba8d40
parent3d9e1223bdf85f5cf2e5668830db1da539d921cb
btrfs: zoned: wait for existing extents before truncating

When truncating a file, file buffers which have already been allocated
but not yet written may be truncated. Truncating these buffers could
cause breakage of a sequential write pattern in a block group if the
truncated blocks are for example followed by blocks allocated to another
file. To avoid this problem, always wait for write out of all unwritten
buffers before proceeding with the truncate execution.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c